@cetusprotocol/sui-clmm-sdk 1.1.2 → 1.2.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/README.md +3 -3
- package/dist/index.d.mts +13 -3
- package/dist/index.d.ts +13 -3
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/docs/get_positions.md +29 -0
- package/docs/utils.md +1 -1
- package/docs/vest.md +103 -0
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<a name="readme-top"></a>
|
|
2
2
|
|
|
3
|
-

|
|
4
|
+

|
|
5
|
+

|
|
6
6
|
|
|
7
7
|
<!-- PROJECT LOGO -->
|
|
8
8
|
<br />
|
package/dist/index.d.mts
CHANGED
|
@@ -356,7 +356,7 @@ type Pool = {
|
|
|
356
356
|
/**
|
|
357
357
|
* is the pool pause
|
|
358
358
|
*/
|
|
359
|
-
|
|
359
|
+
pool_status: PoolStatus;
|
|
360
360
|
/**
|
|
361
361
|
* The liquidity of current tick index
|
|
362
362
|
*/
|
|
@@ -1062,6 +1062,14 @@ type PositionSnapshot = {
|
|
|
1062
1062
|
value_cut: string;
|
|
1063
1063
|
rewards: string[];
|
|
1064
1064
|
};
|
|
1065
|
+
type PoolStatus = {
|
|
1066
|
+
disable_add_liquidity: boolean;
|
|
1067
|
+
disable_remove_liquidity: boolean;
|
|
1068
|
+
disable_swap: boolean;
|
|
1069
|
+
disable_flash_loan: boolean;
|
|
1070
|
+
disable_collect_fee: boolean;
|
|
1071
|
+
disable_collect_reward: boolean;
|
|
1072
|
+
};
|
|
1065
1073
|
|
|
1066
1074
|
/**
|
|
1067
1075
|
* Represents configurations specific to the Cetus protocol.
|
|
@@ -1529,9 +1537,10 @@ declare class PoolModule implements IModule<CetusClmmSDK> {
|
|
|
1529
1537
|
* Gets a pool by its object ID.
|
|
1530
1538
|
* @param {string} pool_id The object ID of the pool to get.
|
|
1531
1539
|
* @param {true} force_refresh Whether to force a refresh of the cache.
|
|
1540
|
+
* @param {boolean} verify_pool_status Whether to verify the pool status.
|
|
1532
1541
|
* @returns {Promise<Pool>} A promise that resolves to a Pool object.
|
|
1533
1542
|
*/
|
|
1534
|
-
getPool(pool_id: string, force_refresh?: boolean): Promise<Pool>;
|
|
1543
|
+
getPool(pool_id: string, force_refresh?: boolean, verify_pool_status?: boolean): Promise<Pool>;
|
|
1535
1544
|
getPoolByCoins(coins: string[], fee_rate?: number): Promise<Pool[]>;
|
|
1536
1545
|
/**
|
|
1537
1546
|
* Create a pool of clmmpool protocol. The pool is identified by (CoinTypeA, CoinTypeB, tick_spacing).
|
|
@@ -1632,6 +1641,7 @@ declare class PoolModule implements IModule<CetusClmmSDK> {
|
|
|
1632
1641
|
* @returns {Promise<Transaction>} A promise that resolves to the transaction payload.
|
|
1633
1642
|
*/
|
|
1634
1643
|
claimPartnerRefFeePayload(partner_cap: string, partner: string, coin_type: string): Promise<Transaction>;
|
|
1644
|
+
getPoolStatus(poolId: string): Promise<PoolStatus | undefined>;
|
|
1635
1645
|
}
|
|
1636
1646
|
|
|
1637
1647
|
/**
|
|
@@ -2376,4 +2386,4 @@ declare class ClmmError extends BaseError {
|
|
|
2376
2386
|
declare const handleError: (code: ClmmErrorCode, error: Error, details?: Record<string, any>) => never;
|
|
2377
2387
|
declare const handleMessageError: (code: ClmmErrorCode, message: string, details?: Record<string, any>) => never;
|
|
2378
2388
|
|
|
2379
|
-
export { AMM_SWAP_MODULE, type AddLiquidityCommonParams, type AddLiquidityFixTokenParams, type AddLiquidityParams, type AddLiquidityWithPriceRangeParams, type AdjustResult, BPS, type BasePath, type BigNumber, type Bits, type CalculateAddLiquidityFixCoinWithPriceParams, type CalculateAddLiquidityResult, type CalculateAddLiquidityWithPriceParams, type CalculateCreatePoolResult, type CalculateCreatePoolWithPriceParams, type CalculateRatesParams, type CalculateRatesResult, CetusClmmSDK, type CetusConfigs, type ClmmConfig, ClmmError, type ClmmErrorCode, ClmmExpectSwapModule, ClmmFetcherModule, ClmmIntegratePoolModule, ClmmIntegratePoolV2Module, ClmmIntegratePoolV3Module, ClmmIntegrateRouterModule, ClmmIntegrateRouterWithPartnerModule, ClmmIntegrateUtilsModule, ClmmPartnerModule, type ClmmPoolConfig, ClmmPositionStatus, type ClmmVestInfo, type ClmmpoolData, type ClosePositionParams, type CoinConfig, type CollectFeeParams, type CollectFeesQuote, type CollectRewarderParams, ConfigErrorCode, ConfigModule, type CreatePartnerEvent, type CreatePoolAddLiquidityParams, type CreatePoolAddLiquidityWithPriceParams, type CreatePoolAndAddLiquidityRowResult, type CreatePoolCustomRangeParams, type CreatePoolParams, type CustomRangeParams, DeepbookClobV2Module, DeepbookCustodianV2Module, DeepbookEndpointsV2Module, type FetchParams, type FetchPosFeeParams, type FetchPosRewardParams, type FullRangeParams, type GetPositionInfoListParams, type GetPositionVestOption, type GlobalVestingPeriod, type LaunchpadPoolConfig, type NFT, type OpenPositionParams, type OpenPositionWithPriceParams, POOL_STRUCT, PartnerErrorCode, type PeriodDetail, type Pool, PoolErrorCode, type PoolImmutables, type PoolLiquiditySnapshot, PoolModule, type PoolTransactionInfo, type PosRewarderResult, type Position, PositionErrorCode, type PositionInfo, PositionModule, type PositionSnapshot, type PositionTransactionInfo, PositionUtils, type PositionVesting, type PreSwapLpChangeParams, type PreSwapParams, type PreSwapWithMultiPoolParams, type RedeemOption, type RemoveLiquidityParams, type Rewarder, type RewarderAmountOwned, RewarderModule, RouterErrorCode, type SdkOptions, type SplitPath, type SuiBasicTypes, type SuiInputTypes, type SuiStructTag, type SuiTxArg, SwapErrorCode, type SwapGasEstimateArg, SwapModule, type SwapParams, type SwapResult, type SwapStepResult, SwapUtils, type Tick, type TickData, type TransPreSwapWithMultiPoolParams, TypesErrorCode, UtilsErrorCode, type VestConfigs, VestErrorCode, VestModule, VestUtils, buildClmmPositionName, buildPool, buildPoolTransactionInfo, buildPosition, buildPositionInfo, buildPositionTransactionInfo, buildTickData, buildTickDataByEvent, buildTransferCoin, buildTransferCoinToSender, clmmMainnet, clmmTestnet, computeSwap, computeSwapStep, CetusClmmSDK as default, estPoolAPR, type estPosAPRResult, estPositionAPRWithDeltaMethod, estPositionAPRWithMultiMethod, findAdjustCoin, getDefaultSuiInputType, getLowerSqrtPriceFromCoinA, getLowerSqrtPriceFromCoinB, getUpperSqrtPriceFromCoinA, getUpperSqrtPriceFromCoinB, handleError, handleMessageError, newBits, poolFilterEvenTypes, poolLiquiditySnapshotType, transClmmpoolDataWithoutTicks };
|
|
2389
|
+
export { AMM_SWAP_MODULE, type AddLiquidityCommonParams, type AddLiquidityFixTokenParams, type AddLiquidityParams, type AddLiquidityWithPriceRangeParams, type AdjustResult, BPS, type BasePath, type BigNumber, type Bits, type CalculateAddLiquidityFixCoinWithPriceParams, type CalculateAddLiquidityResult, type CalculateAddLiquidityWithPriceParams, type CalculateCreatePoolResult, type CalculateCreatePoolWithPriceParams, type CalculateRatesParams, type CalculateRatesResult, CetusClmmSDK, type CetusConfigs, type ClmmConfig, ClmmError, type ClmmErrorCode, ClmmExpectSwapModule, ClmmFetcherModule, ClmmIntegratePoolModule, ClmmIntegratePoolV2Module, ClmmIntegratePoolV3Module, ClmmIntegrateRouterModule, ClmmIntegrateRouterWithPartnerModule, ClmmIntegrateUtilsModule, ClmmPartnerModule, type ClmmPoolConfig, ClmmPositionStatus, type ClmmVestInfo, type ClmmpoolData, type ClosePositionParams, type CoinConfig, type CollectFeeParams, type CollectFeesQuote, type CollectRewarderParams, ConfigErrorCode, ConfigModule, type CreatePartnerEvent, type CreatePoolAddLiquidityParams, type CreatePoolAddLiquidityWithPriceParams, type CreatePoolAndAddLiquidityRowResult, type CreatePoolCustomRangeParams, type CreatePoolParams, type CustomRangeParams, DeepbookClobV2Module, DeepbookCustodianV2Module, DeepbookEndpointsV2Module, type FetchParams, type FetchPosFeeParams, type FetchPosRewardParams, type FullRangeParams, type GetPositionInfoListParams, type GetPositionVestOption, type GlobalVestingPeriod, type LaunchpadPoolConfig, type NFT, type OpenPositionParams, type OpenPositionWithPriceParams, POOL_STRUCT, PartnerErrorCode, type PeriodDetail, type Pool, PoolErrorCode, type PoolImmutables, type PoolLiquiditySnapshot, PoolModule, type PoolStatus, type PoolTransactionInfo, type PosRewarderResult, type Position, PositionErrorCode, type PositionInfo, PositionModule, type PositionSnapshot, type PositionTransactionInfo, PositionUtils, type PositionVesting, type PreSwapLpChangeParams, type PreSwapParams, type PreSwapWithMultiPoolParams, type RedeemOption, type RemoveLiquidityParams, type Rewarder, type RewarderAmountOwned, RewarderModule, RouterErrorCode, type SdkOptions, type SplitPath, type SuiBasicTypes, type SuiInputTypes, type SuiStructTag, type SuiTxArg, SwapErrorCode, type SwapGasEstimateArg, SwapModule, type SwapParams, type SwapResult, type SwapStepResult, SwapUtils, type Tick, type TickData, type TransPreSwapWithMultiPoolParams, TypesErrorCode, UtilsErrorCode, type VestConfigs, VestErrorCode, VestModule, VestUtils, buildClmmPositionName, buildPool, buildPoolTransactionInfo, buildPosition, buildPositionInfo, buildPositionTransactionInfo, buildTickData, buildTickDataByEvent, buildTransferCoin, buildTransferCoinToSender, clmmMainnet, clmmTestnet, computeSwap, computeSwapStep, CetusClmmSDK as default, estPoolAPR, type estPosAPRResult, estPositionAPRWithDeltaMethod, estPositionAPRWithMultiMethod, findAdjustCoin, getDefaultSuiInputType, getLowerSqrtPriceFromCoinA, getLowerSqrtPriceFromCoinB, getUpperSqrtPriceFromCoinA, getUpperSqrtPriceFromCoinB, handleError, handleMessageError, newBits, poolFilterEvenTypes, poolLiquiditySnapshotType, transClmmpoolDataWithoutTicks };
|
package/dist/index.d.ts
CHANGED
|
@@ -356,7 +356,7 @@ type Pool = {
|
|
|
356
356
|
/**
|
|
357
357
|
* is the pool pause
|
|
358
358
|
*/
|
|
359
|
-
|
|
359
|
+
pool_status: PoolStatus;
|
|
360
360
|
/**
|
|
361
361
|
* The liquidity of current tick index
|
|
362
362
|
*/
|
|
@@ -1062,6 +1062,14 @@ type PositionSnapshot = {
|
|
|
1062
1062
|
value_cut: string;
|
|
1063
1063
|
rewards: string[];
|
|
1064
1064
|
};
|
|
1065
|
+
type PoolStatus = {
|
|
1066
|
+
disable_add_liquidity: boolean;
|
|
1067
|
+
disable_remove_liquidity: boolean;
|
|
1068
|
+
disable_swap: boolean;
|
|
1069
|
+
disable_flash_loan: boolean;
|
|
1070
|
+
disable_collect_fee: boolean;
|
|
1071
|
+
disable_collect_reward: boolean;
|
|
1072
|
+
};
|
|
1065
1073
|
|
|
1066
1074
|
/**
|
|
1067
1075
|
* Represents configurations specific to the Cetus protocol.
|
|
@@ -1529,9 +1537,10 @@ declare class PoolModule implements IModule<CetusClmmSDK> {
|
|
|
1529
1537
|
* Gets a pool by its object ID.
|
|
1530
1538
|
* @param {string} pool_id The object ID of the pool to get.
|
|
1531
1539
|
* @param {true} force_refresh Whether to force a refresh of the cache.
|
|
1540
|
+
* @param {boolean} verify_pool_status Whether to verify the pool status.
|
|
1532
1541
|
* @returns {Promise<Pool>} A promise that resolves to a Pool object.
|
|
1533
1542
|
*/
|
|
1534
|
-
getPool(pool_id: string, force_refresh?: boolean): Promise<Pool>;
|
|
1543
|
+
getPool(pool_id: string, force_refresh?: boolean, verify_pool_status?: boolean): Promise<Pool>;
|
|
1535
1544
|
getPoolByCoins(coins: string[], fee_rate?: number): Promise<Pool[]>;
|
|
1536
1545
|
/**
|
|
1537
1546
|
* Create a pool of clmmpool protocol. The pool is identified by (CoinTypeA, CoinTypeB, tick_spacing).
|
|
@@ -1632,6 +1641,7 @@ declare class PoolModule implements IModule<CetusClmmSDK> {
|
|
|
1632
1641
|
* @returns {Promise<Transaction>} A promise that resolves to the transaction payload.
|
|
1633
1642
|
*/
|
|
1634
1643
|
claimPartnerRefFeePayload(partner_cap: string, partner: string, coin_type: string): Promise<Transaction>;
|
|
1644
|
+
getPoolStatus(poolId: string): Promise<PoolStatus | undefined>;
|
|
1635
1645
|
}
|
|
1636
1646
|
|
|
1637
1647
|
/**
|
|
@@ -2376,4 +2386,4 @@ declare class ClmmError extends BaseError {
|
|
|
2376
2386
|
declare const handleError: (code: ClmmErrorCode, error: Error, details?: Record<string, any>) => never;
|
|
2377
2387
|
declare const handleMessageError: (code: ClmmErrorCode, message: string, details?: Record<string, any>) => never;
|
|
2378
2388
|
|
|
2379
|
-
export { AMM_SWAP_MODULE, type AddLiquidityCommonParams, type AddLiquidityFixTokenParams, type AddLiquidityParams, type AddLiquidityWithPriceRangeParams, type AdjustResult, BPS, type BasePath, type BigNumber, type Bits, type CalculateAddLiquidityFixCoinWithPriceParams, type CalculateAddLiquidityResult, type CalculateAddLiquidityWithPriceParams, type CalculateCreatePoolResult, type CalculateCreatePoolWithPriceParams, type CalculateRatesParams, type CalculateRatesResult, CetusClmmSDK, type CetusConfigs, type ClmmConfig, ClmmError, type ClmmErrorCode, ClmmExpectSwapModule, ClmmFetcherModule, ClmmIntegratePoolModule, ClmmIntegratePoolV2Module, ClmmIntegratePoolV3Module, ClmmIntegrateRouterModule, ClmmIntegrateRouterWithPartnerModule, ClmmIntegrateUtilsModule, ClmmPartnerModule, type ClmmPoolConfig, ClmmPositionStatus, type ClmmVestInfo, type ClmmpoolData, type ClosePositionParams, type CoinConfig, type CollectFeeParams, type CollectFeesQuote, type CollectRewarderParams, ConfigErrorCode, ConfigModule, type CreatePartnerEvent, type CreatePoolAddLiquidityParams, type CreatePoolAddLiquidityWithPriceParams, type CreatePoolAndAddLiquidityRowResult, type CreatePoolCustomRangeParams, type CreatePoolParams, type CustomRangeParams, DeepbookClobV2Module, DeepbookCustodianV2Module, DeepbookEndpointsV2Module, type FetchParams, type FetchPosFeeParams, type FetchPosRewardParams, type FullRangeParams, type GetPositionInfoListParams, type GetPositionVestOption, type GlobalVestingPeriod, type LaunchpadPoolConfig, type NFT, type OpenPositionParams, type OpenPositionWithPriceParams, POOL_STRUCT, PartnerErrorCode, type PeriodDetail, type Pool, PoolErrorCode, type PoolImmutables, type PoolLiquiditySnapshot, PoolModule, type PoolTransactionInfo, type PosRewarderResult, type Position, PositionErrorCode, type PositionInfo, PositionModule, type PositionSnapshot, type PositionTransactionInfo, PositionUtils, type PositionVesting, type PreSwapLpChangeParams, type PreSwapParams, type PreSwapWithMultiPoolParams, type RedeemOption, type RemoveLiquidityParams, type Rewarder, type RewarderAmountOwned, RewarderModule, RouterErrorCode, type SdkOptions, type SplitPath, type SuiBasicTypes, type SuiInputTypes, type SuiStructTag, type SuiTxArg, SwapErrorCode, type SwapGasEstimateArg, SwapModule, type SwapParams, type SwapResult, type SwapStepResult, SwapUtils, type Tick, type TickData, type TransPreSwapWithMultiPoolParams, TypesErrorCode, UtilsErrorCode, type VestConfigs, VestErrorCode, VestModule, VestUtils, buildClmmPositionName, buildPool, buildPoolTransactionInfo, buildPosition, buildPositionInfo, buildPositionTransactionInfo, buildTickData, buildTickDataByEvent, buildTransferCoin, buildTransferCoinToSender, clmmMainnet, clmmTestnet, computeSwap, computeSwapStep, CetusClmmSDK as default, estPoolAPR, type estPosAPRResult, estPositionAPRWithDeltaMethod, estPositionAPRWithMultiMethod, findAdjustCoin, getDefaultSuiInputType, getLowerSqrtPriceFromCoinA, getLowerSqrtPriceFromCoinB, getUpperSqrtPriceFromCoinA, getUpperSqrtPriceFromCoinB, handleError, handleMessageError, newBits, poolFilterEvenTypes, poolLiquiditySnapshotType, transClmmpoolDataWithoutTicks };
|
|
2389
|
+
export { AMM_SWAP_MODULE, type AddLiquidityCommonParams, type AddLiquidityFixTokenParams, type AddLiquidityParams, type AddLiquidityWithPriceRangeParams, type AdjustResult, BPS, type BasePath, type BigNumber, type Bits, type CalculateAddLiquidityFixCoinWithPriceParams, type CalculateAddLiquidityResult, type CalculateAddLiquidityWithPriceParams, type CalculateCreatePoolResult, type CalculateCreatePoolWithPriceParams, type CalculateRatesParams, type CalculateRatesResult, CetusClmmSDK, type CetusConfigs, type ClmmConfig, ClmmError, type ClmmErrorCode, ClmmExpectSwapModule, ClmmFetcherModule, ClmmIntegratePoolModule, ClmmIntegratePoolV2Module, ClmmIntegratePoolV3Module, ClmmIntegrateRouterModule, ClmmIntegrateRouterWithPartnerModule, ClmmIntegrateUtilsModule, ClmmPartnerModule, type ClmmPoolConfig, ClmmPositionStatus, type ClmmVestInfo, type ClmmpoolData, type ClosePositionParams, type CoinConfig, type CollectFeeParams, type CollectFeesQuote, type CollectRewarderParams, ConfigErrorCode, ConfigModule, type CreatePartnerEvent, type CreatePoolAddLiquidityParams, type CreatePoolAddLiquidityWithPriceParams, type CreatePoolAndAddLiquidityRowResult, type CreatePoolCustomRangeParams, type CreatePoolParams, type CustomRangeParams, DeepbookClobV2Module, DeepbookCustodianV2Module, DeepbookEndpointsV2Module, type FetchParams, type FetchPosFeeParams, type FetchPosRewardParams, type FullRangeParams, type GetPositionInfoListParams, type GetPositionVestOption, type GlobalVestingPeriod, type LaunchpadPoolConfig, type NFT, type OpenPositionParams, type OpenPositionWithPriceParams, POOL_STRUCT, PartnerErrorCode, type PeriodDetail, type Pool, PoolErrorCode, type PoolImmutables, type PoolLiquiditySnapshot, PoolModule, type PoolStatus, type PoolTransactionInfo, type PosRewarderResult, type Position, PositionErrorCode, type PositionInfo, PositionModule, type PositionSnapshot, type PositionTransactionInfo, PositionUtils, type PositionVesting, type PreSwapLpChangeParams, type PreSwapParams, type PreSwapWithMultiPoolParams, type RedeemOption, type RemoveLiquidityParams, type Rewarder, type RewarderAmountOwned, RewarderModule, RouterErrorCode, type SdkOptions, type SplitPath, type SuiBasicTypes, type SuiInputTypes, type SuiStructTag, type SuiTxArg, SwapErrorCode, type SwapGasEstimateArg, SwapModule, type SwapParams, type SwapResult, type SwapStepResult, SwapUtils, type Tick, type TickData, type TransPreSwapWithMultiPoolParams, TypesErrorCode, UtilsErrorCode, type VestConfigs, VestErrorCode, VestModule, VestUtils, buildClmmPositionName, buildPool, buildPoolTransactionInfo, buildPosition, buildPositionInfo, buildPositionTransactionInfo, buildTickData, buildTickDataByEvent, buildTransferCoin, buildTransferCoinToSender, clmmMainnet, clmmTestnet, computeSwap, computeSwapStep, CetusClmmSDK as default, estPoolAPR, type estPosAPRResult, estPositionAPRWithDeltaMethod, estPositionAPRWithMultiMethod, findAdjustCoin, getDefaultSuiInputType, getLowerSqrtPriceFromCoinA, getLowerSqrtPriceFromCoinB, getUpperSqrtPriceFromCoinA, getUpperSqrtPriceFromCoinB, handleError, handleMessageError, newBits, poolFilterEvenTypes, poolLiquiditySnapshotType, transClmmpoolDataWithoutTicks };
|