Skip to content

Provide proper examples/docs for dynamic #2099

Description

@bkchr

I'm currently using the dynamic instantiation stuff to create transactions, but it is a pain in the ass to figure out how to construct certain transactions. Today it took me quite a lot of time to find out how to properly construct a transfer_allow_death transaction, because encoding the dest parameter is kind of complicated. It would be nice if there are more examples and docs around the dynamic api.

Activity

  1. jsdw commented on Oct 1, 2025

    @jsdw
    Contributor

    Yup for sure; actually building dynamic values isn't well documented!

    If you haven't seen it, this macro may be particularly useful (in theory you can use any type with the dynamic stuff in subxt but in practice this is the scale_value::Value type is the one that is used):

    https://docs.rs/scale-value/latest/scale_value/macro.value.html
    another similar/tiny example of it: https://github.com/paritytech/scale-value/blob/main/examples/value_macro.rs

    We should add better docs in scale-value for this macro especially and then link them from subxt

  2. bkchr commented on Oct 1, 2025

    @bkchr
    MemberAuthor

    Yes, I'm already using the value! macro. I was actually blocked by trying to do a transfer, because the destination decoding always failed :P This was because of the MultiAddress::Id and I did not realized this, because also the error message was confusing etc :D Some nice little quest :P

  3. jsdw commented on Oct 20, 2025

    @jsdw
    Contributor

    I tweaked the docs of the macro to hopefully help on that side: https://docs.rs/scale-value/latest/scale_value/macro.value.html

    But sounds like the other part of the issue is error messages which we can take a look at and see how easily we can make them better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions