日志
根据Address 获取log
返回来自某个地址的事件日志,支持按区块范围进行可选筛选。
https://gatescan.org/api
?module=logs
&action=getLogs
&address=0x94a8b59163e204102569880bf6d40dd591051938
&fromBlock=871852
&toBlock=871855
&page=1
&offset=1000
&apikey=YourApiKeyToken
在 浏览器 中尝试此端点。
- 请求
- 响应
| 参数 | 描述 |
|---|---|
| address | 要查询日志的地址的 字符串 |
| fromBlock | 开始搜索日志的区块号,类型为 整数 ,例如:12878196 |
| toBlock | 停止搜索日志的区块号,类型为 整数 ,例如:12879196 |
| page | 页码编号,类型为 整数 ,在启用分页时使用 |
| offset | 每页显示的交易数量,每次查询最多限制为 1000 条记录;如需查看更多记录,请使用 page 参数获取后续数据 |
{
"status":"1",
"message":"success",
"data":[
{
block: 871854,
address: '0x94a8b59163e204102569880bf6d40dd591051938',
topics: [
'0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
'0x000000000000000000000000c6ef7050fbe638ffd992343c4c8271b9af605d6c',
'0x00000000000000000000000089d556364a4a86bf0ed1a15bfa12f6e225d3d5e9'
],
data: '0x000000000000000000000000000000000000000000000000000000003b9aca00',
block_number: '0xd4dae',
transaction_hash: '0x60ba5eadb0280e37a0f82539407a091260a80da56007a2f2c07e6d67de8dad3c',
transaction_index: '0x0',
block_hash: '0x3cc03d8b848f54be795fe4e23926f64e3b6023110aaf5911dd25be31c8073da0',
log_index: '0x0',
removed: false
}
]
}
根据Topics 获取log
在指定的区块范围内返回事件日志,支持按主题(topics)进行过滤。
https://gatescan.org/api
?module=logs
&action=getLogs
&topic0=0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
&topic1=0x000000000000000000000000c6ef7050fbe638ffd992343c4c8271b9af605d6c
&topicOperator=and
&fromBlock=1403521
&toBlock=1403525
&page=1
&offset=1000
&apikey=YourApiKeyToken
在 浏览器 中尝试此端点。
- 请求
- 响应
| 参数 | 描述 |
|---|---|
| topic | 要查询的 topic 编号,限定为 topic0 、topic1 、topic2 和 topic3 |
| topicOperator | 当使用多个 topic 组合时的逻辑运算符,限定为 and 或 or |
| fromBlock | 开始搜索日志的区块号,类型为 整数 ,例如:12878196 |
| toBlock | 停止搜索日志的区块号,类型为 整数 ,例如:12879196 |
| page | 页码编号,类型为 整数 ,在启用分页时使用 |
| offset | 每页显示的交易数量,每次查询最多限制为 1000 条记录;如需查看更多记录,请使用 page 参数获取后续数据 |
{
"status":"1",
"message":"success",
"data":[
{
block: 871854,
address: '0x94a8b59163e204102569880bf6d40dd591051938',
topics: [
'0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
'0x000000000000000000000000c6ef7050fbe638ffd992343c4c8271b9af605d6c',
'0x00000000000000000000000089d556364a4a86bf0ed1a15bfa12f6e225d3d5e9'
],
data: '0x000000000000000000000000000000000000000000000000000000003b9aca00',
block_number: '0xd4dae',
transaction_hash: '0x60ba5eadb0280e37a0f82539407a091260a80da56007a2f2c07e6d67de8dad3c',
transaction_index: '0x0',
block_hash: '0x3cc03d8b848f54be795fe4e23926f64e3b6023110aaf5911dd25be31c8073da0',
log_index: '0x0',
removed: false
}
]
}
根据Topics 和 Address 获取log
返回指定地址的事件日志,并根据主题(topics)和区块范围进行过滤。
https://gatescan.org/api
?module=logs
&action=getLogs
&address=0x94a8b59163e204102569880bf6d40dd591051938
&topic0=0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
&topic1=0x000000000000000000000000c6ef7050fbe638ffd992343c4c8271b9af605d6c
&topicOperator=and,
&fromBlock=1403521
&toBlock=1403525
&page=1
&offset=1000
&apikey=YourApiKeyToken
在 浏览器 中尝试此端点。
- 请求
- 响应
| 参数 | 描述 |
|---|---|
| address | 用于指定要检索日志的地址的字符串 |
| topic | 要查询的 topic 编号,限定为 topic0 、topic1 、topic2 和 topic3 |
| topicOperator | 当使用多个 topic 组合时的逻辑运算符,限定为 and 或 or |
| fromBlock | 开始搜索日志的区块号,类型为 整数 ,例如:12878196 |
| toBlock | 停止搜索日志的区块号,类型为 整数 ,例如:12879196 |
| page | 页码编号,类型为 整数 ,在启用分页时使用 |
| offset | 每页显示的交易数量,每次查询最多限制为 1000 条记录;如需查看更多记录,请使用 page 参数获取后续数据 |
{
"status":"1",
"message":"success",
"data":[
{
block: 871854,
address: '0x94a8b59163e204102569880bf6d40dd591051938',
topics: [
'0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
'0x000000000000000000000000c6ef7050fbe638ffd992343c4c8271b9af605d6c',
'0x00000000000000000000000089d556364a4a86bf0ed1a15bfa12f6e225d3d5e9'
],
data: '0x000000000000000000000000000000000000000000000000000000003b9aca00',
block_number: '0xd4dae',
transaction_hash: '0x60ba5eadb0280e37a0f82539407a091260a80da56007a2f2c07e6d67de8dad3c',
transaction_index: '0x0',
block_hash: '0x3cc03d8b848f54be795fe4e23926f64e3b6023110aaf5911dd25be31c8073da0',
log_index: '0x0',
removed: false
}
]
}