Token balances
addTokenBalance(options) {#add-token-balance}
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 owns the account.postProgramId: pubkeys of the Token program that owns the account.preMint: pubkeys of the token’s mint prior to execution.postMint: pubkeys of the token’s mint after execution.preOwner: pubkeys of token balance’s owner after execution.postOwner: pubkeys of token balance’s owner after execution.
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 balance.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.
