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-keybackendProject secret key - for backend usage only. Should not be used in frontend code.
x-client-idfrontendProject client ID - for frontend usage on authorized domains.
x-ecosystem-idoptionalEcosystem ID - for ecosystem wallets.
x-ecosystem-partner-idoptionalEcosystem partner ID - for ecosystem wallets.
chainIdintegerRequiredThe blockchain network identifier where the contract is deployed.
addressstringRequiredThe smart contract address or ENS name.
signaturestringFilter by event signature hash, e.g., '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' for Transfer event
filterTopic0stringFilter by event topic 0 (event signature hash)
filterTopic1stringFilter by event topic 1
filterTopic2stringFilter by event topic 2
filterTopic3stringFilter by event topic 3
filterBlockTimestampGteintegerFilter by block timestamp (Unix timestamp) greater than or equal to this value
filterBlockTimestampLteintegerFilter by block timestamp (Unix timestamp) less than or equal to this value
filterBlockNumberGteintegerFilter by block number greater than or equal to this value
filterBlockNumberLteintegerFilter by block number less than or equal to this value
pagenumberCurrent page number
Example:
1limitnumberNumber of items per page
Example:
20sortOrderstringSort 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 } }}