@meteora-ag/cp-amm-sdk 1.2.2 → 1.2.4-rc.0
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 +120 -5
- package/dist/index.d.ts +120 -5
- package/dist/index.js +328 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +330 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -6086,6 +6086,7 @@ type VestingState = IdlAccounts<CpAmm$1>["vesting"];
|
|
|
6086
6086
|
type ConfigState = IdlAccounts<CpAmm$1>["config"];
|
|
6087
6087
|
type TokenBadgeState = IdlAccounts<CpAmm$1>["tokenBadge"];
|
|
6088
6088
|
type RewardInfo = IdlTypes<CpAmm$1>["rewardInfo"];
|
|
6089
|
+
type UserRewardInfo = IdlTypes<CpAmm$1>["userRewardInfo"];
|
|
6089
6090
|
/**
|
|
6090
6091
|
* Dynamic fee parameters
|
|
6091
6092
|
* @param binStep
|
|
@@ -6290,6 +6291,10 @@ type RemoveLiquidityParams = {
|
|
|
6290
6291
|
}>;
|
|
6291
6292
|
currentPoint: BN;
|
|
6292
6293
|
};
|
|
6294
|
+
type RemoveLiquidityParams2 = RemoveLiquidityParams & {
|
|
6295
|
+
receiver: PublicKey;
|
|
6296
|
+
feePayer: PublicKey;
|
|
6297
|
+
};
|
|
6293
6298
|
type RemoveAllLiquidityParams = Omit<RemoveLiquidityParams, "liquidityDelta">;
|
|
6294
6299
|
type BuildAddLiquidityParams = {
|
|
6295
6300
|
owner: PublicKey;
|
|
@@ -6553,17 +6558,31 @@ type InitializeRewardParams = {
|
|
|
6553
6558
|
rewardDuration: BN;
|
|
6554
6559
|
pool: PublicKey;
|
|
6555
6560
|
rewardMint: PublicKey;
|
|
6561
|
+
funder: PublicKey;
|
|
6562
|
+
payer: PublicKey;
|
|
6563
|
+
creator: PublicKey;
|
|
6564
|
+
rewardMintProgram: PublicKey;
|
|
6565
|
+
};
|
|
6566
|
+
type InitializeAndFundReward = {
|
|
6567
|
+
rewardIndex: number;
|
|
6568
|
+
rewardDuration: BN;
|
|
6569
|
+
pool: PublicKey;
|
|
6570
|
+
creator: PublicKey;
|
|
6556
6571
|
payer: PublicKey;
|
|
6572
|
+
rewardMint: PublicKey;
|
|
6573
|
+
carryForward: boolean;
|
|
6574
|
+
amount: BN;
|
|
6575
|
+
rewardMintProgram: PublicKey;
|
|
6557
6576
|
};
|
|
6558
6577
|
type UpdateRewardDurationParams = {
|
|
6559
6578
|
pool: PublicKey;
|
|
6560
|
-
|
|
6579
|
+
signer: PublicKey;
|
|
6561
6580
|
rewardIndex: number;
|
|
6562
6581
|
newDuration: BN;
|
|
6563
6582
|
};
|
|
6564
6583
|
type UpdateRewardFunderParams = {
|
|
6565
6584
|
pool: PublicKey;
|
|
6566
|
-
|
|
6585
|
+
signer: PublicKey;
|
|
6567
6586
|
rewardIndex: number;
|
|
6568
6587
|
newFunder: PublicKey;
|
|
6569
6588
|
};
|
|
@@ -6573,6 +6592,9 @@ type FundRewardParams = {
|
|
|
6573
6592
|
pool: PublicKey;
|
|
6574
6593
|
carryForward: boolean;
|
|
6575
6594
|
amount: BN;
|
|
6595
|
+
rewardMint: PublicKey;
|
|
6596
|
+
rewardVault: PublicKey;
|
|
6597
|
+
rewardMintProgram: PublicKey;
|
|
6576
6598
|
};
|
|
6577
6599
|
type WithdrawIneligibleRewardParams = {
|
|
6578
6600
|
rewardIndex: number;
|
|
@@ -6595,7 +6617,7 @@ type ClaimRewardParams = {
|
|
|
6595
6617
|
positionState: PositionState;
|
|
6596
6618
|
positionNftAccount: PublicKey;
|
|
6597
6619
|
rewardIndex: number;
|
|
6598
|
-
|
|
6620
|
+
isSkipReward: boolean;
|
|
6599
6621
|
feePayer?: PublicKey;
|
|
6600
6622
|
};
|
|
6601
6623
|
type RefreshVestingParams = {
|
|
@@ -6799,6 +6821,15 @@ declare class CpAmm {
|
|
|
6799
6821
|
* @returns Parsed PoolState.
|
|
6800
6822
|
*/
|
|
6801
6823
|
fetchPoolState(pool: PublicKey): Promise<PoolState>;
|
|
6824
|
+
/**
|
|
6825
|
+
* Fetches all Pool states by tokenAMint.
|
|
6826
|
+
* @param tokenAMint - Public key of the tokenA mint.
|
|
6827
|
+
* @returns Array of matched pool accounts and their state.
|
|
6828
|
+
*/
|
|
6829
|
+
fetchPoolStatesByTokenAMint(tokenAMint: PublicKey): Promise<Array<{
|
|
6830
|
+
publicKey: PublicKey;
|
|
6831
|
+
account: PoolState;
|
|
6832
|
+
}>>;
|
|
6802
6833
|
/**
|
|
6803
6834
|
* Fetches the Position state.
|
|
6804
6835
|
* @param position - Public key of the position.
|
|
@@ -6859,11 +6890,26 @@ declare class CpAmm {
|
|
|
6859
6890
|
position: PublicKey;
|
|
6860
6891
|
positionState: PositionState;
|
|
6861
6892
|
}>>;
|
|
6893
|
+
/**
|
|
6894
|
+
* Retrieves all vesting accounts associated with a position.
|
|
6895
|
+
* @param position - Public key of the position.
|
|
6896
|
+
* @returns Array of vesting account public keys and their states.
|
|
6897
|
+
*/
|
|
6862
6898
|
getAllVestingsByPosition(position: PublicKey): Promise<Array<{
|
|
6863
6899
|
publicKey: PublicKey;
|
|
6864
6900
|
account: VestingState;
|
|
6865
6901
|
}>>;
|
|
6902
|
+
/**
|
|
6903
|
+
* Checks if a position has any locked liquidity.
|
|
6904
|
+
* @param position - Position state.
|
|
6905
|
+
* @returns True if the position has locked liquidity, false otherwise.
|
|
6906
|
+
*/
|
|
6866
6907
|
isLockedPosition(position: PositionState): boolean;
|
|
6908
|
+
/**
|
|
6909
|
+
* Checks if a position is permanently locked.
|
|
6910
|
+
* @param positionState - Position state.
|
|
6911
|
+
* @returns True if the position is permanently locked, false otherwise.
|
|
6912
|
+
*/
|
|
6867
6913
|
isPermanentLockedPosition(positionState: PositionState): boolean;
|
|
6868
6914
|
/**
|
|
6869
6915
|
* Checks if a position can be unlocked based on its locking state and vesting schedules.
|
|
@@ -6888,6 +6934,11 @@ declare class CpAmm {
|
|
|
6888
6934
|
canUnlock: boolean;
|
|
6889
6935
|
reason?: string;
|
|
6890
6936
|
};
|
|
6937
|
+
/**
|
|
6938
|
+
* Checks if a pool exists.
|
|
6939
|
+
* @param pool - Public key of the pool.
|
|
6940
|
+
* @returns True if the pool exists, false otherwise.
|
|
6941
|
+
*/
|
|
6891
6942
|
isPoolExist(pool: PublicKey): Promise<boolean>;
|
|
6892
6943
|
/**
|
|
6893
6944
|
* Computes the liquidity delta based on the provided token amounts and sqrt price
|
|
@@ -6909,6 +6960,11 @@ declare class CpAmm {
|
|
|
6909
6960
|
totalFee: BN$1;
|
|
6910
6961
|
priceImpact: Decimal;
|
|
6911
6962
|
};
|
|
6963
|
+
/**
|
|
6964
|
+
* Calculates the expected output amount or input amount for a swap depending on the swap mode.
|
|
6965
|
+
* @param params GetQuote2Params
|
|
6966
|
+
* @returns Quote2Result
|
|
6967
|
+
*/
|
|
6912
6968
|
getQuote2(params: GetQuote2Params): Quote2Result;
|
|
6913
6969
|
/**
|
|
6914
6970
|
* Calculates the deposit quote for liquidity pool.
|
|
@@ -6965,6 +7021,11 @@ declare class CpAmm {
|
|
|
6965
7021
|
pool: PublicKey;
|
|
6966
7022
|
position: PublicKey;
|
|
6967
7023
|
}>;
|
|
7024
|
+
/**
|
|
7025
|
+
* Builds a transaction to create a customizable pool with dynamic config.
|
|
7026
|
+
* @param params InitializeCustomizeablePoolWithDynamicConfigParams
|
|
7027
|
+
* @returns Transaction and related addresses.
|
|
7028
|
+
*/
|
|
6968
7029
|
createCustomPoolWithDynamicConfig(params: InitializeCustomizeablePoolWithDynamicConfigParams): Promise<{
|
|
6969
7030
|
tx: Transaction;
|
|
6970
7031
|
pool: PublicKey;
|
|
@@ -6998,6 +7059,12 @@ declare class CpAmm {
|
|
|
6998
7059
|
* @returns Transaction builder.
|
|
6999
7060
|
*/
|
|
7000
7061
|
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;
|
|
7001
7068
|
/**
|
|
7002
7069
|
* Builds a transaction to remove liquidity from a position.
|
|
7003
7070
|
* @param {RemoveLiquidityParams} params - Parameters for removing liquidity.
|
|
@@ -7010,6 +7077,11 @@ declare class CpAmm {
|
|
|
7010
7077
|
* @returns Transaction builder.
|
|
7011
7078
|
*/
|
|
7012
7079
|
swap(params: SwapParams): TxBuilder;
|
|
7080
|
+
/**
|
|
7081
|
+
* Builds a transaction to perform a swap in the pool.
|
|
7082
|
+
* @param params Swap2Params
|
|
7083
|
+
* @returns Transaction builder.
|
|
7084
|
+
*/
|
|
7013
7085
|
swap2(params: Swap2Params): TxBuilder;
|
|
7014
7086
|
/**
|
|
7015
7087
|
* Builds a transaction to lock a position with vesting schedule.
|
|
@@ -7029,6 +7101,11 @@ declare class CpAmm {
|
|
|
7029
7101
|
* @returns Transaction builder.
|
|
7030
7102
|
*/
|
|
7031
7103
|
refreshVesting(params: RefreshVestingParams): TxBuilder;
|
|
7104
|
+
/**
|
|
7105
|
+
* Builds a transaction to close a position.
|
|
7106
|
+
* @param params ClosePositionParams
|
|
7107
|
+
* @returns Transaction builder.
|
|
7108
|
+
*/
|
|
7032
7109
|
closePosition(params: ClosePositionParams): TxBuilder;
|
|
7033
7110
|
/**
|
|
7034
7111
|
* Builds a transaction to remove all liquidity from a position and close it.
|
|
@@ -7055,6 +7132,18 @@ declare class CpAmm {
|
|
|
7055
7132
|
* @throws {Error} If either position is locked or incompatible
|
|
7056
7133
|
*/
|
|
7057
7134
|
mergePosition(params: MergePositionParams): TxBuilder;
|
|
7135
|
+
/**
|
|
7136
|
+
* Builds a transaction to initialize a reward for a pool.
|
|
7137
|
+
* @param params InitializeRewardParams
|
|
7138
|
+
* @returns Transaction builder.
|
|
7139
|
+
*/
|
|
7140
|
+
initializeReward(params: InitializeRewardParams): TxBuilder;
|
|
7141
|
+
/**
|
|
7142
|
+
* Builds a transaction to initialize and fund a reward for a pool.
|
|
7143
|
+
* @param params InitializeAndFundReward
|
|
7144
|
+
* @returns Transaction builder.
|
|
7145
|
+
*/
|
|
7146
|
+
initializeAndFundReward(params: InitializeAndFundReward): TxBuilder;
|
|
7058
7147
|
/**
|
|
7059
7148
|
* Builds a transaction to update reward duration.
|
|
7060
7149
|
* @param {UpdateRewardDurationParams} params - Parameters including pool and new duration.
|
|
@@ -7103,7 +7192,17 @@ declare class CpAmm {
|
|
|
7103
7192
|
* @returns Transaction builder.
|
|
7104
7193
|
*/
|
|
7105
7194
|
claimReward(params: ClaimRewardParams): TxBuilder;
|
|
7195
|
+
/**
|
|
7196
|
+
* Builds a transaction to split a position into two positions.
|
|
7197
|
+
* @param params SplitPositionParams
|
|
7198
|
+
* @returns Transaction builder.
|
|
7199
|
+
*/
|
|
7106
7200
|
splitPosition(params: SplitPositionParams): TxBuilder;
|
|
7201
|
+
/**
|
|
7202
|
+
* Builds a transaction to split a position into two positions.
|
|
7203
|
+
* @param params SplitPosition2Params
|
|
7204
|
+
* @returns Transaction builder.
|
|
7205
|
+
*/
|
|
7107
7206
|
splitPosition2(params: SplitPosition2Params): TxBuilder;
|
|
7108
7207
|
}
|
|
7109
7208
|
|
|
@@ -7314,11 +7413,20 @@ declare const getSqrtPriceFromPrice: (price: string, tokenADecimal: number, toke
|
|
|
7314
7413
|
* @param positionState - The position state
|
|
7315
7414
|
* @returns The unclaimed reward
|
|
7316
7415
|
*/
|
|
7317
|
-
declare const
|
|
7416
|
+
declare const getUnClaimLpFee: (poolState: PoolState, positionState: PositionState) => {
|
|
7318
7417
|
feeTokenA: BN;
|
|
7319
7418
|
feeTokenB: BN;
|
|
7320
7419
|
rewards: BN[];
|
|
7321
7420
|
};
|
|
7421
|
+
declare function getRewardInfo(poolState: PoolState, rewardIndex: number, periodTime: BN, currentTime: BN): {
|
|
7422
|
+
rewardPerPeriod: BN;
|
|
7423
|
+
rewardBalance: BN;
|
|
7424
|
+
totalRewardDistributed: BN;
|
|
7425
|
+
};
|
|
7426
|
+
declare function getUserRewardPending(poolState: PoolState, positionState: PositionState, rewardIndex: number, currentTime: BN, periodTime: BN): {
|
|
7427
|
+
userRewardPerPeriod: BN;
|
|
7428
|
+
userPendingReward: BN;
|
|
7429
|
+
};
|
|
7322
7430
|
|
|
7323
7431
|
/**
|
|
7324
7432
|
* Filters for the position by pool
|
|
@@ -7332,6 +7440,13 @@ declare const positionByPoolFilter: (pool: PublicKey) => GetProgramAccountsFilte
|
|
|
7332
7440
|
* @returns The filter for the vesting by position
|
|
7333
7441
|
*/
|
|
7334
7442
|
declare const vestingByPositionFilter: (position: PublicKey) => GetProgramAccountsFilter;
|
|
7443
|
+
/**
|
|
7444
|
+
* Create a memcmp filter for offset-based filtering
|
|
7445
|
+
* @param value - The value to filter by
|
|
7446
|
+
* @param offset - The offset where the value field is located in the account data
|
|
7447
|
+
* @returns A GetProgramAccountsFilter array with the value filter
|
|
7448
|
+
*/
|
|
7449
|
+
declare function offsetBasedFilter(value: PublicKey | string, offset: number): GetProgramAccountsFilter[];
|
|
7335
7450
|
|
|
7336
7451
|
interface TransferFeeIncludedAmount {
|
|
7337
7452
|
amount: BN;
|
|
@@ -15601,4 +15716,4 @@ var cp_amm = {
|
|
|
15601
15716
|
types: types
|
|
15602
15717
|
};
|
|
15603
15718
|
|
|
15604
|
-
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 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 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, getSecondKey, getSimulationComputeUnits, getSqrtPriceFromPrice, getSwapResultFromExactInput, getSwapResultFromExactOutput, getSwapResultFromPartialInput, getTokenDecimals, getTokenProgram, getTotalFeeNumerator, getTotalLockedLiquidity, getTotalTradingFeeFromExcludedFeeAmount, getTotalTradingFeeFromIncludedFeeAmount,
|
|
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 RemoveLiquidityParams2, 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
|
@@ -6086,6 +6086,7 @@ type VestingState = IdlAccounts<CpAmm$1>["vesting"];
|
|
|
6086
6086
|
type ConfigState = IdlAccounts<CpAmm$1>["config"];
|
|
6087
6087
|
type TokenBadgeState = IdlAccounts<CpAmm$1>["tokenBadge"];
|
|
6088
6088
|
type RewardInfo = IdlTypes<CpAmm$1>["rewardInfo"];
|
|
6089
|
+
type UserRewardInfo = IdlTypes<CpAmm$1>["userRewardInfo"];
|
|
6089
6090
|
/**
|
|
6090
6091
|
* Dynamic fee parameters
|
|
6091
6092
|
* @param binStep
|
|
@@ -6290,6 +6291,10 @@ type RemoveLiquidityParams = {
|
|
|
6290
6291
|
}>;
|
|
6291
6292
|
currentPoint: BN;
|
|
6292
6293
|
};
|
|
6294
|
+
type RemoveLiquidityParams2 = RemoveLiquidityParams & {
|
|
6295
|
+
receiver: PublicKey;
|
|
6296
|
+
feePayer: PublicKey;
|
|
6297
|
+
};
|
|
6293
6298
|
type RemoveAllLiquidityParams = Omit<RemoveLiquidityParams, "liquidityDelta">;
|
|
6294
6299
|
type BuildAddLiquidityParams = {
|
|
6295
6300
|
owner: PublicKey;
|
|
@@ -6553,17 +6558,31 @@ type InitializeRewardParams = {
|
|
|
6553
6558
|
rewardDuration: BN;
|
|
6554
6559
|
pool: PublicKey;
|
|
6555
6560
|
rewardMint: PublicKey;
|
|
6561
|
+
funder: PublicKey;
|
|
6562
|
+
payer: PublicKey;
|
|
6563
|
+
creator: PublicKey;
|
|
6564
|
+
rewardMintProgram: PublicKey;
|
|
6565
|
+
};
|
|
6566
|
+
type InitializeAndFundReward = {
|
|
6567
|
+
rewardIndex: number;
|
|
6568
|
+
rewardDuration: BN;
|
|
6569
|
+
pool: PublicKey;
|
|
6570
|
+
creator: PublicKey;
|
|
6556
6571
|
payer: PublicKey;
|
|
6572
|
+
rewardMint: PublicKey;
|
|
6573
|
+
carryForward: boolean;
|
|
6574
|
+
amount: BN;
|
|
6575
|
+
rewardMintProgram: PublicKey;
|
|
6557
6576
|
};
|
|
6558
6577
|
type UpdateRewardDurationParams = {
|
|
6559
6578
|
pool: PublicKey;
|
|
6560
|
-
|
|
6579
|
+
signer: PublicKey;
|
|
6561
6580
|
rewardIndex: number;
|
|
6562
6581
|
newDuration: BN;
|
|
6563
6582
|
};
|
|
6564
6583
|
type UpdateRewardFunderParams = {
|
|
6565
6584
|
pool: PublicKey;
|
|
6566
|
-
|
|
6585
|
+
signer: PublicKey;
|
|
6567
6586
|
rewardIndex: number;
|
|
6568
6587
|
newFunder: PublicKey;
|
|
6569
6588
|
};
|
|
@@ -6573,6 +6592,9 @@ type FundRewardParams = {
|
|
|
6573
6592
|
pool: PublicKey;
|
|
6574
6593
|
carryForward: boolean;
|
|
6575
6594
|
amount: BN;
|
|
6595
|
+
rewardMint: PublicKey;
|
|
6596
|
+
rewardVault: PublicKey;
|
|
6597
|
+
rewardMintProgram: PublicKey;
|
|
6576
6598
|
};
|
|
6577
6599
|
type WithdrawIneligibleRewardParams = {
|
|
6578
6600
|
rewardIndex: number;
|
|
@@ -6595,7 +6617,7 @@ type ClaimRewardParams = {
|
|
|
6595
6617
|
positionState: PositionState;
|
|
6596
6618
|
positionNftAccount: PublicKey;
|
|
6597
6619
|
rewardIndex: number;
|
|
6598
|
-
|
|
6620
|
+
isSkipReward: boolean;
|
|
6599
6621
|
feePayer?: PublicKey;
|
|
6600
6622
|
};
|
|
6601
6623
|
type RefreshVestingParams = {
|
|
@@ -6799,6 +6821,15 @@ declare class CpAmm {
|
|
|
6799
6821
|
* @returns Parsed PoolState.
|
|
6800
6822
|
*/
|
|
6801
6823
|
fetchPoolState(pool: PublicKey): Promise<PoolState>;
|
|
6824
|
+
/**
|
|
6825
|
+
* Fetches all Pool states by tokenAMint.
|
|
6826
|
+
* @param tokenAMint - Public key of the tokenA mint.
|
|
6827
|
+
* @returns Array of matched pool accounts and their state.
|
|
6828
|
+
*/
|
|
6829
|
+
fetchPoolStatesByTokenAMint(tokenAMint: PublicKey): Promise<Array<{
|
|
6830
|
+
publicKey: PublicKey;
|
|
6831
|
+
account: PoolState;
|
|
6832
|
+
}>>;
|
|
6802
6833
|
/**
|
|
6803
6834
|
* Fetches the Position state.
|
|
6804
6835
|
* @param position - Public key of the position.
|
|
@@ -6859,11 +6890,26 @@ declare class CpAmm {
|
|
|
6859
6890
|
position: PublicKey;
|
|
6860
6891
|
positionState: PositionState;
|
|
6861
6892
|
}>>;
|
|
6893
|
+
/**
|
|
6894
|
+
* Retrieves all vesting accounts associated with a position.
|
|
6895
|
+
* @param position - Public key of the position.
|
|
6896
|
+
* @returns Array of vesting account public keys and their states.
|
|
6897
|
+
*/
|
|
6862
6898
|
getAllVestingsByPosition(position: PublicKey): Promise<Array<{
|
|
6863
6899
|
publicKey: PublicKey;
|
|
6864
6900
|
account: VestingState;
|
|
6865
6901
|
}>>;
|
|
6902
|
+
/**
|
|
6903
|
+
* Checks if a position has any locked liquidity.
|
|
6904
|
+
* @param position - Position state.
|
|
6905
|
+
* @returns True if the position has locked liquidity, false otherwise.
|
|
6906
|
+
*/
|
|
6866
6907
|
isLockedPosition(position: PositionState): boolean;
|
|
6908
|
+
/**
|
|
6909
|
+
* Checks if a position is permanently locked.
|
|
6910
|
+
* @param positionState - Position state.
|
|
6911
|
+
* @returns True if the position is permanently locked, false otherwise.
|
|
6912
|
+
*/
|
|
6867
6913
|
isPermanentLockedPosition(positionState: PositionState): boolean;
|
|
6868
6914
|
/**
|
|
6869
6915
|
* Checks if a position can be unlocked based on its locking state and vesting schedules.
|
|
@@ -6888,6 +6934,11 @@ declare class CpAmm {
|
|
|
6888
6934
|
canUnlock: boolean;
|
|
6889
6935
|
reason?: string;
|
|
6890
6936
|
};
|
|
6937
|
+
/**
|
|
6938
|
+
* Checks if a pool exists.
|
|
6939
|
+
* @param pool - Public key of the pool.
|
|
6940
|
+
* @returns True if the pool exists, false otherwise.
|
|
6941
|
+
*/
|
|
6891
6942
|
isPoolExist(pool: PublicKey): Promise<boolean>;
|
|
6892
6943
|
/**
|
|
6893
6944
|
* Computes the liquidity delta based on the provided token amounts and sqrt price
|
|
@@ -6909,6 +6960,11 @@ declare class CpAmm {
|
|
|
6909
6960
|
totalFee: BN$1;
|
|
6910
6961
|
priceImpact: Decimal;
|
|
6911
6962
|
};
|
|
6963
|
+
/**
|
|
6964
|
+
* Calculates the expected output amount or input amount for a swap depending on the swap mode.
|
|
6965
|
+
* @param params GetQuote2Params
|
|
6966
|
+
* @returns Quote2Result
|
|
6967
|
+
*/
|
|
6912
6968
|
getQuote2(params: GetQuote2Params): Quote2Result;
|
|
6913
6969
|
/**
|
|
6914
6970
|
* Calculates the deposit quote for liquidity pool.
|
|
@@ -6965,6 +7021,11 @@ declare class CpAmm {
|
|
|
6965
7021
|
pool: PublicKey;
|
|
6966
7022
|
position: PublicKey;
|
|
6967
7023
|
}>;
|
|
7024
|
+
/**
|
|
7025
|
+
* Builds a transaction to create a customizable pool with dynamic config.
|
|
7026
|
+
* @param params InitializeCustomizeablePoolWithDynamicConfigParams
|
|
7027
|
+
* @returns Transaction and related addresses.
|
|
7028
|
+
*/
|
|
6968
7029
|
createCustomPoolWithDynamicConfig(params: InitializeCustomizeablePoolWithDynamicConfigParams): Promise<{
|
|
6969
7030
|
tx: Transaction;
|
|
6970
7031
|
pool: PublicKey;
|
|
@@ -6998,6 +7059,12 @@ declare class CpAmm {
|
|
|
6998
7059
|
* @returns Transaction builder.
|
|
6999
7060
|
*/
|
|
7000
7061
|
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;
|
|
7001
7068
|
/**
|
|
7002
7069
|
* Builds a transaction to remove liquidity from a position.
|
|
7003
7070
|
* @param {RemoveLiquidityParams} params - Parameters for removing liquidity.
|
|
@@ -7010,6 +7077,11 @@ declare class CpAmm {
|
|
|
7010
7077
|
* @returns Transaction builder.
|
|
7011
7078
|
*/
|
|
7012
7079
|
swap(params: SwapParams): TxBuilder;
|
|
7080
|
+
/**
|
|
7081
|
+
* Builds a transaction to perform a swap in the pool.
|
|
7082
|
+
* @param params Swap2Params
|
|
7083
|
+
* @returns Transaction builder.
|
|
7084
|
+
*/
|
|
7013
7085
|
swap2(params: Swap2Params): TxBuilder;
|
|
7014
7086
|
/**
|
|
7015
7087
|
* Builds a transaction to lock a position with vesting schedule.
|
|
@@ -7029,6 +7101,11 @@ declare class CpAmm {
|
|
|
7029
7101
|
* @returns Transaction builder.
|
|
7030
7102
|
*/
|
|
7031
7103
|
refreshVesting(params: RefreshVestingParams): TxBuilder;
|
|
7104
|
+
/**
|
|
7105
|
+
* Builds a transaction to close a position.
|
|
7106
|
+
* @param params ClosePositionParams
|
|
7107
|
+
* @returns Transaction builder.
|
|
7108
|
+
*/
|
|
7032
7109
|
closePosition(params: ClosePositionParams): TxBuilder;
|
|
7033
7110
|
/**
|
|
7034
7111
|
* Builds a transaction to remove all liquidity from a position and close it.
|
|
@@ -7055,6 +7132,18 @@ declare class CpAmm {
|
|
|
7055
7132
|
* @throws {Error} If either position is locked or incompatible
|
|
7056
7133
|
*/
|
|
7057
7134
|
mergePosition(params: MergePositionParams): TxBuilder;
|
|
7135
|
+
/**
|
|
7136
|
+
* Builds a transaction to initialize a reward for a pool.
|
|
7137
|
+
* @param params InitializeRewardParams
|
|
7138
|
+
* @returns Transaction builder.
|
|
7139
|
+
*/
|
|
7140
|
+
initializeReward(params: InitializeRewardParams): TxBuilder;
|
|
7141
|
+
/**
|
|
7142
|
+
* Builds a transaction to initialize and fund a reward for a pool.
|
|
7143
|
+
* @param params InitializeAndFundReward
|
|
7144
|
+
* @returns Transaction builder.
|
|
7145
|
+
*/
|
|
7146
|
+
initializeAndFundReward(params: InitializeAndFundReward): TxBuilder;
|
|
7058
7147
|
/**
|
|
7059
7148
|
* Builds a transaction to update reward duration.
|
|
7060
7149
|
* @param {UpdateRewardDurationParams} params - Parameters including pool and new duration.
|
|
@@ -7103,7 +7192,17 @@ declare class CpAmm {
|
|
|
7103
7192
|
* @returns Transaction builder.
|
|
7104
7193
|
*/
|
|
7105
7194
|
claimReward(params: ClaimRewardParams): TxBuilder;
|
|
7195
|
+
/**
|
|
7196
|
+
* Builds a transaction to split a position into two positions.
|
|
7197
|
+
* @param params SplitPositionParams
|
|
7198
|
+
* @returns Transaction builder.
|
|
7199
|
+
*/
|
|
7106
7200
|
splitPosition(params: SplitPositionParams): TxBuilder;
|
|
7201
|
+
/**
|
|
7202
|
+
* Builds a transaction to split a position into two positions.
|
|
7203
|
+
* @param params SplitPosition2Params
|
|
7204
|
+
* @returns Transaction builder.
|
|
7205
|
+
*/
|
|
7107
7206
|
splitPosition2(params: SplitPosition2Params): TxBuilder;
|
|
7108
7207
|
}
|
|
7109
7208
|
|
|
@@ -7314,11 +7413,20 @@ declare const getSqrtPriceFromPrice: (price: string, tokenADecimal: number, toke
|
|
|
7314
7413
|
* @param positionState - The position state
|
|
7315
7414
|
* @returns The unclaimed reward
|
|
7316
7415
|
*/
|
|
7317
|
-
declare const
|
|
7416
|
+
declare const getUnClaimLpFee: (poolState: PoolState, positionState: PositionState) => {
|
|
7318
7417
|
feeTokenA: BN;
|
|
7319
7418
|
feeTokenB: BN;
|
|
7320
7419
|
rewards: BN[];
|
|
7321
7420
|
};
|
|
7421
|
+
declare function getRewardInfo(poolState: PoolState, rewardIndex: number, periodTime: BN, currentTime: BN): {
|
|
7422
|
+
rewardPerPeriod: BN;
|
|
7423
|
+
rewardBalance: BN;
|
|
7424
|
+
totalRewardDistributed: BN;
|
|
7425
|
+
};
|
|
7426
|
+
declare function getUserRewardPending(poolState: PoolState, positionState: PositionState, rewardIndex: number, currentTime: BN, periodTime: BN): {
|
|
7427
|
+
userRewardPerPeriod: BN;
|
|
7428
|
+
userPendingReward: BN;
|
|
7429
|
+
};
|
|
7322
7430
|
|
|
7323
7431
|
/**
|
|
7324
7432
|
* Filters for the position by pool
|
|
@@ -7332,6 +7440,13 @@ declare const positionByPoolFilter: (pool: PublicKey) => GetProgramAccountsFilte
|
|
|
7332
7440
|
* @returns The filter for the vesting by position
|
|
7333
7441
|
*/
|
|
7334
7442
|
declare const vestingByPositionFilter: (position: PublicKey) => GetProgramAccountsFilter;
|
|
7443
|
+
/**
|
|
7444
|
+
* Create a memcmp filter for offset-based filtering
|
|
7445
|
+
* @param value - The value to filter by
|
|
7446
|
+
* @param offset - The offset where the value field is located in the account data
|
|
7447
|
+
* @returns A GetProgramAccountsFilter array with the value filter
|
|
7448
|
+
*/
|
|
7449
|
+
declare function offsetBasedFilter(value: PublicKey | string, offset: number): GetProgramAccountsFilter[];
|
|
7335
7450
|
|
|
7336
7451
|
interface TransferFeeIncludedAmount {
|
|
7337
7452
|
amount: BN;
|
|
@@ -15601,4 +15716,4 @@ var cp_amm = {
|
|
|
15601
15716
|
types: types
|
|
15602
15717
|
};
|
|
15603
15718
|
|
|
15604
|
-
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 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 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, getSecondKey, getSimulationComputeUnits, getSqrtPriceFromPrice, getSwapResultFromExactInput, getSwapResultFromExactOutput, getSwapResultFromPartialInput, getTokenDecimals, getTokenProgram, getTotalFeeNumerator, getTotalLockedLiquidity, getTotalTradingFeeFromExcludedFeeAmount, getTotalTradingFeeFromIncludedFeeAmount,
|
|
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 RemoveLiquidityParams2, 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 };
|