@cetusprotocol/sui-clmm-sdk 1.4.2 → 1.4.4
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.ts +47 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +8 -7
package/dist/index.d.ts
CHANGED
|
@@ -1615,6 +1615,19 @@ declare class PoolModule implements IModule<CetusClmmSDK> {
|
|
|
1615
1615
|
protected _sdk: CetusClmmSDK;
|
|
1616
1616
|
constructor(sdk: CetusClmmSDK);
|
|
1617
1617
|
get sdk(): CetusClmmSDK;
|
|
1618
|
+
/**
|
|
1619
|
+
* Computes the pool key ID for (coin_type_a, coin_type_b, tick_spacing).
|
|
1620
|
+
* Matches `cetus_clmm::factory::new_pool_key`. Coin types must satisfy coin_type_a > coin_type_b.
|
|
1621
|
+
*/
|
|
1622
|
+
buildPoolKey(coin_type_a: string, coin_type_b: string, tick_spacing: number): string;
|
|
1623
|
+
/**
|
|
1624
|
+
* Resolves a pool object ID from coin types and tick spacing via the factory pools indexer.
|
|
1625
|
+
*/
|
|
1626
|
+
getPoolAddress(coin_type_a: string, coin_type_b: string, tick_spacing: number): Promise<string | undefined>;
|
|
1627
|
+
/**
|
|
1628
|
+
* Returns the linked table handle that indexes pools by pool key.
|
|
1629
|
+
*/
|
|
1630
|
+
private getPoolsListHandle;
|
|
1618
1631
|
/**
|
|
1619
1632
|
* Gets a list of positions for the given positionHandle.
|
|
1620
1633
|
* @param {string} position_handle The handle for the position.
|
|
@@ -2288,6 +2301,12 @@ declare class PositionUtils {
|
|
|
2288
2301
|
static checkCoinThreshold(sdk: CetusClmmSDK, by_amount_in: boolean, tx: Transaction, coin: TransactionObjectArgument, amount_limit: number, coin_type: string): void;
|
|
2289
2302
|
}
|
|
2290
2303
|
|
|
2304
|
+
/**
|
|
2305
|
+
* Computes the CLMM pool key ID, matching `cetus_clmm::factory::new_pool_key`.
|
|
2306
|
+
* Coin types must be in canonical order: coin_type_a > coin_type_b (lexicographic).
|
|
2307
|
+
*/
|
|
2308
|
+
declare function buildPoolKey(coin_type_a: string, coin_type_b: string, tick_spacing: number): string;
|
|
2309
|
+
|
|
2291
2310
|
declare class SwapUtils {
|
|
2292
2311
|
/**
|
|
2293
2312
|
* Get the default sqrt price limit for a swap.
|
|
@@ -2530,6 +2549,32 @@ declare const FetchPositionFeesEventRaw: _mysten_sui_bcs.BcsStruct<{
|
|
|
2530
2549
|
fee_owned_a: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
2531
2550
|
fee_owned_b: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
2532
2551
|
}, string>;
|
|
2552
|
+
declare const PoolSimpleInfoRaw: _mysten_sui_bcs.BcsStruct<{
|
|
2553
|
+
pool_id: _mysten_sui_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
2554
|
+
pool_key: _mysten_sui_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
2555
|
+
coin_type_a: _mysten_sui_bcs.BcsStruct<{
|
|
2556
|
+
name: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
2557
|
+
}, string>;
|
|
2558
|
+
coin_type_b: _mysten_sui_bcs.BcsStruct<{
|
|
2559
|
+
name: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
2560
|
+
}, string>;
|
|
2561
|
+
tick_spacing: _mysten_sui_bcs.BcsType<number, number, "u32">;
|
|
2562
|
+
}, string>;
|
|
2563
|
+
declare const NodeIDPoolSimpleInfo: _mysten_sui_bcs.BcsStruct<{
|
|
2564
|
+
prev: _mysten_sui_bcs.BcsType<Uint8Array<ArrayBufferLike> | null, Iterable<number> | null | undefined, "Option<bytes[32]>">;
|
|
2565
|
+
next: _mysten_sui_bcs.BcsType<Uint8Array<ArrayBufferLike> | null, Iterable<number> | null | undefined, "Option<bytes[32]>">;
|
|
2566
|
+
value: _mysten_sui_bcs.BcsStruct<{
|
|
2567
|
+
pool_id: _mysten_sui_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
2568
|
+
pool_key: _mysten_sui_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
2569
|
+
coin_type_a: _mysten_sui_bcs.BcsStruct<{
|
|
2570
|
+
name: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
2571
|
+
}, string>;
|
|
2572
|
+
coin_type_b: _mysten_sui_bcs.BcsStruct<{
|
|
2573
|
+
name: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
2574
|
+
}, string>;
|
|
2575
|
+
tick_spacing: _mysten_sui_bcs.BcsType<number, number, "u32">;
|
|
2576
|
+
}, string>;
|
|
2577
|
+
}, string>;
|
|
2533
2578
|
declare const CalculatedSwapResultEventRaw: _mysten_sui_bcs.BcsStruct<{
|
|
2534
2579
|
data: _mysten_sui_bcs.BcsStruct<{
|
|
2535
2580
|
amount_in: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
@@ -2619,6 +2664,7 @@ declare enum PositionErrorCode {
|
|
|
2619
2664
|
FetchError = "FetchError"
|
|
2620
2665
|
}
|
|
2621
2666
|
declare enum PoolErrorCode {
|
|
2667
|
+
SameCoinType = "SameCoinType",
|
|
2622
2668
|
InvalidCoinTypeSequence = "InvalidCoinTypeSequence",
|
|
2623
2669
|
InvalidTickIndex = "InvalidTickIndex",
|
|
2624
2670
|
InvalidPoolObject = "InvalidPoolObject",
|
|
@@ -2669,4 +2715,4 @@ declare class ClmmError extends BaseError {
|
|
|
2669
2715
|
declare const handleError: (code: ClmmErrorCode, error: Error, details?: Record<string, any>) => never;
|
|
2670
2716
|
declare const handleMessageError: (code: ClmmErrorCode, message: string, details?: Record<string, any>) => never;
|
|
2671
2717
|
|
|
2672
|
-
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, CalculatedSwapResultEventRaw, CetusClmmSDK, type CetusConfigs, type ClmmConfig, ClmmError, type ClmmErrorCode, ClmmExpectSwapModule, ClmmFetcherModule, ClmmIntegratePoolModule, ClmmIntegratePoolV2Module, ClmmIntegratePoolV3Module, ClmmIntegrateRouterModule, ClmmIntegrateRouterWithPartnerModule, ClmmIntegrateUtilsModule, ClmmPartnerModule, ClmmPool, type ClmmPoolConfig, ClmmPositionStatus, type ClmmVestInfo, type ClmmpoolData, type ClosePositionParams, Coin, type CoinConfig, type CollectFeeParams, type CollectFeesQuote, type CollectRewarderAndReturnCoinParams, 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, FetchPositionFeesEventRaw, FetchPositionRewardsEventRaw, FetchPositionsEventRaw, FetchTicksResultEventRaw, type FullRangeParams, type GetPositionInfoListParams, type GetPositionVestOption, GetPositionsVestingEventRaw, type GlobalVestingPeriod, LaunchpadPool, type LaunchpadPoolConfig, MediaInfo, type NFT, NodeIDPositionInfo, 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, PositionInfoRaw, PositionModule, PositionRewardRaw, 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, TickRaw, 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, eventMainnetContractMaps, eventTestnetContractMaps, findAdjustCoin, getDefaultSuiInputType, getLowerSqrtPriceFromCoinA, getLowerSqrtPriceFromCoinB, getUpperSqrtPriceFromCoinA, getUpperSqrtPriceFromCoinB, handleError, handleMessageError, newBits, poolFilterEvenTypes, poolLiquiditySnapshotType, transClmmpoolDataWithoutTicks };
|
|
2718
|
+
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, CalculatedSwapResultEventRaw, CetusClmmSDK, type CetusConfigs, type ClmmConfig, ClmmError, type ClmmErrorCode, ClmmExpectSwapModule, ClmmFetcherModule, ClmmIntegratePoolModule, ClmmIntegratePoolV2Module, ClmmIntegratePoolV3Module, ClmmIntegrateRouterModule, ClmmIntegrateRouterWithPartnerModule, ClmmIntegrateUtilsModule, ClmmPartnerModule, ClmmPool, type ClmmPoolConfig, ClmmPositionStatus, type ClmmVestInfo, type ClmmpoolData, type ClosePositionParams, Coin, type CoinConfig, type CollectFeeParams, type CollectFeesQuote, type CollectRewarderAndReturnCoinParams, 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, FetchPositionFeesEventRaw, FetchPositionRewardsEventRaw, FetchPositionsEventRaw, FetchTicksResultEventRaw, type FullRangeParams, type GetPositionInfoListParams, type GetPositionVestOption, GetPositionsVestingEventRaw, type GlobalVestingPeriod, LaunchpadPool, type LaunchpadPoolConfig, MediaInfo, type NFT, NodeIDPoolSimpleInfo, NodeIDPositionInfo, type OpenPositionParams, type OpenPositionWithPriceParams, POOL_STRUCT, PartnerErrorCode, type PeriodDetail, type Pool, PoolErrorCode, type PoolImmutables, type PoolLiquiditySnapshot, PoolModule, PoolSimpleInfoRaw, type PoolStatus, type PoolTransactionInfo, type PosRewarderResult, type Position, PositionErrorCode, type PositionInfo, PositionInfoRaw, PositionModule, PositionRewardRaw, 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, TickRaw, type TransPreSwapWithMultiPoolParams, TypesErrorCode, UtilsErrorCode, type VestConfigs, VestErrorCode, VestModule, VestUtils, buildClmmPositionName, buildPool, buildPoolKey, buildPoolTransactionInfo, buildPosition, buildPositionInfo, buildPositionTransactionInfo, buildTickData, buildTickDataByEvent, buildTransferCoin, buildTransferCoinToSender, clmmMainnet, clmmTestnet, computeSwap, computeSwapStep, CetusClmmSDK as default, estPoolAPR, type estPosAPRResult, estPositionAPRWithDeltaMethod, estPositionAPRWithMultiMethod, eventMainnetContractMaps, eventTestnetContractMaps, findAdjustCoin, getDefaultSuiInputType, getLowerSqrtPriceFromCoinA, getLowerSqrtPriceFromCoinB, getUpperSqrtPriceFromCoinA, getUpperSqrtPriceFromCoinB, handleError, handleMessageError, newBits, poolFilterEvenTypes, poolLiquiditySnapshotType, transClmmpoolDataWithoutTicks };
|