@cetusprotocol/aggregator-sdk 0.0.0-experimental-20250829185106 → 0.0.0-experimental-20250903203111
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 +8 -52
- package/dist/index.d.ts +8 -52
- package/dist/index.js +51 -276
- package/dist/index.mjs +52 -276
- package/package.json +1 -1
- package/test.json +267 -0
- package/benchmark-results/benchmark-results-2025-07-17T12-03-15-563Z.csv +0 -3
- package/benchmark-results/benchmark-results-2025-07-17T12-03-15-563Z.json +0 -56
- package/benchmark-results/benchmark-results-2025-07-17T12-03-34-148Z.csv +0 -3
- package/benchmark-results/benchmark-results-2025-07-17T12-03-34-148Z.json +0 -56
- package/benchmark-results/benchmark-results-2025-07-21T03-31-59-263Z.csv +0 -21
- package/benchmark-results/benchmark-results-2025-07-21T03-31-59-263Z.json +0 -444
- package/benchmark-results/benchmark-results-2025-07-21T07-54-54-916Z.csv +0 -21
- package/benchmark-results/benchmark-results-2025-07-21T07-54-54-916Z.json +0 -503
- package/benchmark-results/error-report-2025-07-17T12-03-34-148Z.md +0 -18
- package/benchmark-results/error-report-2025-07-21T03-31-59-263Z.md +0 -18
- package/benchmark-results/error-report-2025-07-21T07-54-54-916Z.md +0 -18
- package/benchmark-results/gas-analysis-report-2025-07-17T12-03-15-563Z.md +0 -80
- package/benchmark-results/gas-analysis-report-2025-07-17T12-03-34-148Z.md +0 -80
- package/benchmark-results/gas-analysis-report-2025-07-21T03-31-59-263Z.md +0 -296
- package/benchmark-results/gas-analysis-report-2025-07-21T07-54-54-916Z.md +0 -323
- package/examples/mergeSwapExample.ts +0 -142
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _mysten_sui_client from '@mysten/sui/client';
|
|
2
2
|
import { SuiClient, DevInspectResults, SuiMoveObject } from '@mysten/sui/client';
|
|
3
|
-
import {
|
|
3
|
+
import { Transaction, TransactionObjectArgument, TransactionArgument } from '@mysten/sui/transactions';
|
|
4
4
|
import BN from 'bn.js';
|
|
5
5
|
import Decimal from 'decimal.js';
|
|
6
6
|
import { SuiPriceServiceConnection, SuiPythClient } from '@pythnetwork/pyth-sui-js';
|
|
@@ -18,35 +18,6 @@ interface FindRouterParams {
|
|
|
18
18
|
providers?: string[];
|
|
19
19
|
liquidityChanges?: PreSwapLpChangeParams[];
|
|
20
20
|
}
|
|
21
|
-
interface MergeSwapFromCoin {
|
|
22
|
-
coinType: string;
|
|
23
|
-
amount: BN | string | number;
|
|
24
|
-
}
|
|
25
|
-
interface MergeSwapParams {
|
|
26
|
-
target: string;
|
|
27
|
-
byAmountIn: boolean;
|
|
28
|
-
depth?: number;
|
|
29
|
-
providers?: string[];
|
|
30
|
-
froms: MergeSwapFromCoin[];
|
|
31
|
-
}
|
|
32
|
-
interface MergeSwapInputCoin {
|
|
33
|
-
coinType: string;
|
|
34
|
-
coin: TransactionObjectArgument;
|
|
35
|
-
}
|
|
36
|
-
interface BuildMergeSwapParams {
|
|
37
|
-
router: MergeSwapRouterData;
|
|
38
|
-
inputCoins: MergeSwapInputCoin[];
|
|
39
|
-
slippage: number;
|
|
40
|
-
txb: Transaction;
|
|
41
|
-
partner?: string;
|
|
42
|
-
}
|
|
43
|
-
interface BuildFastMergeSwapParams {
|
|
44
|
-
router: MergeSwapRouterData;
|
|
45
|
-
slippage: number;
|
|
46
|
-
txb: Transaction;
|
|
47
|
-
partner?: string;
|
|
48
|
-
payDeepFeeAmount?: number;
|
|
49
|
-
}
|
|
50
21
|
interface PreSwapLpChangeParams {
|
|
51
22
|
poolID: string;
|
|
52
23
|
ticklower: number;
|
|
@@ -136,26 +107,12 @@ type RouterDataV3 = {
|
|
|
136
107
|
byAmountIn: boolean;
|
|
137
108
|
paths: Path[];
|
|
138
109
|
insufficientLiquidity: boolean;
|
|
139
|
-
deviationRatio
|
|
110
|
+
deviationRatio: number;
|
|
140
111
|
packages?: Map<string, string>;
|
|
141
112
|
totalDeepFee?: number;
|
|
142
113
|
error?: RouterError;
|
|
143
114
|
overlayFee?: number;
|
|
144
115
|
};
|
|
145
|
-
type MergeRoute = {
|
|
146
|
-
amountIn: BN;
|
|
147
|
-
amountOut: BN;
|
|
148
|
-
deviationRatio?: string;
|
|
149
|
-
paths: Path[];
|
|
150
|
-
};
|
|
151
|
-
type MergeSwapRouterData = {
|
|
152
|
-
quoteID?: string;
|
|
153
|
-
totalAmountOut: BN;
|
|
154
|
-
allRoutes: MergeRoute[];
|
|
155
|
-
packages?: Map<string, string>;
|
|
156
|
-
gas?: number;
|
|
157
|
-
error?: RouterError;
|
|
158
|
-
};
|
|
159
116
|
type FlattenedPath = {
|
|
160
117
|
path: Path;
|
|
161
118
|
isLastUseOfIntermediateToken: boolean;
|
|
@@ -242,7 +199,6 @@ declare class AggregatorConfig {
|
|
|
242
199
|
}
|
|
243
200
|
|
|
244
201
|
declare function getRouterResult(endpoint: string, apiKey: string, params: FindRouterParams, overlayFee: number, overlayFeeReceiver: string): Promise<RouterDataV3 | null>;
|
|
245
|
-
declare function getMergeSwapResult(endpoint: string, apiKey: string, params: MergeSwapParams, overlayFee: number, overlayFeeReceiver: string): Promise<MergeSwapRouterData | null>;
|
|
246
202
|
declare function getDeepbookV3Config(endpoint: string): Promise<DeepbookV3ConfigResponse | null>;
|
|
247
203
|
declare function processFlattenRoutes(routerData: RouterDataV3): ProcessedRouterData;
|
|
248
204
|
|
|
@@ -353,9 +309,9 @@ declare class AggregatorClient {
|
|
|
353
309
|
constructor(params: AggregatorClientParams);
|
|
354
310
|
newPythClients(pythUrls: string[]): SuiPriceServiceConnection[];
|
|
355
311
|
deepbookv3DeepFeeType(): string;
|
|
312
|
+
getDeepbookV3Config(): Promise<DeepbookV3ConfigResponse | null>;
|
|
356
313
|
getOneCoinUsedToMerge(coinType: string): Promise<string | null>;
|
|
357
314
|
findRouters(params: FindRouterParams): Promise<RouterDataV3 | null>;
|
|
358
|
-
findMergeSwapRouters(params: MergeSwapParams): Promise<MergeSwapRouterData | null>;
|
|
359
315
|
executeFlexibleInputSwap(txb: Transaction, inputCoin: TransactionObjectArgument, routerData: RouterDataV3, expectedAmountOut: string, amountLimit: string, pythPriceIDs: Map<string, string>, partner?: string, deepbookv3DeepFee?: TransactionObjectArgument, packages?: Map<string, string>): Promise<void>;
|
|
360
316
|
newDexRouterV3(provider: string, pythPriceIDs: Map<string, string>, partner?: string): DexRouter;
|
|
361
317
|
expectInputSwapV3(txb: Transaction, inputCoin: TransactionObjectArgument, routerData: RouterDataV3, expectAmountOut: string, amountOutLimit: string, pythPriceIDs: Map<string, string>, partner?: string): TransactionObjectArgument;
|
|
@@ -363,8 +319,6 @@ declare class AggregatorClient {
|
|
|
363
319
|
partner?: string): TransactionObjectArgument;
|
|
364
320
|
routerSwap(params: BuildRouterSwapParamsV3): Promise<TransactionObjectArgument>;
|
|
365
321
|
fastRouterSwap(params: BuildFastRouterSwapParamsV3): Promise<void>;
|
|
366
|
-
mergeSwap(params: BuildMergeSwapParams): Promise<TransactionObjectArgument>;
|
|
367
|
-
fastMergeSwap(params: BuildFastMergeSwapParams): Promise<void>;
|
|
368
322
|
fixableRouterSwapV3(params: BuildRouterSwapParamsV3): Promise<TransactionObjectArgument>;
|
|
369
323
|
swapInPools(params: SwapInPoolsParams): Promise<SwapInPoolsResultV3>;
|
|
370
324
|
updatePythPriceIDs(priceIDs: string[], txb: Transaction): Promise<Map<string, string>>;
|
|
@@ -673,7 +627,7 @@ declare const SuiZeroCoinFn = "0x2::coin::zero";
|
|
|
673
627
|
declare const DEEPBOOK_PACKAGE_ID = "0x000000000000000000000000000000000000000000000000000000000000dee9";
|
|
674
628
|
declare const DEEPBOOK_PUBLISHED_AT = "0x000000000000000000000000000000000000000000000000000000000000dee9";
|
|
675
629
|
declare const CETUS_PUBLISHED_AT = "0x70968826ad1b4ba895753f634b0aea68d0672908ca1075a2abdf0fc9e0b2fc6a";
|
|
676
|
-
declare const CETUS_V3_PUBLISHED_AT = "
|
|
630
|
+
declare const CETUS_V3_PUBLISHED_AT = "0x73a9bcf98bd1f4602bd4bb76f235b20253a17722cda3438d1710b70c831168af";
|
|
677
631
|
declare const MAINNET_CETUS_GLOBAL_CONFIG_ID = "0xdaa46292632c3c4d8f31f23ea0f9b36a28ff3677e9684980e4438403a67a3d8f";
|
|
678
632
|
declare const TESTNET_CETUS_GLOBAL_CONFIG_ID = "0x6f4149091a5aea0e818e7243a13adcfb403842d670b9a2089de058512620687a";
|
|
679
633
|
declare const MAINNET_FLOWX_AMM_CONTAINER_ID = "0xb65dcbf63fd3ad5d0ebfbf334780dc9f785eff38a4459e37ab08fa79576ee511";
|
|
@@ -726,6 +680,7 @@ declare const CLIENT_CONFIG: {
|
|
|
726
680
|
readonly DEFAULT_PYTH_URL: "https://hermes.pyth.network";
|
|
727
681
|
readonly PYTH_TIMEOUT: 3000;
|
|
728
682
|
readonly MAX_OVERLAY_FEE_RATE: 0.1;
|
|
683
|
+
readonly MAX_OVERLAY_FEE_RATE_NUMERATOR: 100000;
|
|
729
684
|
readonly FEE_RATE_MULTIPLIER: 1000000;
|
|
730
685
|
readonly DEFAULT_OVERLAY_FEE_RECEIVER: "0x0";
|
|
731
686
|
readonly ERRORS: {
|
|
@@ -739,6 +694,7 @@ declare const CLIENT_CONFIG: {
|
|
|
739
694
|
readonly QUOTE_ID_REQUIRED: "Quote ID is required";
|
|
740
695
|
readonly AGGREGATOR_V3_PACKAGE_REQUIRED: "Aggregator V3 package is required";
|
|
741
696
|
readonly PACKAGES_REQUIRED: "Packages are required";
|
|
697
|
+
readonly OVERLAY_FEE_RECEIVER_REQUIRED: "Overlay fee rate is set, but overlay fee receiver is not set";
|
|
742
698
|
};
|
|
743
699
|
};
|
|
744
700
|
declare const AGGREGATOR_V3_CONFIG: {
|
|
@@ -746,7 +702,7 @@ declare const AGGREGATOR_V3_CONFIG: {
|
|
|
746
702
|
readonly MAX_FEE_RATE: 100000;
|
|
747
703
|
readonly MAX_AMOUNT_IN: "18446744073709551615";
|
|
748
704
|
readonly DEFAULT_PUBLISHED_AT: {
|
|
749
|
-
readonly Mainnet: "
|
|
705
|
+
readonly Mainnet: "0x0422e3239f174320760dd675ba3835cf4b1c511be4a36e819cb61fab7d5d404a";
|
|
750
706
|
readonly Testnet: "0x0";
|
|
751
707
|
};
|
|
752
708
|
};
|
|
@@ -950,4 +906,4 @@ declare class CoinUtils {
|
|
|
950
906
|
static calculateTotalBalance(coins: CoinAsset[]): bigint;
|
|
951
907
|
}
|
|
952
908
|
|
|
953
|
-
export { AFSUI, AFTERMATH, AFTERMATH_AMM, AFTERMATH_MODULE, AGGREGATOR, AGGREGATOR_V3_CONFIG, ALL_DEXES, ALPHAFI, AggregatorClient, type AggregatorClientParams, AggregatorConfig, AggregatorError, type AggregatorErrorCode, type AggregatorResponse, AggregatorServerErrorCode, BLUEFIN, BLUEMOVE, type BigNumber, type BuildCoinResult, type
|
|
909
|
+
export { AFSUI, AFTERMATH, AFTERMATH_AMM, AFTERMATH_MODULE, AGGREGATOR, AGGREGATOR_V3_CONFIG, ALL_DEXES, ALPHAFI, AggregatorClient, type AggregatorClientParams, AggregatorConfig, AggregatorError, type AggregatorErrorCode, type AggregatorResponse, AggregatorServerErrorCode, BLUEFIN, BLUEMOVE, type BigNumber, type BuildCoinResult, type BuildFastRouterSwapParams, type BuildFastRouterSwapParamsV2, type BuildFastRouterSwapParamsV3, type BuildRouterSwapParams, type BuildRouterSwapParamsV2, type BuildRouterSwapParamsV3, CETUS, CETUS_DEX, CETUS_MODULE, CETUS_PUBLISHED_AT, CETUS_V3_PUBLISHED_AT, CHECK_COINS_THRESHOLD_FUNC, CLIENT_CONFIG, CLOCK_ADDRESS, type CoinAsset, CoinInfoAddress, CoinStoreAddress, CoinUtils, type ComparisonResult, ConfigErrorCode, DEEPBOOKV2, DEEPBOOKV3, DEEPBOOK_CLOB_V2_MODULE, DEEPBOOK_CUSTODIAN_V2_MODULE, DEEPBOOK_DEX, DEEPBOOK_MODULE, DEEPBOOK_PACKAGE_ID, DEEPBOOK_PUBLISHED_AT, DEEPBOOK_V3_DEEP_FEE_TYPES, DEFAULT_AGG_V2_ENDPOINT, DEFAULT_AGG_V3_ENDPOINT, DEFAULT_ENDPOINT, DEFAULT_GAS_BUDGET_FOR_MERGE, DEFAULT_GAS_BUDGET_FOR_SPLIT, DEFAULT_GAS_BUDGET_FOR_STAKE, DEFAULT_GAS_BUDGET_FOR_TRANSFER, DEFAULT_GAS_BUDGET_FOR_TRANSFER_SUI, DEFAULT_NFT_TRANSFER_GAS_FEE, type DeepbookV3Config, type DeepbookV3ConfigResponse, type Dex, Env, type ExtendedDetails, FLOWXV2, FLOWXV3, FLOWX_AMM, FLOWX_AMM_MODULE, FULLSAIL, type FindRouterParams, FlashSwapA2BFunc, FlashSwapB2AFunc, FlashSwapFunc, FlashSwapWithPartnerA2BFunc, FlashSwapWithPartnerB2AFunc, FlashSwapWithPartnerFunc, type FlattenedPath, GAS_SYMBOL, GAS_TYPE_ARG, GAS_TYPE_ARG_LONG, type GasMetrics, type GetOrCreateAccountCapResult, HAEDAL, HAEDALHMMV2, HAEDALPMM, HAWAL, INTEGRATE, JOIN_FUNC, KRIYA, KRIYAV3, KRIYA_DEX, KRIYA_MODULE, MAGMA, MAINNET_AFTERMATH_INSURANCE_FUND_ID, MAINNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID, MAINNET_AFTERMATH_REFERRAL_VAULT_ID, MAINNET_AFTERMATH_REGISTRY_ID, MAINNET_AFTERMATH_TREASURY_ID, MAINNET_CETUS_GLOBAL_CONFIG_ID, MAINNET_FLOWX_AMM_CONTAINER_ID, METASTABLE, MOMENTUM, type NFT, OBRIC, ONE, PACKAGE_NAMES, PAY_MODULE, POOL_MODULT, PUBLISHED_ADDRESSES, PYTH_CONFIG, type Package, type Path, type PathV2, type PreSwapLpChangeParams, type ProcessedRouterData, type PythConfig, REPAY_FLASH_SWAP_A2B_FUNC, REPAY_FLASH_SWAP_B2A_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_A2B_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_B2A_FUNC, RepayFalshSwapFunc, RepayFlashSwapWithPartnerFunc, type Router, type RouterData, type RouterDataV2, type RouterDataV3, type RouterError, type RouterV2, SCALLOP, SEVENK, SPRINGSUI, STEAMM, STEAMM_OMM, STEAMM_OMM_V2, SUILEND, SUI_SYSTEM_STATE_OBJECT_ID, SWAP_A2B_FUNC, SWAP_B2A_FUNC, type SuiAddress, type SuiBasicTypes, type SuiInputTypes, type SuiObjectIdType, type SuiResource, type SuiStructTag, type SuiTxArg, SuiZeroCoinFn, type SwapGasAnalysis, type SwapInPoolsParams, type SwapInPoolsResultV3, TEN_POW_NINE, TESTNET_AFTERMATH_INSURANCE_FUND_ID, TESTNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID, TESTNET_AFTERMATH_REFERRAL_VAULT_ID, TESTNET_AFTERMATH_REGISTRY_ID, TESTNET_AFTERMATH_TREASURY_ID, TESTNET_CETUS_GLOBAL_CONFIG_ID, TESTNET_FLOWX_AMM_CONTAINER_ID, TRANSFER_ACCOUNT_CAP, TRANSFER_OR_DESTORY_COIN_FUNC, TURBOS, TURBOS_DEX, TURBOS_MODULE, TURBOS_VERSIONED, TWO, TransactionErrorCode, TypesErrorCode, U128, U64_MAX, U64_MAX_BN, UTILS_MODULE, VOLO, ZERO, buildInputCoin, calculateGasEfficiency, calculatePriceImpact, checkInvalidSuiAddress, compareCoins, compareGasMetrics, completionCoin, composeType, createTarget, dealWithFastRouterSwapParamsForMsafe, exportToCSV, exportToJSON, extractAddressFromType, extractGasMetrics, extractStructTagFromType, extractTimestampFromDowngradeUuid6, fixSuiObjectId, formatGasMetrics, generateDowngradeUuid6, generateSimpleDowngradeUuid6, getAggregatorServerErrorMessage, getAggregatorV2Extend2PublishedAt, getAggregatorV2ExtendPublishedAt, getAggregatorV2PublishedAt, getAllProviders, getDeepbookV3Config, getDefaultSuiInputType, getOrCreateAccountCap, getProvidersExcluding, getProvidersIncluding, getRouterResult, isSortedSymbols, isValidDowngradeUuid6, mintZeroCoin, normalizeCoinType, parseAftermathFeeType, parseTurbosPoolFeeType, patchFixSuiObjectId, printTransaction, processEndpoint, processFlattenRoutes, restituteMsafeFastRouterSwapParams };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _mysten_sui_client from '@mysten/sui/client';
|
|
2
2
|
import { SuiClient, DevInspectResults, SuiMoveObject } from '@mysten/sui/client';
|
|
3
|
-
import {
|
|
3
|
+
import { Transaction, TransactionObjectArgument, TransactionArgument } from '@mysten/sui/transactions';
|
|
4
4
|
import BN from 'bn.js';
|
|
5
5
|
import Decimal from 'decimal.js';
|
|
6
6
|
import { SuiPriceServiceConnection, SuiPythClient } from '@pythnetwork/pyth-sui-js';
|
|
@@ -18,35 +18,6 @@ interface FindRouterParams {
|
|
|
18
18
|
providers?: string[];
|
|
19
19
|
liquidityChanges?: PreSwapLpChangeParams[];
|
|
20
20
|
}
|
|
21
|
-
interface MergeSwapFromCoin {
|
|
22
|
-
coinType: string;
|
|
23
|
-
amount: BN | string | number;
|
|
24
|
-
}
|
|
25
|
-
interface MergeSwapParams {
|
|
26
|
-
target: string;
|
|
27
|
-
byAmountIn: boolean;
|
|
28
|
-
depth?: number;
|
|
29
|
-
providers?: string[];
|
|
30
|
-
froms: MergeSwapFromCoin[];
|
|
31
|
-
}
|
|
32
|
-
interface MergeSwapInputCoin {
|
|
33
|
-
coinType: string;
|
|
34
|
-
coin: TransactionObjectArgument;
|
|
35
|
-
}
|
|
36
|
-
interface BuildMergeSwapParams {
|
|
37
|
-
router: MergeSwapRouterData;
|
|
38
|
-
inputCoins: MergeSwapInputCoin[];
|
|
39
|
-
slippage: number;
|
|
40
|
-
txb: Transaction;
|
|
41
|
-
partner?: string;
|
|
42
|
-
}
|
|
43
|
-
interface BuildFastMergeSwapParams {
|
|
44
|
-
router: MergeSwapRouterData;
|
|
45
|
-
slippage: number;
|
|
46
|
-
txb: Transaction;
|
|
47
|
-
partner?: string;
|
|
48
|
-
payDeepFeeAmount?: number;
|
|
49
|
-
}
|
|
50
21
|
interface PreSwapLpChangeParams {
|
|
51
22
|
poolID: string;
|
|
52
23
|
ticklower: number;
|
|
@@ -136,26 +107,12 @@ type RouterDataV3 = {
|
|
|
136
107
|
byAmountIn: boolean;
|
|
137
108
|
paths: Path[];
|
|
138
109
|
insufficientLiquidity: boolean;
|
|
139
|
-
deviationRatio
|
|
110
|
+
deviationRatio: number;
|
|
140
111
|
packages?: Map<string, string>;
|
|
141
112
|
totalDeepFee?: number;
|
|
142
113
|
error?: RouterError;
|
|
143
114
|
overlayFee?: number;
|
|
144
115
|
};
|
|
145
|
-
type MergeRoute = {
|
|
146
|
-
amountIn: BN;
|
|
147
|
-
amountOut: BN;
|
|
148
|
-
deviationRatio?: string;
|
|
149
|
-
paths: Path[];
|
|
150
|
-
};
|
|
151
|
-
type MergeSwapRouterData = {
|
|
152
|
-
quoteID?: string;
|
|
153
|
-
totalAmountOut: BN;
|
|
154
|
-
allRoutes: MergeRoute[];
|
|
155
|
-
packages?: Map<string, string>;
|
|
156
|
-
gas?: number;
|
|
157
|
-
error?: RouterError;
|
|
158
|
-
};
|
|
159
116
|
type FlattenedPath = {
|
|
160
117
|
path: Path;
|
|
161
118
|
isLastUseOfIntermediateToken: boolean;
|
|
@@ -242,7 +199,6 @@ declare class AggregatorConfig {
|
|
|
242
199
|
}
|
|
243
200
|
|
|
244
201
|
declare function getRouterResult(endpoint: string, apiKey: string, params: FindRouterParams, overlayFee: number, overlayFeeReceiver: string): Promise<RouterDataV3 | null>;
|
|
245
|
-
declare function getMergeSwapResult(endpoint: string, apiKey: string, params: MergeSwapParams, overlayFee: number, overlayFeeReceiver: string): Promise<MergeSwapRouterData | null>;
|
|
246
202
|
declare function getDeepbookV3Config(endpoint: string): Promise<DeepbookV3ConfigResponse | null>;
|
|
247
203
|
declare function processFlattenRoutes(routerData: RouterDataV3): ProcessedRouterData;
|
|
248
204
|
|
|
@@ -353,9 +309,9 @@ declare class AggregatorClient {
|
|
|
353
309
|
constructor(params: AggregatorClientParams);
|
|
354
310
|
newPythClients(pythUrls: string[]): SuiPriceServiceConnection[];
|
|
355
311
|
deepbookv3DeepFeeType(): string;
|
|
312
|
+
getDeepbookV3Config(): Promise<DeepbookV3ConfigResponse | null>;
|
|
356
313
|
getOneCoinUsedToMerge(coinType: string): Promise<string | null>;
|
|
357
314
|
findRouters(params: FindRouterParams): Promise<RouterDataV3 | null>;
|
|
358
|
-
findMergeSwapRouters(params: MergeSwapParams): Promise<MergeSwapRouterData | null>;
|
|
359
315
|
executeFlexibleInputSwap(txb: Transaction, inputCoin: TransactionObjectArgument, routerData: RouterDataV3, expectedAmountOut: string, amountLimit: string, pythPriceIDs: Map<string, string>, partner?: string, deepbookv3DeepFee?: TransactionObjectArgument, packages?: Map<string, string>): Promise<void>;
|
|
360
316
|
newDexRouterV3(provider: string, pythPriceIDs: Map<string, string>, partner?: string): DexRouter;
|
|
361
317
|
expectInputSwapV3(txb: Transaction, inputCoin: TransactionObjectArgument, routerData: RouterDataV3, expectAmountOut: string, amountOutLimit: string, pythPriceIDs: Map<string, string>, partner?: string): TransactionObjectArgument;
|
|
@@ -363,8 +319,6 @@ declare class AggregatorClient {
|
|
|
363
319
|
partner?: string): TransactionObjectArgument;
|
|
364
320
|
routerSwap(params: BuildRouterSwapParamsV3): Promise<TransactionObjectArgument>;
|
|
365
321
|
fastRouterSwap(params: BuildFastRouterSwapParamsV3): Promise<void>;
|
|
366
|
-
mergeSwap(params: BuildMergeSwapParams): Promise<TransactionObjectArgument>;
|
|
367
|
-
fastMergeSwap(params: BuildFastMergeSwapParams): Promise<void>;
|
|
368
322
|
fixableRouterSwapV3(params: BuildRouterSwapParamsV3): Promise<TransactionObjectArgument>;
|
|
369
323
|
swapInPools(params: SwapInPoolsParams): Promise<SwapInPoolsResultV3>;
|
|
370
324
|
updatePythPriceIDs(priceIDs: string[], txb: Transaction): Promise<Map<string, string>>;
|
|
@@ -673,7 +627,7 @@ declare const SuiZeroCoinFn = "0x2::coin::zero";
|
|
|
673
627
|
declare const DEEPBOOK_PACKAGE_ID = "0x000000000000000000000000000000000000000000000000000000000000dee9";
|
|
674
628
|
declare const DEEPBOOK_PUBLISHED_AT = "0x000000000000000000000000000000000000000000000000000000000000dee9";
|
|
675
629
|
declare const CETUS_PUBLISHED_AT = "0x70968826ad1b4ba895753f634b0aea68d0672908ca1075a2abdf0fc9e0b2fc6a";
|
|
676
|
-
declare const CETUS_V3_PUBLISHED_AT = "
|
|
630
|
+
declare const CETUS_V3_PUBLISHED_AT = "0x73a9bcf98bd1f4602bd4bb76f235b20253a17722cda3438d1710b70c831168af";
|
|
677
631
|
declare const MAINNET_CETUS_GLOBAL_CONFIG_ID = "0xdaa46292632c3c4d8f31f23ea0f9b36a28ff3677e9684980e4438403a67a3d8f";
|
|
678
632
|
declare const TESTNET_CETUS_GLOBAL_CONFIG_ID = "0x6f4149091a5aea0e818e7243a13adcfb403842d670b9a2089de058512620687a";
|
|
679
633
|
declare const MAINNET_FLOWX_AMM_CONTAINER_ID = "0xb65dcbf63fd3ad5d0ebfbf334780dc9f785eff38a4459e37ab08fa79576ee511";
|
|
@@ -726,6 +680,7 @@ declare const CLIENT_CONFIG: {
|
|
|
726
680
|
readonly DEFAULT_PYTH_URL: "https://hermes.pyth.network";
|
|
727
681
|
readonly PYTH_TIMEOUT: 3000;
|
|
728
682
|
readonly MAX_OVERLAY_FEE_RATE: 0.1;
|
|
683
|
+
readonly MAX_OVERLAY_FEE_RATE_NUMERATOR: 100000;
|
|
729
684
|
readonly FEE_RATE_MULTIPLIER: 1000000;
|
|
730
685
|
readonly DEFAULT_OVERLAY_FEE_RECEIVER: "0x0";
|
|
731
686
|
readonly ERRORS: {
|
|
@@ -739,6 +694,7 @@ declare const CLIENT_CONFIG: {
|
|
|
739
694
|
readonly QUOTE_ID_REQUIRED: "Quote ID is required";
|
|
740
695
|
readonly AGGREGATOR_V3_PACKAGE_REQUIRED: "Aggregator V3 package is required";
|
|
741
696
|
readonly PACKAGES_REQUIRED: "Packages are required";
|
|
697
|
+
readonly OVERLAY_FEE_RECEIVER_REQUIRED: "Overlay fee rate is set, but overlay fee receiver is not set";
|
|
742
698
|
};
|
|
743
699
|
};
|
|
744
700
|
declare const AGGREGATOR_V3_CONFIG: {
|
|
@@ -746,7 +702,7 @@ declare const AGGREGATOR_V3_CONFIG: {
|
|
|
746
702
|
readonly MAX_FEE_RATE: 100000;
|
|
747
703
|
readonly MAX_AMOUNT_IN: "18446744073709551615";
|
|
748
704
|
readonly DEFAULT_PUBLISHED_AT: {
|
|
749
|
-
readonly Mainnet: "
|
|
705
|
+
readonly Mainnet: "0x0422e3239f174320760dd675ba3835cf4b1c511be4a36e819cb61fab7d5d404a";
|
|
750
706
|
readonly Testnet: "0x0";
|
|
751
707
|
};
|
|
752
708
|
};
|
|
@@ -950,4 +906,4 @@ declare class CoinUtils {
|
|
|
950
906
|
static calculateTotalBalance(coins: CoinAsset[]): bigint;
|
|
951
907
|
}
|
|
952
908
|
|
|
953
|
-
export { AFSUI, AFTERMATH, AFTERMATH_AMM, AFTERMATH_MODULE, AGGREGATOR, AGGREGATOR_V3_CONFIG, ALL_DEXES, ALPHAFI, AggregatorClient, type AggregatorClientParams, AggregatorConfig, AggregatorError, type AggregatorErrorCode, type AggregatorResponse, AggregatorServerErrorCode, BLUEFIN, BLUEMOVE, type BigNumber, type BuildCoinResult, type
|
|
909
|
+
export { AFSUI, AFTERMATH, AFTERMATH_AMM, AFTERMATH_MODULE, AGGREGATOR, AGGREGATOR_V3_CONFIG, ALL_DEXES, ALPHAFI, AggregatorClient, type AggregatorClientParams, AggregatorConfig, AggregatorError, type AggregatorErrorCode, type AggregatorResponse, AggregatorServerErrorCode, BLUEFIN, BLUEMOVE, type BigNumber, type BuildCoinResult, type BuildFastRouterSwapParams, type BuildFastRouterSwapParamsV2, type BuildFastRouterSwapParamsV3, type BuildRouterSwapParams, type BuildRouterSwapParamsV2, type BuildRouterSwapParamsV3, CETUS, CETUS_DEX, CETUS_MODULE, CETUS_PUBLISHED_AT, CETUS_V3_PUBLISHED_AT, CHECK_COINS_THRESHOLD_FUNC, CLIENT_CONFIG, CLOCK_ADDRESS, type CoinAsset, CoinInfoAddress, CoinStoreAddress, CoinUtils, type ComparisonResult, ConfigErrorCode, DEEPBOOKV2, DEEPBOOKV3, DEEPBOOK_CLOB_V2_MODULE, DEEPBOOK_CUSTODIAN_V2_MODULE, DEEPBOOK_DEX, DEEPBOOK_MODULE, DEEPBOOK_PACKAGE_ID, DEEPBOOK_PUBLISHED_AT, DEEPBOOK_V3_DEEP_FEE_TYPES, DEFAULT_AGG_V2_ENDPOINT, DEFAULT_AGG_V3_ENDPOINT, DEFAULT_ENDPOINT, DEFAULT_GAS_BUDGET_FOR_MERGE, DEFAULT_GAS_BUDGET_FOR_SPLIT, DEFAULT_GAS_BUDGET_FOR_STAKE, DEFAULT_GAS_BUDGET_FOR_TRANSFER, DEFAULT_GAS_BUDGET_FOR_TRANSFER_SUI, DEFAULT_NFT_TRANSFER_GAS_FEE, type DeepbookV3Config, type DeepbookV3ConfigResponse, type Dex, Env, type ExtendedDetails, FLOWXV2, FLOWXV3, FLOWX_AMM, FLOWX_AMM_MODULE, FULLSAIL, type FindRouterParams, FlashSwapA2BFunc, FlashSwapB2AFunc, FlashSwapFunc, FlashSwapWithPartnerA2BFunc, FlashSwapWithPartnerB2AFunc, FlashSwapWithPartnerFunc, type FlattenedPath, GAS_SYMBOL, GAS_TYPE_ARG, GAS_TYPE_ARG_LONG, type GasMetrics, type GetOrCreateAccountCapResult, HAEDAL, HAEDALHMMV2, HAEDALPMM, HAWAL, INTEGRATE, JOIN_FUNC, KRIYA, KRIYAV3, KRIYA_DEX, KRIYA_MODULE, MAGMA, MAINNET_AFTERMATH_INSURANCE_FUND_ID, MAINNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID, MAINNET_AFTERMATH_REFERRAL_VAULT_ID, MAINNET_AFTERMATH_REGISTRY_ID, MAINNET_AFTERMATH_TREASURY_ID, MAINNET_CETUS_GLOBAL_CONFIG_ID, MAINNET_FLOWX_AMM_CONTAINER_ID, METASTABLE, MOMENTUM, type NFT, OBRIC, ONE, PACKAGE_NAMES, PAY_MODULE, POOL_MODULT, PUBLISHED_ADDRESSES, PYTH_CONFIG, type Package, type Path, type PathV2, type PreSwapLpChangeParams, type ProcessedRouterData, type PythConfig, REPAY_FLASH_SWAP_A2B_FUNC, REPAY_FLASH_SWAP_B2A_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_A2B_FUNC, REPAY_FLASH_SWAP_WITH_PARTNER_B2A_FUNC, RepayFalshSwapFunc, RepayFlashSwapWithPartnerFunc, type Router, type RouterData, type RouterDataV2, type RouterDataV3, type RouterError, type RouterV2, SCALLOP, SEVENK, SPRINGSUI, STEAMM, STEAMM_OMM, STEAMM_OMM_V2, SUILEND, SUI_SYSTEM_STATE_OBJECT_ID, SWAP_A2B_FUNC, SWAP_B2A_FUNC, type SuiAddress, type SuiBasicTypes, type SuiInputTypes, type SuiObjectIdType, type SuiResource, type SuiStructTag, type SuiTxArg, SuiZeroCoinFn, type SwapGasAnalysis, type SwapInPoolsParams, type SwapInPoolsResultV3, TEN_POW_NINE, TESTNET_AFTERMATH_INSURANCE_FUND_ID, TESTNET_AFTERMATH_PROTOCOL_FEE_VAULT_ID, TESTNET_AFTERMATH_REFERRAL_VAULT_ID, TESTNET_AFTERMATH_REGISTRY_ID, TESTNET_AFTERMATH_TREASURY_ID, TESTNET_CETUS_GLOBAL_CONFIG_ID, TESTNET_FLOWX_AMM_CONTAINER_ID, TRANSFER_ACCOUNT_CAP, TRANSFER_OR_DESTORY_COIN_FUNC, TURBOS, TURBOS_DEX, TURBOS_MODULE, TURBOS_VERSIONED, TWO, TransactionErrorCode, TypesErrorCode, U128, U64_MAX, U64_MAX_BN, UTILS_MODULE, VOLO, ZERO, buildInputCoin, calculateGasEfficiency, calculatePriceImpact, checkInvalidSuiAddress, compareCoins, compareGasMetrics, completionCoin, composeType, createTarget, dealWithFastRouterSwapParamsForMsafe, exportToCSV, exportToJSON, extractAddressFromType, extractGasMetrics, extractStructTagFromType, extractTimestampFromDowngradeUuid6, fixSuiObjectId, formatGasMetrics, generateDowngradeUuid6, generateSimpleDowngradeUuid6, getAggregatorServerErrorMessage, getAggregatorV2Extend2PublishedAt, getAggregatorV2ExtendPublishedAt, getAggregatorV2PublishedAt, getAllProviders, getDeepbookV3Config, getDefaultSuiInputType, getOrCreateAccountCap, getProvidersExcluding, getProvidersIncluding, getRouterResult, isSortedSymbols, isValidDowngradeUuid6, mintZeroCoin, normalizeCoinType, parseAftermathFeeType, parseTurbosPoolFeeType, patchFixSuiObjectId, printTransaction, processEndpoint, processFlattenRoutes, restituteMsafeFastRouterSwapParams };
|