Skip to content

How to get the name of args on parsetransaction? #2825

Answered by daron4ever
daron4ever asked this question in Q&A
Discussion options

You must be logged in to vote

Are you trying to decide the data? You will need to use the ABI to decode that. If you can include a better example, we can help more. :)

For example,

data = "0x095ea7b3000000000000000000000000a80240eb5d7e05d3f250cf000eec0891d00b51ccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"

Then we can know the function name is "approve", decoded by decodedInput.name;
And the first value (data) of args is "0xa80240Eb5d7E05d3F250cF000eEc0891d00b51CC", which is decoded by

fnValue = (decodedInput.args[0]);

I would like to get the name of value, which is "spender" here.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ricmoo
Comment options

Answer selected by daron4ever
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 #2802 on March 19, 2022 09:52.