Etherscan

如何找出 etherscan api 給出的值

  • February 14, 2022

我嘗試使用 etherscan API 獲取交易,但似乎交易的價值以及交易的幾乎所有內容都已編碼。我真的不明白我如何能夠從中找出真正的價值。也許有人能幫助我

{
   "jsonrpc": "2.0", 
   "id": 1, 
   "result": {
       "blockHash": "0x84d7a319a6dbbf8c7f6fd5d3ad7ff8af656823b9150b3b16e62a959209402f66", 
       "blockNumber": "0xd86677", 
       "from": "0x650e035584ec7d44ee1e798e02c55508674e0ef2", 
       "gas": "0x5208", 
       "gasPrice": "0x16deabeae3", 
       "maxFeePerGas": "0x1c5d4d32b0", 
       "maxPriorityFeePerGas": "0x59682f00", 
       "hash": "0x53eeef5726e9b89b47eb0876da44ba2cb9622605d2d60616632d4511bae0c48f", 
       "input": "0x", 
       "nonce": "0x16", 
       "to": "0xc2e9b6cc2e9e47a72c1c4c78b0d6e9e73dbfc277", 
       "transactionIndex": "0x8e", 
       "value": "0x8e1bc9bf040000", 
       "type": "0x2", 
       "accessList": [], 
       "chainId": "0x1", 
       "v": "0x0", 
       "r": "0x273b057fd3819987f7c89c0ba5fe690c98335ef35cc1a2972b392e2c3f102ebe", 
       "s": "0x7eba6b02576e67112584ade4f356877c3bbf67de70bef4f74630bd6a4e1892d8"
   }
   
}

您可以從這裡開始 :) 它將幫助您了解這些鍵是什麼,然後您可以了解這些值並對其進行解碼

https://ethereum.org/en/developers/docs/transactions/ https://ethereum.org/en/developers/docs/blocks/

例子:

值:是在 WEI 中轉移的乙太幣數量的十六進制數。

輸入:如果您正在呼叫智能合約,則傳輸到合約的數據在“輸入”中,您需要合約程式碼輕鬆解碼。

v, r, s: 是簽名

nonce:是交易的數量

chainId:區塊鏈的id。乙太坊主網的 id 1 = 0x1

此交易沒有輸入,所以我假設它只是從 0x650e035584ec7d44ee1e798e02c55508674e0ef2 到 0xc2e9b6cc2e9e47a72c1c4c78b0d6e9e73dbfc277 的乙太傳輸 0.04

引用自:https://ethereum.stackexchange.com/questions/121620