Skip to main content

Path parameters

apiKey
string
required
Your API key for authentication

Request

fromBlock
string
Integer block number, or “latest” for the last mined block or “pending”, “earliest” for not yet mined transactions
toBlock
string
Integer block number, or “latest” for the last mined block or “pending”, “earliest” for not yet mined transactions
address
string
Contract address or a list of addresses from which logs should originate
topics
array
Array of 32 Bytes DATA topics. Topics are order-dependent
blockhash
string
Using blockhash is equivalent to fromBlock = toBlock = the block number with hash blockhash

Example request params

[
  {
    "fromBlock": "0x1",
    "toBlock": "0x2",
    "address": "0x8888f1f195afa192cfee860698584c030f4c9db1",
    "topics": [
      "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
      null,
      [
        "0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
        "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"
      ]
    ]
  }
]
curl https://site1.moralis-nodes.com/zetachain/:apiKey \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0", "method": "eth_getLogs", "params": [{"fromBlock": "0x1", "toBlock": "0x2", "address": "0x8888f1f195afa192cfee860698584c030f4c9db1", "topics": ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", null, ["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"]]}], "id": 1}'
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
    {
      "logIndex": "0x1",
      "blockNumber": "0x1b4",
      "blockHash": "0x8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcfdf829c5a142f1fccd7d",
      "transactionHash": "0xdf829c5a142f1fccd7d8216c5785ac562ff41e2dcfdf5785ac562ff41e2dcf",
      "transactionIndex": "0x0",
      "address": "0x16c5785ac562ff41e2dcfdf829c5a142f1fccd7d",
      "data": "0x0000000000000000000000000000000000000000000000000000000000000000",
      "topics": [
        "0x59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a5"
      ]
    }
  ]
}