fetchTokenBalance method

Future<Amount> fetchTokenBalance(
  1. String address,
  2. ERC20Entity token
)

Fetch Token Balance

Implementation

Future<Amount> fetchTokenBalance(
  String address,
  ERC20Entity token,
) async {
  final erc20Contract = ERC20Contract(
    contractAddress: token.contractAddress,
    rpc: this,
  );
  final balance = await erc20Contract.getBalance(address);
  return Amount(value: balance, decimals: token.decimals);
}