2

如何根据eth的tx详情数据判断该交易的类型? | 登链社区 | 技术问答

 2 years ago
source link: https://learnblockchain.cn/question/2990
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
如何根据eth的tx详情数据判断该交易的类型? | 登链社区 | 技术问答

5 如何根据eth的tx详情数据判断该交易的类型?

回答问题即可获得 5 贡献值,回答被采纳后即可获得 10 学分。

根据节点rpc接口eth_getTransactionByHash返回的交易数据,怎么判断这笔交易是以下哪种类型:

  1. eth普通转账交易
  2. erc-20转账交易
  3. uniswap的dex交易或者其他deif协议的交易
  4. nft相关的交易

例如数据:

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "blockHash": "0xc2d61bdefce88a4db47c4f9687a903f4dd552f23266359c49f46dd965c0c2e53",
        "blockNumber": "0x3bcf69",
        "from": "0xc352b534e8b987e036a93539fd6897f53488e56a",
        "gas": "0x2f1ba",
        "gasPrice": "0xba43b7400",
        "hash": "0x65579455ac3227e7b3db72b4e359e988bb16cae6d26c88818d1a6991b478b274",
        "input": "0x8264fe980000000000000000000000000000000000000000000000000000000000000c3e",
        "nonce": "0xfd",
        "r": "0xefa4d38bb59e3aed21bbc2086056da4836e058f7371730471c42c7d1b7cc7a37",
        "s": "0x2b1194517f0c0cfbaf884841f0de07a28d768b6608cf12b8bda3b8c0c078ce3a",
        "to": "0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb",
        "transactionIndex": "0x27",
        "type": "0x0",
        "v": "0x25",
        "value": "0x2386f26fc10000"
    }
}

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK