Loading

get_logs

Table function

Streams contract logs via eth_getLogs, decoding topics with human-readable signatures or ABI.

get_logs(TRANSPORT, ADDRESS, VARCHAR)

Accepts a human-readable event signature (e.g. `event Transfer(...)`) and returns decoded fields.

Parameters

NameType
transportTRANSPORT
addressADDRESS
event_signatureVARCHAR

Result columns

NameType
addressADDRESS
block_hashBYTES32
block_numberBLOCK_NUMBER
transaction_hashBYTES32
transaction_indexINTEGER
log_indexINTEGER
dataBLOB
removedBOOLEAN
topicsBYTES32[]
...ABI-dependent column(s)
1
SELECT *
2
FROM get_logs(
3
$transport, -- transport
4
'0x4200000000000000000000000000000000000006'::address, -- Base WETH
5
'event Transfer(address indexed from, address indexed to, uint256 value)' -- event_signature
6
)
7
LIMIT 5;
Notebook ready in readonly mode.

get_logs(TRANSPORT, ADDRESS, JSON)

Accepts a JSON ABI fragment to drive indexed/non-indexed decoding.

Parameters

NameType
transportTRANSPORT
addressADDRESS
event_abiJSON

Result columns

NameType
addressADDRESS
block_hashBYTES32
block_numberBLOCK_NUMBER
transaction_hashBYTES32
transaction_indexINTEGER
log_indexINTEGER
dataBLOB
removedBOOLEAN
topicsBYTES32[]
...ABI-dependent column(s)
1
SELECT *
2
FROM get_logs(
3
$transport, -- transport
4
'0x4200000000000000000000000000000000000006'::address, -- Base WETH
5
json('{"type":"event","name":"Transfer","inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}]}') -- event_abi
6
)
7
LIMIT 5;
Notebook ready in readonly mode.

get_logs(TRANSPORT, ADDRESS, VARCHAR, BIGINT)

Adds an inclusive starting block height to constrain the log window.

Parameters

NameType
transportTRANSPORT
addressADDRESS
event_signatureVARCHAR
from_blockBIGINT

Result columns

NameType
addressADDRESS
block_hashBYTES32
block_numberBLOCK_NUMBER
transaction_hashBYTES32
transaction_indexINTEGER
log_indexINTEGER
dataBLOB
removedBOOLEAN
topicsBYTES32[]
...ABI-dependent column(s)
1
SELECT *
2
FROM get_logs(
3
$transport, -- transport
4
'0x4200000000000000000000000000000000000006'::address, -- Base WETH
5
'event Transfer(address indexed from, address indexed to, uint256 value)', -- event_signature
6
36760640 -- from_block
7
);
Notebook ready in readonly mode.

get_logs(TRANSPORT, ADDRESS, JSON, BIGINT)

JSON ABI flavour with a starting block filter for deterministic backfills.

Parameters

NameType
transportTRANSPORT
addressADDRESS
event_abiJSON
from_blockBIGINT

Result columns

NameType
addressADDRESS
block_hashBYTES32
block_numberBLOCK_NUMBER
transaction_hashBYTES32
transaction_indexINTEGER
log_indexINTEGER
dataBLOB
removedBOOLEAN
topicsBYTES32[]
...ABI-dependent column(s)
1
SELECT *
2
FROM get_logs(
3
$transport, -- transport
4
'0x4200000000000000000000000000000000000006'::address, -- Base WETH
5
json('{"type":"event","name":"Transfer","inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}]}'), -- event_abi
6
36760640 -- from_block
7
);
Notebook ready in readonly mode.

get_logs(TRANSPORT, ADDRESS, VARCHAR, BIGINT, BIGINT)

Specifies both start and end block heights (inclusive) for bounded range scans.

Parameters

NameType
transportTRANSPORT
addressADDRESS
event_signatureVARCHAR
from_blockBIGINT
to_blockBIGINT

Result columns

NameType
addressADDRESS
block_hashBYTES32
block_numberBLOCK_NUMBER
transaction_hashBYTES32
transaction_indexINTEGER
log_indexINTEGER
dataBLOB
removedBOOLEAN
topicsBYTES32[]
...ABI-dependent column(s)
1
SELECT *
2
FROM get_logs(
3
$transport, -- transport
4
'0x4200000000000000000000000000000000000006'::address, -- Base WETH
5
'event Transfer(address indexed from, address indexed to, uint256 value)', -- event_signature
6
36760640, -- from_block
7
36760643 -- to_block
8
);
Notebook ready in readonly mode.

get_logs(TRANSPORT, ADDRESS, JSON, BIGINT, BIGINT)

JSON ABI variant that constrains the log search window with explicit from/to heights.

Parameters

NameType
transportTRANSPORT
addressADDRESS
event_abiJSON
from_blockBIGINT
to_blockBIGINT

Result columns

NameType
addressADDRESS
block_hashBYTES32
block_numberBLOCK_NUMBER
transaction_hashBYTES32
transaction_indexINTEGER
log_indexINTEGER
dataBLOB
removedBOOLEAN
topicsBYTES32[]
...ABI-dependent column(s)
1
SELECT *
2
FROM get_logs(
3
$transport, -- transport
4
'0x4200000000000000000000000000000000000006'::address, -- Base WETH
5
json('{"type":"event","name":"Transfer","inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}]}'), -- event_abi
6
36760640, -- from_block
7
36760643 -- to_block
8
);
Notebook ready in readonly mode.