Get Logs By Address#
Query the transaction event logs by address, only returns nearly 1000 results.
Request Path#
GET
https://web3.okx.com/api/v5/xlayer/log/by-addressRequest Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
| chainShortName | String | Yes | The abbreviated name of the blockchain network, e.g, XLAYER |
| address | String | Yes | The smart contract address that triggered the event log |
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.okx.com/api/v5/xlayer/log/by-address?chainShortName=xlayer&address=0x1e4a5963abfd975d8c9021ce480b42188849d41d' \
--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": "31276868",
"address": "0x1e4a5963abfd975d8c9021ce480b42188849d41d",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x00000000000000000000000063ab3204ed7303fc7ad739ce4d15cbc65ef095aa",
"0x000000000000000000000000c71f9e1de80eb505c0cb3bbf90ae6593130e5d25"
],
"data": "0x0000000000000000000000000000000000000000000000000000000006ea11cd",
"methodId": "0x9871efa4",
"blockHash": "0xac930a9aaf8d10b279204c224bd0d736514f3c9b2762de14091a21185c72a23f",
"transactionTime": "1755569577000",
"logIndex": "1",
"txId": "0xbfc5a6ec106a30e060183a93b27e8e6c3470c69d4b542c019e33a95ad404a60b"
}
]
}
