@magmaprotocol/magma-clmm-sdk 0.5.4 → 0.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1032,8 +1032,8 @@ var ClmmPoolUtil = class {
1032
1032
  liquidity = estimateLiquidityForCoinB(curSqrtPrice, lowerSqrtPrice, coinAmount);
1033
1033
  }
1034
1034
  const coinAmounts = ClmmPoolUtil.getCoinAmountFromLiquidity(liquidity, curSqrtPrice, lowerSqrtPrice, upperSqrtPrice, roundUp);
1035
- const tokenLimitA = iscoinA ? d(coinAmounts.coinA.toString()).mul(1 + slippage).toString() : d(coinAmounts.coinA.toString()).mul(1 - slippage).toString();
1036
- const tokenLimitB = iscoinA ? d(coinAmounts.coinB.toString()).mul(1 + slippage).toString() : d(coinAmounts.coinB.toString()).mul(1 - slippage).toString();
1035
+ const tokenLimitA = roundUp ? d(coinAmounts.coinA.toString()).mul(1 + slippage).toString() : d(coinAmounts.coinA.toString()).mul(1 - slippage).toString();
1036
+ const tokenLimitB = roundUp ? d(coinAmounts.coinB.toString()).mul(1 + slippage).toString() : d(coinAmounts.coinB.toString()).mul(1 - slippage).toString();
1037
1037
  return {
1038
1038
  coinAmountA: coinAmounts.coinA,
1039
1039
  coinAmountB: coinAmounts.coinB,
@@ -2677,7 +2677,7 @@ var _TransactionUtil = class {
2677
2677
  { amountSecond: BigInt(reverSlippageAmount(amount, slippage)), amountFirst: BigInt(amount) },
2678
2678
  coinType,
2679
2679
  buildVector
2680
- ) : _TransactionUtil.buildCoinForAmount(tx, allCoinAsset, BigInt(amount), coinType, buildVector);
2680
+ ) : _TransactionUtil.buildCoinForAmount(tx, allCoinAsset, BigInt(amount), coinType, false, true);
2681
2681
  }
2682
2682
  /**
2683
2683
  * fix add liquidity fix token for coin amount