Skip to content

How to create an Hex that can be used in JS UI with Extrinsic / Decode? #374

Answered by arjanz
johnuopini asked this question in Q&A
Discussion options

You must be logged in to vote

You can output the hex of the encoded SCALE data using call.data.to_hex():

call = substrate.compose_call(
    call_module='Balances',
    call_function='transfer',
    call_params={
        'dest': '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty',
        'value': 1 * 10**15
    }
)

print(call.data.to_hex())

For the other way around, see: #361

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by arjanz
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #373 on January 04, 2024 12:01.