How to get the name of args on parsetransaction? #2825
-
I can get the the value of args like the follow. decodedInput = abi.parseTransaction({ data value });
fnValue = Number(decodedInput.args[0]); I have no idea how to get the name of the args. I've searched the document, but I couldn't find it. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
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. :) |
Beta Was this translation helpful? Give feedback.
-
For example, data = "0x095ea7b3000000000000000000000000a80240eb5d7e05d3f250cf000eec0891d00b51ccffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" Then we can know the function name is "approve", decoded by fnValue = (decodedInput.args[0]); I would like to get the name of value, which is "spender" here. |
Beta Was this translation helpful? Give feedback.
For example,
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
I would like to get the name of value, which is "spender" here.