Logs
Log Related API's
Get Event Logs by Address
Returns the event logs from an address, with optional filtering by block range.
GET
http://scan.wemix.com/api/logs/get-logs?address={address}&fromblock={fromblock}&toblock={toblock}&page={page}&offset={offset}&sort={sort}
Query Parameters
chain
wemix
| wemixTestnet
(default to wemix
)
Chain
address (required)
string
Hex address to query
fromblock
integer
The starting block number for the range to query
toblock
integer
The ending block number for the range to query
page
the integer
page number, if pagination is enabled
Page number to return (default to 1)
offset
integer
the number of logs displayed per page (default to 10000)
sort
desc
| asc
Order of the results. (default to asc
)
Example:
http://scan.wemix.com/api/logs/get-logs?address=0x7d72b22a74a216af4a002a1095c8c707d6ec1c5f&page=1&offset=2
Response
{
"logs": [
{
"uuid": "859400001",
"transactionHash": "0xaeb972558bc3d410e05c9bf77112c4524b8a8f34efcb6b3049e2f683d1202ce1",
"blockNumber": "8594",
"blockHash": "0x2c9269438c5b0a3397704916546b2137efa998595bbeecdd4bc26ca47e213020",
"timestamp": "1666243484",
"contractAddress": "0x7d72b22a74a216af4a002a1095c8c707d6ec1c5f",
"data": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000",
"topics": "[\"0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c\",\"0x000000000000000000000000fd35d296c2bee14c4a2de0dc5fe8dbd8429735c8\"]",
"logIndex": 1,
"transactionIndex": 0
},
{
"uuid": "859400000",
"transactionHash": "0xaeb972558bc3d410e05c9bf77112c4524b8a8f34efcb6b3049e2f683d1202ce1",
"blockNumber": "8594",
"blockHash": "0x2c9269438c5b0a3397704916546b2137efa998595bbeecdd4bc26ca47e213020",
"timestamp": "1666243484",
"contractAddress": "0x7d72b22a74a216af4a002a1095c8c707d6ec1c5f",
"data": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000",
"topics": "[\"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef\",\"0x0000000000000000000000000000000000000000000000000000000000000000\",\"0x000000000000000000000000fd35d296c2bee14c4a2de0dc5fe8dbd8429735c8\"]",
"logIndex": 0,
"transactionIndex": 0
}
]
}
Get Event Logs by Topics
Returns the events log in a block range, filtered by topics.
GET
http://scan.wemix.com/api/logs/get-logs?topic0={topic0}&topic1={topic1}&topic0_1_opr={topic0_1_opr}&fromblock={fromblock}&toblock={toblock}&page={page}&offset={offset}&sort={sort}
Usage:
For a single topic, specify the topic number such as
topic0
,topic1
,topic2
,topic3
For multiple topics, specify the topic numbers and topic operator either
and
oror
such as belowtopic0_1_opr (and|or between topic0 & topic1),
topic1_2_opr (and|or between topic1 & topic2)
topic2_3_opr (and|or between topic2 & topic3),
topic0_2_opr (and|or between topic0 & topic2)
topic0_3_opr (and|or between topic0 & topic3),
topic1_3_opr (and|or between topic1 & topic3)
Query Parameters
chain
wemix
| wemixTestnet
(default to wemix
)
Chain
topic(required)
string
the topic to filter by: limited to topic0
, topic1
, topic2
, topic3
topicOperator
string
the topic operator when multiple topic combinations are used limited to and
or or
fromblock
integer
The starting block number for the range to query
toblock
integer
The ending block number for the range to query
page
the integer
page number, if pagination is enabled
Page number to return (default to 1)
offset
integer
the number of logs displayed per page (default to 10000)
sort
desc
| asc
Order of the results. (default to asc
)
Example:
http://scan.wemix.com/logs/get-logs?topic0=0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c&page=1&offset=2&topic1=0x000000000000000000000000fd35d296c2bee14c4a2de0dc5fe8dbd8429735c8&topic0_1_opr=and&fromblock=8000&toblock=9000
Response
{
"logs": [
{
"uuid": "859400001",
"transactionHash": "0xaeb972558bc3d410e05c9bf77112c4524b8a8f34efcb6b3049e2f683d1202ce1",
"blockNumber": "8594",
"blockHash": "0x2c9269438c5b0a3397704916546b2137efa998595bbeecdd4bc26ca47e213020",
"timestamp": "1666243484",
"contractAddress": "0x7d72b22a74a216af4a002a1095c8c707d6ec1c5f",
"data": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000",
"topics": "[\"0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c\",\"0x000000000000000000000000fd35d296c2bee14c4a2de0dc5fe8dbd8429735c8\"]",
"logIndex": 1,
"transactionIndex": 0
}
]
}
Get Event Logs by Address filtered by Topics
Returns the event logs from an address, filtered by topics and block range.
GET
http://scan.wemix.com/api/logs/get-logs?address={address}&topic0={topic0}&topic1={topic1}&topic0_1_opr={topic0_1_opr}&fromblock={fromblock}&toblock={toblock}&page={page}&offset={offset}&sort={sort}
Query Parameters
chain
wemix
| wemixTestnet
(default to wemix
)
Chain
address (required)
string
Hex address to query
topic(required)
string
the topic to filter by: limited to topic0
, topic1
, topic2
, topic3
topicOperator
string
the topic operator when multiple topic combinations are used limited to and
or or
fromblock
integer
The starting block number for the range to query
toblock
integer
The ending block number for the range to query
page
the integer
page number, if pagination is enabled
Page number to return (default to 1)
offset
integer
the number of logs displayed per page (default to 10000)
sort
desc
| asc
Order of the results. (default to asc
)
Example:
http://scan.wemix.com/api/logs/get-logs?address=0x7d72b22a74a216af4a002a1095c8c707d6ec1c5f&topic0=0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c&page=1&offset=2&topic1=0x000000000000000000000000fd35d296c2bee14c4a2de0dc5fe8dbd8429735c8&topic0_1_opr=and&fromblock=8000&toblock=9000
Response
{
"logs": [
{
"uuid": "859400001",
"transactionHash": "0xaeb972558bc3d410e05c9bf77112c4524b8a8f34efcb6b3049e2f683d1202ce1",
"blockNumber": "8594",
"blockHash": "0x2c9269438c5b0a3397704916546b2137efa998595bbeecdd4bc26ca47e213020",
"timestamp": "1666243484",
"contractAddress": "0x7d72b22a74a216af4a002a1095c8c707d6ec1c5f",
"data": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000",
"topics": "[\"0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c\",\"0x000000000000000000000000fd35d296c2bee14c4a2de0dc5fe8dbd8429735c8\"]",
"logIndex": 1,
"transactionIndex": 0
}
]
}
Last updated