Skip to main content

eth_getLogs

Returns an array of all logs matching the specified filter.

Params

(1)

1. Filter (required)

fromBlock
string
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
toBlock
string
Match pattern:
^0x(0|[1-9a-f][0-9a-f]*)$
address
topics

Result

(Log objects)
(one of)
array[string]
Match pattern:
^0x[0-9a-f]{64}$

Example

Request

await window.ethereum.request({
"method": "eth_getLogs",
"params": [
{
"fromBlock": "0x137d3c2",
"toBlock": "0x137d3c3",
"address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"topics": []
}
]
});

Result

[
{
"logIndex": "0x0",
"removed": false,
"blockNumber": "0x233",
"blockHash": "0xfc139f5e2edee9e9c888d8df9a2d2226133a9bd87c88ccbd9c930d3d4c9f9ef5",
"transactionHash": "0x66e7a140c8fa27fe98fde923defea7562c3ca2d6bb89798aabec65782c08f63d",
"transactionIndex": "0x0",
"address": "0x42699a7612a82f1d9c36148af9c77354759b210b",
"data": "0x0000000000000000000000000000000000000000000000000000000000000004",
"topics": [
"0x04474795f5b996ff80cb47c148d4c5ccdbe09ef27551820caa9c2f8ed149cce3"
]
},
{
"logIndex": "0x0",
"removed": false,
"blockNumber": "0x238",
"blockHash": "0x98b0ec0f9fea0018a644959accbe69cd046a8582e89402e1ab0ada91cad644ed",
"transactionHash": "0xdb17aa1c2ce609132f599155d384c0bc5334c988a6c368056d7e167e23eee058",
"transactionIndex": "0x0",
"address": "0x42699a7612a82f1d9c36148af9c77354759b210b",
"data": "0x0000000000000000000000000000000000000000000000000000000000000007",
"topics": [
"0x04474795f5b996ff80cb47c148d4c5ccdbe09ef27551820caa9c2f8ed149cce3"
]
}
]

Params

Filter


Request

await window.ethereum.request({
"method": "eth_getLogs",
"params": [
null
]
});