@cetusprotocol/aggregator-sdk 1.6.1 → 1.6.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 +6 -6
- package/dist/index.cjs +151 -6
- package/dist/index.d.cts +24 -1
- package/dist/index.d.ts +24 -1
- package/dist/index.js +151 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -196,18 +196,18 @@ if (routerRes != null) {
|
|
|
196
196
|
|
|
197
197
|
| Contract | Tag of Repo | Latest published at address |
|
|
198
198
|
| ------------------------- | ----------- | ------------------------------------------------------------------ |
|
|
199
|
-
| CetusAggregatorV2 | mainnet |
|
|
199
|
+
| CetusAggregatorV2 | mainnet | 0x3a7fa58adcd7ff474ca0330c93068b139f5263c0cf9c64e702f5c4b17996ff10 |
|
|
200
200
|
| CetusAggregatorV2ExtendV1 | mainnet | 0x2edc22bf96c85482b2208624fa9339255d5055113c92fd6c33add48ce971b774 |
|
|
201
201
|
| CetusAggregatorV2ExtendV2 | mainnet | 0x2e227a3cbc6715518b18ed339d2f967153674b7b257da114ca62c72b2011258a |
|
|
202
202
|
|
|
203
203
|
## Example
|
|
204
204
|
|
|
205
205
|
```
|
|
206
|
-
CetusAggregatorV2 = { git = "https://github.com/CetusProtocol/aggregator.git", subdir = "packages/cetus-aggregator-v2/mainnet", rev = "mainnet-v1.
|
|
206
|
+
CetusAggregatorV2 = { git = "https://github.com/CetusProtocol/aggregator.git", subdir = "packages/cetus-aggregator-v2/mainnet", rev = "mainnet-v1.63.0", override = true }
|
|
207
207
|
|
|
208
|
-
CetusAggregatorV2ExtendV1 = { git = "https://github.com/CetusProtocol/aggregator.git", subdir = "packages/cetus-aggregator-v2-extend-v1", rev = "mainnet-v1.
|
|
208
|
+
CetusAggregatorV2ExtendV1 = { git = "https://github.com/CetusProtocol/aggregator.git", subdir = "packages/cetus-aggregator-v2-extend-v1", rev = "mainnet-v1.63.0", override = true }
|
|
209
209
|
|
|
210
|
-
CetusAggregatorV2ExtendV2 = { git = "https://github.com/CetusProtocol/aggregator.git", subdir = "packages/cetus-aggregator-v2-extend-v2", rev = "mainnet-v1.
|
|
210
|
+
CetusAggregatorV2ExtendV2 = { git = "https://github.com/CetusProtocol/aggregator.git", subdir = "packages/cetus-aggregator-v2-extend-v2", rev = "mainnet-v1.63.0", override = true }
|
|
211
211
|
```
|
|
212
212
|
|
|
213
213
|
# Simple Aggregator Contract Interface
|
|
@@ -218,12 +218,12 @@ CetusAggregatorV2ExtendV2 = { git = "https://github.com/CetusProtocol/aggregator
|
|
|
218
218
|
|
|
219
219
|
| Contract | Tag of Repo | Latest published at address |
|
|
220
220
|
| --------------------- | ----------- | ------------------------------------------------------------------ |
|
|
221
|
-
| CetusAggregatorSimple | mainnet |
|
|
221
|
+
| CetusAggregatorSimple | mainnet | 0xf44ab76524a6b22a175968ae193a13f4905aea9b805afb6db51655b6b59db69e |
|
|
222
222
|
|
|
223
223
|
## Example
|
|
224
224
|
|
|
225
225
|
```
|
|
226
|
-
CetusAggregatorSimple = { git = "https://github.com/CetusProtocol/aggregator.git", subdir = "packages/cetus-aggregator-v2/simple-mainnet", rev = "mainnet-v1.
|
|
226
|
+
CetusAggregatorSimple = { git = "https://github.com/CetusProtocol/aggregator.git", subdir = "packages/cetus-aggregator-v2/simple-mainnet", rev = "mainnet-v1.63.0", override = true }
|
|
227
227
|
```
|
|
228
228
|
|
|
229
229
|
## Usage
|
package/dist/index.cjs
CHANGED
|
@@ -3416,7 +3416,7 @@ var AGGREGATOR_V3_CONFIG = {
|
|
|
3416
3416
|
};
|
|
3417
3417
|
|
|
3418
3418
|
// src/api.ts
|
|
3419
|
-
var SDK_VERSION =
|
|
3419
|
+
var SDK_VERSION = 1010602;
|
|
3420
3420
|
function parseRouterResponse(data, byAmountIn) {
|
|
3421
3421
|
let packages = /* @__PURE__ */ new Map();
|
|
3422
3422
|
if (data.packages) {
|
|
@@ -7822,20 +7822,56 @@ function transferOrDestroyCoin(params, txb) {
|
|
|
7822
7822
|
});
|
|
7823
7823
|
}
|
|
7824
7824
|
var MAX_ARGUMENT_SIZE = 16 * 1024;
|
|
7825
|
+
var DEFAULT_HERMES_URL = "https://hermes.pyth.network";
|
|
7826
|
+
var DEFAULT_AVAILABILITY_TIMEOUT = 3e3;
|
|
7827
|
+
var DEFAULT_IS_AVAILABLE_STATUS = (status) => status >= 200 && status < 400;
|
|
7825
7828
|
var PythAdapter = class {
|
|
7826
7829
|
constructor(client, pythStateId, wormholeStateId, hermesUrls) {
|
|
7827
7830
|
this.priceFeedObjectIdCache = /* @__PURE__ */ new Map();
|
|
7828
7831
|
this.client = client;
|
|
7829
7832
|
this.pythStateId = pythStateId;
|
|
7830
7833
|
this.wormholeStateId = wormholeStateId;
|
|
7831
|
-
const urls =
|
|
7832
|
-
|
|
7833
|
-
|
|
7834
|
+
const urls = Array.from(
|
|
7835
|
+
new Set(hermesUrls.filter(Boolean).map(normalizeServiceUrl))
|
|
7836
|
+
);
|
|
7837
|
+
if (!urls.includes(DEFAULT_HERMES_URL)) {
|
|
7838
|
+
urls.push(DEFAULT_HERMES_URL);
|
|
7834
7839
|
}
|
|
7840
|
+
this.hermesUrls = urls;
|
|
7835
7841
|
this.hermesClients = urls.map(
|
|
7836
7842
|
(url) => new hermesClient.HermesClient(url, { timeout: 3e3 })
|
|
7837
7843
|
);
|
|
7838
7844
|
}
|
|
7845
|
+
getHermesUrls() {
|
|
7846
|
+
return [...this.hermesUrls];
|
|
7847
|
+
}
|
|
7848
|
+
async checkHermesAvailability({
|
|
7849
|
+
timeout = DEFAULT_AVAILABILITY_TIMEOUT,
|
|
7850
|
+
isAvailableStatus = DEFAULT_IS_AVAILABLE_STATUS
|
|
7851
|
+
} = {}) {
|
|
7852
|
+
if (this.hermesUrls.length === 0) {
|
|
7853
|
+
return {
|
|
7854
|
+
checked: false,
|
|
7855
|
+
availableUrls: [],
|
|
7856
|
+
unavailableUrls: []
|
|
7857
|
+
};
|
|
7858
|
+
}
|
|
7859
|
+
const results = await Promise.all(
|
|
7860
|
+
this.hermesUrls.map(async (url) => ({
|
|
7861
|
+
url,
|
|
7862
|
+
available: await checkServiceUrl(url, timeout, isAvailableStatus)
|
|
7863
|
+
}))
|
|
7864
|
+
);
|
|
7865
|
+
return {
|
|
7866
|
+
checked: true,
|
|
7867
|
+
availableUrls: results.filter((result) => result.available).map((result) => result.url),
|
|
7868
|
+
unavailableUrls: results.filter((result) => !result.available).map((result) => result.url)
|
|
7869
|
+
};
|
|
7870
|
+
}
|
|
7871
|
+
async isHermesAvailable(options) {
|
|
7872
|
+
const snapshot = await this.checkHermesAvailability(options);
|
|
7873
|
+
return snapshot.availableUrls.length > 0;
|
|
7874
|
+
}
|
|
7839
7875
|
async getPriceFeedsUpdateData(priceIDs) {
|
|
7840
7876
|
let lastError = null;
|
|
7841
7877
|
for (const hermes of this.hermesClients) {
|
|
@@ -8044,6 +8080,25 @@ var PythAdapter = class {
|
|
|
8044
8080
|
return priceInfoObjects;
|
|
8045
8081
|
}
|
|
8046
8082
|
};
|
|
8083
|
+
async function checkServiceUrl(url, timeout, isAvailableStatus) {
|
|
8084
|
+
const controller = new AbortController();
|
|
8085
|
+
const timer = setTimeout(() => controller.abort(), timeout);
|
|
8086
|
+
try {
|
|
8087
|
+
const response = await fetch(url, {
|
|
8088
|
+
method: "GET",
|
|
8089
|
+
cache: "no-store",
|
|
8090
|
+
signal: controller.signal
|
|
8091
|
+
});
|
|
8092
|
+
return isAvailableStatus(response.status);
|
|
8093
|
+
} catch {
|
|
8094
|
+
return false;
|
|
8095
|
+
} finally {
|
|
8096
|
+
clearTimeout(timer);
|
|
8097
|
+
}
|
|
8098
|
+
}
|
|
8099
|
+
function normalizeServiceUrl(url) {
|
|
8100
|
+
return url.replace(/\/+$/, "");
|
|
8101
|
+
}
|
|
8047
8102
|
|
|
8048
8103
|
// src/utils/uuid.ts
|
|
8049
8104
|
function generateDowngradeUuid6() {
|
|
@@ -8948,6 +9003,12 @@ var ALL_DEXES = [
|
|
|
8948
9003
|
MAGMAPROPAMM,
|
|
8949
9004
|
HAEDALPROPAMM
|
|
8950
9005
|
];
|
|
9006
|
+
var PYTH_ORACLE_BASED_DEXES = [
|
|
9007
|
+
HAEDALPMM,
|
|
9008
|
+
METASTABLE,
|
|
9009
|
+
STEAMM_OMM_V2,
|
|
9010
|
+
HAEDALHMMV2
|
|
9011
|
+
];
|
|
8951
9012
|
function getAllProviders() {
|
|
8952
9013
|
return ALL_DEXES;
|
|
8953
9014
|
}
|
|
@@ -9027,6 +9088,9 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
9027
9088
|
this.apiKey = params.apiKey || "";
|
|
9028
9089
|
this.partner = params.partner;
|
|
9029
9090
|
this.cetusDlmmPartner = params.cetusDlmmPartner;
|
|
9091
|
+
this.pythAvailabilityCheckInterval = validatePythAvailabilityCheckInterval(
|
|
9092
|
+
params.pythAvailabilityCheckInterval
|
|
9093
|
+
);
|
|
9030
9094
|
if (params.overlayFeeRate) {
|
|
9031
9095
|
if (params.overlayFeeRate > 0 && params.overlayFeeRate <= CLIENT_CONFIG.MAX_OVERLAY_FEE_RATE) {
|
|
9032
9096
|
this.overlayFeeRate = params.overlayFeeRate * AGGREGATOR_V3_CONFIG.FEE_DENOMINATOR;
|
|
@@ -9069,23 +9133,74 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
9069
9133
|
}
|
|
9070
9134
|
}
|
|
9071
9135
|
async findRouters(params) {
|
|
9136
|
+
const {
|
|
9137
|
+
params: routerParams,
|
|
9138
|
+
providersExhausted
|
|
9139
|
+
} = await this.filterProvidersByPythAvailability(params);
|
|
9140
|
+
if (providersExhausted) {
|
|
9141
|
+
return emptyRouterResult(routerParams.byAmountIn);
|
|
9142
|
+
}
|
|
9072
9143
|
return getRouterResult(
|
|
9073
9144
|
this.endpoint,
|
|
9074
9145
|
this.apiKey,
|
|
9075
|
-
|
|
9146
|
+
routerParams,
|
|
9076
9147
|
this.overlayFeeRate,
|
|
9077
9148
|
this.overlayFeeReceiver
|
|
9078
9149
|
);
|
|
9079
9150
|
}
|
|
9080
9151
|
async findMergeSwapRouters(params) {
|
|
9152
|
+
const {
|
|
9153
|
+
params: routerParams,
|
|
9154
|
+
providersExhausted
|
|
9155
|
+
} = await this.filterProvidersByPythAvailability(params);
|
|
9156
|
+
if (providersExhausted) {
|
|
9157
|
+
return emptyMergeSwapResult();
|
|
9158
|
+
}
|
|
9081
9159
|
return getMergeSwapResult(
|
|
9082
9160
|
this.endpoint,
|
|
9083
9161
|
this.apiKey,
|
|
9084
|
-
|
|
9162
|
+
routerParams,
|
|
9085
9163
|
this.overlayFeeRate,
|
|
9086
9164
|
this.overlayFeeReceiver
|
|
9087
9165
|
);
|
|
9088
9166
|
}
|
|
9167
|
+
async filterProvidersByPythAvailability(params) {
|
|
9168
|
+
const interval = validatePythAvailabilityCheckInterval(
|
|
9169
|
+
params.pythAvailabilityCheckInterval ?? this.pythAvailabilityCheckInterval
|
|
9170
|
+
);
|
|
9171
|
+
if (interval === void 0) {
|
|
9172
|
+
return { params, providersExhausted: false };
|
|
9173
|
+
}
|
|
9174
|
+
const pythAvailable = await this.getPythAvailability(interval);
|
|
9175
|
+
if (pythAvailable) {
|
|
9176
|
+
return { params, providersExhausted: false };
|
|
9177
|
+
}
|
|
9178
|
+
const sourceProviders = params.providers && params.providers.length > 0 ? params.providers : ALL_DEXES;
|
|
9179
|
+
const providers = sourceProviders.filter(
|
|
9180
|
+
(provider) => !PYTH_ORACLE_BASED_DEXES.includes(provider)
|
|
9181
|
+
);
|
|
9182
|
+
return {
|
|
9183
|
+
params: { ...params, providers },
|
|
9184
|
+
providersExhausted: providers.length === 0
|
|
9185
|
+
};
|
|
9186
|
+
}
|
|
9187
|
+
async getPythAvailability(interval) {
|
|
9188
|
+
const now = Date.now();
|
|
9189
|
+
if (this.pythAvailable !== void 0 && this.pythAvailabilityCheckedAt !== void 0 && now - this.pythAvailabilityCheckedAt < interval) {
|
|
9190
|
+
return this.pythAvailable;
|
|
9191
|
+
}
|
|
9192
|
+
if (this.pythAvailabilityPromise) {
|
|
9193
|
+
return this.pythAvailabilityPromise;
|
|
9194
|
+
}
|
|
9195
|
+
this.pythAvailabilityPromise = this.pythAdapter.isHermesAvailable().catch(() => false).then((available) => {
|
|
9196
|
+
this.pythAvailable = available;
|
|
9197
|
+
this.pythAvailabilityCheckedAt = Date.now();
|
|
9198
|
+
return available;
|
|
9199
|
+
}).finally(() => {
|
|
9200
|
+
this.pythAvailabilityPromise = void 0;
|
|
9201
|
+
});
|
|
9202
|
+
return this.pythAvailabilityPromise;
|
|
9203
|
+
}
|
|
9089
9204
|
async executeFlexibleInputSwap(txb, inputCoin, routerData, expectedAmountOut, amountLimit, pythPriceIDs, partner, deepbookv3DeepFee, packages) {
|
|
9090
9205
|
}
|
|
9091
9206
|
newDexRouterV3(provider, pythPriceIDs, partner, cetusDlmmPartner) {
|
|
@@ -10047,6 +10162,35 @@ function generateUUID() {
|
|
|
10047
10162
|
return v.toString(16);
|
|
10048
10163
|
});
|
|
10049
10164
|
}
|
|
10165
|
+
function validatePythAvailabilityCheckInterval(interval) {
|
|
10166
|
+
if (interval === void 0) {
|
|
10167
|
+
return void 0;
|
|
10168
|
+
}
|
|
10169
|
+
if (!Number.isFinite(interval) || interval < 0) {
|
|
10170
|
+
throw new Error(
|
|
10171
|
+
"pythAvailabilityCheckInterval must be a non-negative number"
|
|
10172
|
+
);
|
|
10173
|
+
}
|
|
10174
|
+
return interval;
|
|
10175
|
+
}
|
|
10176
|
+
function emptyRouterResult(byAmountIn) {
|
|
10177
|
+
return {
|
|
10178
|
+
quoteID: "",
|
|
10179
|
+
amountIn: ZERO,
|
|
10180
|
+
amountOut: ZERO,
|
|
10181
|
+
paths: [],
|
|
10182
|
+
byAmountIn,
|
|
10183
|
+
insufficientLiquidity: true,
|
|
10184
|
+
deviationRatio: 0
|
|
10185
|
+
};
|
|
10186
|
+
}
|
|
10187
|
+
function emptyMergeSwapResult() {
|
|
10188
|
+
return {
|
|
10189
|
+
quoteID: "",
|
|
10190
|
+
totalAmountOut: ZERO,
|
|
10191
|
+
allRoutes: []
|
|
10192
|
+
};
|
|
10193
|
+
}
|
|
10050
10194
|
function recordFirstCoinIndex(paths) {
|
|
10051
10195
|
let newCoinRecord = /* @__PURE__ */ new Map();
|
|
10052
10196
|
for (let i = 0; i < paths.length; i++) {
|
|
@@ -10186,6 +10330,7 @@ exports.PAY_MODULE = PAY_MODULE;
|
|
|
10186
10330
|
exports.POOL_MODULT = POOL_MODULT;
|
|
10187
10331
|
exports.PUBLISHED_ADDRESSES = PUBLISHED_ADDRESSES;
|
|
10188
10332
|
exports.PYTH_CONFIG = PYTH_CONFIG;
|
|
10333
|
+
exports.PYTH_ORACLE_BASED_DEXES = PYTH_ORACLE_BASED_DEXES;
|
|
10189
10334
|
exports.PYTH_PRELUDE_CALLS = PYTH_PRELUDE_CALLS;
|
|
10190
10335
|
exports.REPAY_FLASH_SWAP_A2B_FUNC = REPAY_FLASH_SWAP_A2B_FUNC;
|
|
10191
10336
|
exports.REPAY_FLASH_SWAP_B2A_FUNC = REPAY_FLASH_SWAP_B2A_FUNC;
|
package/dist/index.d.cts
CHANGED
|
@@ -15,6 +15,7 @@ interface FindRouterParams {
|
|
|
15
15
|
splitFactor?: number;
|
|
16
16
|
splitCount?: number;
|
|
17
17
|
providers?: string[];
|
|
18
|
+
pythAvailabilityCheckInterval?: number;
|
|
18
19
|
liquidityChanges?: PreSwapLpChangeParams[];
|
|
19
20
|
}
|
|
20
21
|
interface MergeSwapFromCoin {
|
|
@@ -26,6 +27,7 @@ interface MergeSwapParams {
|
|
|
26
27
|
byAmountIn: boolean;
|
|
27
28
|
depth?: number;
|
|
28
29
|
providers?: string[];
|
|
30
|
+
pythAvailabilityCheckInterval?: number;
|
|
29
31
|
froms: MergeSwapFromCoin[];
|
|
30
32
|
}
|
|
31
33
|
interface MergeSwapInputCoin {
|
|
@@ -277,9 +279,19 @@ interface PriceTableInfo {
|
|
|
277
279
|
id: ObjectId;
|
|
278
280
|
fieldType: string;
|
|
279
281
|
}
|
|
282
|
+
interface PythAvailabilitySnapshot {
|
|
283
|
+
checked: boolean;
|
|
284
|
+
availableUrls: string[];
|
|
285
|
+
unavailableUrls: string[];
|
|
286
|
+
}
|
|
287
|
+
interface PythAvailabilityOptions {
|
|
288
|
+
timeout?: number;
|
|
289
|
+
isAvailableStatus?: (status: number) => boolean;
|
|
290
|
+
}
|
|
280
291
|
declare class PythAdapter {
|
|
281
292
|
private client;
|
|
282
293
|
private hermesClients;
|
|
294
|
+
private hermesUrls;
|
|
283
295
|
private pythStateId;
|
|
284
296
|
private wormholeStateId;
|
|
285
297
|
private pythPackageId;
|
|
@@ -288,6 +300,9 @@ declare class PythAdapter {
|
|
|
288
300
|
private priceFeedObjectIdCache;
|
|
289
301
|
private baseUpdateFee;
|
|
290
302
|
constructor(client: SuiGrpcClient, pythStateId: ObjectId, wormholeStateId: ObjectId, hermesUrls: string[]);
|
|
303
|
+
getHermesUrls(): string[];
|
|
304
|
+
checkHermesAvailability({ timeout, isAvailableStatus, }?: PythAvailabilityOptions): Promise<PythAvailabilitySnapshot>;
|
|
305
|
+
isHermesAvailable(options?: PythAvailabilityOptions): Promise<boolean>;
|
|
291
306
|
getPriceFeedsUpdateData(priceIDs: string[]): Promise<Buffer[]>;
|
|
292
307
|
getBaseUpdateFee(): Promise<number>;
|
|
293
308
|
getPackageId(objectId: ObjectId): Promise<string>;
|
|
@@ -340,6 +355,7 @@ declare const MAGMAPROPAMM = "MAGMAPROPAMM";
|
|
|
340
355
|
declare const HAEDALPROPAMM = "HAEDALPROPAMM";
|
|
341
356
|
declare const DEFAULT_ENDPOINT = "https://api-sui.cetus.zone/router_v3";
|
|
342
357
|
declare const ALL_DEXES: string[];
|
|
358
|
+
declare const PYTH_ORACLE_BASED_DEXES: string[];
|
|
343
359
|
type BuildRouterSwapParamsV3 = {
|
|
344
360
|
router: RouterDataV3;
|
|
345
361
|
inputCoin: TransactionObjectArgument;
|
|
@@ -407,6 +423,7 @@ type AggregatorClientParams = {
|
|
|
407
423
|
overlayFeeRate?: number;
|
|
408
424
|
overlayFeeReceiver?: string;
|
|
409
425
|
cetusDlmmPartner?: string;
|
|
426
|
+
pythAvailabilityCheckInterval?: number;
|
|
410
427
|
};
|
|
411
428
|
declare class AggregatorClient {
|
|
412
429
|
endpoint: string;
|
|
@@ -419,6 +436,10 @@ declare class AggregatorClient {
|
|
|
419
436
|
protected overlayFeeReceiver: string;
|
|
420
437
|
protected partner?: string;
|
|
421
438
|
protected cetusDlmmPartner?: string;
|
|
439
|
+
private pythAvailabilityCheckInterval?;
|
|
440
|
+
private pythAvailabilityCheckedAt?;
|
|
441
|
+
private pythAvailable?;
|
|
442
|
+
private pythAvailabilityPromise?;
|
|
422
443
|
private static readonly CONFIG;
|
|
423
444
|
constructor(params: AggregatorClientParams);
|
|
424
445
|
deepbookv3DeepFeeType(): string;
|
|
@@ -426,6 +447,8 @@ declare class AggregatorClient {
|
|
|
426
447
|
getOneCoinUsedToMerge(coinType: string): Promise<string | null>;
|
|
427
448
|
findRouters(params: FindRouterParams): Promise<RouterDataV3 | null>;
|
|
428
449
|
findMergeSwapRouters(params: MergeSwapParams): Promise<MergeSwapRouterData | null>;
|
|
450
|
+
private filterProvidersByPythAvailability;
|
|
451
|
+
private getPythAvailability;
|
|
429
452
|
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>;
|
|
430
453
|
newDexRouterV3(provider: string, pythPriceIDs: Map<string, string>, partner?: string, cetusDlmmPartner?: string): DexRouter;
|
|
431
454
|
expectInputSwapV3(txb: Transaction, inputCoin: TransactionObjectArgument, routerData: RouterDataV3, expectAmountOut: string, amountOutLimit: string, pythPriceIDs: Map<string, string>, partner?: string, cetusDlmmPartner?: string): TransactionObjectArgument;
|
|
@@ -1176,4 +1199,4 @@ declare class CoinUtils {
|
|
|
1176
1199
|
static calculateTotalBalance(coins: CoinAsset[]): bigint;
|
|
1177
1200
|
}
|
|
1178
1201
|
|
|
1179
|
-
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, BOLT, type BigNumber, type BuildCoinResult, type BuildFastMergeSwapParams, type BuildFastRouterSwapParams, type BuildFastRouterSwapParamsV2, type BuildFastRouterSwapParamsV3, type BuildMergeSwapParams, type BuildRouterSwapParams, type BuildRouterSwapParamsV2, type BuildRouterSwapParamsV3, type BuildSponsoredTransactionParams, CETUS, CETUSDLMM, CETUS_DEX, CETUS_MODULE, CETUS_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, FERRACLMM, FERRADLMM, 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, HAEDALPROPAMM, HAWAL, INTEGRATE, JOIN_FUNC, KRIYA, KRIYAV3, KRIYA_DEX, KRIYA_MODULE, MAGMA, MAGMAPROPAMM, 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_V3_PUBLISHED_AT, MAINNET_FLOWX_AMM_CONTAINER_ID, METASTABLE, MOMENTUM, type MergeRoute, type MergeSwapFromCoin, type MergeSwapInputCoin, type MergeSwapParams, type MergeSwapRouterData, type NFT, OBRIC, ONE, PACKAGE_NAMES, PAY_MODULE, POOL_MODULT, PUBLISHED_ADDRESSES, PYTH_CONFIG, PYTH_PRELUDE_CALLS, 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, SWAP_GAS_BUDGET_TABLE, type SimulateTransactionResult, type SuiAddress, type SuiBasicTypes, type SuiInputTypes, type SuiMoveObject, 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_V3_PUBLISHED_AT, 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, estimateSwapGasBudget, exportToCSV, exportToJSON, extractAddressFromType, extractGasMetrics, extractStructTagFromType, extractTimestampFromDowngradeUuid6, fixSuiObjectId, formatGasMetrics, generateDowngradeUuid6, generateSimpleDowngradeUuid6, getAggregatorServerErrorMessage, getAggregatorV2Extend2PublishedAt, getAggregatorV2ExtendPublishedAt, getAggregatorV2PublishedAt, getAllProviders, getDeepbookV3Config, getDefaultSuiInputType, getMergeSwapResult, getOrCreateAccountCap, getProvidersExcluding, getProvidersIncluding, getRouterResult, hasPythPrelude, isSortedSymbols, isValidDowngradeUuid6, lookupGasBudget, mintZeroCoin, normalizeCoinType, parseAftermathFeeType, parseTurbosPoolFeeType, patchFixSuiObjectId, printTransaction, processEndpoint, processFlattenRoutes, restituteMsafeFastRouterSwapParams };
|
|
1202
|
+
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, BOLT, type BigNumber, type BuildCoinResult, type BuildFastMergeSwapParams, type BuildFastRouterSwapParams, type BuildFastRouterSwapParamsV2, type BuildFastRouterSwapParamsV3, type BuildMergeSwapParams, type BuildRouterSwapParams, type BuildRouterSwapParamsV2, type BuildRouterSwapParamsV3, type BuildSponsoredTransactionParams, CETUS, CETUSDLMM, CETUS_DEX, CETUS_MODULE, CETUS_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, FERRACLMM, FERRADLMM, 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, HAEDALPROPAMM, HAWAL, INTEGRATE, JOIN_FUNC, KRIYA, KRIYAV3, KRIYA_DEX, KRIYA_MODULE, MAGMA, MAGMAPROPAMM, 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_V3_PUBLISHED_AT, MAINNET_FLOWX_AMM_CONTAINER_ID, METASTABLE, MOMENTUM, type MergeRoute, type MergeSwapFromCoin, type MergeSwapInputCoin, type MergeSwapParams, type MergeSwapRouterData, type NFT, OBRIC, ONE, PACKAGE_NAMES, PAY_MODULE, POOL_MODULT, PUBLISHED_ADDRESSES, PYTH_CONFIG, PYTH_ORACLE_BASED_DEXES, PYTH_PRELUDE_CALLS, 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, SWAP_GAS_BUDGET_TABLE, type SimulateTransactionResult, type SuiAddress, type SuiBasicTypes, type SuiInputTypes, type SuiMoveObject, 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_V3_PUBLISHED_AT, 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, estimateSwapGasBudget, exportToCSV, exportToJSON, extractAddressFromType, extractGasMetrics, extractStructTagFromType, extractTimestampFromDowngradeUuid6, fixSuiObjectId, formatGasMetrics, generateDowngradeUuid6, generateSimpleDowngradeUuid6, getAggregatorServerErrorMessage, getAggregatorV2Extend2PublishedAt, getAggregatorV2ExtendPublishedAt, getAggregatorV2PublishedAt, getAllProviders, getDeepbookV3Config, getDefaultSuiInputType, getMergeSwapResult, getOrCreateAccountCap, getProvidersExcluding, getProvidersIncluding, getRouterResult, hasPythPrelude, isSortedSymbols, isValidDowngradeUuid6, lookupGasBudget, mintZeroCoin, normalizeCoinType, parseAftermathFeeType, parseTurbosPoolFeeType, patchFixSuiObjectId, printTransaction, processEndpoint, processFlattenRoutes, restituteMsafeFastRouterSwapParams };
|
package/dist/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ interface FindRouterParams {
|
|
|
15
15
|
splitFactor?: number;
|
|
16
16
|
splitCount?: number;
|
|
17
17
|
providers?: string[];
|
|
18
|
+
pythAvailabilityCheckInterval?: number;
|
|
18
19
|
liquidityChanges?: PreSwapLpChangeParams[];
|
|
19
20
|
}
|
|
20
21
|
interface MergeSwapFromCoin {
|
|
@@ -26,6 +27,7 @@ interface MergeSwapParams {
|
|
|
26
27
|
byAmountIn: boolean;
|
|
27
28
|
depth?: number;
|
|
28
29
|
providers?: string[];
|
|
30
|
+
pythAvailabilityCheckInterval?: number;
|
|
29
31
|
froms: MergeSwapFromCoin[];
|
|
30
32
|
}
|
|
31
33
|
interface MergeSwapInputCoin {
|
|
@@ -277,9 +279,19 @@ interface PriceTableInfo {
|
|
|
277
279
|
id: ObjectId;
|
|
278
280
|
fieldType: string;
|
|
279
281
|
}
|
|
282
|
+
interface PythAvailabilitySnapshot {
|
|
283
|
+
checked: boolean;
|
|
284
|
+
availableUrls: string[];
|
|
285
|
+
unavailableUrls: string[];
|
|
286
|
+
}
|
|
287
|
+
interface PythAvailabilityOptions {
|
|
288
|
+
timeout?: number;
|
|
289
|
+
isAvailableStatus?: (status: number) => boolean;
|
|
290
|
+
}
|
|
280
291
|
declare class PythAdapter {
|
|
281
292
|
private client;
|
|
282
293
|
private hermesClients;
|
|
294
|
+
private hermesUrls;
|
|
283
295
|
private pythStateId;
|
|
284
296
|
private wormholeStateId;
|
|
285
297
|
private pythPackageId;
|
|
@@ -288,6 +300,9 @@ declare class PythAdapter {
|
|
|
288
300
|
private priceFeedObjectIdCache;
|
|
289
301
|
private baseUpdateFee;
|
|
290
302
|
constructor(client: SuiGrpcClient, pythStateId: ObjectId, wormholeStateId: ObjectId, hermesUrls: string[]);
|
|
303
|
+
getHermesUrls(): string[];
|
|
304
|
+
checkHermesAvailability({ timeout, isAvailableStatus, }?: PythAvailabilityOptions): Promise<PythAvailabilitySnapshot>;
|
|
305
|
+
isHermesAvailable(options?: PythAvailabilityOptions): Promise<boolean>;
|
|
291
306
|
getPriceFeedsUpdateData(priceIDs: string[]): Promise<Buffer[]>;
|
|
292
307
|
getBaseUpdateFee(): Promise<number>;
|
|
293
308
|
getPackageId(objectId: ObjectId): Promise<string>;
|
|
@@ -340,6 +355,7 @@ declare const MAGMAPROPAMM = "MAGMAPROPAMM";
|
|
|
340
355
|
declare const HAEDALPROPAMM = "HAEDALPROPAMM";
|
|
341
356
|
declare const DEFAULT_ENDPOINT = "https://api-sui.cetus.zone/router_v3";
|
|
342
357
|
declare const ALL_DEXES: string[];
|
|
358
|
+
declare const PYTH_ORACLE_BASED_DEXES: string[];
|
|
343
359
|
type BuildRouterSwapParamsV3 = {
|
|
344
360
|
router: RouterDataV3;
|
|
345
361
|
inputCoin: TransactionObjectArgument;
|
|
@@ -407,6 +423,7 @@ type AggregatorClientParams = {
|
|
|
407
423
|
overlayFeeRate?: number;
|
|
408
424
|
overlayFeeReceiver?: string;
|
|
409
425
|
cetusDlmmPartner?: string;
|
|
426
|
+
pythAvailabilityCheckInterval?: number;
|
|
410
427
|
};
|
|
411
428
|
declare class AggregatorClient {
|
|
412
429
|
endpoint: string;
|
|
@@ -419,6 +436,10 @@ declare class AggregatorClient {
|
|
|
419
436
|
protected overlayFeeReceiver: string;
|
|
420
437
|
protected partner?: string;
|
|
421
438
|
protected cetusDlmmPartner?: string;
|
|
439
|
+
private pythAvailabilityCheckInterval?;
|
|
440
|
+
private pythAvailabilityCheckedAt?;
|
|
441
|
+
private pythAvailable?;
|
|
442
|
+
private pythAvailabilityPromise?;
|
|
422
443
|
private static readonly CONFIG;
|
|
423
444
|
constructor(params: AggregatorClientParams);
|
|
424
445
|
deepbookv3DeepFeeType(): string;
|
|
@@ -426,6 +447,8 @@ declare class AggregatorClient {
|
|
|
426
447
|
getOneCoinUsedToMerge(coinType: string): Promise<string | null>;
|
|
427
448
|
findRouters(params: FindRouterParams): Promise<RouterDataV3 | null>;
|
|
428
449
|
findMergeSwapRouters(params: MergeSwapParams): Promise<MergeSwapRouterData | null>;
|
|
450
|
+
private filterProvidersByPythAvailability;
|
|
451
|
+
private getPythAvailability;
|
|
429
452
|
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>;
|
|
430
453
|
newDexRouterV3(provider: string, pythPriceIDs: Map<string, string>, partner?: string, cetusDlmmPartner?: string): DexRouter;
|
|
431
454
|
expectInputSwapV3(txb: Transaction, inputCoin: TransactionObjectArgument, routerData: RouterDataV3, expectAmountOut: string, amountOutLimit: string, pythPriceIDs: Map<string, string>, partner?: string, cetusDlmmPartner?: string): TransactionObjectArgument;
|
|
@@ -1176,4 +1199,4 @@ declare class CoinUtils {
|
|
|
1176
1199
|
static calculateTotalBalance(coins: CoinAsset[]): bigint;
|
|
1177
1200
|
}
|
|
1178
1201
|
|
|
1179
|
-
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, BOLT, type BigNumber, type BuildCoinResult, type BuildFastMergeSwapParams, type BuildFastRouterSwapParams, type BuildFastRouterSwapParamsV2, type BuildFastRouterSwapParamsV3, type BuildMergeSwapParams, type BuildRouterSwapParams, type BuildRouterSwapParamsV2, type BuildRouterSwapParamsV3, type BuildSponsoredTransactionParams, CETUS, CETUSDLMM, CETUS_DEX, CETUS_MODULE, CETUS_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, FERRACLMM, FERRADLMM, 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, HAEDALPROPAMM, HAWAL, INTEGRATE, JOIN_FUNC, KRIYA, KRIYAV3, KRIYA_DEX, KRIYA_MODULE, MAGMA, MAGMAPROPAMM, 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_V3_PUBLISHED_AT, MAINNET_FLOWX_AMM_CONTAINER_ID, METASTABLE, MOMENTUM, type MergeRoute, type MergeSwapFromCoin, type MergeSwapInputCoin, type MergeSwapParams, type MergeSwapRouterData, type NFT, OBRIC, ONE, PACKAGE_NAMES, PAY_MODULE, POOL_MODULT, PUBLISHED_ADDRESSES, PYTH_CONFIG, PYTH_PRELUDE_CALLS, 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, SWAP_GAS_BUDGET_TABLE, type SimulateTransactionResult, type SuiAddress, type SuiBasicTypes, type SuiInputTypes, type SuiMoveObject, 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_V3_PUBLISHED_AT, 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, estimateSwapGasBudget, exportToCSV, exportToJSON, extractAddressFromType, extractGasMetrics, extractStructTagFromType, extractTimestampFromDowngradeUuid6, fixSuiObjectId, formatGasMetrics, generateDowngradeUuid6, generateSimpleDowngradeUuid6, getAggregatorServerErrorMessage, getAggregatorV2Extend2PublishedAt, getAggregatorV2ExtendPublishedAt, getAggregatorV2PublishedAt, getAllProviders, getDeepbookV3Config, getDefaultSuiInputType, getMergeSwapResult, getOrCreateAccountCap, getProvidersExcluding, getProvidersIncluding, getRouterResult, hasPythPrelude, isSortedSymbols, isValidDowngradeUuid6, lookupGasBudget, mintZeroCoin, normalizeCoinType, parseAftermathFeeType, parseTurbosPoolFeeType, patchFixSuiObjectId, printTransaction, processEndpoint, processFlattenRoutes, restituteMsafeFastRouterSwapParams };
|
|
1202
|
+
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, BOLT, type BigNumber, type BuildCoinResult, type BuildFastMergeSwapParams, type BuildFastRouterSwapParams, type BuildFastRouterSwapParamsV2, type BuildFastRouterSwapParamsV3, type BuildMergeSwapParams, type BuildRouterSwapParams, type BuildRouterSwapParamsV2, type BuildRouterSwapParamsV3, type BuildSponsoredTransactionParams, CETUS, CETUSDLMM, CETUS_DEX, CETUS_MODULE, CETUS_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, FERRACLMM, FERRADLMM, 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, HAEDALPROPAMM, HAWAL, INTEGRATE, JOIN_FUNC, KRIYA, KRIYAV3, KRIYA_DEX, KRIYA_MODULE, MAGMA, MAGMAPROPAMM, 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_V3_PUBLISHED_AT, MAINNET_FLOWX_AMM_CONTAINER_ID, METASTABLE, MOMENTUM, type MergeRoute, type MergeSwapFromCoin, type MergeSwapInputCoin, type MergeSwapParams, type MergeSwapRouterData, type NFT, OBRIC, ONE, PACKAGE_NAMES, PAY_MODULE, POOL_MODULT, PUBLISHED_ADDRESSES, PYTH_CONFIG, PYTH_ORACLE_BASED_DEXES, PYTH_PRELUDE_CALLS, 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, SWAP_GAS_BUDGET_TABLE, type SimulateTransactionResult, type SuiAddress, type SuiBasicTypes, type SuiInputTypes, type SuiMoveObject, 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_V3_PUBLISHED_AT, 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, estimateSwapGasBudget, exportToCSV, exportToJSON, extractAddressFromType, extractGasMetrics, extractStructTagFromType, extractTimestampFromDowngradeUuid6, fixSuiObjectId, formatGasMetrics, generateDowngradeUuid6, generateSimpleDowngradeUuid6, getAggregatorServerErrorMessage, getAggregatorV2Extend2PublishedAt, getAggregatorV2ExtendPublishedAt, getAggregatorV2PublishedAt, getAllProviders, getDeepbookV3Config, getDefaultSuiInputType, getMergeSwapResult, getOrCreateAccountCap, getProvidersExcluding, getProvidersIncluding, getRouterResult, hasPythPrelude, isSortedSymbols, isValidDowngradeUuid6, lookupGasBudget, mintZeroCoin, normalizeCoinType, parseAftermathFeeType, parseTurbosPoolFeeType, patchFixSuiObjectId, printTransaction, processEndpoint, processFlattenRoutes, restituteMsafeFastRouterSwapParams };
|
package/dist/index.js
CHANGED
|
@@ -3410,7 +3410,7 @@ var AGGREGATOR_V3_CONFIG = {
|
|
|
3410
3410
|
};
|
|
3411
3411
|
|
|
3412
3412
|
// src/api.ts
|
|
3413
|
-
var SDK_VERSION =
|
|
3413
|
+
var SDK_VERSION = 1010602;
|
|
3414
3414
|
function parseRouterResponse(data, byAmountIn) {
|
|
3415
3415
|
let packages = /* @__PURE__ */ new Map();
|
|
3416
3416
|
if (data.packages) {
|
|
@@ -7816,20 +7816,56 @@ function transferOrDestroyCoin(params, txb) {
|
|
|
7816
7816
|
});
|
|
7817
7817
|
}
|
|
7818
7818
|
var MAX_ARGUMENT_SIZE = 16 * 1024;
|
|
7819
|
+
var DEFAULT_HERMES_URL = "https://hermes.pyth.network";
|
|
7820
|
+
var DEFAULT_AVAILABILITY_TIMEOUT = 3e3;
|
|
7821
|
+
var DEFAULT_IS_AVAILABLE_STATUS = (status) => status >= 200 && status < 400;
|
|
7819
7822
|
var PythAdapter = class {
|
|
7820
7823
|
constructor(client, pythStateId, wormholeStateId, hermesUrls) {
|
|
7821
7824
|
this.priceFeedObjectIdCache = /* @__PURE__ */ new Map();
|
|
7822
7825
|
this.client = client;
|
|
7823
7826
|
this.pythStateId = pythStateId;
|
|
7824
7827
|
this.wormholeStateId = wormholeStateId;
|
|
7825
|
-
const urls =
|
|
7826
|
-
|
|
7827
|
-
|
|
7828
|
+
const urls = Array.from(
|
|
7829
|
+
new Set(hermesUrls.filter(Boolean).map(normalizeServiceUrl))
|
|
7830
|
+
);
|
|
7831
|
+
if (!urls.includes(DEFAULT_HERMES_URL)) {
|
|
7832
|
+
urls.push(DEFAULT_HERMES_URL);
|
|
7828
7833
|
}
|
|
7834
|
+
this.hermesUrls = urls;
|
|
7829
7835
|
this.hermesClients = urls.map(
|
|
7830
7836
|
(url) => new HermesClient(url, { timeout: 3e3 })
|
|
7831
7837
|
);
|
|
7832
7838
|
}
|
|
7839
|
+
getHermesUrls() {
|
|
7840
|
+
return [...this.hermesUrls];
|
|
7841
|
+
}
|
|
7842
|
+
async checkHermesAvailability({
|
|
7843
|
+
timeout = DEFAULT_AVAILABILITY_TIMEOUT,
|
|
7844
|
+
isAvailableStatus = DEFAULT_IS_AVAILABLE_STATUS
|
|
7845
|
+
} = {}) {
|
|
7846
|
+
if (this.hermesUrls.length === 0) {
|
|
7847
|
+
return {
|
|
7848
|
+
checked: false,
|
|
7849
|
+
availableUrls: [],
|
|
7850
|
+
unavailableUrls: []
|
|
7851
|
+
};
|
|
7852
|
+
}
|
|
7853
|
+
const results = await Promise.all(
|
|
7854
|
+
this.hermesUrls.map(async (url) => ({
|
|
7855
|
+
url,
|
|
7856
|
+
available: await checkServiceUrl(url, timeout, isAvailableStatus)
|
|
7857
|
+
}))
|
|
7858
|
+
);
|
|
7859
|
+
return {
|
|
7860
|
+
checked: true,
|
|
7861
|
+
availableUrls: results.filter((result) => result.available).map((result) => result.url),
|
|
7862
|
+
unavailableUrls: results.filter((result) => !result.available).map((result) => result.url)
|
|
7863
|
+
};
|
|
7864
|
+
}
|
|
7865
|
+
async isHermesAvailable(options) {
|
|
7866
|
+
const snapshot = await this.checkHermesAvailability(options);
|
|
7867
|
+
return snapshot.availableUrls.length > 0;
|
|
7868
|
+
}
|
|
7833
7869
|
async getPriceFeedsUpdateData(priceIDs) {
|
|
7834
7870
|
let lastError = null;
|
|
7835
7871
|
for (const hermes of this.hermesClients) {
|
|
@@ -8038,6 +8074,25 @@ var PythAdapter = class {
|
|
|
8038
8074
|
return priceInfoObjects;
|
|
8039
8075
|
}
|
|
8040
8076
|
};
|
|
8077
|
+
async function checkServiceUrl(url, timeout, isAvailableStatus) {
|
|
8078
|
+
const controller = new AbortController();
|
|
8079
|
+
const timer = setTimeout(() => controller.abort(), timeout);
|
|
8080
|
+
try {
|
|
8081
|
+
const response = await fetch(url, {
|
|
8082
|
+
method: "GET",
|
|
8083
|
+
cache: "no-store",
|
|
8084
|
+
signal: controller.signal
|
|
8085
|
+
});
|
|
8086
|
+
return isAvailableStatus(response.status);
|
|
8087
|
+
} catch {
|
|
8088
|
+
return false;
|
|
8089
|
+
} finally {
|
|
8090
|
+
clearTimeout(timer);
|
|
8091
|
+
}
|
|
8092
|
+
}
|
|
8093
|
+
function normalizeServiceUrl(url) {
|
|
8094
|
+
return url.replace(/\/+$/, "");
|
|
8095
|
+
}
|
|
8041
8096
|
|
|
8042
8097
|
// src/utils/uuid.ts
|
|
8043
8098
|
function generateDowngradeUuid6() {
|
|
@@ -8942,6 +8997,12 @@ var ALL_DEXES = [
|
|
|
8942
8997
|
MAGMAPROPAMM,
|
|
8943
8998
|
HAEDALPROPAMM
|
|
8944
8999
|
];
|
|
9000
|
+
var PYTH_ORACLE_BASED_DEXES = [
|
|
9001
|
+
HAEDALPMM,
|
|
9002
|
+
METASTABLE,
|
|
9003
|
+
STEAMM_OMM_V2,
|
|
9004
|
+
HAEDALHMMV2
|
|
9005
|
+
];
|
|
8945
9006
|
function getAllProviders() {
|
|
8946
9007
|
return ALL_DEXES;
|
|
8947
9008
|
}
|
|
@@ -9021,6 +9082,9 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
9021
9082
|
this.apiKey = params.apiKey || "";
|
|
9022
9083
|
this.partner = params.partner;
|
|
9023
9084
|
this.cetusDlmmPartner = params.cetusDlmmPartner;
|
|
9085
|
+
this.pythAvailabilityCheckInterval = validatePythAvailabilityCheckInterval(
|
|
9086
|
+
params.pythAvailabilityCheckInterval
|
|
9087
|
+
);
|
|
9024
9088
|
if (params.overlayFeeRate) {
|
|
9025
9089
|
if (params.overlayFeeRate > 0 && params.overlayFeeRate <= CLIENT_CONFIG.MAX_OVERLAY_FEE_RATE) {
|
|
9026
9090
|
this.overlayFeeRate = params.overlayFeeRate * AGGREGATOR_V3_CONFIG.FEE_DENOMINATOR;
|
|
@@ -9063,23 +9127,74 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
9063
9127
|
}
|
|
9064
9128
|
}
|
|
9065
9129
|
async findRouters(params) {
|
|
9130
|
+
const {
|
|
9131
|
+
params: routerParams,
|
|
9132
|
+
providersExhausted
|
|
9133
|
+
} = await this.filterProvidersByPythAvailability(params);
|
|
9134
|
+
if (providersExhausted) {
|
|
9135
|
+
return emptyRouterResult(routerParams.byAmountIn);
|
|
9136
|
+
}
|
|
9066
9137
|
return getRouterResult(
|
|
9067
9138
|
this.endpoint,
|
|
9068
9139
|
this.apiKey,
|
|
9069
|
-
|
|
9140
|
+
routerParams,
|
|
9070
9141
|
this.overlayFeeRate,
|
|
9071
9142
|
this.overlayFeeReceiver
|
|
9072
9143
|
);
|
|
9073
9144
|
}
|
|
9074
9145
|
async findMergeSwapRouters(params) {
|
|
9146
|
+
const {
|
|
9147
|
+
params: routerParams,
|
|
9148
|
+
providersExhausted
|
|
9149
|
+
} = await this.filterProvidersByPythAvailability(params);
|
|
9150
|
+
if (providersExhausted) {
|
|
9151
|
+
return emptyMergeSwapResult();
|
|
9152
|
+
}
|
|
9075
9153
|
return getMergeSwapResult(
|
|
9076
9154
|
this.endpoint,
|
|
9077
9155
|
this.apiKey,
|
|
9078
|
-
|
|
9156
|
+
routerParams,
|
|
9079
9157
|
this.overlayFeeRate,
|
|
9080
9158
|
this.overlayFeeReceiver
|
|
9081
9159
|
);
|
|
9082
9160
|
}
|
|
9161
|
+
async filterProvidersByPythAvailability(params) {
|
|
9162
|
+
const interval = validatePythAvailabilityCheckInterval(
|
|
9163
|
+
params.pythAvailabilityCheckInterval ?? this.pythAvailabilityCheckInterval
|
|
9164
|
+
);
|
|
9165
|
+
if (interval === void 0) {
|
|
9166
|
+
return { params, providersExhausted: false };
|
|
9167
|
+
}
|
|
9168
|
+
const pythAvailable = await this.getPythAvailability(interval);
|
|
9169
|
+
if (pythAvailable) {
|
|
9170
|
+
return { params, providersExhausted: false };
|
|
9171
|
+
}
|
|
9172
|
+
const sourceProviders = params.providers && params.providers.length > 0 ? params.providers : ALL_DEXES;
|
|
9173
|
+
const providers = sourceProviders.filter(
|
|
9174
|
+
(provider) => !PYTH_ORACLE_BASED_DEXES.includes(provider)
|
|
9175
|
+
);
|
|
9176
|
+
return {
|
|
9177
|
+
params: { ...params, providers },
|
|
9178
|
+
providersExhausted: providers.length === 0
|
|
9179
|
+
};
|
|
9180
|
+
}
|
|
9181
|
+
async getPythAvailability(interval) {
|
|
9182
|
+
const now = Date.now();
|
|
9183
|
+
if (this.pythAvailable !== void 0 && this.pythAvailabilityCheckedAt !== void 0 && now - this.pythAvailabilityCheckedAt < interval) {
|
|
9184
|
+
return this.pythAvailable;
|
|
9185
|
+
}
|
|
9186
|
+
if (this.pythAvailabilityPromise) {
|
|
9187
|
+
return this.pythAvailabilityPromise;
|
|
9188
|
+
}
|
|
9189
|
+
this.pythAvailabilityPromise = this.pythAdapter.isHermesAvailable().catch(() => false).then((available) => {
|
|
9190
|
+
this.pythAvailable = available;
|
|
9191
|
+
this.pythAvailabilityCheckedAt = Date.now();
|
|
9192
|
+
return available;
|
|
9193
|
+
}).finally(() => {
|
|
9194
|
+
this.pythAvailabilityPromise = void 0;
|
|
9195
|
+
});
|
|
9196
|
+
return this.pythAvailabilityPromise;
|
|
9197
|
+
}
|
|
9083
9198
|
async executeFlexibleInputSwap(txb, inputCoin, routerData, expectedAmountOut, amountLimit, pythPriceIDs, partner, deepbookv3DeepFee, packages) {
|
|
9084
9199
|
}
|
|
9085
9200
|
newDexRouterV3(provider, pythPriceIDs, partner, cetusDlmmPartner) {
|
|
@@ -10041,6 +10156,35 @@ function generateUUID() {
|
|
|
10041
10156
|
return v.toString(16);
|
|
10042
10157
|
});
|
|
10043
10158
|
}
|
|
10159
|
+
function validatePythAvailabilityCheckInterval(interval) {
|
|
10160
|
+
if (interval === void 0) {
|
|
10161
|
+
return void 0;
|
|
10162
|
+
}
|
|
10163
|
+
if (!Number.isFinite(interval) || interval < 0) {
|
|
10164
|
+
throw new Error(
|
|
10165
|
+
"pythAvailabilityCheckInterval must be a non-negative number"
|
|
10166
|
+
);
|
|
10167
|
+
}
|
|
10168
|
+
return interval;
|
|
10169
|
+
}
|
|
10170
|
+
function emptyRouterResult(byAmountIn) {
|
|
10171
|
+
return {
|
|
10172
|
+
quoteID: "",
|
|
10173
|
+
amountIn: ZERO,
|
|
10174
|
+
amountOut: ZERO,
|
|
10175
|
+
paths: [],
|
|
10176
|
+
byAmountIn,
|
|
10177
|
+
insufficientLiquidity: true,
|
|
10178
|
+
deviationRatio: 0
|
|
10179
|
+
};
|
|
10180
|
+
}
|
|
10181
|
+
function emptyMergeSwapResult() {
|
|
10182
|
+
return {
|
|
10183
|
+
quoteID: "",
|
|
10184
|
+
totalAmountOut: ZERO,
|
|
10185
|
+
allRoutes: []
|
|
10186
|
+
};
|
|
10187
|
+
}
|
|
10044
10188
|
function recordFirstCoinIndex(paths) {
|
|
10045
10189
|
let newCoinRecord = /* @__PURE__ */ new Map();
|
|
10046
10190
|
for (let i = 0; i < paths.length; i++) {
|
|
@@ -10089,4 +10233,4 @@ decimal.js/decimal.mjs:
|
|
|
10089
10233
|
*)
|
|
10090
10234
|
*/
|
|
10091
10235
|
|
|
10092
|
-
export { AFSUI, AFTERMATH, AFTERMATH_AMM, AFTERMATH_MODULE, AGGREGATOR, AGGREGATOR_V3_CONFIG, ALL_DEXES, ALPHAFI, AggregatorClient, AggregatorConfig, AggregatorError, AggregatorServerErrorCode, BLUEFIN, BLUEMOVE, BOLT, CETUS, CETUSDLMM, CETUS_DEX, CETUS_MODULE, CETUS_PUBLISHED_AT, CHECK_COINS_THRESHOLD_FUNC, CLIENT_CONFIG, CLOCK_ADDRESS, CoinInfoAddress, CoinStoreAddress, CoinUtils, 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, Env, FERRACLMM, FERRADLMM, FLOWXV2, FLOWXV3, FLOWX_AMM, FLOWX_AMM_MODULE, FULLSAIL, FlashSwapA2BFunc, FlashSwapB2AFunc, FlashSwapFunc, FlashSwapWithPartnerA2BFunc, FlashSwapWithPartnerB2AFunc, FlashSwapWithPartnerFunc, GAS_SYMBOL, GAS_TYPE_ARG, GAS_TYPE_ARG_LONG, HAEDAL, HAEDALHMMV2, HAEDALPMM, HAEDALPROPAMM, HAWAL, INTEGRATE, JOIN_FUNC, KRIYA, KRIYAV3, KRIYA_DEX, KRIYA_MODULE, MAGMA, MAGMAPROPAMM, 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_V3_PUBLISHED_AT, MAINNET_FLOWX_AMM_CONTAINER_ID, METASTABLE, MOMENTUM, OBRIC, ONE, PACKAGE_NAMES, PAY_MODULE, POOL_MODULT, PUBLISHED_ADDRESSES, PYTH_CONFIG, PYTH_PRELUDE_CALLS, 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, SCALLOP, SEVENK, SPRINGSUI, STEAMM, STEAMM_OMM, STEAMM_OMM_V2, SUILEND, SUI_SYSTEM_STATE_OBJECT_ID, SWAP_A2B_FUNC, SWAP_B2A_FUNC, SWAP_GAS_BUDGET_TABLE, SuiZeroCoinFn, 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_V3_PUBLISHED_AT, 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, estimateSwapGasBudget, exportToCSV, exportToJSON, extractAddressFromType, extractGasMetrics, extractStructTagFromType, extractTimestampFromDowngradeUuid6, fixSuiObjectId, formatGasMetrics, generateDowngradeUuid6, generateSimpleDowngradeUuid6, getAggregatorServerErrorMessage, getAggregatorV2Extend2PublishedAt, getAggregatorV2ExtendPublishedAt, getAggregatorV2PublishedAt, getAllProviders, getDeepbookV3Config, getDefaultSuiInputType, getMergeSwapResult, getOrCreateAccountCap, getProvidersExcluding, getProvidersIncluding, getRouterResult, hasPythPrelude, isSortedSymbols, isValidDowngradeUuid6, lookupGasBudget, mintZeroCoin, normalizeCoinType, parseAftermathFeeType, parseTurbosPoolFeeType, patchFixSuiObjectId, printTransaction, processEndpoint, processFlattenRoutes, restituteMsafeFastRouterSwapParams };
|
|
10236
|
+
export { AFSUI, AFTERMATH, AFTERMATH_AMM, AFTERMATH_MODULE, AGGREGATOR, AGGREGATOR_V3_CONFIG, ALL_DEXES, ALPHAFI, AggregatorClient, AggregatorConfig, AggregatorError, AggregatorServerErrorCode, BLUEFIN, BLUEMOVE, BOLT, CETUS, CETUSDLMM, CETUS_DEX, CETUS_MODULE, CETUS_PUBLISHED_AT, CHECK_COINS_THRESHOLD_FUNC, CLIENT_CONFIG, CLOCK_ADDRESS, CoinInfoAddress, CoinStoreAddress, CoinUtils, 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, Env, FERRACLMM, FERRADLMM, FLOWXV2, FLOWXV3, FLOWX_AMM, FLOWX_AMM_MODULE, FULLSAIL, FlashSwapA2BFunc, FlashSwapB2AFunc, FlashSwapFunc, FlashSwapWithPartnerA2BFunc, FlashSwapWithPartnerB2AFunc, FlashSwapWithPartnerFunc, GAS_SYMBOL, GAS_TYPE_ARG, GAS_TYPE_ARG_LONG, HAEDAL, HAEDALHMMV2, HAEDALPMM, HAEDALPROPAMM, HAWAL, INTEGRATE, JOIN_FUNC, KRIYA, KRIYAV3, KRIYA_DEX, KRIYA_MODULE, MAGMA, MAGMAPROPAMM, 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_V3_PUBLISHED_AT, MAINNET_FLOWX_AMM_CONTAINER_ID, METASTABLE, MOMENTUM, OBRIC, ONE, PACKAGE_NAMES, PAY_MODULE, POOL_MODULT, PUBLISHED_ADDRESSES, PYTH_CONFIG, PYTH_ORACLE_BASED_DEXES, PYTH_PRELUDE_CALLS, 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, SCALLOP, SEVENK, SPRINGSUI, STEAMM, STEAMM_OMM, STEAMM_OMM_V2, SUILEND, SUI_SYSTEM_STATE_OBJECT_ID, SWAP_A2B_FUNC, SWAP_B2A_FUNC, SWAP_GAS_BUDGET_TABLE, SuiZeroCoinFn, 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_V3_PUBLISHED_AT, 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, estimateSwapGasBudget, exportToCSV, exportToJSON, extractAddressFromType, extractGasMetrics, extractStructTagFromType, extractTimestampFromDowngradeUuid6, fixSuiObjectId, formatGasMetrics, generateDowngradeUuid6, generateSimpleDowngradeUuid6, getAggregatorServerErrorMessage, getAggregatorV2Extend2PublishedAt, getAggregatorV2ExtendPublishedAt, getAggregatorV2PublishedAt, getAllProviders, getDeepbookV3Config, getDefaultSuiInputType, getMergeSwapResult, getOrCreateAccountCap, getProvidersExcluding, getProvidersIncluding, getRouterResult, hasPythPrelude, isSortedSymbols, isValidDowngradeUuid6, lookupGasBudget, mintZeroCoin, normalizeCoinType, parseAftermathFeeType, parseTurbosPoolFeeType, patchFixSuiObjectId, printTransaction, processEndpoint, processFlattenRoutes, restituteMsafeFastRouterSwapParams };
|