eth_getLogs
Returns an array of all logs matching filter with given id.
Parameters
Object - filter options:
fromBlock:Quantityortag(optional, default is"latest"if not specified)- choose 1 of the following options:
A hexadecimal block number.
"earliest"- the earliest/genesis block."latest"- the latest mined block."safe"- the latest safe head block."finalized"- the latest finalized block."pending"- the pending state/transactions.
toBlock:Quantityortag(optional, default is"latest"if not specified)- choose 1 of the following options:
A hexadecimal block number.
"earliest"- the earliest/genesis block."latest"- the latest mined block."safe"- the latest safe head block."finalized"- the latest finalized block."pending"- the pending state/transactions.
address: (optional) Contract address or a list of addresses from which logs should originate.topics: (optional) Array ofDATAtopics. Topics are order-dependent. Each topic can also be an array of DATA with "or" options.blockhash: (optional) restricts the logs returned to the given block. is equivalent to settingfromBlockandtoBlockto the block number referenced in theblockhashIfblockhashis present in the filter criteria, then neitherfromBlocknortoBlockare allowed.
Sample Request
curl https://lb.nodies.app/v1/<INSERT URL> \
-H "x-api-key: <API-KEY>" \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getLogs",
"params": [
{
"blockhash": "0x729eea5dd371632d98ceffaadefedc33d245374786c5d181c7b3eec63ee7b36c"
}
],
"id": 1
}'Sample Response
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"address": "0x2754b28227f041a66c46509d5620782bfc4766ef",
"topics": [
"0xa64da754fccf55aa65a1f0128a648633fade3884b236e879ee9f64c78df5d5d7",
"0x000000000000000000000000efdaf1cd0d539896c06644ebe5d7f81c650bacc2",
"0x000000000000000000000000f32682d5f99ba4143532618d6f516859a055ea06",
"0x0000000000000000000000000000000000000000000000000000000000000000"
],
"data": "0x00000000000000000000000000000000000000000000000000729b123e2f0400",
"blockNumber": "0x9265cd",
"transactionHash": "0x8fef048a4b01804ba49d2a58e3d436c1c2a2abc1977a36b723a5c096e3b6f84e",
"transactionIndex": "0x0",
"blockHash": "0x729eea5dd371632d98ceffaadefedc33d245374786c5d181c7b3eec63ee7b36c",
"logIndex": "0x0",
"removed": false
},
{
"address": "0xaaaebe6fe48e54f431b0c390cfaf0b017d09d42d",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000c12ad9ea067619637fbc74a3ac319dbc312f72af",
"0x0000000000000000000000007481f00e17e0784477c6f6de5c31fe3cd4a84e47"
],
"data": "0x00000000000000000000000000000000000000000000000000000000005c0f6e",
"blockNumber": "0x9265cd",
"transactionHash": "0xfb03571f4c000312792535c9d10e09647768112447709a041913e92dbff334bb",
"transactionIndex": "0x1",
"blockHash": "0x729eea5dd371632d98ceffaadefedc33d245374786c5d181c7b3eec63ee7b36c",
"logIndex": "0x1",
"removed": false
},
{
"address": "0xa22c1b5320108c19db53f58241fd64b105562296",
"topics": [
"0xce7dc747411ac40191c5335943fcc79d8c2d8c01ca5ae83d9fed160409fa6120",
"0x000000000000000000000000cb6b973b93d4d4be2753e7dffc11e26a220f4122",
"0x000000000000000000000000cea488bfd550f775427c32ccb4fc080ef996b7f3"
],
"data": "0x0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000005e5d84fb",
"blockNumber": "0x9265cd",
"transactionHash": "0x041265c8d4610cbac6f4e46084ae70de2c049fe7fc895ef635ba34e50b73bf8a",
"transactionIndex": "0x2",
"blockHash": "0x729eea5dd371632d98ceffaadefedc33d245374786c5d181c7b3eec63ee7b36c",
"logIndex": "0x2",
"removed": false
},
{
"address": "0xa22c1b5320108c19db53f58241fd64b105562296",
"topics": [
"0x9ea70f0eb33d898c3336ecf2c0e3cf1c0195c13ad3fbcb34447777dbfd5ff2d0",
"0x000000000000000000000000cea488bfd550f775427c32ccb4fc080ef996b7f3"
],
"data": "0x0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000005e5d84fb",
"blockNumber": "0x9265cd",
"transactionHash": "0x041265c8d4610cbac6f4e46084ae70de2c049fe7fc895ef635ba34e50b73bf8a",
"transactionIndex": "x2",
"blockHash": "0x729eea5dd371632d98ceffaadefedc33d245374786c5d181c7b3eec63ee7b36c",
"logIndex": "0x3",
"removed": false
}
]
}Last updated