svm.token has the write side covered (transfer_checked, mint_to_checked,
create_ata, …) but there's no read side — getting a balance means unpacking
raw bytes:
int.from_bytes(Account(ata).data[64:72], "little")
The magic offset carries no meaning at the call site, and using it on the wrong
account (a wallet instead of a token account) returns plausible garbage rather
than failing.
It will be looks like, but not sure the best option, the original is still straight forward..
bob_bal = svm.token.account(bob_ata).amount
svm.tokenhas the write side covered (transfer_checked,mint_to_checked,create_ata, …) but there's no read side — getting a balance means unpackingraw bytes:
The magic offset carries no meaning at the call site, and using it on the wrong
account (a wallet instead of a token account) returns plausible garbage rather
than failing.
It will be looks like, but not sure the best option, the original is still straight forward..