@cetusprotocol/aggregator-sdk 1.6.0 → 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/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 = 1010600;
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 = [...hermesUrls];
7826
- if (!urls.includes("https://hermes.pyth.network")) {
7827
- urls.push("https://hermes.pyth.network");
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
- params,
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
- params,
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) {
@@ -9583,7 +9698,15 @@ var _AggregatorClient = class _AggregatorClient {
9583
9698
  // auto build input coin
9584
9699
  // auto merge, transfer or destory target coin.
9585
9700
  async fastRouterSwap(params) {
9586
- const { router, slippage, txb, partner, cetusDlmmPartner, payDeepFeeAmount } = params;
9701
+ const {
9702
+ router,
9703
+ slippage,
9704
+ txb,
9705
+ partner,
9706
+ cetusDlmmPartner,
9707
+ payDeepFeeAmount,
9708
+ sponsored = false
9709
+ } = params;
9587
9710
  const fromCoinType = router.paths[0].from;
9588
9711
  const targetCoinType = router.paths[router.paths.length - 1].target;
9589
9712
  const byAmountIn = router.byAmountIn;
@@ -9608,7 +9731,7 @@ var _AggregatorClient = class _AggregatorClient {
9608
9731
  const amount = byAmountIn ? expectedAmountIn : amountLimit;
9609
9732
  let inputCoin = coinWithBalance({
9610
9733
  balance: BigInt(amount.toString()),
9611
- useGasCoin: true,
9734
+ useGasCoin: !sponsored,
9612
9735
  type: fromCoinType
9613
9736
  });
9614
9737
  let deepCoin;
@@ -9628,22 +9751,46 @@ var _AggregatorClient = class _AggregatorClient {
9628
9751
  deepbookv3DeepFee: deepCoin
9629
9752
  };
9630
9753
  const targetCoin = await this.routerSwap(routerSwapParams);
9754
+ await this.deliverTargetCoin(
9755
+ txb,
9756
+ targetCoin,
9757
+ targetCoinType,
9758
+ router.packages,
9759
+ sponsored
9760
+ );
9761
+ }
9762
+ // Delivers a swap's output coin. In sponsored mode the SDK must not query or touch
9763
+ // coins through `this.signer`, because the transaction sender may be different from
9764
+ // the SDK instance signer. Let the router transfer helper deliver the output to the
9765
+ // transaction sender instead.
9766
+ async deliverTargetCoin(txb, targetCoin, targetCoinType, packages, sponsored) {
9767
+ if (sponsored) {
9768
+ transferOrDestroyCoin(
9769
+ {
9770
+ coin: targetCoin,
9771
+ coinType: targetCoinType,
9772
+ packages
9773
+ },
9774
+ txb
9775
+ );
9776
+ return;
9777
+ }
9631
9778
  if (CoinUtils.isSuiCoin(targetCoinType)) {
9632
9779
  txb.mergeCoins(txb.gas, [targetCoin]);
9780
+ return;
9781
+ }
9782
+ const targetCoinObjID = await this.getOneCoinUsedToMerge(targetCoinType);
9783
+ if (targetCoinObjID != null) {
9784
+ txb.mergeCoins(txb.object(targetCoinObjID), [targetCoin]);
9633
9785
  } else {
9634
- const targetCoinObjID = await this.getOneCoinUsedToMerge(targetCoinType);
9635
- if (targetCoinObjID != null) {
9636
- txb.mergeCoins(txb.object(targetCoinObjID), [targetCoin]);
9637
- } else {
9638
- transferOrDestroyCoin(
9639
- {
9640
- coin: targetCoin,
9641
- coinType: targetCoinType,
9642
- packages: router.packages
9643
- },
9644
- txb
9645
- );
9646
- }
9786
+ transferOrDestroyCoin(
9787
+ {
9788
+ coin: targetCoin,
9789
+ coinType: targetCoinType,
9790
+ packages
9791
+ },
9792
+ txb
9793
+ );
9647
9794
  }
9648
9795
  }
9649
9796
  async mergeSwap(params) {
@@ -9692,7 +9839,7 @@ var _AggregatorClient = class _AggregatorClient {
9692
9839
  return finalOutputCoin;
9693
9840
  }
9694
9841
  async fastMergeSwap(params) {
9695
- const { router, slippage, txb, partner } = params;
9842
+ const { router, slippage, txb, partner, sponsored = false } = params;
9696
9843
  if (!router || !router.allRoutes || router.allRoutes.length === 0) {
9697
9844
  throw new Error("Invalid router: no routes found");
9698
9845
  }
@@ -9708,7 +9855,7 @@ var _AggregatorClient = class _AggregatorClient {
9708
9855
  coinTypeSet.add(firstCoinType);
9709
9856
  const coin = coinWithBalance({
9710
9857
  balance: BigInt(route.amountIn.toString()),
9711
- useGasCoin: CoinUtils.isSuiCoin(firstCoinType),
9858
+ useGasCoin: !sponsored && CoinUtils.isSuiCoin(firstCoinType),
9712
9859
  type: firstCoinType
9713
9860
  });
9714
9861
  inputCoins.push({ coinType: firstCoinType, coin });
@@ -9721,23 +9868,13 @@ var _AggregatorClient = class _AggregatorClient {
9721
9868
  partner: partner ?? this.partner
9722
9869
  };
9723
9870
  const targetCoin = await this.mergeSwap(mergeSwapParams);
9724
- if (CoinUtils.isSuiCoin(targetCoinType)) {
9725
- txb.mergeCoins(txb.gas, [targetCoin]);
9726
- } else {
9727
- const targetCoinObjID = await this.getOneCoinUsedToMerge(targetCoinType);
9728
- if (targetCoinObjID != null) {
9729
- txb.mergeCoins(txb.object(targetCoinObjID), [targetCoin]);
9730
- } else {
9731
- transferOrDestroyCoin(
9732
- {
9733
- coin: targetCoin,
9734
- coinType: targetCoinType,
9735
- packages: router.packages
9736
- },
9737
- txb
9738
- );
9739
- }
9740
- }
9871
+ await this.deliverTargetCoin(
9872
+ txb,
9873
+ targetCoin,
9874
+ targetCoinType,
9875
+ router.packages,
9876
+ sponsored
9877
+ );
9741
9878
  }
9742
9879
  async fixableRouterSwapV3(params) {
9743
9880
  const { router, inputCoin, slippage, txb, partner } = params;
@@ -9936,6 +10073,70 @@ var _AggregatorClient = class _AggregatorClient {
9936
10073
  });
9937
10074
  return res;
9938
10075
  }
10076
+ // ---------------------------------------------------------------------------
10077
+ // Sponsored transactions
10078
+ //
10079
+ // A sponsored transaction lets a sponsor (gas station) pay gas for a transaction
10080
+ // whose commands are authored by a different sender. The sender and the sponsor both
10081
+ // sign the same transaction bytes, and the transaction is submitted with both
10082
+ // signatures. See: https://docs.sui.io/concepts/transactions/sponsored-transactions
10083
+ //
10084
+ // Build the swap with `sponsored: true` (e.g. `fastRouterSwap`/`fastMergeSwap`) so the
10085
+ // gas coin is never used, then:
10086
+ // - Remote gas station: `buildTransactionKind(txb, sender)` -> station assembles gas
10087
+ // data with `buildSponsoredTransaction` -> station builds/signs full bytes -> user
10088
+ // signs the same bytes -> `executeWithSignatures`.
10089
+ // - Local sponsor (both keypairs available): `signAndExecuteSponsoredTransaction`.
10090
+ // ---------------------------------------------------------------------------
10091
+ // Builds the TransactionKind bytes (commands only, no gas data) to hand to a sponsor /
10092
+ // gas station. Pass `sender` when the transaction contains CoinWithBalance intents,
10093
+ // because those are resolved while building the kind.
10094
+ async buildTransactionKind(txb, sender) {
10095
+ if (sender) {
10096
+ txb.setSender(sender);
10097
+ }
10098
+ return txb.build({ client: this.client, onlyTransactionKind: true });
10099
+ }
10100
+ // Assembles a sponsored transaction from TransactionKind bytes plus the gas data
10101
+ // provided by the sponsor. The returned transaction is ready to be built and signed by
10102
+ // both the sender and the sponsor.
10103
+ buildSponsoredTransaction(params) {
10104
+ const { txKindBytes, sender, sponsor, sponsorCoins, gasBudget, gasPrice } = params;
10105
+ const tx = Transaction.fromKind(txKindBytes);
10106
+ tx.setSender(sender);
10107
+ tx.setGasOwner(sponsor);
10108
+ tx.setGasPayment(sponsorCoins);
10109
+ if (gasBudget != null) {
10110
+ tx.setGasBudget(gasBudget);
10111
+ }
10112
+ if (gasPrice != null) {
10113
+ tx.setGasPrice(gasPrice);
10114
+ }
10115
+ return tx;
10116
+ }
10117
+ // Builds the full transaction bytes (including gas data) that both parties must sign.
10118
+ // Returns the exact bytes the signatures must be produced over.
10119
+ async buildTransactionBytes(txb) {
10120
+ return txb.build({ client: this.client });
10121
+ }
10122
+ // Executes a transaction from pre-built bytes plus the collected signatures. The
10123
+ // signatures MUST be produced over exactly these `bytes` (see `buildTransactionBytes`).
10124
+ async executeWithSignatures(bytes, signatures) {
10125
+ return this.client.executeTransaction({
10126
+ transaction: bytes,
10127
+ signatures,
10128
+ include: { effects: true, events: true, balanceChanges: true }
10129
+ });
10130
+ }
10131
+ // Convenience for the local dual-key case: signs the transaction with both the user's
10132
+ // and the sponsor's signer and executes it. `txb` must already have its sender, gas
10133
+ // owner and gas payment set (e.g. via `buildSponsoredTransaction`).
10134
+ async signAndExecuteSponsoredTransaction(txb, userSigner, sponsorSigner) {
10135
+ const bytes = await txb.build({ client: this.client });
10136
+ const { signature: sponsorSig } = await sponsorSigner.signTransaction(bytes);
10137
+ const { signature: userSig } = await userSigner.signTransaction(bytes);
10138
+ return this.executeWithSignatures(bytes, [userSig, sponsorSig]);
10139
+ }
9939
10140
  };
9940
10141
  _AggregatorClient.CONFIG = {
9941
10142
  [1 /* Testnet */]: {
@@ -9955,6 +10156,35 @@ function generateUUID() {
9955
10156
  return v.toString(16);
9956
10157
  });
9957
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
+ }
9958
10188
  function recordFirstCoinIndex(paths) {
9959
10189
  let newCoinRecord = /* @__PURE__ */ new Map();
9960
10190
  for (let i = 0; i < paths.length; i++) {
@@ -10003,4 +10233,4 @@ decimal.js/decimal.mjs:
10003
10233
  *)
10004
10234
  */
10005
10235
 
10006
- 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cetusprotocol/aggregator-sdk",
3
- "version": "1.6.0",
3
+ "version": "1.6.2",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "main": "dist/index.js",