Check Token Balances
// Check your SOL balance
const solBalance = await agent.methods.getBalance();
// Check your SPL token balance
const tokenBalance = await agent.methods.getBalance(
new PublicKey("token-mint-address")
);
// Check another wallet's SOL balance
const otherSolBalance = await agent.methods.getBalanceOther(
new PublicKey("wallet-address")
);
// Check another wallet's token balance
const otherTokenBalance = await agent.methods.getBalanceOther(
new PublicKey("wallet-address"),
new PublicKey("token-mint-address")
);Parameter
Type
Required
Description
Parameter
Type
Required
Description
Last updated