Is it possible to get SOL balance and/or SPL token balances for a given account in an Anchor program?
The lamports of an account in Anchor can be found with:
let lmps: u64 = ctx.accounts.my_account.to_account_info().lamports();
If you have an account that is defined as
Account<'info, anchor_spl::token::TokenAccount>, you can get the amount of SPL tokens stored in that account with:
let amt: u64 = ctx.accounts.my_token_account.amount;