L0vdL0vd

eth_getTransactionByHash

Returns a transaction by hash.

Архив · Работает на любом прошлом блоке

curl https://eth.l0vdinfra.com/YOUR_KEY \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_getTransactionByHash","params":["0xbb62ecfc053ce6aa2f12dd09261e27e7c06b46dd015c67e28d5f7200bd6251ac"]}'

Пример ответа

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "blockHash": "0xc7a2fd354a9a1512636dad41b44e618905f5e8d2500f08c515c3bbbdf5261f6a",
    "blockNumber": "0x1208a5f",
    "blockTimestamp": "0x65922b33",
    "from": "0x958da591e94cc7678931915018f0af1a0c81b88f",
    "gas": "0x5208",
    "gasPrice": "0x104c533c00",
    "hash": "0xbb62ecfc053ce6aa2f12dd09261e27e7c06b46dd015c67e28d5f7200bd6251ac",
    "input": "0x",
    "nonce": "0x1",
    "to": "0x0016c0d0343e8f2c3a7b6a51606b84b1545ec606",
    "transactionIndex": "0x0",
    "value": "0x33d16ab2475000",
    "type": "0x0",
    "chainId": "0x1",
    "v": "0x25",
    "r": "0x96a1dd0c9729d6340a778a1d5c405f02e25fb2c6eae9f90c2ef30fc7127e50a3",
    "s": "0x3dd747997bd8aa478bbdf2e242ae481995b061be95bf515b0656a73ce3f50b1f"
  }
}
Параметры и свой эндпоинт

Параметры

transactionHashstringобязательный
32-byte transaction hash.

Возвращает

object Transaction object, or null if unknown.

hashstring
Transaction hash.
blockNumberstring
Block number, hex; null while pending.
blockHashstring
Block hash; null while pending.
transactionIndexstring
Position in the block, hex.
fromstring
Sender address.
tostring
Recipient; null for contract creation.
valuestring
Value transferred, hex wei.
inputstring
Call data.
gasstring
Gas limit provided by the sender, hex.
noncestring
Sender nonce, hex.
typestring
Transaction type: "0x0" legacy, "0x2" EIP-1559, "0x3" blob.

Когда использовать

Look up a transaction: sender, recipient, value, input data, gas settings and the block it landed in.

Как читать ответ

blockNumber is null while the transaction is pending.

input is the call data; decode it with the target contract's ABI to see which function was called with which arguments.

Советы

  • The transaction object does not say whether it succeeded. Read status from eth_getTransactionReceipt.

Связанные методы