TriportRPC

eth_getLogs

POSThttps://triport.io/rpc/bsc

Return event logs matching a filter.

BNB Smart Chainbsc:rpcbsc_read_rpc_heavy - 15 / 20 / 100 / 250 RPS (free / basic / pro / business) (default, unmeasured); enterprise unlimited

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].

filterobjectrequired
Per-node maximum range is ≤ 100 blocks; address is required by some nodes.
addressstring or array<string>optional
Contract address or non-empty address list. Part of the BSC pool requires it.
blockHashstring (hash)optional
Match one block. Must not be combined with fromBlock.
fromBlockstring (block tag or hex quantity)optional
Inclusive start of the block range.
toBlockstring (block tag or hex quantity)optional
Inclusive end of the block range.
topicsarrayoptional
Up to four positional topic selectors; each is null, 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>
Matching log entries.
result[].addressstring
Contract address that emitted the log.
result[].datastring
Unindexed event data as hex bytes.
result[].topicsarray<string>
Indexed event topics.
result[].blockHashstring
Containing block hash when supplied.
result[].blockNumberstring
Containing block number as a hex quantity when supplied.
result[].transactionHashstring
Containing transaction hash when supplied.
result[].transactionIndexstring
Transaction index as a hex quantity when supplied.
result[].logIndexstring
Log index as a hex quantity when supplied.
result[].removedboolean
Whether the log was removed by a reorganization when supplied.

Errors

Errors use the standard JSON-RPC error envelope. See BSC errors for network-specific classification and the linked shared reference.

CodeMeaningWhen it happens
-32602Invalid paramsA required positional parameter is missing or a value does not match the OpenRPC schema.
-32000Upstream request failureInterpret the message with the code: header not found means a missing block; pruned/unsupported state text means unavailable historical state.
-32005 or upstream errorLog query limitThe selected node rejects the requested range or requires an address filter.
401UnauthorizedThe x-token API key is missing or invalid.
429Rate limitedThe 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 address whenever 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.