get https://example.com
Xlayer API - Returns the information about a transaction requested by transaction hash. In the response object, blockHash, blockNumber, and transactionIndex are null when the transaction is pending.
Parameters
DATA, 32 Bytes - hash of a transaction
params: ["0x64cceed4574d55c2d0d5d16c05660fd1f9e0d7f836f4f5c49f0c10e8c9c781ef"];
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_getTransactionByHash","params":["0x64cceed4574d55c2d0d5d16c05660fd1f9e0d7f836f4f5c49f0c10e8c9c781ef"],"id":0}'
URL: https://xlayer-mainnet.unifra.io/v1/your-api-key
RequestType: POST
Body:
{
"jsonrpc":"2.0",
"method":"eth_getTransactionByHash",
"params":["0x64cceed4574d55c2d0d5d16c05660fd1f9e0d7f836f4f5c49f0c10e8c9c781ef"],
"id":0
}
Result
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"blockHash": "0xbeae567e948dd259a68c52ffa39b0385109978f3d024947ea84c438cd5ee7e45",
"blockNumber": "0x223645c",
"from": "0xca72753b4bab1836d701cb0f77ab15d8551989bf",
"gas": "0x927c0",
"gasPrice": "0x7270e00",
"hash": "0x64cceed4574d55c2d0d5d16c05660fd1f9e0d7f836f4f5c49f0c10e8c9c781ef",
"input": "0x69ce29ed0000000000000000000000006bff3b94b9bd51b8adf3b84ffc50c39e3fe18816000000000000000000000000e538905cf8410324e03a5a23c1c177a474d59b2b00000000000000000000000000000000000000000000017b8664771cbdc40000000000000000000000000000debe9e7ae790df09189f102232e8699e9be9651d",
"nonce": "0x778",
"to": "0x4f91b9d3668b39e8204fd1bd9f769e489f7435fb",
"transactionIndex": "0x9",
"value": "0x0",
"type": "0x0",
"chainId": "0xc4",
"v": "0x1ac",
"r": "0x83bbd3758aca965f635fd741befc2b20b5eb04ad4f3cd67ac6780fee68d0f430",
"s": "0x54fd8022e90d10050bd2d05efa09c0aa258fea04d1015e309181bd1ff8b014dd"
}
}