@meteora-ag/cp-amm-sdk 1.0.1-rc.33 → 1.0.1-rc.35
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 +87 -4
- package/dist/index.d.ts +87 -4
- package/dist/index.js +284 -110
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +287 -113
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -5232,8 +5232,6 @@ type PreparePoolCreationParams = {
|
|
|
5232
5232
|
tokenBAmount: BN;
|
|
5233
5233
|
minSqrtPrice: BN;
|
|
5234
5234
|
maxSqrtPrice: BN;
|
|
5235
|
-
tokenADecimal: number;
|
|
5236
|
-
tokenBDecimal: number;
|
|
5237
5235
|
tokenAInfo?: {
|
|
5238
5236
|
mint: Mint;
|
|
5239
5237
|
currentEpoch: number;
|
|
@@ -5324,6 +5322,11 @@ type RemoveLiquidityParams = {
|
|
|
5324
5322
|
tokenBVault: PublicKey;
|
|
5325
5323
|
tokenAProgram: PublicKey;
|
|
5326
5324
|
tokenBProgram: PublicKey;
|
|
5325
|
+
vestings: Array<{
|
|
5326
|
+
account: PublicKey;
|
|
5327
|
+
vestingState: VestingState;
|
|
5328
|
+
}>;
|
|
5329
|
+
currentPoint: BN;
|
|
5327
5330
|
};
|
|
5328
5331
|
type RemoveAllLiquidityParams = Omit<RemoveLiquidityParams, "liquidityDelta">;
|
|
5329
5332
|
type BuildAddLiquidityParams = {
|
|
@@ -5343,6 +5346,17 @@ type BuildAddLiquidityParams = {
|
|
|
5343
5346
|
tokenAProgram: PublicKey;
|
|
5344
5347
|
tokenBProgram: PublicKey;
|
|
5345
5348
|
};
|
|
5349
|
+
type BuildLiquidatePositionInstructionParams = {
|
|
5350
|
+
owner: PublicKey;
|
|
5351
|
+
position: PublicKey;
|
|
5352
|
+
positionNftAccount: PublicKey;
|
|
5353
|
+
positionState: PositionState;
|
|
5354
|
+
poolState: PoolState;
|
|
5355
|
+
tokenAAccount: PublicKey;
|
|
5356
|
+
tokenBAccount: PublicKey;
|
|
5357
|
+
tokenAAmountThreshold: BN;
|
|
5358
|
+
tokenBAmountThreshold: BN;
|
|
5359
|
+
};
|
|
5346
5360
|
type BuildRemoveAllLiquidityInstructionParams = {
|
|
5347
5361
|
poolAuthority: PublicKey;
|
|
5348
5362
|
owner: PublicKey;
|
|
@@ -5375,6 +5389,11 @@ type RemoveAllLiquidityAndClosePositionParams = {
|
|
|
5375
5389
|
positionState: PositionState;
|
|
5376
5390
|
tokenAAmountThreshold: BN;
|
|
5377
5391
|
tokenBAmountThreshold: BN;
|
|
5392
|
+
vestings: Array<{
|
|
5393
|
+
account: PublicKey;
|
|
5394
|
+
vestingState: VestingState;
|
|
5395
|
+
}>;
|
|
5396
|
+
currentPoint: BN;
|
|
5378
5397
|
};
|
|
5379
5398
|
type MergePositionParams = {
|
|
5380
5399
|
owner: PublicKey;
|
|
@@ -5388,6 +5407,11 @@ type MergePositionParams = {
|
|
|
5388
5407
|
tokenBAmountAddLiquidityThreshold: BN;
|
|
5389
5408
|
tokenAAmountRemoveLiquidityThreshold: BN;
|
|
5390
5409
|
tokenBAmountRemoveLiquidityThreshold: BN;
|
|
5410
|
+
positionBVestings: Array<{
|
|
5411
|
+
account: PublicKey;
|
|
5412
|
+
vestingState: VestingState;
|
|
5413
|
+
}>;
|
|
5414
|
+
currentPoint: BN;
|
|
5391
5415
|
};
|
|
5392
5416
|
type GetQuoteParams = {
|
|
5393
5417
|
inAmount: BN;
|
|
@@ -5523,7 +5547,7 @@ type RefreshVestingParams = {
|
|
|
5523
5547
|
position: PublicKey;
|
|
5524
5548
|
positionNftAccount: PublicKey;
|
|
5525
5549
|
pool: PublicKey;
|
|
5526
|
-
|
|
5550
|
+
vestingAccounts: PublicKey[];
|
|
5527
5551
|
};
|
|
5528
5552
|
type PermanentLockParams = {
|
|
5529
5553
|
owner: PublicKey;
|
|
@@ -5632,6 +5656,19 @@ declare class CpAmm {
|
|
|
5632
5656
|
* @returns {Promise<TransactionInstruction>} Instruction to close the position
|
|
5633
5657
|
*/
|
|
5634
5658
|
private buildClosePositionInstruction;
|
|
5659
|
+
/**
|
|
5660
|
+
* Builds an instruction to refresh vesting for a position
|
|
5661
|
+
* @param params Parameters required for the refresh vesting instruction
|
|
5662
|
+
* @returns Transaction instruction or null if no vestings to refresh
|
|
5663
|
+
*/
|
|
5664
|
+
private buildRefreshVestingInstruction;
|
|
5665
|
+
/**
|
|
5666
|
+
* Helper function that builds instructions to claim fees, remove liquidity, and close a position
|
|
5667
|
+
* @param {BuildLiquidatePositionInstructionParams} params - Parameters for liquidating a position
|
|
5668
|
+
* @returns {Promise<TransactionInstruction[]>} Array of instructions
|
|
5669
|
+
* @private
|
|
5670
|
+
*/
|
|
5671
|
+
private buildLiquidatePositionInstruction;
|
|
5635
5672
|
/**
|
|
5636
5673
|
* Fetches the Config state of the program.
|
|
5637
5674
|
* @param config - Public key of the config account.
|
|
@@ -5709,6 +5746,30 @@ declare class CpAmm {
|
|
|
5709
5746
|
account: VestingState;
|
|
5710
5747
|
}>>;
|
|
5711
5748
|
isLockedPosition(position: PositionState): boolean;
|
|
5749
|
+
isPermanentLockedPosition(positionState: PositionState): boolean;
|
|
5750
|
+
/**
|
|
5751
|
+
* Checks if a position can be unlocked based on its locking state and vesting schedules.
|
|
5752
|
+
*
|
|
5753
|
+
* This method evaluates whether a position is eligible for operations that require
|
|
5754
|
+
* unlocked liquidity, such as removing all liquidity or closing the position. It checks both
|
|
5755
|
+
* permanent locks and time-based vesting schedules.
|
|
5756
|
+
*
|
|
5757
|
+
* @private
|
|
5758
|
+
* @param {PositionState} positionState - The current state of the position
|
|
5759
|
+
* @param {Array<{account: PublicKey; vestingState: VestingState}>} vestings - Array of vesting accounts and their states
|
|
5760
|
+
* @param {BN} currentPoint - Current timestamp or slot number (depending on activation type of pool)
|
|
5761
|
+
*
|
|
5762
|
+
* @returns {Object} Result object containing unlock status and reason
|
|
5763
|
+
* @returns {boolean} result.canUnlock - Whether the position can be unlocked
|
|
5764
|
+
* @returns {string|undefined} result.reason - Reason why position cannot be unlocked (if applicable)
|
|
5765
|
+
*/
|
|
5766
|
+
canUnlockPosition(positionState: PositionState, vestings: Array<{
|
|
5767
|
+
account: PublicKey;
|
|
5768
|
+
vestingState: VestingState;
|
|
5769
|
+
}>, currentPoint: BN): {
|
|
5770
|
+
canUnlock: boolean;
|
|
5771
|
+
reason?: string;
|
|
5772
|
+
};
|
|
5712
5773
|
isPoolExist(pool: PublicKey): Promise<boolean>;
|
|
5713
5774
|
/**
|
|
5714
5775
|
* Calculates swap quote based on input amount and pool state.
|
|
@@ -6063,6 +6124,28 @@ interface TransferFeeExcludedAmount {
|
|
|
6063
6124
|
}
|
|
6064
6125
|
declare function calculateTransferFeeExcludedAmount(transferFeeIncludedAmount: BN, mint: Mint, currentEpoch: number): TransferFeeExcludedAmount;
|
|
6065
6126
|
|
|
6127
|
+
/**
|
|
6128
|
+
* Checks if a vesting schedule is ready for full release
|
|
6129
|
+
* @param vestingData The vesting account data
|
|
6130
|
+
* @param currentPoint Current timestamp or slot
|
|
6131
|
+
* @returns True if the vesting is complete and all liquidity can be released
|
|
6132
|
+
*/
|
|
6133
|
+
declare function isVestingComplete(vestingData: VestingState, currentPoint: BN): boolean;
|
|
6134
|
+
/**
|
|
6135
|
+
* Gets the total amount of liquidity in the vesting schedule
|
|
6136
|
+
* @param vestingData The vesting account data
|
|
6137
|
+
* @returns The total locked liquidity amount
|
|
6138
|
+
*/
|
|
6139
|
+
declare function getTotalLockedLiquidity(vestingData: VestingState): BN;
|
|
6140
|
+
/**
|
|
6141
|
+
* Calculates the available liquidity to withdraw based on vesting schedule
|
|
6142
|
+
* @param vestingData The vesting account data
|
|
6143
|
+
* @param positionData The position account data
|
|
6144
|
+
* @param currentPoint Current timestamp or slot
|
|
6145
|
+
* @returns The amount of liquidity available to withdraw
|
|
6146
|
+
*/
|
|
6147
|
+
declare function getAvailableVestingLiquidity(vestingData: VestingState, currentPoint: BN): BN;
|
|
6148
|
+
|
|
6066
6149
|
declare const ONE: BN;
|
|
6067
6150
|
declare function pow(base: BN, exp: BN): BN;
|
|
6068
6151
|
|
|
@@ -12410,4 +12493,4 @@ var CpAmmIDL = {
|
|
|
12410
12493
|
types: types
|
|
12411
12494
|
};
|
|
12412
12495
|
|
|
12413
|
-
export { ActivationPoint, ActivationType, type AddLiquidityParams, type AmmProgram, BASIS_POINT_MAX, type BaseFee, type BuildAddLiquidityParams, type BuildRemoveAllLiquidityInstructionParams, CP_AMM_PROGRAM_ID, type ClaimPartnerFeeParams, type ClaimPositionFeeInstructionParams, type ClaimPositionFeeParams, type ClaimRewardParams, type ClosePositionInstructionParams, type ClosePositionParams, CollectFeeMode, type ConfigState, CpAmm, type CpAmm$1 as CpAmmTypes, type CreatePoolParams, type CreatePositionParams, type DepositQuote, type DynamicFee, FEE_DENOMINATOR, type FeeMode, FeeSchedulerMode, type FundRewardParams, type GetDepositQuoteParams, type GetQuoteParams, type GetWithdrawQuoteParams, type InitializeCustomizeablePoolParams, type InitializeRewardParams, LIQUIDITY_SCALE, type LiquidityDeltaParams, type LockPositionParams, MAX_CU_BUFFER, MAX_FEE_NUMERATOR, MAX_SQRT_PRICE, MIN_CU_BUFFER, MIN_SQRT_PRICE, type MergePositionParams, ONE, PRECISION, type PermanentLockParams, type PoolFeesParams, type PoolState, type PositionState, type PreparePoolCreationParams, type PreparePoolCreationSingleSide, type PreparedPoolCreation, type RefreshVestingParams, type RemoveAllLiquidityAndClosePositionParams, type RemoveAllLiquidityParams, type RemoveLiquidityParams, type RewardInfo, Rounding, SCALE_OFFSET, type SwapParams, type SwapQuotes, type TokenBadgeState, TradeDirection, type TxBuilder, type UpdateRewardDurationParams, type UpdateRewardFunderParams, type VestingState, type WithdrawIneligibleRewardParams, type WithdrawQuote, calculateInitSqrtPrice, calculateTransferFeeExcludedAmount, calculateTransferFeeIncludedAmount, decimalToQ64, CpAmmIDL as default, deriveClaimFeeOperatorAddress, deriveConfigAddress, deriveCustomizablePoolAddress, derivePoolAddress, derivePoolAuthority, derivePositionAddress, derivePositionNftAccount, deriveRewardVaultAddress, deriveTokenBadge, deriveTokenBadgeAddress, deriveTokenVaultAddress, divCeil, getAllUserPositionNftAccount, getAmountAFromLiquidityDelta, getAmountBFromLiquidityDelta, getBaseFeeNumerator, getDynamicFeeNumerator, getEstimatedComputeUnitIxWithBuffer, getEstimatedComputeUnitUsageWithBuffer, getFeeNumerator, getFirstKey, getLiquidityDeltaFromAmountA, getLiquidityDeltaFromAmountB, getMaxAmountWithSlippage, getMinAmountWithSlippage, getNextSqrtPrice, getNftOwner, getOrCreateATAInstruction, getPriceFromSqrtPrice, getPriceImpact, getSecondKey, getSimulationComputeUnits, getSqrtPriceFromPrice, getSwapAmount, getTokenDecimals, getTokenProgram, getUnClaimReward, mulDiv, positionByPoolFilter, pow, q64ToDecimal, unwrapSOLInstruction, vestingByPositionFilter, wrapSOLInstruction };
|
|
12496
|
+
export { ActivationPoint, ActivationType, type AddLiquidityParams, type AmmProgram, BASIS_POINT_MAX, type BaseFee, type BuildAddLiquidityParams, type BuildLiquidatePositionInstructionParams, type BuildRemoveAllLiquidityInstructionParams, CP_AMM_PROGRAM_ID, type ClaimPartnerFeeParams, type ClaimPositionFeeInstructionParams, type ClaimPositionFeeParams, type ClaimRewardParams, type ClosePositionInstructionParams, type ClosePositionParams, CollectFeeMode, type ConfigState, CpAmm, type CpAmm$1 as CpAmmTypes, type CreatePoolParams, type CreatePositionParams, type DepositQuote, type DynamicFee, FEE_DENOMINATOR, type FeeMode, FeeSchedulerMode, type FundRewardParams, type GetDepositQuoteParams, type GetQuoteParams, type GetWithdrawQuoteParams, type InitializeCustomizeablePoolParams, type InitializeRewardParams, LIQUIDITY_SCALE, type LiquidityDeltaParams, type LockPositionParams, MAX_CU_BUFFER, MAX_FEE_NUMERATOR, MAX_SQRT_PRICE, MIN_CU_BUFFER, MIN_SQRT_PRICE, type MergePositionParams, ONE, PRECISION, type PermanentLockParams, type PoolFeesParams, type PoolState, type PositionState, type PreparePoolCreationParams, type PreparePoolCreationSingleSide, type PreparedPoolCreation, type RefreshVestingParams, type RemoveAllLiquidityAndClosePositionParams, type RemoveAllLiquidityParams, type RemoveLiquidityParams, type RewardInfo, Rounding, SCALE_OFFSET, type SwapParams, type SwapQuotes, type TokenBadgeState, TradeDirection, type TxBuilder, type UpdateRewardDurationParams, type UpdateRewardFunderParams, type VestingState, type WithdrawIneligibleRewardParams, type WithdrawQuote, calculateInitSqrtPrice, calculateTransferFeeExcludedAmount, calculateTransferFeeIncludedAmount, decimalToQ64, CpAmmIDL as default, deriveClaimFeeOperatorAddress, deriveConfigAddress, deriveCustomizablePoolAddress, derivePoolAddress, derivePoolAuthority, derivePositionAddress, derivePositionNftAccount, deriveRewardVaultAddress, deriveTokenBadge, deriveTokenBadgeAddress, deriveTokenVaultAddress, divCeil, getAllUserPositionNftAccount, getAmountAFromLiquidityDelta, getAmountBFromLiquidityDelta, getAvailableVestingLiquidity, getBaseFeeNumerator, getDynamicFeeNumerator, getEstimatedComputeUnitIxWithBuffer, getEstimatedComputeUnitUsageWithBuffer, getFeeNumerator, getFirstKey, getLiquidityDeltaFromAmountA, getLiquidityDeltaFromAmountB, getMaxAmountWithSlippage, getMinAmountWithSlippage, getNextSqrtPrice, getNftOwner, getOrCreateATAInstruction, getPriceFromSqrtPrice, getPriceImpact, getSecondKey, getSimulationComputeUnits, getSqrtPriceFromPrice, getSwapAmount, getTokenDecimals, getTokenProgram, getTotalLockedLiquidity, getUnClaimReward, isVestingComplete, mulDiv, positionByPoolFilter, pow, q64ToDecimal, unwrapSOLInstruction, vestingByPositionFilter, wrapSOLInstruction };
|
package/dist/index.d.ts
CHANGED
|
@@ -5232,8 +5232,6 @@ type PreparePoolCreationParams = {
|
|
|
5232
5232
|
tokenBAmount: BN;
|
|
5233
5233
|
minSqrtPrice: BN;
|
|
5234
5234
|
maxSqrtPrice: BN;
|
|
5235
|
-
tokenADecimal: number;
|
|
5236
|
-
tokenBDecimal: number;
|
|
5237
5235
|
tokenAInfo?: {
|
|
5238
5236
|
mint: Mint;
|
|
5239
5237
|
currentEpoch: number;
|
|
@@ -5324,6 +5322,11 @@ type RemoveLiquidityParams = {
|
|
|
5324
5322
|
tokenBVault: PublicKey;
|
|
5325
5323
|
tokenAProgram: PublicKey;
|
|
5326
5324
|
tokenBProgram: PublicKey;
|
|
5325
|
+
vestings: Array<{
|
|
5326
|
+
account: PublicKey;
|
|
5327
|
+
vestingState: VestingState;
|
|
5328
|
+
}>;
|
|
5329
|
+
currentPoint: BN;
|
|
5327
5330
|
};
|
|
5328
5331
|
type RemoveAllLiquidityParams = Omit<RemoveLiquidityParams, "liquidityDelta">;
|
|
5329
5332
|
type BuildAddLiquidityParams = {
|
|
@@ -5343,6 +5346,17 @@ type BuildAddLiquidityParams = {
|
|
|
5343
5346
|
tokenAProgram: PublicKey;
|
|
5344
5347
|
tokenBProgram: PublicKey;
|
|
5345
5348
|
};
|
|
5349
|
+
type BuildLiquidatePositionInstructionParams = {
|
|
5350
|
+
owner: PublicKey;
|
|
5351
|
+
position: PublicKey;
|
|
5352
|
+
positionNftAccount: PublicKey;
|
|
5353
|
+
positionState: PositionState;
|
|
5354
|
+
poolState: PoolState;
|
|
5355
|
+
tokenAAccount: PublicKey;
|
|
5356
|
+
tokenBAccount: PublicKey;
|
|
5357
|
+
tokenAAmountThreshold: BN;
|
|
5358
|
+
tokenBAmountThreshold: BN;
|
|
5359
|
+
};
|
|
5346
5360
|
type BuildRemoveAllLiquidityInstructionParams = {
|
|
5347
5361
|
poolAuthority: PublicKey;
|
|
5348
5362
|
owner: PublicKey;
|
|
@@ -5375,6 +5389,11 @@ type RemoveAllLiquidityAndClosePositionParams = {
|
|
|
5375
5389
|
positionState: PositionState;
|
|
5376
5390
|
tokenAAmountThreshold: BN;
|
|
5377
5391
|
tokenBAmountThreshold: BN;
|
|
5392
|
+
vestings: Array<{
|
|
5393
|
+
account: PublicKey;
|
|
5394
|
+
vestingState: VestingState;
|
|
5395
|
+
}>;
|
|
5396
|
+
currentPoint: BN;
|
|
5378
5397
|
};
|
|
5379
5398
|
type MergePositionParams = {
|
|
5380
5399
|
owner: PublicKey;
|
|
@@ -5388,6 +5407,11 @@ type MergePositionParams = {
|
|
|
5388
5407
|
tokenBAmountAddLiquidityThreshold: BN;
|
|
5389
5408
|
tokenAAmountRemoveLiquidityThreshold: BN;
|
|
5390
5409
|
tokenBAmountRemoveLiquidityThreshold: BN;
|
|
5410
|
+
positionBVestings: Array<{
|
|
5411
|
+
account: PublicKey;
|
|
5412
|
+
vestingState: VestingState;
|
|
5413
|
+
}>;
|
|
5414
|
+
currentPoint: BN;
|
|
5391
5415
|
};
|
|
5392
5416
|
type GetQuoteParams = {
|
|
5393
5417
|
inAmount: BN;
|
|
@@ -5523,7 +5547,7 @@ type RefreshVestingParams = {
|
|
|
5523
5547
|
position: PublicKey;
|
|
5524
5548
|
positionNftAccount: PublicKey;
|
|
5525
5549
|
pool: PublicKey;
|
|
5526
|
-
|
|
5550
|
+
vestingAccounts: PublicKey[];
|
|
5527
5551
|
};
|
|
5528
5552
|
type PermanentLockParams = {
|
|
5529
5553
|
owner: PublicKey;
|
|
@@ -5632,6 +5656,19 @@ declare class CpAmm {
|
|
|
5632
5656
|
* @returns {Promise<TransactionInstruction>} Instruction to close the position
|
|
5633
5657
|
*/
|
|
5634
5658
|
private buildClosePositionInstruction;
|
|
5659
|
+
/**
|
|
5660
|
+
* Builds an instruction to refresh vesting for a position
|
|
5661
|
+
* @param params Parameters required for the refresh vesting instruction
|
|
5662
|
+
* @returns Transaction instruction or null if no vestings to refresh
|
|
5663
|
+
*/
|
|
5664
|
+
private buildRefreshVestingInstruction;
|
|
5665
|
+
/**
|
|
5666
|
+
* Helper function that builds instructions to claim fees, remove liquidity, and close a position
|
|
5667
|
+
* @param {BuildLiquidatePositionInstructionParams} params - Parameters for liquidating a position
|
|
5668
|
+
* @returns {Promise<TransactionInstruction[]>} Array of instructions
|
|
5669
|
+
* @private
|
|
5670
|
+
*/
|
|
5671
|
+
private buildLiquidatePositionInstruction;
|
|
5635
5672
|
/**
|
|
5636
5673
|
* Fetches the Config state of the program.
|
|
5637
5674
|
* @param config - Public key of the config account.
|
|
@@ -5709,6 +5746,30 @@ declare class CpAmm {
|
|
|
5709
5746
|
account: VestingState;
|
|
5710
5747
|
}>>;
|
|
5711
5748
|
isLockedPosition(position: PositionState): boolean;
|
|
5749
|
+
isPermanentLockedPosition(positionState: PositionState): boolean;
|
|
5750
|
+
/**
|
|
5751
|
+
* Checks if a position can be unlocked based on its locking state and vesting schedules.
|
|
5752
|
+
*
|
|
5753
|
+
* This method evaluates whether a position is eligible for operations that require
|
|
5754
|
+
* unlocked liquidity, such as removing all liquidity or closing the position. It checks both
|
|
5755
|
+
* permanent locks and time-based vesting schedules.
|
|
5756
|
+
*
|
|
5757
|
+
* @private
|
|
5758
|
+
* @param {PositionState} positionState - The current state of the position
|
|
5759
|
+
* @param {Array<{account: PublicKey; vestingState: VestingState}>} vestings - Array of vesting accounts and their states
|
|
5760
|
+
* @param {BN} currentPoint - Current timestamp or slot number (depending on activation type of pool)
|
|
5761
|
+
*
|
|
5762
|
+
* @returns {Object} Result object containing unlock status and reason
|
|
5763
|
+
* @returns {boolean} result.canUnlock - Whether the position can be unlocked
|
|
5764
|
+
* @returns {string|undefined} result.reason - Reason why position cannot be unlocked (if applicable)
|
|
5765
|
+
*/
|
|
5766
|
+
canUnlockPosition(positionState: PositionState, vestings: Array<{
|
|
5767
|
+
account: PublicKey;
|
|
5768
|
+
vestingState: VestingState;
|
|
5769
|
+
}>, currentPoint: BN): {
|
|
5770
|
+
canUnlock: boolean;
|
|
5771
|
+
reason?: string;
|
|
5772
|
+
};
|
|
5712
5773
|
isPoolExist(pool: PublicKey): Promise<boolean>;
|
|
5713
5774
|
/**
|
|
5714
5775
|
* Calculates swap quote based on input amount and pool state.
|
|
@@ -6063,6 +6124,28 @@ interface TransferFeeExcludedAmount {
|
|
|
6063
6124
|
}
|
|
6064
6125
|
declare function calculateTransferFeeExcludedAmount(transferFeeIncludedAmount: BN, mint: Mint, currentEpoch: number): TransferFeeExcludedAmount;
|
|
6065
6126
|
|
|
6127
|
+
/**
|
|
6128
|
+
* Checks if a vesting schedule is ready for full release
|
|
6129
|
+
* @param vestingData The vesting account data
|
|
6130
|
+
* @param currentPoint Current timestamp or slot
|
|
6131
|
+
* @returns True if the vesting is complete and all liquidity can be released
|
|
6132
|
+
*/
|
|
6133
|
+
declare function isVestingComplete(vestingData: VestingState, currentPoint: BN): boolean;
|
|
6134
|
+
/**
|
|
6135
|
+
* Gets the total amount of liquidity in the vesting schedule
|
|
6136
|
+
* @param vestingData The vesting account data
|
|
6137
|
+
* @returns The total locked liquidity amount
|
|
6138
|
+
*/
|
|
6139
|
+
declare function getTotalLockedLiquidity(vestingData: VestingState): BN;
|
|
6140
|
+
/**
|
|
6141
|
+
* Calculates the available liquidity to withdraw based on vesting schedule
|
|
6142
|
+
* @param vestingData The vesting account data
|
|
6143
|
+
* @param positionData The position account data
|
|
6144
|
+
* @param currentPoint Current timestamp or slot
|
|
6145
|
+
* @returns The amount of liquidity available to withdraw
|
|
6146
|
+
*/
|
|
6147
|
+
declare function getAvailableVestingLiquidity(vestingData: VestingState, currentPoint: BN): BN;
|
|
6148
|
+
|
|
6066
6149
|
declare const ONE: BN;
|
|
6067
6150
|
declare function pow(base: BN, exp: BN): BN;
|
|
6068
6151
|
|
|
@@ -12410,4 +12493,4 @@ var CpAmmIDL = {
|
|
|
12410
12493
|
types: types
|
|
12411
12494
|
};
|
|
12412
12495
|
|
|
12413
|
-
export { ActivationPoint, ActivationType, type AddLiquidityParams, type AmmProgram, BASIS_POINT_MAX, type BaseFee, type BuildAddLiquidityParams, type BuildRemoveAllLiquidityInstructionParams, CP_AMM_PROGRAM_ID, type ClaimPartnerFeeParams, type ClaimPositionFeeInstructionParams, type ClaimPositionFeeParams, type ClaimRewardParams, type ClosePositionInstructionParams, type ClosePositionParams, CollectFeeMode, type ConfigState, CpAmm, type CpAmm$1 as CpAmmTypes, type CreatePoolParams, type CreatePositionParams, type DepositQuote, type DynamicFee, FEE_DENOMINATOR, type FeeMode, FeeSchedulerMode, type FundRewardParams, type GetDepositQuoteParams, type GetQuoteParams, type GetWithdrawQuoteParams, type InitializeCustomizeablePoolParams, type InitializeRewardParams, LIQUIDITY_SCALE, type LiquidityDeltaParams, type LockPositionParams, MAX_CU_BUFFER, MAX_FEE_NUMERATOR, MAX_SQRT_PRICE, MIN_CU_BUFFER, MIN_SQRT_PRICE, type MergePositionParams, ONE, PRECISION, type PermanentLockParams, type PoolFeesParams, type PoolState, type PositionState, type PreparePoolCreationParams, type PreparePoolCreationSingleSide, type PreparedPoolCreation, type RefreshVestingParams, type RemoveAllLiquidityAndClosePositionParams, type RemoveAllLiquidityParams, type RemoveLiquidityParams, type RewardInfo, Rounding, SCALE_OFFSET, type SwapParams, type SwapQuotes, type TokenBadgeState, TradeDirection, type TxBuilder, type UpdateRewardDurationParams, type UpdateRewardFunderParams, type VestingState, type WithdrawIneligibleRewardParams, type WithdrawQuote, calculateInitSqrtPrice, calculateTransferFeeExcludedAmount, calculateTransferFeeIncludedAmount, decimalToQ64, CpAmmIDL as default, deriveClaimFeeOperatorAddress, deriveConfigAddress, deriveCustomizablePoolAddress, derivePoolAddress, derivePoolAuthority, derivePositionAddress, derivePositionNftAccount, deriveRewardVaultAddress, deriveTokenBadge, deriveTokenBadgeAddress, deriveTokenVaultAddress, divCeil, getAllUserPositionNftAccount, getAmountAFromLiquidityDelta, getAmountBFromLiquidityDelta, getBaseFeeNumerator, getDynamicFeeNumerator, getEstimatedComputeUnitIxWithBuffer, getEstimatedComputeUnitUsageWithBuffer, getFeeNumerator, getFirstKey, getLiquidityDeltaFromAmountA, getLiquidityDeltaFromAmountB, getMaxAmountWithSlippage, getMinAmountWithSlippage, getNextSqrtPrice, getNftOwner, getOrCreateATAInstruction, getPriceFromSqrtPrice, getPriceImpact, getSecondKey, getSimulationComputeUnits, getSqrtPriceFromPrice, getSwapAmount, getTokenDecimals, getTokenProgram, getUnClaimReward, mulDiv, positionByPoolFilter, pow, q64ToDecimal, unwrapSOLInstruction, vestingByPositionFilter, wrapSOLInstruction };
|
|
12496
|
+
export { ActivationPoint, ActivationType, type AddLiquidityParams, type AmmProgram, BASIS_POINT_MAX, type BaseFee, type BuildAddLiquidityParams, type BuildLiquidatePositionInstructionParams, type BuildRemoveAllLiquidityInstructionParams, CP_AMM_PROGRAM_ID, type ClaimPartnerFeeParams, type ClaimPositionFeeInstructionParams, type ClaimPositionFeeParams, type ClaimRewardParams, type ClosePositionInstructionParams, type ClosePositionParams, CollectFeeMode, type ConfigState, CpAmm, type CpAmm$1 as CpAmmTypes, type CreatePoolParams, type CreatePositionParams, type DepositQuote, type DynamicFee, FEE_DENOMINATOR, type FeeMode, FeeSchedulerMode, type FundRewardParams, type GetDepositQuoteParams, type GetQuoteParams, type GetWithdrawQuoteParams, type InitializeCustomizeablePoolParams, type InitializeRewardParams, LIQUIDITY_SCALE, type LiquidityDeltaParams, type LockPositionParams, MAX_CU_BUFFER, MAX_FEE_NUMERATOR, MAX_SQRT_PRICE, MIN_CU_BUFFER, MIN_SQRT_PRICE, type MergePositionParams, ONE, PRECISION, type PermanentLockParams, type PoolFeesParams, type PoolState, type PositionState, type PreparePoolCreationParams, type PreparePoolCreationSingleSide, type PreparedPoolCreation, type RefreshVestingParams, type RemoveAllLiquidityAndClosePositionParams, type RemoveAllLiquidityParams, type RemoveLiquidityParams, type RewardInfo, Rounding, SCALE_OFFSET, type SwapParams, type SwapQuotes, type TokenBadgeState, TradeDirection, type TxBuilder, type UpdateRewardDurationParams, type UpdateRewardFunderParams, type VestingState, type WithdrawIneligibleRewardParams, type WithdrawQuote, calculateInitSqrtPrice, calculateTransferFeeExcludedAmount, calculateTransferFeeIncludedAmount, decimalToQ64, CpAmmIDL as default, deriveClaimFeeOperatorAddress, deriveConfigAddress, deriveCustomizablePoolAddress, derivePoolAddress, derivePoolAuthority, derivePositionAddress, derivePositionNftAccount, deriveRewardVaultAddress, deriveTokenBadge, deriveTokenBadgeAddress, deriveTokenVaultAddress, divCeil, getAllUserPositionNftAccount, getAmountAFromLiquidityDelta, getAmountBFromLiquidityDelta, getAvailableVestingLiquidity, getBaseFeeNumerator, getDynamicFeeNumerator, getEstimatedComputeUnitIxWithBuffer, getEstimatedComputeUnitUsageWithBuffer, getFeeNumerator, getFirstKey, getLiquidityDeltaFromAmountA, getLiquidityDeltaFromAmountB, getMaxAmountWithSlippage, getMinAmountWithSlippage, getNextSqrtPrice, getNftOwner, getOrCreateATAInstruction, getPriceFromSqrtPrice, getPriceImpact, getSecondKey, getSimulationComputeUnits, getSqrtPriceFromPrice, getSwapAmount, getTokenDecimals, getTokenProgram, getTotalLockedLiquidity, getUnClaimReward, isVestingComplete, mulDiv, positionByPoolFilter, pow, q64ToDecimal, unwrapSOLInstruction, vestingByPositionFilter, wrapSOLInstruction };
|