Get ERC20 Token balances

Once the user's wallet is created, you may want to fetch the balances of ERC20 tokens in the user's account. The Leap Wallet SDK provides the necessary methods for this.

To get the balance of an ERC20 token, use the following code:

const balance = await provider.getBalance('wallet-address');

// ERC20 Token Balance
const contract = new erc20(erc20_token_contract_address, provider);
const balance = await contract.getBalance('wallet-address');

Last updated