Skip to main content

GET Smart Wallet Token Balance

Get Smart Wallet’s Token Balance

The getTokenBalance() function allows you to retrieve the balance of a specific ERC20 token owned by a Fuse wallet. You will need to provide the contract address of the token and the address of the Fuse wallet. The function returns the balance as a BigInt object, which you can use to perform further calculations or display the balance to the user.

const tokenAddress = "TOKEN_ADDRESS";
const smartWalletAddress = fuseSDK.wallet.getSender();
const tokenBalance = await fuseSDK.explorerModule.getTokenBalance(
tokenAddress,
smartWalletAddress
);
console.log(`Token: ${tokenAddress}, balance: ${tokenBalance.toString()}`);