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
-
Is there a way to encode the compose_call output in a way that can be understood in JS UI using Extrinsic -> Decode? I cant find an equivalent to toHex() in JS. |
Beta Was this translation helpful? Give feedback.
Answered by
arjanz
Jan 4, 2024
Replies: 2 comments
-
You can output the hex of the encoded SCALE data using 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 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
arjanz
-
Works like a charm, thanks! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can output the hex of the encoded SCALE data using
call.data.to_hex()
:For the other way around, see: #361