increaseAllowance method

Future<void> increaseAllowance(
  1. BigInt amount
)

Implementation

Future<void> increaseAllowance(BigInt amount) async {
  final params = Args();
  params.addString(
      grpc.isBuildnet ? BuildnetConstants.routerAddress : MainnetConstants.routerAddress); //spender address
  params.addU256(amount);
  const targetFunction = "increaseAllowance";
  final functionParameters = params.serialise();
  final maximumGas = toMAS(BigInt.from(GasLimit.MAX_GAS_CALL.value));
  final smartContracAddress = getTokenAddress(token, grpc.isBuildnet);

  await grpc.scCall(
    account: grpc.account,
    fee: 0.01,
    coins: 0.0,
    maximumGas: maximumGas,
    smartContracAddress: smartContracAddress,
    functionName: targetFunction,
    functionParameters: functionParameters,
  );
}