Skip to content

Question: How to decode a call? #361

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

You must be logged in to vote

Of course, you can manually create an Extrinsic SCALE-object (in PolkadotJS apps it's titled "hex-encoded call" but in reality this is an "hex-encoded extrinsic", which of course contains the call. I personally think this is a bit misleading) and then decode the hex-encoded string. Something like:

extrinsic_obj = substrate.create_scale_object("Extrinsic")
extrinsic_obj.decode(ScaleBytes("0x280403000b8052d3818b01"))

print(extrinsic_obj.value)

And If you only want to decode the actual Call with corresponding hex-encoded string:

call_obj = substrate.create_scale_object("Call")
call_obj.decode(ScaleBytes("0x03000b8052d3818b01"))

print(call_obj.value)

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 #360 on October 31, 2023 10:46.