events property with three capabilities:
- Fetch historical logs — query past event logs from the blockchain
- Decode raw logs — parse raw transaction receipt logs into typed event objects
- Watch live events — subscribe to real-time event notifications
Fetching historical logs
Each event has aget*Logs() method that returns all matching logs from the entire chain history. You can optionally pass { fromBlock, toBlock } to narrow the search range.
Decoding raw logs
UsedecodeLog() to decode a raw log from a transaction receipt. This is useful when you have a receipt and want to decode its logs without knowing which event they belong to.
Watching live events
Each event has awatch*() method that subscribes to real-time event notifications. The method returns an unwatch function to stop listening.
Available events per contract
GlobalParams
CampaignInfoFactory
TreasuryFactory
CampaignInfo
PaymentTreasury
AllOrNothing Treasury
KeepWhatsRaised Treasury
ItemRegistry
Types
All event methods use shared types from@oaknetwork/contracts-sdk:
| Type | Description |
|---|---|
EventFilterOptions | Optional { fromBlock?: bigint; toBlock?: bigint } for get*Logs methods. Defaults to genesis → latest. |
DecodedEventLog | Returned by get*Logs and decodeLog. Contains eventName and typed args. |
RawLog | Input to decodeLog. Contains topics and data from a transaction receipt. |
EventWatchHandler | Callback for watch* methods: (logs: readonly DecodedEventLog[]) => void. |