getProvideLiquidityTonTxParams method

Future<SenderArguments> getProvideLiquidityTonTxParams({
  1. required InternalAddress userWalletAddress,
  2. required PtonV1 proxyTon,
  3. required InternalAddress otherTokenAddress,
  4. required BigInt sendAmount,
  5. required BigInt minLpOut,
  6. BigInt? forwardGasAmount,
  7. BigInt? queryId,
})

Implementation

Future<SenderArguments> getProvideLiquidityTonTxParams({
  required InternalAddress userWalletAddress,
  required PtonV1 proxyTon,
  required InternalAddress otherTokenAddress,
  required BigInt sendAmount,
  required BigInt minLpOut,
  BigInt? forwardGasAmount,
  BigInt? queryId,
}) async {
  final routerWalletAddress = await stonfiProvider!
      .open(JettonMaster(otherTokenAddress))
      .getWalletAddress(this.address);

  final forwardPayload = createProvideLiquidityBody(
    routerWalletAddress: routerWalletAddress,
    minLpOut: minLpOut,
  );

  final forwardTonAmount =
      forwardGasAmount ?? gasConstants.provideLpTon.forwardGasAmount;

  return await proxyTon.getTonTransferTxParams(
    queryId: queryId ?? BigInt.zero,
    tonAmount: sendAmount,
    destinationAddress: this.address,
    refundAddress: userWalletAddress,
    forwardPayload: forwardPayload,
    forwardTonAmount: forwardTonAmount,
  );
}