swapTokenForExactTokensTx method

Future<RawEvmTransaction> swapTokenForExactTokensTx({
  1. required BigInt amountOut,
  2. required BigInt amountInMax,
  3. required List<String> path,
  4. required String to,
  5. required BigInt deadline,
  6. required String sender,
})

Implementation

Future<RawEvmTransaction> swapTokenForExactTokensTx({
  required BigInt amountOut,
  required BigInt amountInMax,
  required List<String> path,
  required String to,
  required BigInt deadline,
  required String sender,
}) async {
  final function = abi.getFunction("swapTokensForExactTokens")!;

  final result = await buildTransactionForFunction(
    sender: sender,
    function: function
        .addValues(values: [amountOut, amountInMax, path, to, deadline]),
  );

  return result;
}