This method allows getting either the native token balance or the balance of a specific token for a wallet.
// Get native balanceBigInteger nativeBalance = await wallet.GetBalance(chainId); // Get ERC20 token balanceBigInteger tokenBalance = await wallet.GetBalance(chainId, erc20ContractAddress);
An instance of IThirdwebWallet. This represents the wallet for which you want to retrieve the balance.
IThirdwebWallet
The chain ID from which you want to retrieve the balance.
The optional ERC20 contract address from which you want to retrieve the balance. If not provided, the method will return the native token balance.
The method returns a BigInteger representing the balance in Wei.
BigInteger