sendERC20Token method

Future<String> sendERC20Token({
  1. required TransferIntent<EvmFeeInformation<EvmGasPrice>> intent,
  2. required String from,
  3. required Uint8List seed,
})

Send ERC20 Token

Implementation

Future<String> sendERC20Token({
  required TransferIntent<EvmFeeInformation> intent,
  required String from,
  required Uint8List seed,
}) async {
  assert(intent.token is ERC20Entity);
  assert(intent.memo == null);

  final erc20 = intent.token as ERC20Entity;
  final tokenContractAddress = erc20.contractAddress;

  final erc20Contract = ERC20Contract(
    contractAddress: tokenContractAddress,
    rpc: this,
  );

  return erc20Contract.transfer(
    seed: seed,
    sender: from,
    to: intent.recipient,
    value: intent.amount.value,
    feeInfo: intent.feeInfo,
    accessList: intent.accessList,
  );
}