createDirectAddLiquidityBody method

Cell createDirectAddLiquidityBody({
  1. required BigInt amount0,
  2. required BigInt amount1,
  3. required InternalAddress userWalletAddress,
  4. BigInt? minimumLpToMint,
  5. BigInt? queryId,
  6. InternalAddress? refundAddress,
  7. InternalAddress? excessesAddress,
  8. Cell? customPayload,
  9. BigInt? customPayloadForwardGasAmount,
})

Implementation

Cell createDirectAddLiquidityBody({
  required BigInt amount0,
  required BigInt amount1,
  required InternalAddress userWalletAddress,
  BigInt? minimumLpToMint,
  BigInt? queryId,
  InternalAddress? refundAddress,
  InternalAddress? excessesAddress,
  Cell? customPayload,
  BigInt? customPayloadForwardGasAmount,
}) {
  return beginCell()
      .storeUint(DexOpCodes.DIRECT_ADD_LIQUIDITY.op, 32)
      .storeUint(queryId ?? BigInt.zero, 64)
      .storeCoins(amount0)
      .storeCoins(amount1)
      .storeCoins(minimumLpToMint ?? BigInt.from(1))
      .storeCoins(customPayloadForwardGasAmount ?? BigInt.zero)
      .storeAddress(userWalletAddress)
      .storeMaybeRef(customPayload)
      .storeRef(beginCell()
          .storeAddress(refundAddress ?? userWalletAddress)
          .storeAddress(excessesAddress ?? refundAddress ?? userWalletAddress)
          .endCell())
      .endCell();
}