Skip to main content

addLog(options)

Get log messages emitted by some or all programs in the network. options has the following structure:
Data requests:
  • programId: the set of addresses of programs emitting the logs. Leave it undefined to subscribe to logs from all programs in the network.
  • kind: the set of values of kind.
With transaction = true the processor will retrieve all parent transactions and add them to the transactions iterable within the block data. You can also call augmentBlock() from @subsquid/solana-objects on the block data to populate the convenience reference fields like log.transaction. Similarly, instruction = true retrieves the instructions that emitted the matching logs. Note that logs can also be requested by the other DataSourceBuilder methods as related data. Selection of the exact fields to be retrieved for each log and its optional parent transaction is done with the setFields() method documented on the Field selection page.

Examples

Fetch all log messages emitted by the Pyth push oracle program, together with the instructions that emitted them: