addTokenBalance(options)
This allows for tracking token balances. options has the following structure:
account: the set of accounts to track. Leave undefined to subscribe to balance updates of all accounts across the network.preProgramId: pubkeys of the Token program that owned the account prior to execution.postProgramId: pubkeys of the Token program that owns the account after execution.preMint: pubkeys of the token’s mint prior to execution.postMint: pubkeys of the token’s mint after execution.preOwner: pubkeys of the token balance’s owner prior to execution.postOwner: pubkeys of the token balance’s owner after execution.
pre* fields describe the value before the transaction and post* fields describe it after the transaction (see TokenBalance field selection).
Related data retrieval flags:
transaction = true: retrieve the transaction that gave rise to the balance updatetransactionInstructions = true: retrieve all instructions executed by the parent transaction
augmentBlock() from @subsquid/solana-objects on the block data to populate the convenience reference fields like tokenBalance.transaction.
Selection of the exact fields to be retrieved for each token balance item and the related data is done with the setFields() method documented on the Field selection page.