swapExactEthForTokensTransaction method

Future<RawEvmTransaction> swapExactEthForTokensTransaction({
  1. required BigInt amountIn,
  2. required BigInt amountOutMin,
  3. required List<String> path,
  4. required String to,
  5. required BigInt deadline,
  6. required String sender,
  7. EvmFeeInformation<EvmGasPrice>? feeInformation,
})

Implementation

Future<RawEvmTransaction> swapExactEthForTokensTransaction({
  required BigInt amountIn,
  required BigInt amountOutMin,
  required List<String> path,
  required String to,
  required BigInt deadline,
  required String sender,
  EvmFeeInformation? feeInformation,
}) async {
  final function = abi.getFunction("swapExactETHForTokens")!;

  final result = await buildTransactionForFunction(
    value: amountIn,
    function: function.addValues(values: [amountOutMin, path, to, deadline]),
    sender: sender,
    feeInfo: feeInformation,
  );

  return result;
}