API Reference

eth_getTransactionByBlockHashAndIndex - Xlayer

Xlayer API - 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: [
  "0x71f344107b58bcbd0e4b844406ef82d4e4c92947a57016835720e99dbeb1d793",
  "0x0",
];

Returns

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

Example

Request

curl https://xlayer-mainnet.unifra.io/v1/your-api-key \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getTransactionByBlockHashAndIndex","params":["0x71f344107b58bcbd0e4b844406ef82d4e4c92947a57016835720e99dbeb1d793", "0x0"],"id":0}'
URL: https://xlayer-mainnet.unifra.io/v1/your-api-key
RequestType: POST
Body:
{
  "jsonrpc":"2.0",
  "method":"eth_getTransactionByBlockHashAndIndex",
  "params":["0x71f344107b58bcbd0e4b844406ef82d4e4c92947a57016835720e99dbeb1d793", "0x0"],
  "id":0
}

Result

{
  "jsonrpc": "2.0",
  "id": 0,
  "result": {
    "blockHash": "0x71f344107b58bcbd0e4b844406ef82d4e4c92947a57016835720e99dbeb1d793",
    "blockNumber": "0x20273c2",
    "from": "0x3005037b2d902fd501703e940d4d1d9c18c7e73d",
    "gas": "0x54c563",
    "gasPrice": "0x5f5e101",
    "hash": "0x25337dc5d22c3a0807ca462ce9b716ef3f380d9e2aae6b2d9156ec8364c30c25",
    "input": "0x290c05ea0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000003ea2a2f97a8bf3bbb1a3539bce45c612982ea9bf00000000000000000000000099a7a97780eafae7ab953ee79db2a5b737bd84fb000000000000000000000000b84bd1f49b41bdf4f7518385e00c55ef2fdb2e7000000000000000000000000007acace793c28a3936645c1906cea701dd757f0400000000000000000000000073d787e6f05c5f1e910e9f17e83e99cad5422e63000000000000000000000000f184c815a3fefaf32c700f723826b087b842dde5000000000000000000000000d511348927053458a42178712bc87bbabb712e910000000000000000000000007888ff3a2770ac45eb67ba1bdd64e40d04dd4b51000000000000000000000000c71f9e1de80eb505c0cb3bbf90ae6593130e5d2500000000000000000000000032d6b77ee026d471c191ea9ef9ed404d2cb4d4a6000000000000000000000000df7400449fea0b1d42ba1743cb46935c6cbf1604000000000000000000000000cab16b189b71981c0c791c866419a8f1c74e2c41000000000000000000000000c271e3e93d64e1431fd037e572ffc80feb78a29e000000000000000000000000702da5a9379569fd0335ec9ccebc40279eb16b18",
    "nonce": "0x2b7d4",
    "to": "0x164d9b632f0eca9c47e52fe4f8467e4d9eb5149c",
    "transactionIndex": "0x0",
    "value": "0x0",
    "type": "0x0",
    "chainId": "0xc4",
    "v": "0x1ac",
    "r": "0x70a7b9349144ccdf5f6fb9a2165ad2d8eb58099893c5f60c5a32317ffe70000f",
    "s": "0x47328a0412d8ba655b863be8aeab10377e40ee4d41d492d3d7a4f6e3d7367526"
  }
}
Language
Click Try It! to start a request and see the response here!