createProvideLiquidityBody method

Cell createProvideLiquidityBody({
  1. required InternalAddress routerWalletAddress,
  2. required BigInt minLpOut,
  3. required InternalAddress receiverAddress,
  4. required InternalAddress refundAddress,
  5. bool bothPositive = false,
  6. InternalAddress? excessesAddress,
  7. Cell? customPayload,
  8. BigInt? customPayloadForwardGasAmount,
})

Implementation

Cell createProvideLiquidityBody({
  required InternalAddress routerWalletAddress,
  required BigInt minLpOut,
  required InternalAddress receiverAddress,
  required InternalAddress refundAddress,
  bool bothPositive = false,
  InternalAddress? excessesAddress,
  Cell? customPayload,
  BigInt? customPayloadForwardGasAmount,
}) {
  return beginCell()
      .storeUint(DexOpCodes.PROVIDE_LP.op, 32)
      .storeAddress(routerWalletAddress)
      .storeAddress(refundAddress)
      .storeAddress(excessesAddress ?? refundAddress)
      .storeRef(beginCell()
          .storeCoins(minLpOut)
          .storeAddress(receiverAddress)
          .storeUint(bothPositive ? BigInt.one : BigInt.zero, 1)
          .storeCoins(customPayloadForwardGasAmount ?? BigInt.zero)
          .storeMaybeRef(customPayload)
          .endCell())
      .endCell();
}