@meteora-ag/cp-amm-sdk 1.2.4-rc.0 → 1.2.5
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.d.mts +1 -11
- package/dist/index.d.ts +1 -11
- package/dist/index.js +24 -94
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -94
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -6291,10 +6291,6 @@ type RemoveLiquidityParams = {
|
|
|
6291
6291
|
}>;
|
|
6292
6292
|
currentPoint: BN;
|
|
6293
6293
|
};
|
|
6294
|
-
type RemoveLiquidityParams2 = RemoveLiquidityParams & {
|
|
6295
|
-
receiver: PublicKey;
|
|
6296
|
-
feePayer: PublicKey;
|
|
6297
|
-
};
|
|
6298
6294
|
type RemoveAllLiquidityParams = Omit<RemoveLiquidityParams, "liquidityDelta">;
|
|
6299
6295
|
type BuildAddLiquidityParams = {
|
|
6300
6296
|
owner: PublicKey;
|
|
@@ -7059,12 +7055,6 @@ declare class CpAmm {
|
|
|
7059
7055
|
* @returns Transaction builder.
|
|
7060
7056
|
*/
|
|
7061
7057
|
removeLiquidity(params: RemoveLiquidityParams): TxBuilder;
|
|
7062
|
-
/**
|
|
7063
|
-
* Builds a transaction to remove liquidity from a position.
|
|
7064
|
-
* @param {RemoveLiquidityParams} params - Parameters for removing liquidity.
|
|
7065
|
-
* @returns Transaction builder.
|
|
7066
|
-
*/
|
|
7067
|
-
removeLiquidity2(params: RemoveLiquidityParams2): TxBuilder;
|
|
7068
7058
|
/**
|
|
7069
7059
|
* Builds a transaction to remove liquidity from a position.
|
|
7070
7060
|
* @param {RemoveLiquidityParams} params - Parameters for removing liquidity.
|
|
@@ -15716,4 +15706,4 @@ var cp_amm = {
|
|
|
15716
15706
|
types: types
|
|
15717
15707
|
};
|
|
15718
15708
|
|
|
15719
|
-
export { ActivationPoint, ActivationType, type AddLiquidityParams, type AmmProgram, BASIS_POINT_MAX, BIN_STEP_BPS_DEFAULT, BIN_STEP_BPS_U128_DEFAULT, type BaseFee, type BaseFeeHandler, BaseFeeMode, type BuildAddLiquidityParams, type BuildLiquidatePositionInstructionParams, type BuildRemoveAllLiquidityInstructionParams, CP_AMM_PROGRAM_ID, CURRENT_POOL_VERSION, type ClaimPartnerFeeParams, type ClaimPositionFeeInstructionParams, type ClaimPositionFeeParams, type ClaimPositionFeeParams2, type ClaimRewardParams, type ClosePositionInstructionParams, type ClosePositionParams, CollectFeeMode, type ConfigState, CpAmm, cp_amm as CpAmmIdl, type CpAmm$1 as CpAmmTypes, type CreatePoolParams, type CreatePositionAndAddLiquidity, type CreatePositionParams, DYNAMIC_FEE_DECAY_PERIOD_DEFAULT, DYNAMIC_FEE_FILTER_PERIOD_DEFAULT, DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT, DYNAMIC_FEE_ROUNDING_OFFSET, DYNAMIC_FEE_SCALING_FACTOR, type DepositQuote, type DynamicFee, type DynamicFeeParams, type DynamicFeeStruct, FEE_DENOMINATOR, type FeeMode, type FeeOnAmountResult, FeeRateLimiter, FeeScheduler, type FundRewardParams, type GetDepositQuoteParams, type GetQuote2Params, type GetQuoteParams, type GetWithdrawQuoteParams, type InitializeAndFundReward, type InitializeCustomizeablePoolParams, type InitializeCustomizeablePoolWithDynamicConfigParams, type InitializeRewardParams, LIQUIDITY_SCALE, type LiquidityDeltaParams, type LockPositionParams, MAX, MAX_CU_BUFFER, MAX_EXPONENTIAL, MAX_FEE_BPS_V0, MAX_FEE_BPS_V1, MAX_FEE_NUMERATOR_V0, MAX_FEE_NUMERATOR_V1, MAX_PRICE_CHANGE_BPS_DEFAULT, MAX_RATE_LIMITER_DURATION_IN_SECONDS, MAX_RATE_LIMITER_DURATION_IN_SLOTS, MAX_SQRT_PRICE, MIN_CU_BUFFER, MIN_FEE_BPS, MIN_FEE_NUMERATOR, MIN_SQRT_PRICE, type MergePositionParams, ONE_Q64, type PermanentLockParams, type PoolFeesParams, type PoolFeesStruct, type PoolState, PoolStatus, PoolVersion, type PositionState, type PrepareCustomizablePoolParams, type PreparePoolCreationParams, type PreparePoolCreationSingleSide, type PrepareTokenAccountParams, type PreparedPoolCreation, type Quote2Result, type RefreshVestingParams, type RemoveAllLiquidityAndClosePositionParams, type RemoveAllLiquidityParams, type RemoveLiquidityParams, type
|
|
15709
|
+
export { ActivationPoint, ActivationType, type AddLiquidityParams, type AmmProgram, BASIS_POINT_MAX, BIN_STEP_BPS_DEFAULT, BIN_STEP_BPS_U128_DEFAULT, type BaseFee, type BaseFeeHandler, BaseFeeMode, type BuildAddLiquidityParams, type BuildLiquidatePositionInstructionParams, type BuildRemoveAllLiquidityInstructionParams, CP_AMM_PROGRAM_ID, CURRENT_POOL_VERSION, type ClaimPartnerFeeParams, type ClaimPositionFeeInstructionParams, type ClaimPositionFeeParams, type ClaimPositionFeeParams2, type ClaimRewardParams, type ClosePositionInstructionParams, type ClosePositionParams, CollectFeeMode, type ConfigState, CpAmm, cp_amm as CpAmmIdl, type CpAmm$1 as CpAmmTypes, type CreatePoolParams, type CreatePositionAndAddLiquidity, type CreatePositionParams, DYNAMIC_FEE_DECAY_PERIOD_DEFAULT, DYNAMIC_FEE_FILTER_PERIOD_DEFAULT, DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT, DYNAMIC_FEE_ROUNDING_OFFSET, DYNAMIC_FEE_SCALING_FACTOR, type DepositQuote, type DynamicFee, type DynamicFeeParams, type DynamicFeeStruct, FEE_DENOMINATOR, type FeeMode, type FeeOnAmountResult, FeeRateLimiter, FeeScheduler, type FundRewardParams, type GetDepositQuoteParams, type GetQuote2Params, type GetQuoteParams, type GetWithdrawQuoteParams, type InitializeAndFundReward, type InitializeCustomizeablePoolParams, type InitializeCustomizeablePoolWithDynamicConfigParams, type InitializeRewardParams, LIQUIDITY_SCALE, type LiquidityDeltaParams, type LockPositionParams, MAX, MAX_CU_BUFFER, MAX_EXPONENTIAL, MAX_FEE_BPS_V0, MAX_FEE_BPS_V1, MAX_FEE_NUMERATOR_V0, MAX_FEE_NUMERATOR_V1, MAX_PRICE_CHANGE_BPS_DEFAULT, MAX_RATE_LIMITER_DURATION_IN_SECONDS, MAX_RATE_LIMITER_DURATION_IN_SLOTS, MAX_SQRT_PRICE, MIN_CU_BUFFER, MIN_FEE_BPS, MIN_FEE_NUMERATOR, MIN_SQRT_PRICE, type MergePositionParams, ONE_Q64, type PermanentLockParams, type PoolFeesParams, type PoolFeesStruct, type PoolState, PoolStatus, PoolVersion, type PositionState, type PrepareCustomizablePoolParams, type PreparePoolCreationParams, type PreparePoolCreationSingleSide, type PrepareTokenAccountParams, type PreparedPoolCreation, type Quote2Result, type RefreshVestingParams, type RemoveAllLiquidityAndClosePositionParams, type RemoveAllLiquidityParams, type RemoveLiquidityParams, type RewardInfo, Rounding, SCALE_OFFSET, SPLIT_POSITION_DENOMINATOR, type SetupFeeClaimAccountsParams, type SplitFees, type SplitPosition2Params, type SplitPositionParams, type Swap2Params, type SwapAmount, SwapMode, type SwapParams, type SwapResult, type SwapResult2, type TokenBadgeState, TradeDirection, type TxBuilder, U128_MAX, U16_MAX, U64_MAX, type UpdateRewardDurationParams, type UpdateRewardFunderParams, type UserRewardInfo, type VestingState, type WithdrawIneligibleRewardParams, type WithdrawQuote, bpsToFeeNumerator, calculateAtoBFromAmountIn, calculateAtoBFromAmountOut, calculateAtoBFromPartialAmountIn, calculateBtoAFromAmountIn, calculateBtoAFromAmountOut, calculateBtoAFromPartialAmountIn, calculateInitSqrtPrice, calculateTransferFeeExcludedAmount, calculateTransferFeeIncludedAmount, convertToFeeSchedulerSecondFactor, convertToLamports, convertToRateLimiterSecondFactor, decimalToQ64, deriveClaimFeeOperatorAddress, deriveConfigAddress, deriveCustomizablePoolAddress, derivePoolAddress, derivePoolAuthority, derivePositionAddress, derivePositionNftAccount, deriveRewardVaultAddress, deriveTokenBadgeAddress, deriveTokenVaultAddress, feeNumeratorToBps, fromDecimalToBN, getAllPositionNftAccountByOwner, getAllUserPositionNftAccount, getAmountAFromLiquidityDelta, getAmountBFromLiquidityDelta, getAmountWithSlippage, getAvailableVestingLiquidity, getBaseFeeHandler, getBaseFeeNumerator, getBaseFeeNumeratorByPeriod, getBaseFeeParams, getCheckedAmounts, getCurrentPoint, getDynamicFeeNumerator, getDynamicFeeParams, getEstimatedComputeUnitIxWithBuffer, getEstimatedComputeUnitUsageWithBuffer, getExcludedFeeAmount, getExcludedFeeAmountFromIncludedFeeAmount, getFeeInPeriod, getFeeMode, getFeeNumeratorFromExcludedFeeAmount, getFeeNumeratorFromIncludedFeeAmount, getFeeNumeratorOnExponentialFeeScheduler, getFeeNumeratorOnLinearFeeScheduler, getFeeOnAmount, getFeeSchedulerParams, getFirstKey, getIncludedFeeAmount, getLiquidityDeltaFromAmountA, getLiquidityDeltaFromAmountB, getMaxAmountWithSlippage, getMaxBaseFeeNumerator, getMaxFeeBps, getMaxFeeNumerator, getMaxIndex, getMinBaseFeeNumerator, getNextSqrtPriceFromAmountInARoundingUp, getNextSqrtPriceFromAmountInBRoundingDown, getNextSqrtPriceFromAmountOutARoundingUp, getNextSqrtPriceFromAmountOutBRoundingDown, getNextSqrtPriceFromInput, getNextSqrtPriceFromOutput, getOrCreateATAInstruction, getPriceChange, getPriceFromSqrtPrice, getPriceImpact, getRateLimiterParams, getRewardInfo, getSecondKey, getSimulationComputeUnits, getSqrtPriceFromPrice, getSwapResultFromExactInput, getSwapResultFromExactOutput, getSwapResultFromPartialInput, getTokenDecimals, getTokenProgram, getTotalFeeNumerator, getTotalLockedLiquidity, getTotalTradingFeeFromExcludedFeeAmount, getTotalTradingFeeFromIncludedFeeAmount, getUnClaimLpFee, getUserRewardPending, hasPartner, isDynamicFeeEnabled, isNonZeroRateLimiter, isRateLimiterApplied, isSwapEnabled, isVestingComplete, isZeroRateLimiter, mulDiv, offsetBasedFilter, parseFeeSchedulerSecondFactor, parseRateLimiterSecondFactor, positionByPoolFilter, pow, q64ToDecimal, splitFees, sqrt, swapQuoteExactInput, swapQuoteExactOutput, swapQuotePartialInput, toNumerator, unwrapSOLInstruction, validateFeeFraction, validateFeeRateLimiter, validateFeeScheduler, vestingByPositionFilter, wrapSOLInstruction };
|
package/dist/index.d.ts
CHANGED
|
@@ -6291,10 +6291,6 @@ type RemoveLiquidityParams = {
|
|
|
6291
6291
|
}>;
|
|
6292
6292
|
currentPoint: BN;
|
|
6293
6293
|
};
|
|
6294
|
-
type RemoveLiquidityParams2 = RemoveLiquidityParams & {
|
|
6295
|
-
receiver: PublicKey;
|
|
6296
|
-
feePayer: PublicKey;
|
|
6297
|
-
};
|
|
6298
6294
|
type RemoveAllLiquidityParams = Omit<RemoveLiquidityParams, "liquidityDelta">;
|
|
6299
6295
|
type BuildAddLiquidityParams = {
|
|
6300
6296
|
owner: PublicKey;
|
|
@@ -7059,12 +7055,6 @@ declare class CpAmm {
|
|
|
7059
7055
|
* @returns Transaction builder.
|
|
7060
7056
|
*/
|
|
7061
7057
|
removeLiquidity(params: RemoveLiquidityParams): TxBuilder;
|
|
7062
|
-
/**
|
|
7063
|
-
* Builds a transaction to remove liquidity from a position.
|
|
7064
|
-
* @param {RemoveLiquidityParams} params - Parameters for removing liquidity.
|
|
7065
|
-
* @returns Transaction builder.
|
|
7066
|
-
*/
|
|
7067
|
-
removeLiquidity2(params: RemoveLiquidityParams2): TxBuilder;
|
|
7068
7058
|
/**
|
|
7069
7059
|
* Builds a transaction to remove liquidity from a position.
|
|
7070
7060
|
* @param {RemoveLiquidityParams} params - Parameters for removing liquidity.
|
|
@@ -15716,4 +15706,4 @@ var cp_amm = {
|
|
|
15716
15706
|
types: types
|
|
15717
15707
|
};
|
|
15718
15708
|
|
|
15719
|
-
export { ActivationPoint, ActivationType, type AddLiquidityParams, type AmmProgram, BASIS_POINT_MAX, BIN_STEP_BPS_DEFAULT, BIN_STEP_BPS_U128_DEFAULT, type BaseFee, type BaseFeeHandler, BaseFeeMode, type BuildAddLiquidityParams, type BuildLiquidatePositionInstructionParams, type BuildRemoveAllLiquidityInstructionParams, CP_AMM_PROGRAM_ID, CURRENT_POOL_VERSION, type ClaimPartnerFeeParams, type ClaimPositionFeeInstructionParams, type ClaimPositionFeeParams, type ClaimPositionFeeParams2, type ClaimRewardParams, type ClosePositionInstructionParams, type ClosePositionParams, CollectFeeMode, type ConfigState, CpAmm, cp_amm as CpAmmIdl, type CpAmm$1 as CpAmmTypes, type CreatePoolParams, type CreatePositionAndAddLiquidity, type CreatePositionParams, DYNAMIC_FEE_DECAY_PERIOD_DEFAULT, DYNAMIC_FEE_FILTER_PERIOD_DEFAULT, DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT, DYNAMIC_FEE_ROUNDING_OFFSET, DYNAMIC_FEE_SCALING_FACTOR, type DepositQuote, type DynamicFee, type DynamicFeeParams, type DynamicFeeStruct, FEE_DENOMINATOR, type FeeMode, type FeeOnAmountResult, FeeRateLimiter, FeeScheduler, type FundRewardParams, type GetDepositQuoteParams, type GetQuote2Params, type GetQuoteParams, type GetWithdrawQuoteParams, type InitializeAndFundReward, type InitializeCustomizeablePoolParams, type InitializeCustomizeablePoolWithDynamicConfigParams, type InitializeRewardParams, LIQUIDITY_SCALE, type LiquidityDeltaParams, type LockPositionParams, MAX, MAX_CU_BUFFER, MAX_EXPONENTIAL, MAX_FEE_BPS_V0, MAX_FEE_BPS_V1, MAX_FEE_NUMERATOR_V0, MAX_FEE_NUMERATOR_V1, MAX_PRICE_CHANGE_BPS_DEFAULT, MAX_RATE_LIMITER_DURATION_IN_SECONDS, MAX_RATE_LIMITER_DURATION_IN_SLOTS, MAX_SQRT_PRICE, MIN_CU_BUFFER, MIN_FEE_BPS, MIN_FEE_NUMERATOR, MIN_SQRT_PRICE, type MergePositionParams, ONE_Q64, type PermanentLockParams, type PoolFeesParams, type PoolFeesStruct, type PoolState, PoolStatus, PoolVersion, type PositionState, type PrepareCustomizablePoolParams, type PreparePoolCreationParams, type PreparePoolCreationSingleSide, type PrepareTokenAccountParams, type PreparedPoolCreation, type Quote2Result, type RefreshVestingParams, type RemoveAllLiquidityAndClosePositionParams, type RemoveAllLiquidityParams, type RemoveLiquidityParams, type
|
|
15709
|
+
export { ActivationPoint, ActivationType, type AddLiquidityParams, type AmmProgram, BASIS_POINT_MAX, BIN_STEP_BPS_DEFAULT, BIN_STEP_BPS_U128_DEFAULT, type BaseFee, type BaseFeeHandler, BaseFeeMode, type BuildAddLiquidityParams, type BuildLiquidatePositionInstructionParams, type BuildRemoveAllLiquidityInstructionParams, CP_AMM_PROGRAM_ID, CURRENT_POOL_VERSION, type ClaimPartnerFeeParams, type ClaimPositionFeeInstructionParams, type ClaimPositionFeeParams, type ClaimPositionFeeParams2, type ClaimRewardParams, type ClosePositionInstructionParams, type ClosePositionParams, CollectFeeMode, type ConfigState, CpAmm, cp_amm as CpAmmIdl, type CpAmm$1 as CpAmmTypes, type CreatePoolParams, type CreatePositionAndAddLiquidity, type CreatePositionParams, DYNAMIC_FEE_DECAY_PERIOD_DEFAULT, DYNAMIC_FEE_FILTER_PERIOD_DEFAULT, DYNAMIC_FEE_REDUCTION_FACTOR_DEFAULT, DYNAMIC_FEE_ROUNDING_OFFSET, DYNAMIC_FEE_SCALING_FACTOR, type DepositQuote, type DynamicFee, type DynamicFeeParams, type DynamicFeeStruct, FEE_DENOMINATOR, type FeeMode, type FeeOnAmountResult, FeeRateLimiter, FeeScheduler, type FundRewardParams, type GetDepositQuoteParams, type GetQuote2Params, type GetQuoteParams, type GetWithdrawQuoteParams, type InitializeAndFundReward, type InitializeCustomizeablePoolParams, type InitializeCustomizeablePoolWithDynamicConfigParams, type InitializeRewardParams, LIQUIDITY_SCALE, type LiquidityDeltaParams, type LockPositionParams, MAX, MAX_CU_BUFFER, MAX_EXPONENTIAL, MAX_FEE_BPS_V0, MAX_FEE_BPS_V1, MAX_FEE_NUMERATOR_V0, MAX_FEE_NUMERATOR_V1, MAX_PRICE_CHANGE_BPS_DEFAULT, MAX_RATE_LIMITER_DURATION_IN_SECONDS, MAX_RATE_LIMITER_DURATION_IN_SLOTS, MAX_SQRT_PRICE, MIN_CU_BUFFER, MIN_FEE_BPS, MIN_FEE_NUMERATOR, MIN_SQRT_PRICE, type MergePositionParams, ONE_Q64, type PermanentLockParams, type PoolFeesParams, type PoolFeesStruct, type PoolState, PoolStatus, PoolVersion, type PositionState, type PrepareCustomizablePoolParams, type PreparePoolCreationParams, type PreparePoolCreationSingleSide, type PrepareTokenAccountParams, type PreparedPoolCreation, type Quote2Result, type RefreshVestingParams, type RemoveAllLiquidityAndClosePositionParams, type RemoveAllLiquidityParams, type RemoveLiquidityParams, type RewardInfo, Rounding, SCALE_OFFSET, SPLIT_POSITION_DENOMINATOR, type SetupFeeClaimAccountsParams, type SplitFees, type SplitPosition2Params, type SplitPositionParams, type Swap2Params, type SwapAmount, SwapMode, type SwapParams, type SwapResult, type SwapResult2, type TokenBadgeState, TradeDirection, type TxBuilder, U128_MAX, U16_MAX, U64_MAX, type UpdateRewardDurationParams, type UpdateRewardFunderParams, type UserRewardInfo, type VestingState, type WithdrawIneligibleRewardParams, type WithdrawQuote, bpsToFeeNumerator, calculateAtoBFromAmountIn, calculateAtoBFromAmountOut, calculateAtoBFromPartialAmountIn, calculateBtoAFromAmountIn, calculateBtoAFromAmountOut, calculateBtoAFromPartialAmountIn, calculateInitSqrtPrice, calculateTransferFeeExcludedAmount, calculateTransferFeeIncludedAmount, convertToFeeSchedulerSecondFactor, convertToLamports, convertToRateLimiterSecondFactor, decimalToQ64, deriveClaimFeeOperatorAddress, deriveConfigAddress, deriveCustomizablePoolAddress, derivePoolAddress, derivePoolAuthority, derivePositionAddress, derivePositionNftAccount, deriveRewardVaultAddress, deriveTokenBadgeAddress, deriveTokenVaultAddress, feeNumeratorToBps, fromDecimalToBN, getAllPositionNftAccountByOwner, getAllUserPositionNftAccount, getAmountAFromLiquidityDelta, getAmountBFromLiquidityDelta, getAmountWithSlippage, getAvailableVestingLiquidity, getBaseFeeHandler, getBaseFeeNumerator, getBaseFeeNumeratorByPeriod, getBaseFeeParams, getCheckedAmounts, getCurrentPoint, getDynamicFeeNumerator, getDynamicFeeParams, getEstimatedComputeUnitIxWithBuffer, getEstimatedComputeUnitUsageWithBuffer, getExcludedFeeAmount, getExcludedFeeAmountFromIncludedFeeAmount, getFeeInPeriod, getFeeMode, getFeeNumeratorFromExcludedFeeAmount, getFeeNumeratorFromIncludedFeeAmount, getFeeNumeratorOnExponentialFeeScheduler, getFeeNumeratorOnLinearFeeScheduler, getFeeOnAmount, getFeeSchedulerParams, getFirstKey, getIncludedFeeAmount, getLiquidityDeltaFromAmountA, getLiquidityDeltaFromAmountB, getMaxAmountWithSlippage, getMaxBaseFeeNumerator, getMaxFeeBps, getMaxFeeNumerator, getMaxIndex, getMinBaseFeeNumerator, getNextSqrtPriceFromAmountInARoundingUp, getNextSqrtPriceFromAmountInBRoundingDown, getNextSqrtPriceFromAmountOutARoundingUp, getNextSqrtPriceFromAmountOutBRoundingDown, getNextSqrtPriceFromInput, getNextSqrtPriceFromOutput, getOrCreateATAInstruction, getPriceChange, getPriceFromSqrtPrice, getPriceImpact, getRateLimiterParams, getRewardInfo, getSecondKey, getSimulationComputeUnits, getSqrtPriceFromPrice, getSwapResultFromExactInput, getSwapResultFromExactOutput, getSwapResultFromPartialInput, getTokenDecimals, getTokenProgram, getTotalFeeNumerator, getTotalLockedLiquidity, getTotalTradingFeeFromExcludedFeeAmount, getTotalTradingFeeFromIncludedFeeAmount, getUnClaimLpFee, getUserRewardPending, hasPartner, isDynamicFeeEnabled, isNonZeroRateLimiter, isRateLimiterApplied, isSwapEnabled, isVestingComplete, isZeroRateLimiter, mulDiv, offsetBasedFilter, parseFeeSchedulerSecondFactor, parseRateLimiterSecondFactor, positionByPoolFilter, pow, q64ToDecimal, splitFees, sqrt, swapQuoteExactInput, swapQuoteExactOutput, swapQuotePartialInput, toNumerator, unwrapSOLInstruction, validateFeeFraction, validateFeeRateLimiter, validateFeeScheduler, vestingByPositionFilter, wrapSOLInstruction };
|
package/dist/index.js
CHANGED
|
@@ -11640,82 +11640,6 @@ var CpAmm = class {
|
|
|
11640
11640
|
}).preInstructions(preInstructions).postInstructions(postInstructions).transaction();
|
|
11641
11641
|
});
|
|
11642
11642
|
}
|
|
11643
|
-
/**
|
|
11644
|
-
* Builds a transaction to remove liquidity from a position.
|
|
11645
|
-
* @param {RemoveLiquidityParams} params - Parameters for removing liquidity.
|
|
11646
|
-
* @returns Transaction builder.
|
|
11647
|
-
*/
|
|
11648
|
-
removeLiquidity2(params) {
|
|
11649
|
-
return __async(this, null, function* () {
|
|
11650
|
-
const {
|
|
11651
|
-
owner,
|
|
11652
|
-
receiver,
|
|
11653
|
-
feePayer,
|
|
11654
|
-
pool,
|
|
11655
|
-
position,
|
|
11656
|
-
positionNftAccount,
|
|
11657
|
-
liquidityDelta,
|
|
11658
|
-
tokenAAmountThreshold,
|
|
11659
|
-
tokenBAmountThreshold,
|
|
11660
|
-
tokenAMint,
|
|
11661
|
-
tokenBMint,
|
|
11662
|
-
tokenAVault,
|
|
11663
|
-
tokenBVault,
|
|
11664
|
-
tokenAProgram,
|
|
11665
|
-
tokenBProgram,
|
|
11666
|
-
vestings
|
|
11667
|
-
} = params;
|
|
11668
|
-
const {
|
|
11669
|
-
tokenAAta: tokenAAccount,
|
|
11670
|
-
tokenBAta: tokenBAccount,
|
|
11671
|
-
instructions: preInstructions
|
|
11672
|
-
} = yield this.prepareTokenAccounts({
|
|
11673
|
-
payer: feePayer,
|
|
11674
|
-
tokenAOwner: receiver,
|
|
11675
|
-
tokenBOwner: receiver,
|
|
11676
|
-
tokenAMint,
|
|
11677
|
-
tokenBMint,
|
|
11678
|
-
tokenAProgram,
|
|
11679
|
-
tokenBProgram
|
|
11680
|
-
});
|
|
11681
|
-
const postInstructions = [];
|
|
11682
|
-
if ([tokenAMint.toBase58(), tokenBMint.toBase58()].includes(
|
|
11683
|
-
_spltoken.NATIVE_MINT.toBase58()
|
|
11684
|
-
)) {
|
|
11685
|
-
const closeWrappedSOLIx = yield unwrapSOLInstruction(owner);
|
|
11686
|
-
closeWrappedSOLIx && postInstructions.push(closeWrappedSOLIx);
|
|
11687
|
-
}
|
|
11688
|
-
if (vestings.length > 0) {
|
|
11689
|
-
const refreshVestingInstruction = yield this.buildRefreshVestingInstruction({
|
|
11690
|
-
owner,
|
|
11691
|
-
position,
|
|
11692
|
-
positionNftAccount,
|
|
11693
|
-
pool,
|
|
11694
|
-
vestingAccounts: vestings.map((item) => item.account)
|
|
11695
|
-
});
|
|
11696
|
-
refreshVestingInstruction && preInstructions.push(refreshVestingInstruction);
|
|
11697
|
-
}
|
|
11698
|
-
return yield this._program.methods.removeLiquidity({
|
|
11699
|
-
liquidityDelta,
|
|
11700
|
-
tokenAAmountThreshold,
|
|
11701
|
-
tokenBAmountThreshold
|
|
11702
|
-
}).accountsPartial({
|
|
11703
|
-
poolAuthority: this.poolAuthority,
|
|
11704
|
-
pool,
|
|
11705
|
-
position,
|
|
11706
|
-
positionNftAccount,
|
|
11707
|
-
owner,
|
|
11708
|
-
tokenAAccount,
|
|
11709
|
-
tokenBAccount,
|
|
11710
|
-
tokenAMint,
|
|
11711
|
-
tokenBMint,
|
|
11712
|
-
tokenAVault,
|
|
11713
|
-
tokenBVault,
|
|
11714
|
-
tokenAProgram,
|
|
11715
|
-
tokenBProgram
|
|
11716
|
-
}).preInstructions(preInstructions).postInstructions(postInstructions).transaction();
|
|
11717
|
-
});
|
|
11718
|
-
}
|
|
11719
11643
|
/**
|
|
11720
11644
|
* Builds a transaction to remove liquidity from a position.
|
|
11721
11645
|
* @param {RemoveLiquidityParams} params - Parameters for removing liquidity.
|
|
@@ -11857,15 +11781,18 @@ var CpAmm = class {
|
|
|
11857
11781
|
const { maxLimiterDuration, maxFeeBps } = parseRateLimiterSecondFactor(
|
|
11858
11782
|
poolState.poolFees.baseFee.secondFactor
|
|
11859
11783
|
);
|
|
11860
|
-
|
|
11861
|
-
|
|
11862
|
-
|
|
11863
|
-
|
|
11864
|
-
|
|
11865
|
-
|
|
11866
|
-
|
|
11867
|
-
|
|
11868
|
-
|
|
11784
|
+
let rateLimiterApplied = false;
|
|
11785
|
+
if (poolState.poolFees.baseFee.baseFeeMode === 2 /* RateLimiter */) {
|
|
11786
|
+
rateLimiterApplied = isRateLimiterApplied(
|
|
11787
|
+
poolState.poolFees.baseFee.thirdFactor,
|
|
11788
|
+
maxLimiterDuration,
|
|
11789
|
+
maxFeeBps,
|
|
11790
|
+
poolState.poolFees.baseFee.firstFactor,
|
|
11791
|
+
currentPoint,
|
|
11792
|
+
poolState.activationPoint,
|
|
11793
|
+
tradeDirection
|
|
11794
|
+
);
|
|
11795
|
+
}
|
|
11869
11796
|
const remainingAccounts = rateLimiterApplied ? [
|
|
11870
11797
|
{
|
|
11871
11798
|
isSigner: false,
|
|
@@ -11964,15 +11891,18 @@ var CpAmm = class {
|
|
|
11964
11891
|
const { maxLimiterDuration, maxFeeBps } = parseRateLimiterSecondFactor(
|
|
11965
11892
|
poolState.poolFees.baseFee.secondFactor
|
|
11966
11893
|
);
|
|
11967
|
-
|
|
11968
|
-
|
|
11969
|
-
|
|
11970
|
-
|
|
11971
|
-
|
|
11972
|
-
|
|
11973
|
-
|
|
11974
|
-
|
|
11975
|
-
|
|
11894
|
+
let rateLimiterApplied = false;
|
|
11895
|
+
if (poolState.poolFees.baseFee.baseFeeMode === 2 /* RateLimiter */) {
|
|
11896
|
+
rateLimiterApplied = isRateLimiterApplied(
|
|
11897
|
+
poolState.poolFees.baseFee.thirdFactor,
|
|
11898
|
+
maxLimiterDuration,
|
|
11899
|
+
maxFeeBps,
|
|
11900
|
+
poolState.poolFees.baseFee.firstFactor,
|
|
11901
|
+
currentPoint,
|
|
11902
|
+
poolState.activationPoint,
|
|
11903
|
+
tradeDirection
|
|
11904
|
+
);
|
|
11905
|
+
}
|
|
11976
11906
|
const remainingAccounts = rateLimiterApplied ? [
|
|
11977
11907
|
{
|
|
11978
11908
|
isSigner: false,
|