@cetusprotocol/aggregator-sdk 0.0.0-experimental-20250724183511 → 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 -207
- package/dist/index.d.ts +157 -207
- package/dist/index.js +3405 -5763
- package/dist/index.mjs +3405 -5761
- 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,10 +99,22 @@ 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;
|
|
132
|
-
executionOrder: number;
|
|
133
118
|
};
|
|
134
119
|
type ProcessedRouterData = {
|
|
135
120
|
quoteID: string;
|
|
@@ -173,11 +158,11 @@ interface SwapInPoolsParams$1 {
|
|
|
173
158
|
byAmountIn: boolean;
|
|
174
159
|
pools: string[];
|
|
175
160
|
}
|
|
176
|
-
interface SwapInPoolsResult
|
|
161
|
+
interface SwapInPoolsResult {
|
|
177
162
|
isExceed: boolean;
|
|
178
163
|
routeData?: RouterData;
|
|
179
164
|
}
|
|
180
|
-
type BuildRouterSwapParams
|
|
165
|
+
type BuildRouterSwapParams = {
|
|
181
166
|
routers: Router[];
|
|
182
167
|
amountIn: BN;
|
|
183
168
|
amountOut: BN;
|
|
@@ -214,33 +199,146 @@ type RouterDataV2 = {
|
|
|
214
199
|
insufficientLiquidity: boolean;
|
|
215
200
|
};
|
|
216
201
|
|
|
217
|
-
|
|
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>;
|
|
218
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
|
+
|
|
219
311
|
/**
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
* Example:
|
|
225
|
-
* Route1: P1(X,A) -> P2(A,Y)
|
|
226
|
-
* Route2: P3(X,B) -> P4(B,A) -> P2(A,Y)
|
|
227
|
-
* Route3: P5(X,C) -> P6(C,A) -> P2(A,Y)
|
|
228
|
-
*
|
|
229
|
-
* Dependency constraints extracted:
|
|
230
|
-
* - Route1: P1 -> P2
|
|
231
|
-
* - Route2: P3 -> P4 -> P2
|
|
232
|
-
* - Route3: P5 -> P6 -> P2
|
|
233
|
-
*
|
|
234
|
-
* Topological sort results in execution order:
|
|
235
|
-
* 1. P1(X,A), P3(X,B), P5(X,C) (no dependencies)
|
|
236
|
-
* 2. P4(B,A), P6(C,A) (depend on P3, P5)
|
|
237
|
-
* 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
|
|
238
315
|
*/
|
|
239
|
-
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;
|
|
240
334
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
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>;
|
|
244
342
|
|
|
245
343
|
/**
|
|
246
344
|
* Represents a SUI address, which is a string.
|
|
@@ -353,158 +451,6 @@ type CoinAsset = {
|
|
|
353
451
|
balance: bigint;
|
|
354
452
|
};
|
|
355
453
|
|
|
356
|
-
type BuildRouterSwapParams = {
|
|
357
|
-
routers: Router[];
|
|
358
|
-
byAmountIn: boolean;
|
|
359
|
-
inputCoin: TransactionObjectArgument;
|
|
360
|
-
slippage: number;
|
|
361
|
-
txb: Transaction;
|
|
362
|
-
partner?: string;
|
|
363
|
-
deepbookv3DeepFee?: TransactionObjectArgument;
|
|
364
|
-
};
|
|
365
|
-
type BuildFastRouterSwapParams$1 = {
|
|
366
|
-
routers: Router[];
|
|
367
|
-
byAmountIn: boolean;
|
|
368
|
-
slippage: number;
|
|
369
|
-
txb: Transaction;
|
|
370
|
-
partner?: string;
|
|
371
|
-
refreshAllCoins?: boolean;
|
|
372
|
-
payDeepFeeAmount?: number;
|
|
373
|
-
};
|
|
374
|
-
type BuildRouterSwapParamsV2$1 = {
|
|
375
|
-
routers: RouterData;
|
|
376
|
-
inputCoin: TransactionObjectArgument;
|
|
377
|
-
slippage: number;
|
|
378
|
-
txb: Transaction;
|
|
379
|
-
partner?: string;
|
|
380
|
-
deepbookv3DeepFee?: TransactionObjectArgument;
|
|
381
|
-
};
|
|
382
|
-
type BuildFastRouterSwapParamsV2$1 = {
|
|
383
|
-
routers: RouterData;
|
|
384
|
-
slippage: number;
|
|
385
|
-
txb: Transaction;
|
|
386
|
-
partner?: string;
|
|
387
|
-
refreshAllCoins?: boolean;
|
|
388
|
-
payDeepFeeAmount?: number;
|
|
389
|
-
};
|
|
390
|
-
interface SwapInPoolsParams {
|
|
391
|
-
from: string;
|
|
392
|
-
target: string;
|
|
393
|
-
amount: BN;
|
|
394
|
-
byAmountIn: boolean;
|
|
395
|
-
pools: string[];
|
|
396
|
-
}
|
|
397
|
-
interface SwapInPoolsResult {
|
|
398
|
-
isExceed: boolean;
|
|
399
|
-
routeData?: RouterData;
|
|
400
|
-
}
|
|
401
|
-
type AggregatorClientParams$1 = {
|
|
402
|
-
endpoint?: string;
|
|
403
|
-
signer?: string;
|
|
404
|
-
client?: SuiClient;
|
|
405
|
-
env?: Env;
|
|
406
|
-
pythUrls?: string[];
|
|
407
|
-
apiKey?: string;
|
|
408
|
-
partner?: string;
|
|
409
|
-
overlayFeeRate?: number;
|
|
410
|
-
overlayFeeReceiver?: string;
|
|
411
|
-
};
|
|
412
|
-
declare class AggregatorClient {
|
|
413
|
-
endpoint: string;
|
|
414
|
-
signer: string;
|
|
415
|
-
client: SuiClient;
|
|
416
|
-
env: Env;
|
|
417
|
-
apiKey: string;
|
|
418
|
-
private allCoins;
|
|
419
|
-
protected pythConnections: SuiPriceServiceConnection[];
|
|
420
|
-
protected pythClient: SuiPythClient;
|
|
421
|
-
protected overlayFeeRate: number;
|
|
422
|
-
protected overlayFeeReceiver: string;
|
|
423
|
-
protected partner?: string;
|
|
424
|
-
private static readonly CONFIG;
|
|
425
|
-
constructor(params: AggregatorClientParams$1);
|
|
426
|
-
newPythClients(pythUrls: string[]): SuiPriceServiceConnection[];
|
|
427
|
-
getCoins(coinType: string, refresh?: boolean): Promise<CoinAsset[]>;
|
|
428
|
-
findRouters(params: FindRouterParams): Promise<RouterData | null>;
|
|
429
|
-
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>;
|
|
430
|
-
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>;
|
|
431
|
-
expectOutputSwap(txb: Transaction, inputCoin: TransactionObjectArgument, routers: Router[], partner?: string, packages?: Map<string, string>): Promise<TransactionObjectArgument>;
|
|
432
|
-
swapInPools(params: SwapInPoolsParams): Promise<SwapInPoolsResult | null>;
|
|
433
|
-
routerSwap(params: BuildRouterSwapParams | BuildRouterSwapParamsV2$1): Promise<TransactionObjectArgument>;
|
|
434
|
-
fixableRouterSwap(params: BuildRouterSwapParamsV2$1): Promise<TransactionObjectArgument>;
|
|
435
|
-
fastRouterSwap(params: BuildFastRouterSwapParams$1 | BuildFastRouterSwapParamsV2$1): Promise<void>;
|
|
436
|
-
publishedAtV2(): string;
|
|
437
|
-
publishedAtV2Extend(): string;
|
|
438
|
-
publishedAtV2Extend2(): string;
|
|
439
|
-
deepbookv3DeepFeeType(): string;
|
|
440
|
-
transferOrDestoryCoin(txb: Transaction, coin: TransactionObjectArgument, coinType: string, aggregatorV2PublishedAt: string): void;
|
|
441
|
-
checkCoinThresholdAndMergeCoin(txb: Transaction, coins: TransactionObjectArgument[], coinType: string, expectedAmountOut: string, threshold: string, aggregatorV2ExtendPublishedAt: string): TransactionObjectArgument;
|
|
442
|
-
newDex(provider: string, pythPriceIDs: Map<string, string>, partner?: string): Dex;
|
|
443
|
-
signAndExecuteTransaction(txb: Transaction, signer: Signer): Promise<_mysten_sui_client.SuiTransactionBlockResponse>;
|
|
444
|
-
devInspectTransactionBlock(txb: Transaction): Promise<_mysten_sui_client.DevInspectResults>;
|
|
445
|
-
sendTransaction(txb: Transaction, signer: Signer): Promise<_mysten_sui_client.SuiTransactionBlockResponse>;
|
|
446
|
-
getDeepbookV3Config(): Promise<DeepbookV3Config | null>;
|
|
447
|
-
updatePythPriceIDs(priceIDs: string[], txb: Transaction): Promise<Map<string, string>>;
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
interface Extends {
|
|
451
|
-
deepbookv3DeepFee?: TransactionObjectArgument;
|
|
452
|
-
pythPriceIDs?: Map<string, string>;
|
|
453
|
-
}
|
|
454
|
-
interface DexRouter {
|
|
455
|
-
swap(txb: Transaction, flattenedPath: FlattenedPath, swapContext: TransactionObjectArgument, _extends?: Extends): void;
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
declare class AggregatorClientV3 extends AggregatorClient {
|
|
459
|
-
constructor(params: AggregatorClientParams$1);
|
|
460
|
-
newDexRouterV3(provider: string, pythPriceIDs: Map<string, string>, partner?: string): DexRouter;
|
|
461
|
-
expectInputSwapV3(txb: Transaction, inputCoin: TransactionObjectArgument, routerData: RouterData, expectAmountOut: string, amountOutLimit: string, pythPriceIDs: Map<string, string>, partner?: string): TransactionObjectArgument;
|
|
462
|
-
expectOutputSwapV3(txb: Transaction, inputCoin: TransactionObjectArgument, routerData: RouterData, amountOut: string, _amountLimit: string, // it will set when build inputcoin
|
|
463
|
-
partner?: string): TransactionObjectArgument;
|
|
464
|
-
routerSwapV3(params: BuildRouterSwapParamsV2$1): Promise<TransactionObjectArgument>;
|
|
465
|
-
fastRouterSwapV3(params: BuildFastRouterSwapParamsV2$1): Promise<void>;
|
|
466
|
-
fixableRouterSwapV3(params: BuildRouterSwapParamsV2$1): Promise<TransactionObjectArgument>;
|
|
467
|
-
routerSwap(params: BuildRouterSwapParamsV2$1): Promise<TransactionObjectArgument>;
|
|
468
|
-
fastRouterSwap(params: BuildFastRouterSwapParamsV2$1): Promise<void>;
|
|
469
|
-
fixableRouterSwap(params: BuildRouterSwapParamsV2$1): Promise<TransactionObjectArgument>;
|
|
470
|
-
swapInPools(params: SwapInPoolsParams): Promise<SwapInPoolsResult | null>;
|
|
471
|
-
private swapInPoolsV3;
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
declare function swapInPools(client: SuiClient, params: SwapInPoolsParams, sender: string, env: Env): Promise<SwapInPoolsResult>;
|
|
475
|
-
|
|
476
|
-
/**
|
|
477
|
-
* Generate a downgraded UUID6 format identifier
|
|
478
|
-
* This creates a time-based identifier with reduced entropy for better compatibility
|
|
479
|
-
* @returns A downgrade_uuid6 string in format: downgrade_xxxxxxxx-xxxx-6xxx-xxxx-xxxxxxxxxxxx
|
|
480
|
-
*/
|
|
481
|
-
declare function generateDowngradeUuid6(): string;
|
|
482
|
-
/**
|
|
483
|
-
* Generate a simplified downgrade UUID6 with timestamp-based components
|
|
484
|
-
* @returns A simplified downgrade_uuid6 string
|
|
485
|
-
*/
|
|
486
|
-
declare function generateSimpleDowngradeUuid6(): string;
|
|
487
|
-
/**
|
|
488
|
-
* Validate if a string is a valid downgrade_uuid6 format
|
|
489
|
-
* @param uuid The string to validate
|
|
490
|
-
* @returns true if valid downgrade_uuid6 format
|
|
491
|
-
*/
|
|
492
|
-
declare function isValidDowngradeUuid6(uuid: string): boolean;
|
|
493
|
-
/**
|
|
494
|
-
* Extract timestamp from downgrade_uuid6 if possible
|
|
495
|
-
* @param uuid The downgrade_uuid6 string
|
|
496
|
-
* @returns timestamp in milliseconds or null if cannot extract
|
|
497
|
-
*/
|
|
498
|
-
declare function extractTimestampFromDowngradeUuid6(uuid: string): number | null;
|
|
499
|
-
|
|
500
|
-
declare function processEndpoint(endpoint: string): string;
|
|
501
|
-
|
|
502
|
-
type GetOrCreateAccountCapResult = {
|
|
503
|
-
accountCap: TransactionObjectArgument;
|
|
504
|
-
isCreate: boolean;
|
|
505
|
-
};
|
|
506
|
-
declare function getOrCreateAccountCap(txb: Transaction, client: SuiClient, owner: string): Promise<GetOrCreateAccountCapResult>;
|
|
507
|
-
|
|
508
454
|
declare function completionCoin(s: string): string;
|
|
509
455
|
declare function mintZeroCoin(txb: Transaction, coinType: string): TransactionObjectArgument;
|
|
510
456
|
declare function compareCoins(coinA: string, coinB: string): boolean;
|
|
@@ -537,6 +483,10 @@ declare function fixSuiObjectId(value: string): string;
|
|
|
537
483
|
declare function patchFixSuiObjectId(data: any): void;
|
|
538
484
|
declare function createTarget(packageName: string, moduleName: string, functionName: string): `${string}::${string}::${string}`;
|
|
539
485
|
|
|
486
|
+
interface Dex {
|
|
487
|
+
swap(client: AggregatorClient, ptb: Transaction, path: Path, inputCoin: TransactionObjectArgument, packages?: Map<string, string>, deepbookv3DeepFee?: TransactionObjectArgument): Promise<TransactionObjectArgument>;
|
|
488
|
+
}
|
|
489
|
+
|
|
540
490
|
interface GasMetrics {
|
|
541
491
|
computationCost: string;
|
|
542
492
|
storageCost: string;
|
|
@@ -969,4 +919,4 @@ declare class CoinUtils {
|
|
|
969
919
|
static calculateTotalBalance(coins: CoinAsset[]): bigint;
|
|
970
920
|
}
|
|
971
921
|
|
|
972
|
-
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 };
|