Skip to main content
Every contract entity exposes an events property with three capabilities:
  1. Fetch historical logs — query past event logs from the blockchain
  2. Decode raw logs — parse raw transaction receipt logs into typed event objects
  3. Watch live events — subscribe to real-time event notifications

Fetching historical logs

Each event has a get*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

Use decodeLog() 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 a watch*() 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: