useScaffoldEventHistory
Use this hook to retrieve historical event logs for your smart contract, providing past activity data, with the option to watch for new events.
Use this hook to retrieve historical event logs for your smart contract, providing past activity data, with the option to watch for new events.
typescript
This example retrieves the historical event logs for the GreetingChange
event of the YourContract
smart contract, starting from block number 31231 and filtering events where the greetingSetter
parameter is 0x9eB2C4866aAe575bC88d00DE5061d5063a1bb3aF
.
Configuration
Return Values
data
property of the returned object contains an array of event objects, each containing the event parameters and (optionally) the block, transaction, and receipt data.isLoading
property indicates whether the event logs are currently being fetched.error
property contains any error that occurred during the fetching process (if applicable).