Logs
Get Event Logs by Address
Returns the event logs from an address, with optional filtering by block range.
https://api-era.zksync.network/api
?module=logs
&action=getLogs
&address=0x000000000000000000000000000000000000800a
&fromBlock=0
&toBlock=latest
&page=1
&offset=2
&apikey=YourApiKeyToken
Query Parameters
Sample Response
{
"status": "1",
"message": "OK",
"result": [
{
"address": "0x000000000000000000000000000000000000800a",
"topics": [
"0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885",
"0x00000000000000000000000029df43f75149d0552475a6f9b2ac96e28796ed0b"
],
"data": "0x0000000000000000000000000000000000000000000000000000000000000000",
"blockNumber": "0x1",
"blockHash": "0x51f81bcdfc324a0dff2b5bec9d92e21cbebc4d5e29d3a3d30de3e03fbeab8d7f",
"timeStamp": "0x63eb991e",
"gasPrice": "0x",
"gasUsed": "0x44aa200",
"logIndex": "0x2",
"transactionHash": "0xe9a1a8601bc9199c80c97169fdc9e1fc7c307185a0c9fa2cfab04098a7840645",
"transactionIndex": "0x"
},
{
"address": "0x000000000000000000000000000000000000800a",
"topics": [
"0x0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885",
"0x000000000000000000000000c301f8b2a2c08958e6e7a286ab49a986c1f7ef6a"
],
"data": "0x0000000000000000000000000000000000000000000000000000000000000000",
"blockNumber": "0x1",
"blockHash": "0x51f81bcdfc324a0dff2b5bec9d92e21cbebc4d5e29d3a3d30de3e03fbeab8d7f",
"timeStamp": "0x63eb991e",
"gasPrice": "0x",
"gasUsed": "0x44aa200",
"logIndex": "0x5",
"transactionHash": "0x0817b7b518df03a0f6a35e3e9a36a074fd26d31ff5c59ac8a59dcc5ed6093f71",
"transactionIndex": "0x1"
}
]
}
Get Event Logs by Topics
Returns the events log in a block range, filtered by topics.
https://api-era.zksync.network/api
?module=logs
&action=getLogs
&fromBlock=0
&toBlock=latest
&topic0=0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
&topic0_1_opr=and
&topic1=0x0000000000000000000000000000000000000000000000000000000000008001
&page=1
&offset=2
&apikey=YourApiKeyToken
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 below topic0_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
Sample Response
{
"status": "1",
"message": "OK",
"result": [
{
"address": "0x000000000000000000000000000000000000800a",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x0000000000000000000000000000000000000000000000000000000000008001",
"0x000000000000000000000000e5b06bfd663c94005b8b159cd320fd7976549f9b"
],
"data": "0x0000000000000000000000000000000000000000000000000000ac8cbf025500",
"blockNumber": "0xd",
"blockHash": "0x0e814ac3d2697269bfdc5233432fb2cedebd80e0d22aa486feb679ad45c168b8",
"timeStamp": "0x63ecf4c1",
"gasPrice": "0x1dcd6500",
"gasUsed": "0x883eb",
"logIndex": "0x2",
"transactionHash": "0x56fbdc0fa04f16816514e765658a4daf8e524b073c51db868f1191cd827c27e0",
"transactionIndex": "0x"
},
{
"address": "0x000000000000000000000000000000000000800a",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x0000000000000000000000000000000000000000000000000000000000008001",
"0x00000000000000000000000029df43f75149d0552475a6f9b2ac96e28796ed0b"
],
"data": "0x0000000000000000000000000000000000000000000000000007e8fc9cf9e500",
"blockNumber": "0xd",
"blockHash": "0x0e814ac3d2697269bfdc5233432fb2cedebd80e0d22aa486feb679ad45c168b8",
"timeStamp": "0x63ecf4c1",
"gasPrice": "0x1dcd6500",
"gasUsed": "0xe39f44",
"logIndex": "0x7",
"transactionHash": "0x136d6c60a365226cf14a6a8007e085cb122646c6e0e8f76fe7c051612bff8d5f",
"transactionIndex": "0x1"
}
]
}
Get Event Logs by Address filtered by Topics
Returns the event logs from an address, filtered by topics and block range.
https://api-era.zksync.network/api
?module=logs
&action=getLogs
&fromBlock=15073139
&toBlock=15074139
&address=0x000000000000000000000000000000000000800a
&topic0=0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
&topic0_1_opr=and
&topic1=0x0000000000000000000000000000000000000000000000000000000000008001
&page=1
&offset=2
&apikey=YourApiKeyToken
Query Parameters
Sample Response
{
"status": "1",
"message": "OK",
"result": [
{
"address": "0x000000000000000000000000000000000000800a",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x0000000000000000000000000000000000000000000000000000000000008001",
"0x000000000000000000000000925a84bef8693ee1c2afd232160a318bc5d8cebd"
],
"data": "0x000000000000000000000000000000000000000000000000000007b3c8d5df80",
"blockNumber": "0xe5ff73",
"blockHash": "0xda15b4e17b0e452d43e91ed9b1b650dcf690018afc2aa872db07e2f63bf292c0",
"timeStamp": "0x65166175",
"gasPrice": "0xee6b280",
"gasUsed": "0x2fbd0",
"logIndex": "0x2",
"transactionHash": "0x375e185dacccdc9ed7a17f49c81e31c67aa5b99cafe1fbce9b101f18680b4427",
"transactionIndex": "0x"
},
{
"address": "0x000000000000000000000000000000000000800a",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x0000000000000000000000000000000000000000000000000000000000008001",
"0x000000000000000000000000f4d778eb17ca6f19a366a87d56f7889ba07f4404"
],
"data": "0x00000000000000000000000000000000000000000000000000005538c7494f80",
"blockNumber": "0xe5ff73",
"blockHash": "0xda15b4e17b0e452d43e91ed9b1b650dcf690018afc2aa872db07e2f63bf292c0",
"timeStamp": "0x65166175",
"gasPrice": "0xee6b280",
"gasUsed": "0x69574",
"logIndex": "0x4",
"transactionHash": "0x803fbcb1743b30fdf1f75dd9abeee1733e8d8460906ccc0d9a8c5c9ccacfe311",
"transactionIndex": "0x1"
}
]
}
Last updated