allowance method

Future<String> allowance(
  1. String ownerAdd_,
  2. dynamic contractAdd_,
  3. dynamic spenderAdd_
)

Gets how much allowance spender have from owner ownAdd_ : The address of the Token's owner. contractAddr_ : The address of the token. spenderAdd_ : The address of the Spender's address. An String representing the Allowance .

Implementation

Future<String> allowance(String ownerAdd_, contractAdd_, spenderAdd_) async {
  final EthereumAddress ownAddress = EthereumAddress.fromHex(ownerAdd_);
  final EthereumAddress contractAddr = EthereumAddress.fromHex(contractAdd_);
  final contract = DeployedContract(
      ContractAbi.fromJson(abiString, 'XRC20'), contractAddr);
  final tokenAllowance = contract.function('allowance');
  final EthereumAddress spender = EthereumAddress.fromHex(spenderAdd_);
  final allowance = await client.call(
      contract: contract,
      function: tokenAllowance,
      params: [ownAddress, spender]);
  return '$allowance';
}