Closed johnuopini closed 6 months ago
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: https://github.com/polkascan/py-substrate-interface/discussions/361
Works like a charm, thanks!
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.