eth_getTransactionByBlockHashAndIndex (BSC)

Returns information about a transaction by block hash and transaction index position.

Parameters

DATA, 32 Bytes - hash of a block.

QUANTITY - integer of the transaction index position.

params: [ 
    '0xc0f4906fea23cf6f3cce98cb44e8e1449e455b28d684dfa9ff65426495584de6', 
    '0x0' // 0 
]

Returns

See eth_getTransactionByHash

Object - A transaction object, or null when no transaction was found:

  • blockHash: DATA, 32 Bytes - hash of the block where this transaction was in. null when its pending.

  • blockNumber: QUANTITY - block number where this transaction was in. null when it's pending.

  • from: DATA, 20 Bytes - address of the sender.

  • gas: QUANTITY - gas provided by the sender.

  • gasPrice: QUANTITY - gas price provided by the sender in Wei.

  • hash: DATA, 32 Bytes - hash of the transaction.

  • input: DATA - the data send along with the transaction.

  • nonce: QUANTITY - the number of transactions made by the sender prior to this one.

  • to: DATA, 20 Bytes - address of the receiver. null when it's a contract creation transaction.

  • transactionIndex: QUANTITY - integer of the transactions index position in the block. null when its pending.

  • value: QUANTITY - value transferred in Wei.

  • v: QUANTITY - ECDSA recovery id

  • r: DATA, 32 Bytes - ECDSA signature r

  • s: DATA, 32 Bytes - ECDSA signature s

Request example

curl https://bsc.api.watchdata.io/node/jsonrpc?api_key=your_api_key
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockHashAndIndex","params":["0x18b8e20d83a9c9636c6e9828157b1d684934e3e4c540531831460f9c8be60b9f", "0x0"],"id":0}'

Result

{
    "jsonrpc": "2.0",
    "id": 0,
    "result": {
        "hash": "0xb856fb2cc766b2fedf25ec7e235fd1a380fee672a76a5f78af3e077988455d87",
        "nonce": "0x3a6af",
        "transactionIndex": "0x0",
        "from": "0xf5b4c4e9e8fb4b0cc961197b6c512c66dcf55e01",
        "to": "0x18b2a687610328590bc8f2e5fedde3b582a49cda",
        "value": "0x0",
        "gasPrice": "0x59682f000",
        "gas": "0x7a120",
        "input": "0x7b3205f5",
        "v": "0x94",
        "r": "0xa7b6fa0bb3c20e0e5e82d44357790f93a2219d4688b0e99b99cc385bc6a33900",
        "s": "0x38942cb7745848566bde5c142e486d984288dfc9bb431b004aa3b9c166c94e0d",
        "chainId": "0x38",
        "blockHash": "0x18b8e20d83a9c9636c6e9828157b1d684934e3e4c540531831460f9c8be60b9f",
        "blockNumber": "0x119b752"
    }
}

Last updated