eth_getLogs
https://triport.io/rpc/bscReturn event logs matching a filter.
eth_getLogs returns BNB Smart Chain event logs matching one address/topic filter and either a block range or a block hash.
Use it for bounded event indexing and contract-event lookups. Topics are positional and support a hash, null, or an array of hashes per position. blockHash must not be combined with fromBlock according to the OpenRPC schema.
This pool has per-node limits: the limited class accepts 25 blocks and rejects 50, while two standard classes accept 100 blocks and reject 1,000. One standard class requires address. Split wider queries before sending them so routing can honor the selected node's capability.
Parameters
JSON-RPC params is a positional array: [filter].
filterobjectrequiredaddressstring or array<string>optionalblockHashstring (hash)optionalfromBlock.fromBlockstring (block tag or hex quantity)optionaltoBlockstring (block tag or hex quantity)optionaltopicsarrayoptionalnull, one hash, or an array of hashes.Response
The response below is the checked fixture for this method; it is reproduced without changing its fields or values.
resultarray<object>result[].addressstringresult[].datastringresult[].topicsarray<string>result[].blockHashstringresult[].blockNumberstringresult[].transactionHashstringresult[].transactionIndexstringresult[].logIndexstringresult[].removedbooleanErrors
Errors use the standard JSON-RPC error envelope. See BSC errors for network-specific classification and the linked shared reference.
| Code | Meaning | When it happens |
|---|---|---|
-32602 | Invalid params | A required positional parameter is missing or a value does not match the OpenRPC schema. |
-32000 | Upstream request failure | Interpret the message with the code: header not found means a missing block; pruned/unsupported state text means unavailable historical state. |
-32005 or upstream error | Log query limit | The selected node rejects the requested range or requires an address filter. |
401 | Unauthorized | The x-token API key is missing or invalid. |
429 | Rate limited | The request exceeds the configured category RPS for the caller's tier. |
Examples
JavaScript (fetch)
const response = await fetch("https://triport.io/rpc/bsc", {
method: "POST",
headers: {
"x-token": process.env.TRIPORT_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getLogs",
"params": [
{
"fromBlock": "latest",
"toBlock": "latest",
"address": "0x0000000000000000000000000000000000000000"
}
]
}),
});
const payload = await response.json();
console.log(payload.result);Notes
- Keep requests within the selected node's 25- or 100-block limit. Include
addresswhenever possible because part of the pool requires it. - The BSC categories use configured defaults of 15 / 20 / 100 / 250 RPS; they are marked unmeasured in the tier matrix.
- Related methods:
eth_getBlockReceipts,eth_getTransactionReceipt,eth_getBlockByNumber.