erc20Approve static method

Future<String> erc20Approve(
  1. String contractAddress,
  2. String spender,
  3. BigInt amount
)

Request data when send erc20 approve. contractAddress is token contract address.

spender is spender public address.

amount is token amount.

Implementation

static Future<String> erc20Approve(
    String contractAddress, String spender, BigInt amount) async {
  var list2 = [spender, amount.toString()];
  var list1 = [contractAddress, "erc20_approve", list2];

  const method = "particle_abi_encodeFunctionCall";
  final params = list1;
  return await EvmService.rpc(method, params);
}