Contracts
Contract Events
Query and listen to contract events for any deployed contract on any EVM chain.
fetch( "https://api.thirdweb.com/v1/contracts/{chainId}/{address}/events?page=1&limit=20&sortOrder=desc", { method: "GET", headers: { "x-secret-key": "<your-project-secret-key>", }, },);
x-secret-key
backendProject secret key - for backend usage only. Should not be used in frontend code.
x-client-id
frontendProject client ID - for frontend usage on authorized domains.
x-ecosystem-id
optionalEcosystem ID - for ecosystem wallets.
x-ecosystem-partner-id
optionalEcosystem partner ID - for ecosystem wallets.
chainId
integerRequiredThe blockchain network identifier where the contract is deployed.
address
stringRequiredThe smart contract address or ENS name.
signature
stringFilter by event signature hash, e.g., '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' for Transfer event
filterTopic0
stringFilter by event topic 0 (event signature hash)
filterTopic1
stringFilter by event topic 1
filterTopic2
stringFilter by event topic 2
filterTopic3
stringFilter by event topic 3
filterBlockTimestampGte
integerFilter by block timestamp (Unix timestamp) greater than or equal to this value
filterBlockTimestampLte
integerFilter by block timestamp (Unix timestamp) less than or equal to this value
filterBlockNumberGte
integerFilter by block number greater than or equal to this value
filterBlockNumberLte
integerFilter by block number less than or equal to this value
page
numberCurrent page number
Example:
1
limit
numberNumber of items per page
Example:
20
sortOrder
stringSort order: 'asc' for ascending, 'desc' for descending
Example:
desc
{ "result": { "events": [ { "address": "string", "blockHash": "string", "blockNumber": 0, "blockTimestamp": 0, "chainId": "string", "data": "string", "logIndex": 0, "topics": [ "string" ], "transactionHash": "string", "transactionIndex": 0, "decoded": { "name": "string", "params": { "property": "value" }, "signature": "string" } } ], "pagination": { "hasMore": true, "limit": 20, "page": 1 } }}