owner filter means the program that owns an account, not the wallet that owns tokens inside it.
Save the quickstart helper as stream.mts in the same directory. These examples use the same environment variables and dependencies.
Watch one account
accounts.mts
Filter program accounts
This request selects legacy SPL Token accounts for one mint and downloads only their amount field. Passrequest to subscribe(request) in place of the previous account filter.
datasize, and offsets are strings in this client. Filters within one named account filter are combined; named filters can be used for separate selections.
Decode sliced token amounts
Inside the account handler, decode the eight-byte slice as an unsigned little-endian integer:The 165-byte size and offsets above describe legacy SPL Token accounts. Token-2022 extensions can change account size. Do not apply this filter to every token program without checking its layout.