Get Logs By Hash#
Query the transaction event logs by transaction hash, only returns nearly 1000 results.
Request Path#
GET
https://web3.okx200.com/api/v5/xlayer/log/by-transactionRequest Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
| chainShortName | String | Yes | The abbreviated name of the blockchain network, e.g, XLAYER |
| txId | String | Yes | Transaction hash |
Response Parameters#
| Parameter | Type | Description |
|---|---|---|
| height | String | Block height |
| address | String | The smart contract address that triggered the event log |
| topics | Array | The topics of the event log |
| data | String | The non-indexed parameter of the event |
| blockHash | String | Block hash |
| methodId | String | Method ID |
| transactionTime | String | The Unix timestamp of the transaction time, in milliseconds format, e.g., 1597026383085 |
| logIndex | String | The location index of the event log in the block |
| txId | String | Transaction hash |
Request Example#
shell
curl --location --request GET 'https://web3.okx200.com/api/v5/xlayer/log/by-transaction?chainShortName=xlayer&txId=0x8afe0f22fffd564b0af7db45a0c1718f20ff92b7091b0b843c4f00dba4b2cd0b' \
--header 'OK-ACCESS-KEY: 37c541a1-****-****-****-10fe7a038418' \
--header 'OK-ACCESS-SIGN: leaV********3uw=' \
--header 'OK-ACCESS-PASSPHRASE: 1****6' \
--header 'OK-ACCESS-TIMESTAMP: 2023-10-18T12:21:41.274Z'
Response Example#
json
{
"code": "0",
"msg": "",
"data": [
{
"height": "31128380",
"address": "0x1e4a5963abfd975d8c9021ce480b42188849d41d",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000458209474e786d424d03b9937069ab3f0badd47e",
"0x000000000000000000000000d1c2d511c0963901cfb602a1e801afec529d81c3"
],
"data": "0x0000000000000000000000000000000000000000000000000000000000c2ef61",
"methodId": "0xa9059cbb",
"blockHash": "0x1251f714d627e7cb53c52373f1c7082c5748bfa2a3f8c78f14a21f43d6fc9a50",
"transactionTime": "1755489346000",
"logIndex": "1",
"txId": "0x8afe0f22fffd564b0af7db45a0c1718f20ff92b7091b0b843c4f00dba4b2cd0b"
}
]
}
