@cetusprotocol/aggregator-sdk 0.0.0-experimental-20250729170433 → 0.0.0-experimental-20250730142527
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/CLAUDE.md +1 -1
- package/README.md +2 -2
- package/dist/index.d.mts +157 -206
- package/dist/index.d.ts +157 -206
- package/dist/index.js +3723 -5992
- package/dist/index.mjs +3718 -5985
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,37 +1,10 @@
|
|
|
1
1
|
import * as _mysten_sui_client from '@mysten/sui/client';
|
|
2
2
|
import { SuiClient, DevInspectResults, SuiMoveObject } from '@mysten/sui/client';
|
|
3
3
|
import { Transaction, TransactionObjectArgument, TransactionArgument } from '@mysten/sui/transactions';
|
|
4
|
-
import { Signer } from '@mysten/sui/cryptography';
|
|
5
4
|
import BN from 'bn.js';
|
|
6
5
|
import Decimal from 'decimal.js';
|
|
7
6
|
import { SuiPriceServiceConnection, SuiPythClient } from '@pythnetwork/pyth-sui-js';
|
|
8
|
-
|
|
9
|
-
type Package = {
|
|
10
|
-
packageName: string;
|
|
11
|
-
packageId: string;
|
|
12
|
-
publishedAt: string;
|
|
13
|
-
};
|
|
14
|
-
declare enum Env {
|
|
15
|
-
Mainnet = 0,
|
|
16
|
-
Testnet = 1
|
|
17
|
-
}
|
|
18
|
-
declare class AggregatorConfig {
|
|
19
|
-
private endpoint;
|
|
20
|
-
private fullNodeUrl;
|
|
21
|
-
private signer;
|
|
22
|
-
private packages;
|
|
23
|
-
private env;
|
|
24
|
-
constructor(endpoint: string, fullNodeUrl: string, signer: string, packages: Package[], env: Env);
|
|
25
|
-
getAggregatorUrl(): string;
|
|
26
|
-
getFullNodeUrl(): string;
|
|
27
|
-
getWallet(): string;
|
|
28
|
-
getENV(): Env;
|
|
29
|
-
getPackages(): Package[];
|
|
30
|
-
getPackage(packageName: string): Package | undefined;
|
|
31
|
-
addPackage(newPackage: Package): void;
|
|
32
|
-
removePackageById(packageId: string): void;
|
|
33
|
-
findPackageById(packageId: string): Package | undefined;
|
|
34
|
-
}
|
|
7
|
+
import { Signer } from '@mysten/sui/cryptography';
|
|
35
8
|
|
|
36
9
|
interface FindRouterParams {
|
|
37
10
|
from: string;
|
|
@@ -126,6 +99,19 @@ type RouterData = {
|
|
|
126
99
|
error?: RouterError;
|
|
127
100
|
overlayFee?: number;
|
|
128
101
|
};
|
|
102
|
+
type RouterDataV3 = {
|
|
103
|
+
quoteID?: string;
|
|
104
|
+
amountIn: BN;
|
|
105
|
+
amountOut: BN;
|
|
106
|
+
byAmountIn: boolean;
|
|
107
|
+
paths: Path[];
|
|
108
|
+
insufficientLiquidity: boolean;
|
|
109
|
+
deviationRatio?: number;
|
|
110
|
+
packages?: Map<string, string>;
|
|
111
|
+
totalDeepFee?: number;
|
|
112
|
+
error?: RouterError;
|
|
113
|
+
overlayFee?: number;
|
|
114
|
+
};
|
|
129
115
|
type FlattenedPath = {
|
|
130
116
|
path: Path;
|
|
131
117
|
isLastUseOfIntermediateToken: boolean;
|
|
@@ -172,11 +158,11 @@ interface SwapInPoolsParams$1 {
|
|
|
172
158
|
byAmountIn: boolean;
|
|
173
159
|
pools: string[];
|
|
174
160
|
}
|
|
175
|
-
interface SwapInPoolsResult
|
|
161
|
+
interface SwapInPoolsResult {
|
|
176
162
|
isExceed: boolean;
|
|
177
163
|
routeData?: RouterData;
|
|
178
164
|
}
|
|
179
|
-
type BuildRouterSwapParams
|
|
165
|
+
type BuildRouterSwapParams = {
|
|
180
166
|
routers: Router[];
|
|
181
167
|
amountIn: BN;
|
|
182
168
|
amountOut: BN;
|
|
@@ -213,33 +199,146 @@ type RouterDataV2 = {
|
|
|
213
199
|
insufficientLiquidity: boolean;
|
|
214
200
|
};
|
|
215
201
|
|
|
216
|
-
|
|
202
|
+
type Package = {
|
|
203
|
+
packageName: string;
|
|
204
|
+
packageId: string;
|
|
205
|
+
publishedAt: string;
|
|
206
|
+
};
|
|
207
|
+
declare enum Env {
|
|
208
|
+
Mainnet = 0,
|
|
209
|
+
Testnet = 1
|
|
210
|
+
}
|
|
211
|
+
declare class AggregatorConfig {
|
|
212
|
+
private endpoint;
|
|
213
|
+
private fullNodeUrl;
|
|
214
|
+
private signer;
|
|
215
|
+
private packages;
|
|
216
|
+
private env;
|
|
217
|
+
constructor(endpoint: string, fullNodeUrl: string, signer: string, packages: Package[], env: Env);
|
|
218
|
+
getAggregatorUrl(): string;
|
|
219
|
+
getFullNodeUrl(): string;
|
|
220
|
+
getWallet(): string;
|
|
221
|
+
getENV(): Env;
|
|
222
|
+
getPackages(): Package[];
|
|
223
|
+
getPackage(packageName: string): Package | undefined;
|
|
224
|
+
addPackage(newPackage: Package): void;
|
|
225
|
+
removePackageById(packageId: string): void;
|
|
226
|
+
findPackageById(packageId: string): Package | undefined;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
declare function getRouterResult(endpoint: string, apiKey: string, params: FindRouterParams, overlayFee: number, overlayFeeReceiver: string): Promise<RouterDataV3 | null>;
|
|
217
230
|
declare function getDeepbookV3Config(endpoint: string): Promise<DeepbookV3ConfigResponse | null>;
|
|
231
|
+
declare function processFlattenRoutes(routerData: RouterDataV3, fixable?: boolean): ProcessedRouterData;
|
|
232
|
+
|
|
233
|
+
interface Extends {
|
|
234
|
+
deepbookv3DeepFee?: TransactionObjectArgument;
|
|
235
|
+
pythPriceIDs?: Map<string, string>;
|
|
236
|
+
}
|
|
237
|
+
interface DexRouter {
|
|
238
|
+
swap(txb: Transaction, flattenedPath: FlattenedPath, swapContext: TransactionObjectArgument, _extends?: Extends): void;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
type BuildRouterSwapParamsV3 = {
|
|
242
|
+
router: RouterDataV3;
|
|
243
|
+
inputCoin: TransactionObjectArgument;
|
|
244
|
+
slippage: number;
|
|
245
|
+
txb: Transaction;
|
|
246
|
+
partner?: string;
|
|
247
|
+
deepbookv3DeepFee?: TransactionObjectArgument;
|
|
248
|
+
fixable?: boolean;
|
|
249
|
+
};
|
|
250
|
+
type BuildFastRouterSwapParamsV3 = {
|
|
251
|
+
router: RouterDataV3;
|
|
252
|
+
slippage: number;
|
|
253
|
+
txb: Transaction;
|
|
254
|
+
partner?: string;
|
|
255
|
+
refreshAllCoins?: boolean;
|
|
256
|
+
payDeepFeeAmount?: number;
|
|
257
|
+
};
|
|
258
|
+
interface SwapInPoolsParams {
|
|
259
|
+
from: string;
|
|
260
|
+
target: string;
|
|
261
|
+
amount: BN;
|
|
262
|
+
byAmountIn: boolean;
|
|
263
|
+
pools: string[];
|
|
264
|
+
}
|
|
265
|
+
interface SwapInPoolsResultV3 {
|
|
266
|
+
isExceed: boolean;
|
|
267
|
+
routeData?: RouterDataV3;
|
|
268
|
+
}
|
|
269
|
+
type AggregatorClientParams$1 = {
|
|
270
|
+
endpoint?: string;
|
|
271
|
+
signer?: string;
|
|
272
|
+
client?: SuiClient;
|
|
273
|
+
env?: Env;
|
|
274
|
+
pythUrls?: string[];
|
|
275
|
+
apiKey?: string;
|
|
276
|
+
partner?: string;
|
|
277
|
+
overlayFeeRate?: number;
|
|
278
|
+
overlayFeeReceiver?: string;
|
|
279
|
+
};
|
|
280
|
+
declare class AggregatorClient {
|
|
281
|
+
endpoint: string;
|
|
282
|
+
signer: string;
|
|
283
|
+
client: SuiClient;
|
|
284
|
+
env: Env;
|
|
285
|
+
apiKey: string;
|
|
286
|
+
protected pythConnections: SuiPriceServiceConnection[];
|
|
287
|
+
protected pythClient: SuiPythClient;
|
|
288
|
+
protected overlayFeeRate: number;
|
|
289
|
+
protected overlayFeeReceiver: string;
|
|
290
|
+
protected partner?: string;
|
|
291
|
+
private static readonly CONFIG;
|
|
292
|
+
constructor(params: AggregatorClientParams$1);
|
|
293
|
+
newPythClients(pythUrls: string[]): SuiPriceServiceConnection[];
|
|
294
|
+
deepbookv3DeepFeeType(): string;
|
|
295
|
+
getOneCoinUsedToMerge(coinType: string): Promise<string | null>;
|
|
296
|
+
findRouters(params: FindRouterParams): Promise<RouterDataV3 | null>;
|
|
297
|
+
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>;
|
|
298
|
+
newDexRouterV3(provider: string, pythPriceIDs: Map<string, string>, partner?: string): DexRouter;
|
|
299
|
+
expectInputSwapV3(txb: Transaction, inputCoin: TransactionObjectArgument, routerData: RouterDataV3, expectAmountOut: string, amountOutLimit: string, pythPriceIDs: Map<string, string>, fixable?: boolean, partner?: string): TransactionObjectArgument;
|
|
300
|
+
expectOutputSwapV3(txb: Transaction, inputCoin: TransactionObjectArgument, routerData: RouterDataV3, amountOut: string, _amountLimit: string, // it will set when build inputcoin
|
|
301
|
+
partner?: string): TransactionObjectArgument;
|
|
302
|
+
routerSwap(params: BuildRouterSwapParamsV3): Promise<TransactionObjectArgument>;
|
|
303
|
+
fastRouterSwap(params: BuildFastRouterSwapParamsV3): Promise<void>;
|
|
304
|
+
fixableRouterSwapV3(params: BuildRouterSwapParamsV3): Promise<TransactionObjectArgument>;
|
|
305
|
+
swapInPools(params: SwapInPoolsParams): Promise<SwapInPoolsResultV3>;
|
|
306
|
+
updatePythPriceIDs(priceIDs: string[], txb: Transaction): Promise<Map<string, string>>;
|
|
307
|
+
devInspectTransactionBlock(txb: Transaction): Promise<_mysten_sui_client.DevInspectResults>;
|
|
308
|
+
sendTransaction(txb: Transaction, signer: Signer): Promise<_mysten_sui_client.SuiTransactionBlockResponse>;
|
|
309
|
+
}
|
|
310
|
+
|
|
218
311
|
/**
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
* Example:
|
|
224
|
-
* Route1: P1(X,A) -> P2(A,Y)
|
|
225
|
-
* Route2: P3(X,B) -> P4(B,A) -> P2(A,Y)
|
|
226
|
-
* Route3: P5(X,C) -> P6(C,A) -> P2(A,Y)
|
|
227
|
-
*
|
|
228
|
-
* Dependency constraints extracted:
|
|
229
|
-
* - Route1: P1 -> P2
|
|
230
|
-
* - Route2: P3 -> P4 -> P2
|
|
231
|
-
* - Route3: P5 -> P6 -> P2
|
|
232
|
-
*
|
|
233
|
-
* Topological sort results in execution order:
|
|
234
|
-
* 1. P1(X,A), P3(X,B), P5(X,C) (no dependencies)
|
|
235
|
-
* 2. P4(B,A), P6(C,A) (depend on P3, P5)
|
|
236
|
-
* 3. P2(A,Y) with combined amount_in (depends on P1, P4, P6)
|
|
312
|
+
* Generate a downgraded UUID6 format identifier
|
|
313
|
+
* This creates a time-based identifier with reduced entropy for better compatibility
|
|
314
|
+
* @returns A downgrade_uuid6 string in format: downgrade_xxxxxxxx-xxxx-6xxx-xxxx-xxxxxxxxxxxx
|
|
237
315
|
*/
|
|
238
|
-
declare function
|
|
316
|
+
declare function generateDowngradeUuid6(): string;
|
|
317
|
+
/**
|
|
318
|
+
* Generate a simplified downgrade UUID6 with timestamp-based components
|
|
319
|
+
* @returns A simplified downgrade_uuid6 string
|
|
320
|
+
*/
|
|
321
|
+
declare function generateSimpleDowngradeUuid6(): string;
|
|
322
|
+
/**
|
|
323
|
+
* Validate if a string is a valid downgrade_uuid6 format
|
|
324
|
+
* @param uuid The string to validate
|
|
325
|
+
* @returns true if valid downgrade_uuid6 format
|
|
326
|
+
*/
|
|
327
|
+
declare function isValidDowngradeUuid6(uuid: string): boolean;
|
|
328
|
+
/**
|
|
329
|
+
* Extract timestamp from downgrade_uuid6 if possible
|
|
330
|
+
* @param uuid The downgrade_uuid6 string
|
|
331
|
+
* @returns timestamp in milliseconds or null if cannot extract
|
|
332
|
+
*/
|
|
333
|
+
declare function extractTimestampFromDowngradeUuid6(uuid: string): number | null;
|
|
239
334
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
335
|
+
declare function processEndpoint(endpoint: string): string;
|
|
336
|
+
|
|
337
|
+
type GetOrCreateAccountCapResult = {
|
|
338
|
+
accountCap: TransactionObjectArgument;
|
|
339
|
+
isCreate: boolean;
|
|
340
|
+
};
|
|
341
|
+
declare function getOrCreateAccountCap(txb: Transaction, client: SuiClient, owner: string): Promise<GetOrCreateAccountCapResult>;
|
|
243
342
|
|
|
244
343
|
/**
|
|
245
344
|
* Represents a SUI address, which is a string.
|
|
@@ -352,158 +451,6 @@ type CoinAsset = {
|
|
|
352
451
|
balance: bigint;
|
|
353
452
|
};
|
|
354
453
|
|
|
355
|
-
type BuildRouterSwapParams = {
|
|
356
|
-
routers: Router[];
|
|
357
|
-
byAmountIn: boolean;
|
|
358
|
-
inputCoin: TransactionObjectArgument;
|
|
359
|
-
slippage: number;
|
|
360
|
-
txb: Transaction;
|
|
361
|
-
partner?: string;
|
|
362
|
-
deepbookv3DeepFee?: TransactionObjectArgument;
|
|
363
|
-
};
|
|
364
|
-
type BuildFastRouterSwapParams$1 = {
|
|
365
|
-
routers: Router[];
|
|
366
|
-
byAmountIn: boolean;
|
|
367
|
-
slippage: number;
|
|
368
|
-
txb: Transaction;
|
|
369
|
-
partner?: string;
|
|
370
|
-
refreshAllCoins?: boolean;
|
|
371
|
-
payDeepFeeAmount?: number;
|
|
372
|
-
};
|
|
373
|
-
type BuildRouterSwapParamsV2$1 = {
|
|
374
|
-
routers: RouterData;
|
|
375
|
-
inputCoin: TransactionObjectArgument;
|
|
376
|
-
slippage: number;
|
|
377
|
-
txb: Transaction;
|
|
378
|
-
partner?: string;
|
|
379
|
-
deepbookv3DeepFee?: TransactionObjectArgument;
|
|
380
|
-
};
|
|
381
|
-
type BuildFastRouterSwapParamsV2$1 = {
|
|
382
|
-
routers: RouterData;
|
|
383
|
-
slippage: number;
|
|
384
|
-
txb: Transaction;
|
|
385
|
-
partner?: string;
|
|
386
|
-
refreshAllCoins?: boolean;
|
|
387
|
-
payDeepFeeAmount?: number;
|
|
388
|
-
};
|
|
389
|
-
interface SwapInPoolsParams {
|
|
390
|
-
from: string;
|
|
391
|
-
target: string;
|
|
392
|
-
amount: BN;
|
|
393
|
-
byAmountIn: boolean;
|
|
394
|
-
pools: string[];
|
|
395
|
-
}
|
|
396
|
-
interface SwapInPoolsResult {
|
|
397
|
-
isExceed: boolean;
|
|
398
|
-
routeData?: RouterData;
|
|
399
|
-
}
|
|
400
|
-
type AggregatorClientParams$1 = {
|
|
401
|
-
endpoint?: string;
|
|
402
|
-
signer?: string;
|
|
403
|
-
client?: SuiClient;
|
|
404
|
-
env?: Env;
|
|
405
|
-
pythUrls?: string[];
|
|
406
|
-
apiKey?: string;
|
|
407
|
-
partner?: string;
|
|
408
|
-
overlayFeeRate?: number;
|
|
409
|
-
overlayFeeReceiver?: string;
|
|
410
|
-
};
|
|
411
|
-
declare class AggregatorClient {
|
|
412
|
-
endpoint: string;
|
|
413
|
-
signer: string;
|
|
414
|
-
client: SuiClient;
|
|
415
|
-
env: Env;
|
|
416
|
-
apiKey: string;
|
|
417
|
-
private allCoins;
|
|
418
|
-
protected pythConnections: SuiPriceServiceConnection[];
|
|
419
|
-
protected pythClient: SuiPythClient;
|
|
420
|
-
protected overlayFeeRate: number;
|
|
421
|
-
protected overlayFeeReceiver: string;
|
|
422
|
-
protected partner?: string;
|
|
423
|
-
private static readonly CONFIG;
|
|
424
|
-
constructor(params: AggregatorClientParams$1);
|
|
425
|
-
newPythClients(pythUrls: string[]): SuiPriceServiceConnection[];
|
|
426
|
-
getCoins(coinType: string, refresh?: boolean): Promise<CoinAsset[]>;
|
|
427
|
-
findRouters(params: FindRouterParams): Promise<RouterData | null>;
|
|
428
|
-
executeFlexibleInputSwap(txb: Transaction, inputCoin: TransactionObjectArgument, routers: Router[], expectedAmountOut: string, amountLimit: string, pythPriceIDs: Map<string, string>, partner?: string, deepbookv3DeepFee?: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
|
|
429
|
-
expectInputSwap(txb: Transaction, inputCoin: TransactionObjectArgument, routers: Router[], expectedAmountOut: string, amountLimit: string, pythPriceIDs: Map<string, string>, partner?: string, deepbookv3DeepFee?: TransactionObjectArgument, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
|
|
430
|
-
expectOutputSwap(txb: Transaction, inputCoin: TransactionObjectArgument, routers: Router[], partner?: string, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
|
|
431
|
-
swapInPools(params: SwapInPoolsParams): Promise<SwapInPoolsResult | null>;
|
|
432
|
-
routerSwap(params: BuildRouterSwapParams | BuildRouterSwapParamsV2$1): Promise<TransactionObjectArgument>;
|
|
433
|
-
fixableRouterSwap(params: BuildRouterSwapParamsV2$1): Promise<TransactionObjectArgument>;
|
|
434
|
-
fastRouterSwap(params: BuildFastRouterSwapParams$1 | BuildFastRouterSwapParamsV2$1): Promise<void>;
|
|
435
|
-
publishedAtV2(): string;
|
|
436
|
-
publishedAtV2Extend(): string;
|
|
437
|
-
publishedAtV2Extend2(): string;
|
|
438
|
-
deepbookv3DeepFeeType(): string;
|
|
439
|
-
transferOrDestoryCoin(txb: Transaction, coin: TransactionObjectArgument, coinType: string, aggregatorV2PublishedAt: string): void;
|
|
440
|
-
checkCoinThresholdAndMergeCoin(txb: Transaction, coins: TransactionObjectArgument[], coinType: string, expectedAmountOut: string, threshold: string, aggregatorV2ExtendPublishedAt: string): TransactionObjectArgument;
|
|
441
|
-
newDex(provider: string, pythPriceIDs: Map<string, string>, partner?: string): Dex;
|
|
442
|
-
signAndExecuteTransaction(txb: Transaction, signer: Signer): Promise<_mysten_sui_client.SuiTransactionBlockResponse>;
|
|
443
|
-
devInspectTransactionBlock(txb: Transaction): Promise<_mysten_sui_client.DevInspectResults>;
|
|
444
|
-
sendTransaction(txb: Transaction, signer: Signer): Promise<_mysten_sui_client.SuiTransactionBlockResponse>;
|
|
445
|
-
getDeepbookV3Config(): Promise<DeepbookV3Config | null>;
|
|
446
|
-
updatePythPriceIDs(priceIDs: string[], txb: Transaction): Promise<Map<string, string>>;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
interface Extends {
|
|
450
|
-
deepbookv3DeepFee?: TransactionObjectArgument;
|
|
451
|
-
pythPriceIDs?: Map<string, string>;
|
|
452
|
-
}
|
|
453
|
-
interface DexRouter {
|
|
454
|
-
swap(txb: Transaction, flattenedPath: FlattenedPath, swapContext: TransactionObjectArgument, _extends?: Extends): void;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
declare class AggregatorClientV3 extends AggregatorClient {
|
|
458
|
-
constructor(params: AggregatorClientParams$1);
|
|
459
|
-
newDexRouterV3(provider: string, pythPriceIDs: Map<string, string>, partner?: string): DexRouter;
|
|
460
|
-
expectInputSwapV3(txb: Transaction, inputCoin: TransactionObjectArgument, routerData: RouterData, expectAmountOut: string, amountOutLimit: string, pythPriceIDs: Map<string, string>, partner?: string): TransactionObjectArgument;
|
|
461
|
-
expectOutputSwapV3(txb: Transaction, inputCoin: TransactionObjectArgument, routerData: RouterData, amountOut: string, _amountLimit: string, // it will set when build inputcoin
|
|
462
|
-
partner?: string): TransactionObjectArgument;
|
|
463
|
-
routerSwapV3(params: BuildRouterSwapParamsV2$1): Promise<TransactionObjectArgument>;
|
|
464
|
-
fastRouterSwapV3(params: BuildFastRouterSwapParamsV2$1): Promise<void>;
|
|
465
|
-
fixableRouterSwapV3(params: BuildRouterSwapParamsV2$1): Promise<TransactionObjectArgument>;
|
|
466
|
-
routerSwap(params: BuildRouterSwapParamsV2$1): Promise<TransactionObjectArgument>;
|
|
467
|
-
fastRouterSwap(params: BuildFastRouterSwapParamsV2$1): Promise<void>;
|
|
468
|
-
fixableRouterSwap(params: BuildRouterSwapParamsV2$1): Promise<TransactionObjectArgument>;
|
|
469
|
-
swapInPools(params: SwapInPoolsParams): Promise<SwapInPoolsResult | null>;
|
|
470
|
-
private swapInPoolsV3;
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
declare function swapInPools(client: SuiClient, params: SwapInPoolsParams, sender: string, env: Env): Promise<SwapInPoolsResult>;
|
|
474
|
-
|
|
475
|
-
/**
|
|
476
|
-
* Generate a downgraded UUID6 format identifier
|
|
477
|
-
* This creates a time-based identifier with reduced entropy for better compatibility
|
|
478
|
-
* @returns A downgrade_uuid6 string in format: downgrade_xxxxxxxx-xxxx-6xxx-xxxx-xxxxxxxxxxxx
|
|
479
|
-
*/
|
|
480
|
-
declare function generateDowngradeUuid6(): string;
|
|
481
|
-
/**
|
|
482
|
-
* Generate a simplified downgrade UUID6 with timestamp-based components
|
|
483
|
-
* @returns A simplified downgrade_uuid6 string
|
|
484
|
-
*/
|
|
485
|
-
declare function generateSimpleDowngradeUuid6(): string;
|
|
486
|
-
/**
|
|
487
|
-
* Validate if a string is a valid downgrade_uuid6 format
|
|
488
|
-
* @param uuid The string to validate
|
|
489
|
-
* @returns true if valid downgrade_uuid6 format
|
|
490
|
-
*/
|
|
491
|
-
declare function isValidDowngradeUuid6(uuid: string): boolean;
|
|
492
|
-
/**
|
|
493
|
-
* Extract timestamp from downgrade_uuid6 if possible
|
|
494
|
-
* @param uuid The downgrade_uuid6 string
|
|
495
|
-
* @returns timestamp in milliseconds or null if cannot extract
|
|
496
|
-
*/
|
|
497
|
-
declare function extractTimestampFromDowngradeUuid6(uuid: string): number | null;
|
|
498
|
-
|
|
499
|
-
declare function processEndpoint(endpoint: string): string;
|
|
500
|
-
|
|
501
|
-
type GetOrCreateAccountCapResult = {
|
|
502
|
-
accountCap: TransactionObjectArgument;
|
|
503
|
-
isCreate: boolean;
|
|
504
|
-
};
|
|
505
|
-
declare function getOrCreateAccountCap(txb: Transaction, client: SuiClient, owner: string): Promise<GetOrCreateAccountCapResult>;
|
|
506
|
-
|
|
507
454
|
declare function completionCoin(s: string): string;
|
|
508
455
|
declare function mintZeroCoin(txb: Transaction, coinType: string): TransactionObjectArgument;
|
|
509
456
|
declare function compareCoins(coinA: string, coinB: string): boolean;
|
|
@@ -536,6 +483,10 @@ declare function fixSuiObjectId(value: string): string;
|
|
|
536
483
|
declare function patchFixSuiObjectId(data: any): void;
|
|
537
484
|
declare function createTarget(packageName: string, moduleName: string, functionName: string): `${string}::${string}::${string}`;
|
|
538
485
|
|
|
486
|
+
interface Dex {
|
|
487
|
+
swap(client: AggregatorClient, ptb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>, deepbookv3DeepFee?: TransactionObjectArgument): Promise<TransactionObjectArgument>;
|
|
488
|
+
}
|
|
489
|
+
|
|
539
490
|
interface GasMetrics {
|
|
540
491
|
computationCost: string;
|
|
541
492
|
storageCost: string;
|
|
@@ -968,4 +919,4 @@ declare class CoinUtils {
|
|
|
968
919
|
static calculateTotalBalance(coins: CoinAsset[]): bigint;
|
|
969
920
|
}
|
|
970
921
|
|
|
971
|
-
export { AFSUI, AFTERMATH, AFTERMATH_AMM, AFTERMATH_MODULE, AGGREGATOR, AGGREGATOR_V3_CONFIG, ALL_DEXES, ALPHAFI, AggregatorClient, type AggregatorClientParams,
|
|
922
|
+
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 BuildRouterSwapParams, type BuildRouterSwapParamsV2, 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_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, type FindRouterParams, FlashSwapA2BFunc, FlashSwapB2AFunc, FlashSwapFunc, FlashSwapWithPartnerA2BFunc, FlashSwapWithPartnerB2AFunc, FlashSwapWithPartnerFunc, type FlattenedPath, GAS_SYMBOL, GAS_TYPE_ARG, GAS_TYPE_ARG_LONG, type GasMetrics, type GetOrCreateAccountCapResult, HAEDAL, 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 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$1 as SwapInPoolsParams, type SwapInPoolsResult, 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, getDeepbookV3Config, getDefaultSuiInputType, getOrCreateAccountCap, getRouterResult, isSortedSymbols, isValidDowngradeUuid6, mintZeroCoin, normalizeCoinType, parseAftermathFeeType, parseTurbosPoolFeeType, patchFixSuiObjectId, printTransaction, processEndpoint, processFlattenRoutes, restituteMsafeFastRouterSwapParams };
|