Skip to main content
Plasma API method that returns an array of all logs matching a given filter object.

Parameters

  • object — the filter options with fields like fromBlock, toBlock, address, topics, blockHash

Response

  • array — an array of log objects

eth_getLogs code examples

const { JsonRpcProvider } = require("ethers");

const provider = new JsonRpcProvider("CHAINSTACK_NODE_URL");

async function call() {
  const result = await provider.send("eth_getLogs", [
    {
      fromBlock: "latest",
      toBlock: "latest"
    }
  ]);
  console.log(result);
}

call();