@cetusprotocol/aggregator-sdk 0.0.0-experimental-20250625194659 → 0.0.0-experimental-20250630205929
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +123 -32
- package/dist/index.mjs +118 -32
- package/package.json +4 -2
package/dist/index.d.mts
CHANGED
|
@@ -88,6 +88,7 @@ declare const STEAMM_OMM = "STEAMM_OMM";
|
|
|
88
88
|
declare const MOMENTUM = "MOMENTUM";
|
|
89
89
|
declare const STEAMM_OMM_V2 = "STEAMM_OMM_V2";
|
|
90
90
|
declare const MAGMA = "MAGMA";
|
|
91
|
+
declare const SEVENK = "SEVENK";
|
|
91
92
|
declare const DEFAULT_ENDPOINT = "https://api-sui.cetus.zone/router_v2";
|
|
92
93
|
declare const ALL_DEXES: string[];
|
|
93
94
|
type BuildRouterSwapParams = {
|
|
@@ -302,6 +303,11 @@ type ExtendedDetails = {
|
|
|
302
303
|
obricCoinBPriceSeed?: string;
|
|
303
304
|
obricCoinAPriceId?: string;
|
|
304
305
|
obricCoinBPriceId?: string;
|
|
306
|
+
sevenkCoinAPriceSeed?: string;
|
|
307
|
+
sevenkCoinBPriceSeed?: string;
|
|
308
|
+
sevenkCoinAOracleId?: string;
|
|
309
|
+
sevenkCoinBOracleId?: string;
|
|
310
|
+
sevenkLPCapType?: string;
|
|
305
311
|
};
|
|
306
312
|
type Path = {
|
|
307
313
|
id: string;
|
|
@@ -366,4 +372,4 @@ declare enum Env {
|
|
|
366
372
|
Testnet = 1
|
|
367
373
|
}
|
|
368
374
|
|
|
369
|
-
export { AFSUI, AFTERMATH, AGGREGATOR_V2, AGGREGATOR_V2_EXTEND, AGGREGATOR_V2_EXTEND2, ALL_DEXES, ALPHAFI, AggregatorClient, type AggregatorClientParams, type AggregatorResponse, BLUEFIN, BLUEMOVE, type BuildCoinResult, type BuildFastRouterSwapParams, type BuildFastRouterSwapParamsV2, type BuildRouterSwapParams, type BuildRouterSwapParamsV2, CETUS, CLOCK_ADDRESS, DEEPBOOKV2, DEEPBOOKV3, DEFAULT_ENDPOINT, type DeepbookV3Config, type DeepbookV3ConfigResponse, type Dex, Env, type ExtendedDetails, FLOWXV2, FLOWXV3, type FindRouterParams, HAEDAL, HAEDALPMM, HAWAL, KRIYA, KRIYAV3, MAGMA, METASTABLE, MOMENTUM, OBRIC, ONE, type Path, type PreSwapLpChangeParams, type Router, type RouterData, type RouterError, SCALLOP, SPRINGSUI, STEAMM, STEAMM_OMM, STEAMM_OMM_V2, SUILEND, type SwapInPoolsParams, type SwapInPoolsResult, TEN_POW_NINE, TURBOS, TWO, U128, U64_MAX, U64_MAX_BN, VOLO, ZERO, buildInputCoin, checkInvalidSuiAddress, compareCoins, completionCoin, composeType, createTarget, dealWithFastRouterSwapParamsForMsafe, extractAddressFromType, extractStructTagFromType, findPythPriceIDs, fixSuiObjectId, getAggregatorV2Extend2PublishedAt, getAggregatorV2ExtendPublishedAt, getAggregatorV2PublishedAt, getAllProviders, getDeepbookV3Config, getProvidersExcluding, getProvidersIncluding, getRouterResult, isSortedSymbols, mintZeroCoin, normalizeCoinType, parseRouterResponse, patchFixSuiObjectId, printTransaction, processEndpoint, restituteMsafeFastRouterSwapParams };
|
|
375
|
+
export { AFSUI, AFTERMATH, AGGREGATOR_V2, AGGREGATOR_V2_EXTEND, AGGREGATOR_V2_EXTEND2, ALL_DEXES, ALPHAFI, AggregatorClient, type AggregatorClientParams, type AggregatorResponse, BLUEFIN, BLUEMOVE, type BuildCoinResult, type BuildFastRouterSwapParams, type BuildFastRouterSwapParamsV2, type BuildRouterSwapParams, type BuildRouterSwapParamsV2, CETUS, CLOCK_ADDRESS, DEEPBOOKV2, DEEPBOOKV3, DEFAULT_ENDPOINT, type DeepbookV3Config, type DeepbookV3ConfigResponse, type Dex, Env, type ExtendedDetails, FLOWXV2, FLOWXV3, type FindRouterParams, HAEDAL, HAEDALPMM, HAWAL, KRIYA, KRIYAV3, MAGMA, METASTABLE, MOMENTUM, OBRIC, ONE, type Path, type PreSwapLpChangeParams, type Router, type RouterData, type RouterError, SCALLOP, SEVENK, SPRINGSUI, STEAMM, STEAMM_OMM, STEAMM_OMM_V2, SUILEND, type SwapInPoolsParams, type SwapInPoolsResult, TEN_POW_NINE, TURBOS, TWO, U128, U64_MAX, U64_MAX_BN, VOLO, ZERO, buildInputCoin, checkInvalidSuiAddress, compareCoins, completionCoin, composeType, createTarget, dealWithFastRouterSwapParamsForMsafe, extractAddressFromType, extractStructTagFromType, findPythPriceIDs, fixSuiObjectId, getAggregatorV2Extend2PublishedAt, getAggregatorV2ExtendPublishedAt, getAggregatorV2PublishedAt, getAllProviders, getDeepbookV3Config, getProvidersExcluding, getProvidersIncluding, getRouterResult, isSortedSymbols, mintZeroCoin, normalizeCoinType, parseRouterResponse, patchFixSuiObjectId, printTransaction, processEndpoint, restituteMsafeFastRouterSwapParams };
|
package/dist/index.d.ts
CHANGED
|
@@ -88,6 +88,7 @@ declare const STEAMM_OMM = "STEAMM_OMM";
|
|
|
88
88
|
declare const MOMENTUM = "MOMENTUM";
|
|
89
89
|
declare const STEAMM_OMM_V2 = "STEAMM_OMM_V2";
|
|
90
90
|
declare const MAGMA = "MAGMA";
|
|
91
|
+
declare const SEVENK = "SEVENK";
|
|
91
92
|
declare const DEFAULT_ENDPOINT = "https://api-sui.cetus.zone/router_v2";
|
|
92
93
|
declare const ALL_DEXES: string[];
|
|
93
94
|
type BuildRouterSwapParams = {
|
|
@@ -302,6 +303,11 @@ type ExtendedDetails = {
|
|
|
302
303
|
obricCoinBPriceSeed?: string;
|
|
303
304
|
obricCoinAPriceId?: string;
|
|
304
305
|
obricCoinBPriceId?: string;
|
|
306
|
+
sevenkCoinAPriceSeed?: string;
|
|
307
|
+
sevenkCoinBPriceSeed?: string;
|
|
308
|
+
sevenkCoinAOracleId?: string;
|
|
309
|
+
sevenkCoinBOracleId?: string;
|
|
310
|
+
sevenkLPCapType?: string;
|
|
305
311
|
};
|
|
306
312
|
type Path = {
|
|
307
313
|
id: string;
|
|
@@ -366,4 +372,4 @@ declare enum Env {
|
|
|
366
372
|
Testnet = 1
|
|
367
373
|
}
|
|
368
374
|
|
|
369
|
-
export { AFSUI, AFTERMATH, AGGREGATOR_V2, AGGREGATOR_V2_EXTEND, AGGREGATOR_V2_EXTEND2, ALL_DEXES, ALPHAFI, AggregatorClient, type AggregatorClientParams, type AggregatorResponse, BLUEFIN, BLUEMOVE, type BuildCoinResult, type BuildFastRouterSwapParams, type BuildFastRouterSwapParamsV2, type BuildRouterSwapParams, type BuildRouterSwapParamsV2, CETUS, CLOCK_ADDRESS, DEEPBOOKV2, DEEPBOOKV3, DEFAULT_ENDPOINT, type DeepbookV3Config, type DeepbookV3ConfigResponse, type Dex, Env, type ExtendedDetails, FLOWXV2, FLOWXV3, type FindRouterParams, HAEDAL, HAEDALPMM, HAWAL, KRIYA, KRIYAV3, MAGMA, METASTABLE, MOMENTUM, OBRIC, ONE, type Path, type PreSwapLpChangeParams, type Router, type RouterData, type RouterError, SCALLOP, SPRINGSUI, STEAMM, STEAMM_OMM, STEAMM_OMM_V2, SUILEND, type SwapInPoolsParams, type SwapInPoolsResult, TEN_POW_NINE, TURBOS, TWO, U128, U64_MAX, U64_MAX_BN, VOLO, ZERO, buildInputCoin, checkInvalidSuiAddress, compareCoins, completionCoin, composeType, createTarget, dealWithFastRouterSwapParamsForMsafe, extractAddressFromType, extractStructTagFromType, findPythPriceIDs, fixSuiObjectId, getAggregatorV2Extend2PublishedAt, getAggregatorV2ExtendPublishedAt, getAggregatorV2PublishedAt, getAllProviders, getDeepbookV3Config, getProvidersExcluding, getProvidersIncluding, getRouterResult, isSortedSymbols, mintZeroCoin, normalizeCoinType, parseRouterResponse, patchFixSuiObjectId, printTransaction, processEndpoint, restituteMsafeFastRouterSwapParams };
|
|
375
|
+
export { AFSUI, AFTERMATH, AGGREGATOR_V2, AGGREGATOR_V2_EXTEND, AGGREGATOR_V2_EXTEND2, ALL_DEXES, ALPHAFI, AggregatorClient, type AggregatorClientParams, type AggregatorResponse, BLUEFIN, BLUEMOVE, type BuildCoinResult, type BuildFastRouterSwapParams, type BuildFastRouterSwapParamsV2, type BuildRouterSwapParams, type BuildRouterSwapParamsV2, CETUS, CLOCK_ADDRESS, DEEPBOOKV2, DEEPBOOKV3, DEFAULT_ENDPOINT, type DeepbookV3Config, type DeepbookV3ConfigResponse, type Dex, Env, type ExtendedDetails, FLOWXV2, FLOWXV3, type FindRouterParams, HAEDAL, HAEDALPMM, HAWAL, KRIYA, KRIYAV3, MAGMA, METASTABLE, MOMENTUM, OBRIC, ONE, type Path, type PreSwapLpChangeParams, type Router, type RouterData, type RouterError, SCALLOP, SEVENK, SPRINGSUI, STEAMM, STEAMM_OMM, STEAMM_OMM_V2, SUILEND, type SwapInPoolsParams, type SwapInPoolsResult, TEN_POW_NINE, TURBOS, TWO, U128, U64_MAX, U64_MAX_BN, VOLO, ZERO, buildInputCoin, checkInvalidSuiAddress, compareCoins, completionCoin, composeType, createTarget, dealWithFastRouterSwapParamsForMsafe, extractAddressFromType, extractStructTagFromType, findPythPriceIDs, fixSuiObjectId, getAggregatorV2Extend2PublishedAt, getAggregatorV2ExtendPublishedAt, getAggregatorV2PublishedAt, getAllProviders, getDeepbookV3Config, getProvidersExcluding, getProvidersIncluding, getRouterResult, isSortedSymbols, mintZeroCoin, normalizeCoinType, parseRouterResponse, patchFixSuiObjectId, printTransaction, processEndpoint, restituteMsafeFastRouterSwapParams };
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,11 @@ var client = require('@mysten/sui/client');
|
|
|
4
4
|
var utils = require('@mysten/sui/utils');
|
|
5
5
|
var transactions = require('@mysten/sui/transactions');
|
|
6
6
|
var pythSuiJs = require('@pythnetwork/pyth-sui-js');
|
|
7
|
+
var JSONbig = require('json-bigint');
|
|
8
|
+
|
|
9
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
|
|
11
|
+
var JSONbig__default = /*#__PURE__*/_interopDefault(JSONbig);
|
|
7
12
|
|
|
8
13
|
var __create = Object.create;
|
|
9
14
|
var __defProp = Object.defineProperty;
|
|
@@ -6783,6 +6788,87 @@ var Magma = class {
|
|
|
6783
6788
|
}
|
|
6784
6789
|
};
|
|
6785
6790
|
|
|
6791
|
+
// src/transaction/sevenk.ts
|
|
6792
|
+
var Sevenk = class {
|
|
6793
|
+
constructor(env, pythPriceIDs) {
|
|
6794
|
+
if (env === 1 /* Testnet */) {
|
|
6795
|
+
throw new Error("Sevenk is not supported on testnet");
|
|
6796
|
+
}
|
|
6797
|
+
this.pythPriceIDs = pythPriceIDs;
|
|
6798
|
+
this.oraclePublishedAt = "0x8c36ea167c5e6da8c3d60b4fc897416105dcb986471bd81cfbfd38720a4487c0";
|
|
6799
|
+
}
|
|
6800
|
+
swap(client, txb, path, inputCoin, packages) {
|
|
6801
|
+
return __async(this, null, function* () {
|
|
6802
|
+
const { direction, from, target } = path;
|
|
6803
|
+
const [func, coinAType, coinBType] = direction ? ["swap_a2b", from, target] : ["swap_b2a", target, from];
|
|
6804
|
+
let coinAPriceSeed;
|
|
6805
|
+
let coinBPriceSeed;
|
|
6806
|
+
let coinAOracleId;
|
|
6807
|
+
let coinBOracleId;
|
|
6808
|
+
let lpCapType;
|
|
6809
|
+
if (path.extendedDetails == null) {
|
|
6810
|
+
throw new Error("Extended details not supported haedal pmm");
|
|
6811
|
+
} else {
|
|
6812
|
+
if (!path.extendedDetails.sevenkCoinAPriceSeed || !path.extendedDetails.sevenkCoinBPriceSeed || !path.extendedDetails.sevenkCoinAOracleId || !path.extendedDetails.sevenkCoinBOracleId || !path.extendedDetails.sevenkLPCapType) {
|
|
6813
|
+
throw new Error("Base price seed or quote price seed not supported");
|
|
6814
|
+
}
|
|
6815
|
+
coinAPriceSeed = path.extendedDetails.sevenkCoinAPriceSeed;
|
|
6816
|
+
coinBPriceSeed = path.extendedDetails.sevenkCoinBPriceSeed;
|
|
6817
|
+
coinAOracleId = path.extendedDetails.sevenkCoinAOracleId;
|
|
6818
|
+
coinBOracleId = path.extendedDetails.sevenkCoinBOracleId;
|
|
6819
|
+
lpCapType = path.extendedDetails.sevenkLPCapType;
|
|
6820
|
+
}
|
|
6821
|
+
const coinAPriceInfoObjectId = this.pythPriceIDs.get(coinAPriceSeed);
|
|
6822
|
+
const coinBPriceInfoObjectId = this.pythPriceIDs.get(coinBPriceSeed);
|
|
6823
|
+
if (!coinAPriceInfoObjectId || !coinBPriceInfoObjectId) {
|
|
6824
|
+
throw new Error(
|
|
6825
|
+
"Base price info object id or quote price info object id not found"
|
|
6826
|
+
);
|
|
6827
|
+
}
|
|
6828
|
+
const holder = txb.moveCall({
|
|
6829
|
+
target: `${this.oraclePublishedAt}::oracle::new_holder`,
|
|
6830
|
+
typeArguments: [],
|
|
6831
|
+
arguments: []
|
|
6832
|
+
});
|
|
6833
|
+
txb.moveCall({
|
|
6834
|
+
target: `${this.oraclePublishedAt}::pyth::get_price`,
|
|
6835
|
+
typeArguments: [],
|
|
6836
|
+
arguments: [
|
|
6837
|
+
txb.object(coinAOracleId),
|
|
6838
|
+
holder,
|
|
6839
|
+
txb.object(coinAPriceInfoObjectId),
|
|
6840
|
+
txb.object(CLOCK_ADDRESS)
|
|
6841
|
+
]
|
|
6842
|
+
});
|
|
6843
|
+
txb.moveCall({
|
|
6844
|
+
target: `${this.oraclePublishedAt}::pyth::get_price`,
|
|
6845
|
+
typeArguments: [],
|
|
6846
|
+
arguments: [
|
|
6847
|
+
txb.object(coinBOracleId),
|
|
6848
|
+
holder,
|
|
6849
|
+
txb.object(coinBPriceInfoObjectId),
|
|
6850
|
+
txb.object(CLOCK_ADDRESS)
|
|
6851
|
+
]
|
|
6852
|
+
});
|
|
6853
|
+
const args = [
|
|
6854
|
+
txb.object(path.id),
|
|
6855
|
+
holder,
|
|
6856
|
+
inputCoin
|
|
6857
|
+
];
|
|
6858
|
+
const publishedAt = getAggregatorV2Extend2PublishedAt(
|
|
6859
|
+
client.publishedAtV2Extend2(),
|
|
6860
|
+
packages
|
|
6861
|
+
);
|
|
6862
|
+
const res = txb.moveCall({
|
|
6863
|
+
target: `${publishedAt}::sevenk::${func}`,
|
|
6864
|
+
typeArguments: [coinAType, coinBType, lpCapType],
|
|
6865
|
+
arguments: args
|
|
6866
|
+
});
|
|
6867
|
+
return res;
|
|
6868
|
+
});
|
|
6869
|
+
}
|
|
6870
|
+
};
|
|
6871
|
+
|
|
6786
6872
|
// src/client.ts
|
|
6787
6873
|
var CETUS = "CETUS";
|
|
6788
6874
|
var DEEPBOOKV2 = "DEEPBOOK";
|
|
@@ -6811,6 +6897,7 @@ var STEAMM_OMM = "STEAMM_OMM";
|
|
|
6811
6897
|
var MOMENTUM = "MOMENTUM";
|
|
6812
6898
|
var STEAMM_OMM_V2 = "STEAMM_OMM_V2";
|
|
6813
6899
|
var MAGMA = "MAGMA";
|
|
6900
|
+
var SEVENK = "SEVENK";
|
|
6814
6901
|
var DEFAULT_ENDPOINT = "https://api-sui.cetus.zone/router_v2";
|
|
6815
6902
|
var ALL_DEXES = [
|
|
6816
6903
|
CETUS,
|
|
@@ -6838,7 +6925,8 @@ var ALL_DEXES = [
|
|
|
6838
6925
|
MOMENTUM,
|
|
6839
6926
|
STEAMM_OMM,
|
|
6840
6927
|
STEAMM_OMM_V2,
|
|
6841
|
-
MAGMA
|
|
6928
|
+
MAGMA,
|
|
6929
|
+
SEVENK
|
|
6842
6930
|
];
|
|
6843
6931
|
function isBuilderRouterSwapParams(params) {
|
|
6844
6932
|
return Array.isArray(params.routers);
|
|
@@ -7069,10 +7157,18 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
7069
7157
|
);
|
|
7070
7158
|
for (let i = 0; i < routers.length; i++) {
|
|
7071
7159
|
const router = routers[i];
|
|
7072
|
-
let amount_arg = txb.pure.u64(
|
|
7160
|
+
let amount_arg = txb.pure.u64(
|
|
7161
|
+
router.amountOut.toString()
|
|
7162
|
+
);
|
|
7073
7163
|
for (let j = router.path.length - 1; j >= 0; j--) {
|
|
7074
7164
|
const path = router.path[j];
|
|
7075
|
-
const flashSwapResult = dex.flash_swap(
|
|
7165
|
+
const flashSwapResult = dex.flash_swap(
|
|
7166
|
+
this,
|
|
7167
|
+
txb,
|
|
7168
|
+
path,
|
|
7169
|
+
amount_arg,
|
|
7170
|
+
false
|
|
7171
|
+
);
|
|
7076
7172
|
amount_arg = flashSwapResult.payAmount;
|
|
7077
7173
|
returnCoins.unshift(flashSwapResult.targetCoin);
|
|
7078
7174
|
receipts.unshift(flashSwapResult.flashReceipt);
|
|
@@ -7392,7 +7488,7 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
7392
7488
|
}
|
|
7393
7489
|
publishedAtV2Extend2() {
|
|
7394
7490
|
if (this.env === 0 /* Mainnet */) {
|
|
7395
|
-
return "
|
|
7491
|
+
return "0xc40b43f0aa4ba5a4d71e39770265d3698d0e6dcfd846b7d7c443207f4e919e04";
|
|
7396
7492
|
} else {
|
|
7397
7493
|
return "0x0";
|
|
7398
7494
|
}
|
|
@@ -7503,6 +7599,8 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
7503
7599
|
return new SteammOmmV2(this.env, pythPriceIDs);
|
|
7504
7600
|
case MAGMA:
|
|
7505
7601
|
return new Magma(this.env);
|
|
7602
|
+
case SEVENK:
|
|
7603
|
+
return new Sevenk(this.env, pythPriceIDs);
|
|
7506
7604
|
default:
|
|
7507
7605
|
throw new Error(`Unsupported dex ${provider}`);
|
|
7508
7606
|
}
|
|
@@ -7598,7 +7696,7 @@ _AggregatorClient.CONFIG = {
|
|
|
7598
7696
|
pythStateId: "0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8"
|
|
7599
7697
|
}
|
|
7600
7698
|
};
|
|
7601
|
-
var
|
|
7699
|
+
var AggregatorClient28 = _AggregatorClient;
|
|
7602
7700
|
function findPythPriceIDs(routes) {
|
|
7603
7701
|
const priceIDs = /* @__PURE__ */ new Set();
|
|
7604
7702
|
for (const route of routes) {
|
|
@@ -7633,6 +7731,14 @@ function findPythPriceIDs(routes) {
|
|
|
7633
7731
|
priceIDs.add(path.extendedDetails.steammOraclePythPriceSeedB);
|
|
7634
7732
|
}
|
|
7635
7733
|
}
|
|
7734
|
+
if (path.provider === SEVENK) {
|
|
7735
|
+
if (path.extendedDetails && path.extendedDetails.sevenkCoinAPriceSeed) {
|
|
7736
|
+
priceIDs.add(path.extendedDetails.sevenkCoinAPriceSeed);
|
|
7737
|
+
}
|
|
7738
|
+
if (path.extendedDetails && path.extendedDetails.sevenkCoinBPriceSeed) {
|
|
7739
|
+
priceIDs.add(path.extendedDetails.sevenkCoinBPriceSeed);
|
|
7740
|
+
}
|
|
7741
|
+
}
|
|
7636
7742
|
}
|
|
7637
7743
|
}
|
|
7638
7744
|
return Array.from(priceIDs);
|
|
@@ -7661,13 +7767,14 @@ function parseRouterResponse(data, byAmountIn) {
|
|
|
7661
7767
|
routes: data.routes.map((route) => {
|
|
7662
7768
|
return {
|
|
7663
7769
|
path: route.path.map((path) => {
|
|
7664
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D;
|
|
7770
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I;
|
|
7665
7771
|
let version;
|
|
7666
7772
|
if (path.provider === AFTERMATH) {
|
|
7667
7773
|
version = path.extended_details.aftermath_pool_flatness === 0 ? "v2" : "v3";
|
|
7668
7774
|
}
|
|
7775
|
+
console.log("path", path.extended_details);
|
|
7669
7776
|
let extendedDetails;
|
|
7670
|
-
if (path.provider === TURBOS || path.provider === AFTERMATH || path.provider === CETUS || path.provider === DEEPBOOKV3 || path.provider === SCALLOP || path.provider === HAEDALPMM || path.provider === METASTABLE || path.provider === OBRIC || path.provider === STEAMM || path.provider === STEAMM_OMM || path.provider === STEAMM_OMM_V2) {
|
|
7777
|
+
if (path.provider === TURBOS || path.provider === AFTERMATH || path.provider === CETUS || path.provider === DEEPBOOKV3 || path.provider === SCALLOP || path.provider === HAEDALPMM || path.provider === METASTABLE || path.provider === OBRIC || path.provider === STEAMM || path.provider === STEAMM_OMM || path.provider === STEAMM_OMM_V2 || path.provider === SEVENK) {
|
|
7671
7778
|
extendedDetails = {
|
|
7672
7779
|
aftermathLpSupplyType: (_a = path.extended_details) == null ? void 0 : _a.aftermath_lp_supply_type,
|
|
7673
7780
|
turbosFeeType: (_b = path.extended_details) == null ? void 0 : _b.turbos_fee_type,
|
|
@@ -7698,7 +7805,12 @@ function parseRouterResponse(data, byAmountIn) {
|
|
|
7698
7805
|
obricCoinAPriceSeed: (_A = path.extended_details) == null ? void 0 : _A.obric_coin_a_price_seed,
|
|
7699
7806
|
obricCoinBPriceSeed: (_B = path.extended_details) == null ? void 0 : _B.obric_coin_b_price_seed,
|
|
7700
7807
|
obricCoinAPriceId: (_C = path.extended_details) == null ? void 0 : _C.obric_coin_a_price_id,
|
|
7701
|
-
obricCoinBPriceId: (_D = path.extended_details) == null ? void 0 : _D.obric_coin_b_price_id
|
|
7808
|
+
obricCoinBPriceId: (_D = path.extended_details) == null ? void 0 : _D.obric_coin_b_price_id,
|
|
7809
|
+
sevenkCoinAPriceSeed: (_E = path.extended_details) == null ? void 0 : _E.sevenk_coin_a_price_seed,
|
|
7810
|
+
sevenkCoinBPriceSeed: (_F = path.extended_details) == null ? void 0 : _F.sevenk_coin_b_price_seed,
|
|
7811
|
+
sevenkCoinAOracleId: (_G = path.extended_details) == null ? void 0 : _G.sevenk_oracle_config_a,
|
|
7812
|
+
sevenkCoinBOracleId: (_H = path.extended_details) == null ? void 0 : _H.sevenk_oracle_config_b,
|
|
7813
|
+
sevenkLPCapType: (_I = path.extended_details) == null ? void 0 : _I.sevenk_lp_cap_type
|
|
7702
7814
|
};
|
|
7703
7815
|
}
|
|
7704
7816
|
return {
|
|
@@ -7824,28 +7936,7 @@ function getRouterResult(endpoint, apiKey, params, overlayFee, overlayFeeReceive
|
|
|
7824
7936
|
}
|
|
7825
7937
|
};
|
|
7826
7938
|
}
|
|
7827
|
-
|
|
7828
|
-
const data = yield response.text().then((text) => {
|
|
7829
|
-
const bigNumbers = [];
|
|
7830
|
-
const regex = /"([^"]+)"\s*:\s*(\d{16,})/g;
|
|
7831
|
-
const matches = text.matchAll(regex);
|
|
7832
|
-
for (const match of matches) {
|
|
7833
|
-
const key = match[1];
|
|
7834
|
-
const value = match[2];
|
|
7835
|
-
if (value.length > 15) {
|
|
7836
|
-
bigNumbers.push({ key, value });
|
|
7837
|
-
}
|
|
7838
|
-
}
|
|
7839
|
-
let safeText = text;
|
|
7840
|
-
bigNumbers.forEach(({ key, value }) => {
|
|
7841
|
-
safeText = safeText.replace(`"${key}":${value}`, `"${key}":"${value}"`);
|
|
7842
|
-
});
|
|
7843
|
-
const data2 = JSON.parse(safeText);
|
|
7844
|
-
console.log("\u5B89\u5168\u89E3\u6790\u7684\u6570\u636E:", data2);
|
|
7845
|
-
return data2;
|
|
7846
|
-
});
|
|
7847
|
-
console.log("sdk getRouterResult \u{1F680} ~ data:", data);
|
|
7848
|
-
console.log("sdk getRouterResult \u{1F680} ~ data:", data);
|
|
7939
|
+
const data = JSONbig__default.default.parse(yield response.text());
|
|
7849
7940
|
const insufficientLiquidity = data.msg === "liquidity is not enough";
|
|
7850
7941
|
if (data.msg && data.msg.indexOf("HoneyPot scam") > -1) {
|
|
7851
7942
|
return {
|
|
@@ -7864,7 +7955,6 @@ function getRouterResult(endpoint, apiKey, params, overlayFee, overlayFeeReceive
|
|
|
7864
7955
|
}
|
|
7865
7956
|
if (data.data != null) {
|
|
7866
7957
|
const res = parseRouterResponse(data.data, params.byAmountIn);
|
|
7867
|
-
console.log("sdk getRouterResult parseRouterResponse \u{1F680} ~ res:", res);
|
|
7868
7958
|
if (overlayFee > 0 && overlayFeeReceiver !== "0x0") {
|
|
7869
7959
|
if (params.byAmountIn) {
|
|
7870
7960
|
const overlayFeeAmount = res.amountOut.mul(new import_bn7.default(overlayFee)).div(new import_bn7.default(1e6));
|
|
@@ -8028,7 +8118,7 @@ exports.AGGREGATOR_V2_EXTEND = AGGREGATOR_V2_EXTEND;
|
|
|
8028
8118
|
exports.AGGREGATOR_V2_EXTEND2 = AGGREGATOR_V2_EXTEND2;
|
|
8029
8119
|
exports.ALL_DEXES = ALL_DEXES;
|
|
8030
8120
|
exports.ALPHAFI = ALPHAFI;
|
|
8031
|
-
exports.AggregatorClient =
|
|
8121
|
+
exports.AggregatorClient = AggregatorClient28;
|
|
8032
8122
|
exports.BLUEFIN = BLUEFIN;
|
|
8033
8123
|
exports.BLUEMOVE = BLUEMOVE;
|
|
8034
8124
|
exports.CETUS = CETUS;
|
|
@@ -8050,6 +8140,7 @@ exports.MOMENTUM = MOMENTUM;
|
|
|
8050
8140
|
exports.OBRIC = OBRIC;
|
|
8051
8141
|
exports.ONE = ONE;
|
|
8052
8142
|
exports.SCALLOP = SCALLOP;
|
|
8143
|
+
exports.SEVENK = SEVENK;
|
|
8053
8144
|
exports.SPRINGSUI = SPRINGSUI;
|
|
8054
8145
|
exports.STEAMM = STEAMM;
|
|
8055
8146
|
exports.STEAMM_OMM = STEAMM_OMM;
|
package/dist/index.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { SuiClient, getFullnodeUrl } from '@mysten/sui/client';
|
|
|
2
2
|
import { normalizeSuiObjectId, SUI_CLOCK_OBJECT_ID, SUI_FRAMEWORK_ADDRESS } from '@mysten/sui/utils';
|
|
3
3
|
import { Transaction } from '@mysten/sui/transactions';
|
|
4
4
|
import { SuiPythClient, SuiPriceServiceConnection } from '@pythnetwork/pyth-sui-js';
|
|
5
|
+
import JSONbig from 'json-bigint';
|
|
5
6
|
|
|
6
7
|
var __create = Object.create;
|
|
7
8
|
var __defProp = Object.defineProperty;
|
|
@@ -6781,6 +6782,87 @@ var Magma = class {
|
|
|
6781
6782
|
}
|
|
6782
6783
|
};
|
|
6783
6784
|
|
|
6785
|
+
// src/transaction/sevenk.ts
|
|
6786
|
+
var Sevenk = class {
|
|
6787
|
+
constructor(env, pythPriceIDs) {
|
|
6788
|
+
if (env === 1 /* Testnet */) {
|
|
6789
|
+
throw new Error("Sevenk is not supported on testnet");
|
|
6790
|
+
}
|
|
6791
|
+
this.pythPriceIDs = pythPriceIDs;
|
|
6792
|
+
this.oraclePublishedAt = "0x8c36ea167c5e6da8c3d60b4fc897416105dcb986471bd81cfbfd38720a4487c0";
|
|
6793
|
+
}
|
|
6794
|
+
swap(client, txb, path, inputCoin, packages) {
|
|
6795
|
+
return __async(this, null, function* () {
|
|
6796
|
+
const { direction, from, target } = path;
|
|
6797
|
+
const [func, coinAType, coinBType] = direction ? ["swap_a2b", from, target] : ["swap_b2a", target, from];
|
|
6798
|
+
let coinAPriceSeed;
|
|
6799
|
+
let coinBPriceSeed;
|
|
6800
|
+
let coinAOracleId;
|
|
6801
|
+
let coinBOracleId;
|
|
6802
|
+
let lpCapType;
|
|
6803
|
+
if (path.extendedDetails == null) {
|
|
6804
|
+
throw new Error("Extended details not supported haedal pmm");
|
|
6805
|
+
} else {
|
|
6806
|
+
if (!path.extendedDetails.sevenkCoinAPriceSeed || !path.extendedDetails.sevenkCoinBPriceSeed || !path.extendedDetails.sevenkCoinAOracleId || !path.extendedDetails.sevenkCoinBOracleId || !path.extendedDetails.sevenkLPCapType) {
|
|
6807
|
+
throw new Error("Base price seed or quote price seed not supported");
|
|
6808
|
+
}
|
|
6809
|
+
coinAPriceSeed = path.extendedDetails.sevenkCoinAPriceSeed;
|
|
6810
|
+
coinBPriceSeed = path.extendedDetails.sevenkCoinBPriceSeed;
|
|
6811
|
+
coinAOracleId = path.extendedDetails.sevenkCoinAOracleId;
|
|
6812
|
+
coinBOracleId = path.extendedDetails.sevenkCoinBOracleId;
|
|
6813
|
+
lpCapType = path.extendedDetails.sevenkLPCapType;
|
|
6814
|
+
}
|
|
6815
|
+
const coinAPriceInfoObjectId = this.pythPriceIDs.get(coinAPriceSeed);
|
|
6816
|
+
const coinBPriceInfoObjectId = this.pythPriceIDs.get(coinBPriceSeed);
|
|
6817
|
+
if (!coinAPriceInfoObjectId || !coinBPriceInfoObjectId) {
|
|
6818
|
+
throw new Error(
|
|
6819
|
+
"Base price info object id or quote price info object id not found"
|
|
6820
|
+
);
|
|
6821
|
+
}
|
|
6822
|
+
const holder = txb.moveCall({
|
|
6823
|
+
target: `${this.oraclePublishedAt}::oracle::new_holder`,
|
|
6824
|
+
typeArguments: [],
|
|
6825
|
+
arguments: []
|
|
6826
|
+
});
|
|
6827
|
+
txb.moveCall({
|
|
6828
|
+
target: `${this.oraclePublishedAt}::pyth::get_price`,
|
|
6829
|
+
typeArguments: [],
|
|
6830
|
+
arguments: [
|
|
6831
|
+
txb.object(coinAOracleId),
|
|
6832
|
+
holder,
|
|
6833
|
+
txb.object(coinAPriceInfoObjectId),
|
|
6834
|
+
txb.object(CLOCK_ADDRESS)
|
|
6835
|
+
]
|
|
6836
|
+
});
|
|
6837
|
+
txb.moveCall({
|
|
6838
|
+
target: `${this.oraclePublishedAt}::pyth::get_price`,
|
|
6839
|
+
typeArguments: [],
|
|
6840
|
+
arguments: [
|
|
6841
|
+
txb.object(coinBOracleId),
|
|
6842
|
+
holder,
|
|
6843
|
+
txb.object(coinBPriceInfoObjectId),
|
|
6844
|
+
txb.object(CLOCK_ADDRESS)
|
|
6845
|
+
]
|
|
6846
|
+
});
|
|
6847
|
+
const args = [
|
|
6848
|
+
txb.object(path.id),
|
|
6849
|
+
holder,
|
|
6850
|
+
inputCoin
|
|
6851
|
+
];
|
|
6852
|
+
const publishedAt = getAggregatorV2Extend2PublishedAt(
|
|
6853
|
+
client.publishedAtV2Extend2(),
|
|
6854
|
+
packages
|
|
6855
|
+
);
|
|
6856
|
+
const res = txb.moveCall({
|
|
6857
|
+
target: `${publishedAt}::sevenk::${func}`,
|
|
6858
|
+
typeArguments: [coinAType, coinBType, lpCapType],
|
|
6859
|
+
arguments: args
|
|
6860
|
+
});
|
|
6861
|
+
return res;
|
|
6862
|
+
});
|
|
6863
|
+
}
|
|
6864
|
+
};
|
|
6865
|
+
|
|
6784
6866
|
// src/client.ts
|
|
6785
6867
|
var CETUS = "CETUS";
|
|
6786
6868
|
var DEEPBOOKV2 = "DEEPBOOK";
|
|
@@ -6809,6 +6891,7 @@ var STEAMM_OMM = "STEAMM_OMM";
|
|
|
6809
6891
|
var MOMENTUM = "MOMENTUM";
|
|
6810
6892
|
var STEAMM_OMM_V2 = "STEAMM_OMM_V2";
|
|
6811
6893
|
var MAGMA = "MAGMA";
|
|
6894
|
+
var SEVENK = "SEVENK";
|
|
6812
6895
|
var DEFAULT_ENDPOINT = "https://api-sui.cetus.zone/router_v2";
|
|
6813
6896
|
var ALL_DEXES = [
|
|
6814
6897
|
CETUS,
|
|
@@ -6836,7 +6919,8 @@ var ALL_DEXES = [
|
|
|
6836
6919
|
MOMENTUM,
|
|
6837
6920
|
STEAMM_OMM,
|
|
6838
6921
|
STEAMM_OMM_V2,
|
|
6839
|
-
MAGMA
|
|
6922
|
+
MAGMA,
|
|
6923
|
+
SEVENK
|
|
6840
6924
|
];
|
|
6841
6925
|
function isBuilderRouterSwapParams(params) {
|
|
6842
6926
|
return Array.isArray(params.routers);
|
|
@@ -7067,10 +7151,18 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
7067
7151
|
);
|
|
7068
7152
|
for (let i = 0; i < routers.length; i++) {
|
|
7069
7153
|
const router = routers[i];
|
|
7070
|
-
let amount_arg = txb.pure.u64(
|
|
7154
|
+
let amount_arg = txb.pure.u64(
|
|
7155
|
+
router.amountOut.toString()
|
|
7156
|
+
);
|
|
7071
7157
|
for (let j = router.path.length - 1; j >= 0; j--) {
|
|
7072
7158
|
const path = router.path[j];
|
|
7073
|
-
const flashSwapResult = dex.flash_swap(
|
|
7159
|
+
const flashSwapResult = dex.flash_swap(
|
|
7160
|
+
this,
|
|
7161
|
+
txb,
|
|
7162
|
+
path,
|
|
7163
|
+
amount_arg,
|
|
7164
|
+
false
|
|
7165
|
+
);
|
|
7074
7166
|
amount_arg = flashSwapResult.payAmount;
|
|
7075
7167
|
returnCoins.unshift(flashSwapResult.targetCoin);
|
|
7076
7168
|
receipts.unshift(flashSwapResult.flashReceipt);
|
|
@@ -7390,7 +7482,7 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
7390
7482
|
}
|
|
7391
7483
|
publishedAtV2Extend2() {
|
|
7392
7484
|
if (this.env === 0 /* Mainnet */) {
|
|
7393
|
-
return "
|
|
7485
|
+
return "0xc40b43f0aa4ba5a4d71e39770265d3698d0e6dcfd846b7d7c443207f4e919e04";
|
|
7394
7486
|
} else {
|
|
7395
7487
|
return "0x0";
|
|
7396
7488
|
}
|
|
@@ -7501,6 +7593,8 @@ var _AggregatorClient = class _AggregatorClient {
|
|
|
7501
7593
|
return new SteammOmmV2(this.env, pythPriceIDs);
|
|
7502
7594
|
case MAGMA:
|
|
7503
7595
|
return new Magma(this.env);
|
|
7596
|
+
case SEVENK:
|
|
7597
|
+
return new Sevenk(this.env, pythPriceIDs);
|
|
7504
7598
|
default:
|
|
7505
7599
|
throw new Error(`Unsupported dex ${provider}`);
|
|
7506
7600
|
}
|
|
@@ -7596,7 +7690,7 @@ _AggregatorClient.CONFIG = {
|
|
|
7596
7690
|
pythStateId: "0x1f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b8"
|
|
7597
7691
|
}
|
|
7598
7692
|
};
|
|
7599
|
-
var
|
|
7693
|
+
var AggregatorClient28 = _AggregatorClient;
|
|
7600
7694
|
function findPythPriceIDs(routes) {
|
|
7601
7695
|
const priceIDs = /* @__PURE__ */ new Set();
|
|
7602
7696
|
for (const route of routes) {
|
|
@@ -7631,6 +7725,14 @@ function findPythPriceIDs(routes) {
|
|
|
7631
7725
|
priceIDs.add(path.extendedDetails.steammOraclePythPriceSeedB);
|
|
7632
7726
|
}
|
|
7633
7727
|
}
|
|
7728
|
+
if (path.provider === SEVENK) {
|
|
7729
|
+
if (path.extendedDetails && path.extendedDetails.sevenkCoinAPriceSeed) {
|
|
7730
|
+
priceIDs.add(path.extendedDetails.sevenkCoinAPriceSeed);
|
|
7731
|
+
}
|
|
7732
|
+
if (path.extendedDetails && path.extendedDetails.sevenkCoinBPriceSeed) {
|
|
7733
|
+
priceIDs.add(path.extendedDetails.sevenkCoinBPriceSeed);
|
|
7734
|
+
}
|
|
7735
|
+
}
|
|
7634
7736
|
}
|
|
7635
7737
|
}
|
|
7636
7738
|
return Array.from(priceIDs);
|
|
@@ -7659,13 +7761,14 @@ function parseRouterResponse(data, byAmountIn) {
|
|
|
7659
7761
|
routes: data.routes.map((route) => {
|
|
7660
7762
|
return {
|
|
7661
7763
|
path: route.path.map((path) => {
|
|
7662
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D;
|
|
7764
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I;
|
|
7663
7765
|
let version;
|
|
7664
7766
|
if (path.provider === AFTERMATH) {
|
|
7665
7767
|
version = path.extended_details.aftermath_pool_flatness === 0 ? "v2" : "v3";
|
|
7666
7768
|
}
|
|
7769
|
+
console.log("path", path.extended_details);
|
|
7667
7770
|
let extendedDetails;
|
|
7668
|
-
if (path.provider === TURBOS || path.provider === AFTERMATH || path.provider === CETUS || path.provider === DEEPBOOKV3 || path.provider === SCALLOP || path.provider === HAEDALPMM || path.provider === METASTABLE || path.provider === OBRIC || path.provider === STEAMM || path.provider === STEAMM_OMM || path.provider === STEAMM_OMM_V2) {
|
|
7771
|
+
if (path.provider === TURBOS || path.provider === AFTERMATH || path.provider === CETUS || path.provider === DEEPBOOKV3 || path.provider === SCALLOP || path.provider === HAEDALPMM || path.provider === METASTABLE || path.provider === OBRIC || path.provider === STEAMM || path.provider === STEAMM_OMM || path.provider === STEAMM_OMM_V2 || path.provider === SEVENK) {
|
|
7669
7772
|
extendedDetails = {
|
|
7670
7773
|
aftermathLpSupplyType: (_a = path.extended_details) == null ? void 0 : _a.aftermath_lp_supply_type,
|
|
7671
7774
|
turbosFeeType: (_b = path.extended_details) == null ? void 0 : _b.turbos_fee_type,
|
|
@@ -7696,7 +7799,12 @@ function parseRouterResponse(data, byAmountIn) {
|
|
|
7696
7799
|
obricCoinAPriceSeed: (_A = path.extended_details) == null ? void 0 : _A.obric_coin_a_price_seed,
|
|
7697
7800
|
obricCoinBPriceSeed: (_B = path.extended_details) == null ? void 0 : _B.obric_coin_b_price_seed,
|
|
7698
7801
|
obricCoinAPriceId: (_C = path.extended_details) == null ? void 0 : _C.obric_coin_a_price_id,
|
|
7699
|
-
obricCoinBPriceId: (_D = path.extended_details) == null ? void 0 : _D.obric_coin_b_price_id
|
|
7802
|
+
obricCoinBPriceId: (_D = path.extended_details) == null ? void 0 : _D.obric_coin_b_price_id,
|
|
7803
|
+
sevenkCoinAPriceSeed: (_E = path.extended_details) == null ? void 0 : _E.sevenk_coin_a_price_seed,
|
|
7804
|
+
sevenkCoinBPriceSeed: (_F = path.extended_details) == null ? void 0 : _F.sevenk_coin_b_price_seed,
|
|
7805
|
+
sevenkCoinAOracleId: (_G = path.extended_details) == null ? void 0 : _G.sevenk_oracle_config_a,
|
|
7806
|
+
sevenkCoinBOracleId: (_H = path.extended_details) == null ? void 0 : _H.sevenk_oracle_config_b,
|
|
7807
|
+
sevenkLPCapType: (_I = path.extended_details) == null ? void 0 : _I.sevenk_lp_cap_type
|
|
7700
7808
|
};
|
|
7701
7809
|
}
|
|
7702
7810
|
return {
|
|
@@ -7822,28 +7930,7 @@ function getRouterResult(endpoint, apiKey, params, overlayFee, overlayFeeReceive
|
|
|
7822
7930
|
}
|
|
7823
7931
|
};
|
|
7824
7932
|
}
|
|
7825
|
-
|
|
7826
|
-
const data = yield response.text().then((text) => {
|
|
7827
|
-
const bigNumbers = [];
|
|
7828
|
-
const regex = /"([^"]+)"\s*:\s*(\d{16,})/g;
|
|
7829
|
-
const matches = text.matchAll(regex);
|
|
7830
|
-
for (const match of matches) {
|
|
7831
|
-
const key = match[1];
|
|
7832
|
-
const value = match[2];
|
|
7833
|
-
if (value.length > 15) {
|
|
7834
|
-
bigNumbers.push({ key, value });
|
|
7835
|
-
}
|
|
7836
|
-
}
|
|
7837
|
-
let safeText = text;
|
|
7838
|
-
bigNumbers.forEach(({ key, value }) => {
|
|
7839
|
-
safeText = safeText.replace(`"${key}":${value}`, `"${key}":"${value}"`);
|
|
7840
|
-
});
|
|
7841
|
-
const data2 = JSON.parse(safeText);
|
|
7842
|
-
console.log("\u5B89\u5168\u89E3\u6790\u7684\u6570\u636E:", data2);
|
|
7843
|
-
return data2;
|
|
7844
|
-
});
|
|
7845
|
-
console.log("sdk getRouterResult \u{1F680} ~ data:", data);
|
|
7846
|
-
console.log("sdk getRouterResult \u{1F680} ~ data:", data);
|
|
7933
|
+
const data = JSONbig.parse(yield response.text());
|
|
7847
7934
|
const insufficientLiquidity = data.msg === "liquidity is not enough";
|
|
7848
7935
|
if (data.msg && data.msg.indexOf("HoneyPot scam") > -1) {
|
|
7849
7936
|
return {
|
|
@@ -7862,7 +7949,6 @@ function getRouterResult(endpoint, apiKey, params, overlayFee, overlayFeeReceive
|
|
|
7862
7949
|
}
|
|
7863
7950
|
if (data.data != null) {
|
|
7864
7951
|
const res = parseRouterResponse(data.data, params.byAmountIn);
|
|
7865
|
-
console.log("sdk getRouterResult parseRouterResponse \u{1F680} ~ res:", res);
|
|
7866
7952
|
if (overlayFee > 0 && overlayFeeReceiver !== "0x0") {
|
|
7867
7953
|
if (params.byAmountIn) {
|
|
7868
7954
|
const overlayFeeAmount = res.amountOut.mul(new import_bn7.default(overlayFee)).div(new import_bn7.default(1e6));
|
|
@@ -8019,4 +8105,4 @@ decimal.js/decimal.mjs:
|
|
|
8019
8105
|
*)
|
|
8020
8106
|
*/
|
|
8021
8107
|
|
|
8022
|
-
export { AFSUI, AFTERMATH, AGGREGATOR_V2, AGGREGATOR_V2_EXTEND, AGGREGATOR_V2_EXTEND2, ALL_DEXES, ALPHAFI,
|
|
8108
|
+
export { AFSUI, AFTERMATH, AGGREGATOR_V2, AGGREGATOR_V2_EXTEND, AGGREGATOR_V2_EXTEND2, ALL_DEXES, ALPHAFI, AggregatorClient28 as AggregatorClient, BLUEFIN, BLUEMOVE, CETUS, CLOCK_ADDRESS, DEEPBOOKV2, DEEPBOOKV3, DEFAULT_ENDPOINT, Env, FLOWXV2, FLOWXV3, HAEDAL, HAEDALPMM, HAWAL, KRIYA, KRIYAV3, MAGMA, METASTABLE, MOMENTUM, OBRIC, ONE, SCALLOP, SEVENK, SPRINGSUI, STEAMM, STEAMM_OMM, STEAMM_OMM_V2, SUILEND, TEN_POW_NINE, TURBOS, TWO, U128, U64_MAX, U64_MAX_BN, VOLO, ZERO, buildInputCoin, checkInvalidSuiAddress, compareCoins, completionCoin, composeType, createTarget, dealWithFastRouterSwapParamsForMsafe, extractAddressFromType, extractStructTagFromType, findPythPriceIDs, fixSuiObjectId, getAggregatorV2Extend2PublishedAt, getAggregatorV2ExtendPublishedAt, getAggregatorV2PublishedAt, getAllProviders, getDeepbookV3Config, getProvidersExcluding, getProvidersIncluding, getRouterResult, isSortedSymbols, mintZeroCoin, normalizeCoinType, parseRouterResponse, patchFixSuiObjectId, printTransaction, processEndpoint, restituteMsafeFastRouterSwapParams };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cetusprotocol/aggregator-sdk",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-20250630205929",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -30,13 +30,15 @@
|
|
|
30
30
|
"@mysten/sui": "^1.6.0",
|
|
31
31
|
"@pythnetwork/pyth-sui-js": "^2.1.0",
|
|
32
32
|
"@types/jest": "^29.5.12",
|
|
33
|
+
"@types/json-bigint": "^1.0.4",
|
|
33
34
|
"@types/node": "^20.12.12",
|
|
34
35
|
"babel-jest": "^29.7.0",
|
|
35
36
|
"bip39": "^3.1.0",
|
|
36
37
|
"dotenv": "^16.4.5",
|
|
37
38
|
"jest": "^29.7.0",
|
|
39
|
+
"json-bigint": "^1.0.0",
|
|
38
40
|
"node-fetch": "^3.3.2",
|
|
39
41
|
"ts-jest": "^29.1.3",
|
|
40
|
-
"typescript": "^5.
|
|
42
|
+
"typescript": "^5.0.0"
|
|
41
43
|
}
|
|
42
44
|
}
|