@cetusprotocol/sui-clmm-sdk 1.4.1 → 1.4.2
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 +4 -0
- package/dist/index.d.ts +304 -23
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -73,7 +73,11 @@ const wallet = 'YOUR_WALLET_ADDRESS'
|
|
|
73
73
|
const sdk = CetusClmmSDK.createSDK({ env })
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
+
<<<<<<< HEAD
|
|
77
|
+
If you wish to set your own full node URL or SuiGrpcClient, you can do so as follows:
|
|
78
|
+
=======
|
|
76
79
|
If you wish to set your own full node URL or SuiJsonRpcClient, you can do so as follows:
|
|
80
|
+
>>>>>>> dev_migrate_json_rpc
|
|
77
81
|
|
|
78
82
|
```typescript
|
|
79
83
|
const sdk = CetusClmmSDK.createSDK({ env, sui_client })
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { CoinPairType, SuiAddressType, SuiObjectIdType, NFT as NFT$1, Percentage, IModule, SuiResource, PaginationArgs, DataPage, PageQuery, CoinAsset, SdkWrapper, BaseSdkOptions, Package, BaseError } from '@cetusprotocol/common-sdk';
|
|
2
|
+
import * as _mysten_sui_bcs from '@mysten/sui/bcs';
|
|
2
3
|
import * as _mysten_sui_transactions from '@mysten/sui/transactions';
|
|
3
4
|
import { TransactionArgument, TransactionObjectArgument, Transaction } from '@mysten/sui/transactions';
|
|
4
5
|
import BN from 'bn.js';
|
|
5
6
|
import Decimal from 'decimal.js';
|
|
6
|
-
import {
|
|
7
|
+
import { SuiTransactionBlockResponse } from '@mysten/sui/jsonRpc';
|
|
7
8
|
|
|
8
9
|
type BasePath = {
|
|
9
10
|
direction: boolean;
|
|
@@ -1423,6 +1424,100 @@ type GetPositionVestOption = {
|
|
|
1423
1424
|
|
|
1424
1425
|
type BigNumber = Decimal.Value | number | string;
|
|
1425
1426
|
|
|
1427
|
+
declare const Coin: _mysten_sui_bcs.BcsStruct<{
|
|
1428
|
+
name: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
1429
|
+
symbol: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
1430
|
+
coingecko_id: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
1431
|
+
pyth_id: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
1432
|
+
decimals: _mysten_sui_bcs.BcsType<number, number, "u8">;
|
|
1433
|
+
logo_url: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
1434
|
+
project_url: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
1435
|
+
coin_type: _mysten_sui_bcs.BcsStruct<{
|
|
1436
|
+
name: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
1437
|
+
}, string>;
|
|
1438
|
+
extension_fields: _mysten_sui_bcs.BcsStruct<{
|
|
1439
|
+
contents: _mysten_sui_bcs.BcsType<{
|
|
1440
|
+
key: string;
|
|
1441
|
+
value: string;
|
|
1442
|
+
}[], Iterable<{
|
|
1443
|
+
key: string;
|
|
1444
|
+
value: string;
|
|
1445
|
+
}> & {
|
|
1446
|
+
length: number;
|
|
1447
|
+
}, string>;
|
|
1448
|
+
}, string>;
|
|
1449
|
+
}, string>;
|
|
1450
|
+
declare const ClmmPool: _mysten_sui_bcs.BcsStruct<{
|
|
1451
|
+
pool_address: _mysten_sui_bcs.BcsType<string, string, "bytes[32]">;
|
|
1452
|
+
pool_type: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
1453
|
+
project_url: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
1454
|
+
is_closed: _mysten_sui_bcs.BcsType<boolean, boolean, "bool">;
|
|
1455
|
+
is_show_rewarder: _mysten_sui_bcs.BcsType<boolean, boolean, "bool">;
|
|
1456
|
+
show_rewarder_1: _mysten_sui_bcs.BcsType<boolean, boolean, "bool">;
|
|
1457
|
+
show_rewarder_2: _mysten_sui_bcs.BcsType<boolean, boolean, "bool">;
|
|
1458
|
+
show_rewarder_3: _mysten_sui_bcs.BcsType<boolean, boolean, "bool">;
|
|
1459
|
+
extension_fields: _mysten_sui_bcs.BcsStruct<{
|
|
1460
|
+
contents: _mysten_sui_bcs.BcsType<{
|
|
1461
|
+
key: string;
|
|
1462
|
+
value: string;
|
|
1463
|
+
}[], Iterable<{
|
|
1464
|
+
key: string;
|
|
1465
|
+
value: string;
|
|
1466
|
+
}> & {
|
|
1467
|
+
length: number;
|
|
1468
|
+
}, string>;
|
|
1469
|
+
}, string>;
|
|
1470
|
+
}, string>;
|
|
1471
|
+
declare const MediaInfo: _mysten_sui_bcs.BcsStruct<{
|
|
1472
|
+
name: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
1473
|
+
link: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
1474
|
+
}, string>;
|
|
1475
|
+
declare const LaunchpadPool: _mysten_sui_bcs.BcsStruct<{
|
|
1476
|
+
pool_address: _mysten_sui_bcs.BcsType<string, string, "bytes[32]">;
|
|
1477
|
+
is_closed: _mysten_sui_bcs.BcsType<boolean, boolean, "bool">;
|
|
1478
|
+
show_settle: _mysten_sui_bcs.BcsType<boolean, boolean, "bool">;
|
|
1479
|
+
coin_symbol: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
1480
|
+
coin_name: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
1481
|
+
coin_icon: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
1482
|
+
banners: _mysten_sui_bcs.BcsType<string[], Iterable<string> & {
|
|
1483
|
+
length: number;
|
|
1484
|
+
}, string>;
|
|
1485
|
+
introduction: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
1486
|
+
website: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
1487
|
+
tokenomics: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
1488
|
+
social_media: _mysten_sui_bcs.BcsStruct<{
|
|
1489
|
+
contents: _mysten_sui_bcs.BcsType<{
|
|
1490
|
+
key: string;
|
|
1491
|
+
value: {
|
|
1492
|
+
name: string;
|
|
1493
|
+
link: string;
|
|
1494
|
+
};
|
|
1495
|
+
}[], Iterable<{
|
|
1496
|
+
key: string;
|
|
1497
|
+
value: {
|
|
1498
|
+
name: string;
|
|
1499
|
+
link: string;
|
|
1500
|
+
};
|
|
1501
|
+
}> & {
|
|
1502
|
+
length: number;
|
|
1503
|
+
}, string>;
|
|
1504
|
+
}, string>;
|
|
1505
|
+
terms: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
1506
|
+
white_list_terms: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
1507
|
+
regulation: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
1508
|
+
project_details: _mysten_sui_bcs.BcsType<string, string, "string">;
|
|
1509
|
+
extension_fields: _mysten_sui_bcs.BcsStruct<{
|
|
1510
|
+
contents: _mysten_sui_bcs.BcsType<{
|
|
1511
|
+
key: string;
|
|
1512
|
+
value: string;
|
|
1513
|
+
}[], Iterable<{
|
|
1514
|
+
key: string;
|
|
1515
|
+
value: string;
|
|
1516
|
+
}> & {
|
|
1517
|
+
length: number;
|
|
1518
|
+
}, string>;
|
|
1519
|
+
}, string>;
|
|
1520
|
+
}, string>;
|
|
1426
1521
|
/**
|
|
1427
1522
|
* Helper class to help interact with clmm pool and coin and launchpad pool config.
|
|
1428
1523
|
*/
|
|
@@ -1459,7 +1554,6 @@ declare class ConfigModule implements IModule<CetusClmmSDK> {
|
|
|
1459
1554
|
getCoinConfig(coin_type: string, force_refresh?: boolean, transform_extensions?: boolean): Promise<CoinConfig>;
|
|
1460
1555
|
/**
|
|
1461
1556
|
* Build coin config.
|
|
1462
|
-
* @param {SuiObjectResponse} object Coin object.
|
|
1463
1557
|
* @param {boolean} transform_extensions Whether to transform extensions.
|
|
1464
1558
|
* @returns {CoinConfig} Coin config.
|
|
1465
1559
|
*/
|
|
@@ -1581,7 +1675,7 @@ declare class PoolModule implements IModule<CetusClmmSDK> {
|
|
|
1581
1675
|
* @returns the ClmmConfig object.
|
|
1582
1676
|
*/
|
|
1583
1677
|
getClmmConfigs(force_refresh?: boolean): Promise<ClmmConfig>;
|
|
1584
|
-
getPoolTransactionList({ pool_id, pagination_args,
|
|
1678
|
+
getPoolTransactionList({ pool_id, pagination_args, full_rpc_url, }: {
|
|
1585
1679
|
pool_id: string;
|
|
1586
1680
|
full_rpc_url?: string;
|
|
1587
1681
|
pagination_args: PageQuery;
|
|
@@ -1652,7 +1746,7 @@ declare class PoolModule implements IModule<CetusClmmSDK> {
|
|
|
1652
1746
|
* @param {string}partner Partner object id
|
|
1653
1747
|
* @returns {Promise<CoinAsset[]>} A promise that resolves to an array of coin asset.
|
|
1654
1748
|
*/
|
|
1655
|
-
getPartnerRefFeeAmount(partner: string
|
|
1749
|
+
getPartnerRefFeeAmount(partner: string): Promise<CoinAsset[]>;
|
|
1656
1750
|
/**
|
|
1657
1751
|
* Claim partner ref fee.
|
|
1658
1752
|
* @param {string} partner_cap partner cap id.
|
|
@@ -1718,24 +1812,22 @@ declare class PositionModule implements IModule<CetusClmmSDK> {
|
|
|
1718
1812
|
* if you want to get a position, you can use getPositionById method directly.
|
|
1719
1813
|
* @param {string} position_handle The handle of the position to get.
|
|
1720
1814
|
* @param {string} position_id The ID of the position to get.
|
|
1721
|
-
* @param {boolean} calculate_rewarder Whether to calculate the rewarder of the position.
|
|
1722
1815
|
* @returns {Promise<Position>} Position object.
|
|
1723
1816
|
*/
|
|
1724
|
-
getPosition(position_handle: string, position_id: string, calculate_rewarder?: boolean
|
|
1817
|
+
getPosition(position_handle: string, position_id: string, calculate_rewarder?: boolean): Promise<Position>;
|
|
1725
1818
|
/**
|
|
1726
1819
|
* Gets a position by its ID.
|
|
1727
1820
|
* @param {string} position_id The ID of the position to get.
|
|
1728
1821
|
* @param {boolean} calculate_rewarder Whether to calculate the rewarder of the position.
|
|
1729
|
-
* @param {boolean} show_display When some testnet rpc nodes can't return object's display data, you can set this option to false to avoid returning errors. Default is true.
|
|
1730
1822
|
* @returns {Promise<Position>} Position object.
|
|
1731
1823
|
*/
|
|
1732
|
-
getPositionById(position_id: string, calculate_rewarder?: boolean
|
|
1824
|
+
getPositionById(position_id: string, calculate_rewarder?: boolean): Promise<Position>;
|
|
1733
1825
|
/**
|
|
1734
1826
|
* Gets a simple position for the given position ID.
|
|
1735
1827
|
* @param {string} position_id The ID of the position to get.
|
|
1736
1828
|
* @returns {Promise<Position>} Position object.
|
|
1737
1829
|
*/
|
|
1738
|
-
getSimplePosition(position_id: string
|
|
1830
|
+
getSimplePosition(position_id: string): Promise<Position>;
|
|
1739
1831
|
/**
|
|
1740
1832
|
* Gets a simple position for the given position ID.
|
|
1741
1833
|
* @param {string} position_id Position object id
|
|
@@ -1764,7 +1856,7 @@ declare class PositionModule implements IModule<CetusClmmSDK> {
|
|
|
1764
1856
|
getPositionInfo(position_handle: string, position_id: string): Promise<PositionInfo>;
|
|
1765
1857
|
getPositionInfoList(options: GetPositionInfoListParams[]): Promise<PositionInfo[]>;
|
|
1766
1858
|
buildFetchPosFee(params: FetchPosFeeParams, tx: Transaction): void;
|
|
1767
|
-
parsedPosFeeData(simulate_res:
|
|
1859
|
+
parsedPosFeeData(simulate_res: any): Record<string, {
|
|
1768
1860
|
position_id: string;
|
|
1769
1861
|
fee_owned_a: string;
|
|
1770
1862
|
fee_owned_b: string;
|
|
@@ -1914,7 +2006,7 @@ declare class RewarderModule implements IModule<CetusClmmSDK> {
|
|
|
1914
2006
|
* @returns
|
|
1915
2007
|
*/
|
|
1916
2008
|
fetchPosRewardersAmount(params: FetchPosRewardParams[]): Promise<PosRewarderResult[]>;
|
|
1917
|
-
parsedPosRewardData(simulate_res:
|
|
2009
|
+
parsedPosRewardData(simulate_res: any): Record<string, {
|
|
1918
2010
|
position_id: string;
|
|
1919
2011
|
rewarder_amount: string[];
|
|
1920
2012
|
}>;
|
|
@@ -1986,10 +2078,10 @@ declare class SwapModule implements IModule<CetusClmmSDK> {
|
|
|
1986
2078
|
pool_address: string;
|
|
1987
2079
|
current_sqrt_price: number;
|
|
1988
2080
|
estimated_amount_in: string;
|
|
1989
|
-
estimated_amount_out:
|
|
1990
|
-
estimated_end_sqrt_price:
|
|
1991
|
-
estimated_fee_amount:
|
|
1992
|
-
is_exceed:
|
|
2081
|
+
estimated_amount_out: string;
|
|
2082
|
+
estimated_end_sqrt_price: string;
|
|
2083
|
+
estimated_fee_amount: string;
|
|
2084
|
+
is_exceed: boolean;
|
|
1993
2085
|
amount: string;
|
|
1994
2086
|
a2b: boolean;
|
|
1995
2087
|
by_amount_in: boolean;
|
|
@@ -2142,12 +2234,12 @@ declare class CetusClmmSDK extends SdkWrapper<SdkOptions> {
|
|
|
2142
2234
|
* @param {SuiObjectResponse} objects - The SuiObjectResponse containing information about the pool.
|
|
2143
2235
|
* @returns {Pool} - The built Pool object.
|
|
2144
2236
|
*/
|
|
2145
|
-
declare function buildPool(objects:
|
|
2237
|
+
declare function buildPool(objects: any): Pool;
|
|
2146
2238
|
/** Builds a Position object based on a SuiObjectResponse.
|
|
2147
2239
|
* @param {SuiObjectResponse} object - The SuiObjectResponse containing information about the position.
|
|
2148
2240
|
* @returns {Position} - The built Position object.
|
|
2149
2241
|
*/
|
|
2150
|
-
declare function buildPosition(object:
|
|
2242
|
+
declare function buildPosition(object: any): Position;
|
|
2151
2243
|
/**
|
|
2152
2244
|
* Builds a PositionReward object based on a response containing information about the reward.
|
|
2153
2245
|
* @param {any} fields - The response containing information about the reward.
|
|
@@ -2160,7 +2252,7 @@ declare function buildPositionInfo(fields: any): PositionInfo;
|
|
|
2160
2252
|
* @param {SuiObjectResponse} objects - The response containing information about tick data.
|
|
2161
2253
|
* @returns {TickData} - The built TickData object.
|
|
2162
2254
|
*/
|
|
2163
|
-
declare function buildTickData(objects:
|
|
2255
|
+
declare function buildTickData(objects: any): TickData;
|
|
2164
2256
|
/**
|
|
2165
2257
|
* Builds a TickData object based on a given event's fields.
|
|
2166
2258
|
* @param {any} fields - The fields of an event.
|
|
@@ -2170,7 +2262,7 @@ declare function buildTickData(objects: SuiObjectResponse): TickData;
|
|
|
2170
2262
|
declare function buildTickDataByEvent(fields: any): TickData;
|
|
2171
2263
|
declare function buildClmmPositionName(pool_index: number, position_index: number): string;
|
|
2172
2264
|
declare function buildPositionTransactionInfo(data: SuiTransactionBlockResponse, txIndex: number, filterIds: string[]): PositionTransactionInfo[];
|
|
2173
|
-
declare function buildPoolTransactionInfo(
|
|
2265
|
+
declare function buildPoolTransactionInfo(rawData: any, txIndex: number, package_ids: string[], pool_id: string): PoolTransactionInfo[];
|
|
2174
2266
|
declare function buildTransferCoinToSender(sdk: CetusClmmSDK, tx: Transaction, coin: TransactionObjectArgument, coinType: string): void;
|
|
2175
2267
|
declare function buildTransferCoin(sdk: CetusClmmSDK, tx: Transaction, coin: TransactionObjectArgument, coinType: string, recipient?: string): void;
|
|
2176
2268
|
|
|
@@ -2297,12 +2389,201 @@ declare function getUpperSqrtPriceFromCoinB(amount: BN, liquidity: BN, sqrt_pric
|
|
|
2297
2389
|
|
|
2298
2390
|
declare const BPS = 10000;
|
|
2299
2391
|
declare class VestUtils {
|
|
2300
|
-
static parseClmmVestInfo(res:
|
|
2392
|
+
static parseClmmVestInfo(res: any): ClmmVestInfo;
|
|
2301
2393
|
static parsePositionVesting(fields: any): PositionVesting;
|
|
2302
|
-
static parsePoolLiquiditySnapshot(res:
|
|
2303
|
-
static parsePositionSnapshot(res:
|
|
2394
|
+
static parsePoolLiquiditySnapshot(res: any): PoolLiquiditySnapshot;
|
|
2395
|
+
static parsePositionSnapshot(res: any): PositionSnapshot;
|
|
2304
2396
|
}
|
|
2305
2397
|
|
|
2398
|
+
declare const PositionRewardRaw: _mysten_sui_bcs.BcsStruct<{
|
|
2399
|
+
growth_inside: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u128">;
|
|
2400
|
+
amount_owned: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
2401
|
+
}, string>;
|
|
2402
|
+
declare const PositionInfoRaw: _mysten_sui_bcs.BcsStruct<{
|
|
2403
|
+
position_id: _mysten_sui_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
2404
|
+
liquidity: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u128">;
|
|
2405
|
+
tick_lower_index: _mysten_sui_bcs.BcsType<number, number, "u32">;
|
|
2406
|
+
tick_upper_index: _mysten_sui_bcs.BcsType<number, number, "u32">;
|
|
2407
|
+
fee_growth_inside_a: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u128">;
|
|
2408
|
+
fee_growth_inside_b: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u128">;
|
|
2409
|
+
fee_owned_a: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
2410
|
+
fee_owned_b: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
2411
|
+
points_owned: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u128">;
|
|
2412
|
+
points_growth_inside: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u128">;
|
|
2413
|
+
rewards: _mysten_sui_bcs.BcsType<{
|
|
2414
|
+
growth_inside: string;
|
|
2415
|
+
amount_owned: string;
|
|
2416
|
+
}[], Iterable<{
|
|
2417
|
+
growth_inside: string | number | bigint;
|
|
2418
|
+
amount_owned: string | number | bigint;
|
|
2419
|
+
}> & {
|
|
2420
|
+
length: number;
|
|
2421
|
+
}, string>;
|
|
2422
|
+
}, string>;
|
|
2423
|
+
declare const NodeIDPositionInfo: _mysten_sui_bcs.BcsStruct<{
|
|
2424
|
+
prev: _mysten_sui_bcs.BcsType<Uint8Array<ArrayBufferLike> | null, Iterable<number> | null | undefined, "Option<bytes[32]>">;
|
|
2425
|
+
next: _mysten_sui_bcs.BcsType<Uint8Array<ArrayBufferLike> | null, Iterable<number> | null | undefined, "Option<bytes[32]>">;
|
|
2426
|
+
value: _mysten_sui_bcs.BcsStruct<{
|
|
2427
|
+
position_id: _mysten_sui_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
2428
|
+
liquidity: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u128">;
|
|
2429
|
+
tick_lower_index: _mysten_sui_bcs.BcsType<number, number, "u32">;
|
|
2430
|
+
tick_upper_index: _mysten_sui_bcs.BcsType<number, number, "u32">;
|
|
2431
|
+
fee_growth_inside_a: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u128">;
|
|
2432
|
+
fee_growth_inside_b: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u128">;
|
|
2433
|
+
fee_owned_a: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
2434
|
+
fee_owned_b: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
2435
|
+
points_owned: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u128">;
|
|
2436
|
+
points_growth_inside: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u128">;
|
|
2437
|
+
rewards: _mysten_sui_bcs.BcsType<{
|
|
2438
|
+
growth_inside: string;
|
|
2439
|
+
amount_owned: string;
|
|
2440
|
+
}[], Iterable<{
|
|
2441
|
+
growth_inside: string | number | bigint;
|
|
2442
|
+
amount_owned: string | number | bigint;
|
|
2443
|
+
}> & {
|
|
2444
|
+
length: number;
|
|
2445
|
+
}, string>;
|
|
2446
|
+
}, string>;
|
|
2447
|
+
}, string>;
|
|
2448
|
+
declare const FetchPositionsEventRaw: _mysten_sui_bcs.BcsStruct<{
|
|
2449
|
+
positions: _mysten_sui_bcs.BcsType<{
|
|
2450
|
+
position_id: string;
|
|
2451
|
+
liquidity: string;
|
|
2452
|
+
tick_lower_index: number;
|
|
2453
|
+
tick_upper_index: number;
|
|
2454
|
+
fee_growth_inside_a: string;
|
|
2455
|
+
fee_growth_inside_b: string;
|
|
2456
|
+
fee_owned_a: string;
|
|
2457
|
+
fee_owned_b: string;
|
|
2458
|
+
points_owned: string;
|
|
2459
|
+
points_growth_inside: string;
|
|
2460
|
+
rewards: {
|
|
2461
|
+
growth_inside: string;
|
|
2462
|
+
amount_owned: string;
|
|
2463
|
+
}[];
|
|
2464
|
+
}[], Iterable<{
|
|
2465
|
+
position_id: string | Uint8Array<ArrayBufferLike>;
|
|
2466
|
+
liquidity: string | number | bigint;
|
|
2467
|
+
tick_lower_index: number;
|
|
2468
|
+
tick_upper_index: number;
|
|
2469
|
+
fee_growth_inside_a: string | number | bigint;
|
|
2470
|
+
fee_growth_inside_b: string | number | bigint;
|
|
2471
|
+
fee_owned_a: string | number | bigint;
|
|
2472
|
+
fee_owned_b: string | number | bigint;
|
|
2473
|
+
points_owned: string | number | bigint;
|
|
2474
|
+
points_growth_inside: string | number | bigint;
|
|
2475
|
+
rewards: Iterable<{
|
|
2476
|
+
growth_inside: string | number | bigint;
|
|
2477
|
+
amount_owned: string | number | bigint;
|
|
2478
|
+
}> & {
|
|
2479
|
+
length: number;
|
|
2480
|
+
};
|
|
2481
|
+
}> & {
|
|
2482
|
+
length: number;
|
|
2483
|
+
}, string>;
|
|
2484
|
+
}, string>;
|
|
2485
|
+
declare const TickRaw: _mysten_sui_bcs.BcsStruct<{
|
|
2486
|
+
index: _mysten_sui_bcs.BcsType<number, number, "u32">;
|
|
2487
|
+
sqrt_price: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u128">;
|
|
2488
|
+
liquidity_net: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u128">;
|
|
2489
|
+
liquidity_gross: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u128">;
|
|
2490
|
+
fee_growth_outside_a: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u128">;
|
|
2491
|
+
fee_growth_outside_b: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u128">;
|
|
2492
|
+
points_growth_outside: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u128">;
|
|
2493
|
+
rewards_growth_outside: _mysten_sui_bcs.BcsType<string[], Iterable<string | number | bigint> & {
|
|
2494
|
+
length: number;
|
|
2495
|
+
}, string>;
|
|
2496
|
+
}, string>;
|
|
2497
|
+
declare const FetchTicksResultEventRaw: _mysten_sui_bcs.BcsStruct<{
|
|
2498
|
+
ticks: _mysten_sui_bcs.BcsType<{
|
|
2499
|
+
index: number;
|
|
2500
|
+
sqrt_price: string;
|
|
2501
|
+
liquidity_net: string;
|
|
2502
|
+
liquidity_gross: string;
|
|
2503
|
+
fee_growth_outside_a: string;
|
|
2504
|
+
fee_growth_outside_b: string;
|
|
2505
|
+
points_growth_outside: string;
|
|
2506
|
+
rewards_growth_outside: string[];
|
|
2507
|
+
}[], Iterable<{
|
|
2508
|
+
index: number;
|
|
2509
|
+
sqrt_price: string | number | bigint;
|
|
2510
|
+
liquidity_net: string | number | bigint;
|
|
2511
|
+
liquidity_gross: string | number | bigint;
|
|
2512
|
+
fee_growth_outside_a: string | number | bigint;
|
|
2513
|
+
fee_growth_outside_b: string | number | bigint;
|
|
2514
|
+
points_growth_outside: string | number | bigint;
|
|
2515
|
+
rewards_growth_outside: Iterable<string | number | bigint> & {
|
|
2516
|
+
length: number;
|
|
2517
|
+
};
|
|
2518
|
+
}> & {
|
|
2519
|
+
length: number;
|
|
2520
|
+
}, string>;
|
|
2521
|
+
}, string>;
|
|
2522
|
+
declare const FetchPositionRewardsEventRaw: _mysten_sui_bcs.BcsStruct<{
|
|
2523
|
+
data: _mysten_sui_bcs.BcsType<string[], Iterable<string | number | bigint> & {
|
|
2524
|
+
length: number;
|
|
2525
|
+
}, string>;
|
|
2526
|
+
position_id: _mysten_sui_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
2527
|
+
}, string>;
|
|
2528
|
+
declare const FetchPositionFeesEventRaw: _mysten_sui_bcs.BcsStruct<{
|
|
2529
|
+
position_id: _mysten_sui_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
2530
|
+
fee_owned_a: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
2531
|
+
fee_owned_b: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
2532
|
+
}, string>;
|
|
2533
|
+
declare const CalculatedSwapResultEventRaw: _mysten_sui_bcs.BcsStruct<{
|
|
2534
|
+
data: _mysten_sui_bcs.BcsStruct<{
|
|
2535
|
+
amount_in: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
2536
|
+
amount_out: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
2537
|
+
fee_amount: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
2538
|
+
fee_rate: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
2539
|
+
after_sqrt_price: _mysten_sui_bcs.BcsType<string, string | number | bigint, "u128">;
|
|
2540
|
+
is_exceed: _mysten_sui_bcs.BcsType<boolean, boolean, "bool">;
|
|
2541
|
+
}, string>;
|
|
2542
|
+
}, string>;
|
|
2543
|
+
declare const GetPositionsVestingEventRaw: _mysten_sui_bcs.BcsStruct<{
|
|
2544
|
+
data: _mysten_sui_bcs.BcsType<{
|
|
2545
|
+
position_id: string;
|
|
2546
|
+
cetus_amount: string;
|
|
2547
|
+
redeemed_amount: string;
|
|
2548
|
+
coin_a: {
|
|
2549
|
+
name: string;
|
|
2550
|
+
};
|
|
2551
|
+
coin_b: {
|
|
2552
|
+
name: string;
|
|
2553
|
+
};
|
|
2554
|
+
impaired_a: string;
|
|
2555
|
+
impaired_b: string;
|
|
2556
|
+
period_details: {
|
|
2557
|
+
period: string;
|
|
2558
|
+
cetus_amount: string;
|
|
2559
|
+
is_redeemed: boolean;
|
|
2560
|
+
}[];
|
|
2561
|
+
is_paused: boolean;
|
|
2562
|
+
}[], Iterable<{
|
|
2563
|
+
position_id: string | Uint8Array<ArrayBufferLike>;
|
|
2564
|
+
cetus_amount: string | number | bigint;
|
|
2565
|
+
redeemed_amount: string | number | bigint;
|
|
2566
|
+
coin_a: {
|
|
2567
|
+
name: string;
|
|
2568
|
+
};
|
|
2569
|
+
coin_b: {
|
|
2570
|
+
name: string;
|
|
2571
|
+
};
|
|
2572
|
+
impaired_a: string | number | bigint;
|
|
2573
|
+
impaired_b: string | number | bigint;
|
|
2574
|
+
period_details: Iterable<{
|
|
2575
|
+
period: string | number | bigint;
|
|
2576
|
+
cetus_amount: string | number | bigint;
|
|
2577
|
+
is_redeemed: boolean;
|
|
2578
|
+
}> & {
|
|
2579
|
+
length: number;
|
|
2580
|
+
};
|
|
2581
|
+
is_paused: boolean;
|
|
2582
|
+
}> & {
|
|
2583
|
+
length: number;
|
|
2584
|
+
}, string>;
|
|
2585
|
+
}, string>;
|
|
2586
|
+
|
|
2306
2587
|
declare function estPoolAPR(pre_block_reward: BN, reward_price: BN, total_trading_fee: BN, total_liquidity_value: BN): BN;
|
|
2307
2588
|
type estPosAPRResult = {
|
|
2308
2589
|
fee_apr: Decimal;
|
|
@@ -2388,4 +2669,4 @@ declare class ClmmError extends BaseError {
|
|
|
2388
2669
|
declare const handleError: (code: ClmmErrorCode, error: Error, details?: Record<string, any>) => never;
|
|
2389
2670
|
declare const handleMessageError: (code: ClmmErrorCode, message: string, details?: Record<string, any>) => never;
|
|
2390
2671
|
|
|
2391
|
-
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 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, 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, eventMainnetContractMaps, eventTestnetContractMaps, findAdjustCoin, getDefaultSuiInputType, getLowerSqrtPriceFromCoinA, getLowerSqrtPriceFromCoinB, getUpperSqrtPriceFromCoinA, getUpperSqrtPriceFromCoinB, handleError, handleMessageError, newBits, poolFilterEvenTypes, poolLiquiditySnapshotType, transClmmpoolDataWithoutTicks };
|
|
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 };
|