@cetusprotocol/aggregator-sdk 0.11.0 → 0.11.1

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 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 DEFAULT_ENDPOINT = "https://api-sui.cetus.zone/router_v2";
91
+ declare const ALL_DEXES: string[];
91
92
  type BuildRouterSwapParams = {
92
93
  routers: Router[];
93
94
  byAmountIn: boolean;
@@ -133,6 +134,19 @@ interface SwapInPoolsResult {
133
134
  isExceed: boolean;
134
135
  routeData?: RouterData;
135
136
  }
137
+ declare function getAllProviders(): string[];
138
+ /**
139
+ * Get all providers excluding the specified ones
140
+ * @param excludeProviders Array of provider names to exclude
141
+ * @returns Filtered provider list
142
+ */
143
+ declare function getProvidersExcluding(excludeProviders: string[]): string[];
144
+ /**
145
+ * Get only the specified providers
146
+ * @param includeProviders Array of provider names to include
147
+ * @returns Filtered provider list
148
+ */
149
+ declare function getProvidersIncluding(includeProviders: string[]): string[];
136
150
  type AggregatorClientParams = {
137
151
  endpoint?: string;
138
152
  signer?: string;
@@ -351,4 +365,4 @@ declare enum Env {
351
365
  Testnet = 1
352
366
  }
353
367
 
354
- export { AFSUI, AFTERMATH, AGGREGATOR_V2, AGGREGATOR_V2_EXTEND, AGGREGATOR_V2_EXTEND2, 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, 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, getDeepbookV3Config, getRouterResult, isSortedSymbols, mintZeroCoin, normalizeCoinType, parseRouterResponse, patchFixSuiObjectId, printTransaction, processEndpoint, restituteMsafeFastRouterSwapParams };
368
+ 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, 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 };
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 DEFAULT_ENDPOINT = "https://api-sui.cetus.zone/router_v2";
91
+ declare const ALL_DEXES: string[];
91
92
  type BuildRouterSwapParams = {
92
93
  routers: Router[];
93
94
  byAmountIn: boolean;
@@ -133,6 +134,19 @@ interface SwapInPoolsResult {
133
134
  isExceed: boolean;
134
135
  routeData?: RouterData;
135
136
  }
137
+ declare function getAllProviders(): string[];
138
+ /**
139
+ * Get all providers excluding the specified ones
140
+ * @param excludeProviders Array of provider names to exclude
141
+ * @returns Filtered provider list
142
+ */
143
+ declare function getProvidersExcluding(excludeProviders: string[]): string[];
144
+ /**
145
+ * Get only the specified providers
146
+ * @param includeProviders Array of provider names to include
147
+ * @returns Filtered provider list
148
+ */
149
+ declare function getProvidersIncluding(includeProviders: string[]): string[];
136
150
  type AggregatorClientParams = {
137
151
  endpoint?: string;
138
152
  signer?: string;
@@ -351,4 +365,4 @@ declare enum Env {
351
365
  Testnet = 1
352
366
  }
353
367
 
354
- export { AFSUI, AFTERMATH, AGGREGATOR_V2, AGGREGATOR_V2_EXTEND, AGGREGATOR_V2_EXTEND2, 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, 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, getDeepbookV3Config, getRouterResult, isSortedSymbols, mintZeroCoin, normalizeCoinType, parseRouterResponse, patchFixSuiObjectId, printTransaction, processEndpoint, restituteMsafeFastRouterSwapParams };
368
+ 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, 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 };
package/dist/index.js CHANGED
@@ -6783,12 +6783,48 @@ var STEAMM_OMM = "STEAMM_OMM";
6783
6783
  var MOMENTUM = "MOMENTUM";
6784
6784
  var STEAMM_OMM_V2 = "STEAMM_OMM_V2";
6785
6785
  var DEFAULT_ENDPOINT = "https://api-sui.cetus.zone/router_v2";
6786
+ var ALL_DEXES = [
6787
+ CETUS,
6788
+ KRIYA,
6789
+ FLOWXV2,
6790
+ FLOWXV3,
6791
+ KRIYAV3,
6792
+ TURBOS,
6793
+ AFTERMATH,
6794
+ HAEDAL,
6795
+ VOLO,
6796
+ AFSUI,
6797
+ BLUEMOVE,
6798
+ DEEPBOOKV3,
6799
+ SCALLOP,
6800
+ SUILEND,
6801
+ BLUEFIN,
6802
+ HAEDALPMM,
6803
+ ALPHAFI,
6804
+ SPRINGSUI,
6805
+ STEAMM,
6806
+ METASTABLE,
6807
+ OBRIC,
6808
+ HAWAL,
6809
+ MOMENTUM,
6810
+ STEAMM_OMM,
6811
+ STEAMM_OMM_V2
6812
+ ];
6786
6813
  function isBuilderRouterSwapParams(params) {
6787
6814
  return Array.isArray(params.routers);
6788
6815
  }
6789
6816
  function isBuilderFastRouterSwapParams(params) {
6790
6817
  return Array.isArray(params.routers);
6791
6818
  }
6819
+ function getAllProviders() {
6820
+ return ALL_DEXES;
6821
+ }
6822
+ function getProvidersExcluding(excludeProviders) {
6823
+ return ALL_DEXES.filter((provider) => !excludeProviders.includes(provider));
6824
+ }
6825
+ function getProvidersIncluding(includeProviders) {
6826
+ return ALL_DEXES.filter((provider) => includeProviders.includes(provider));
6827
+ }
6792
6828
  var _AggregatorClient = class _AggregatorClient {
6793
6829
  constructor(params) {
6794
6830
  var _a, _b;
@@ -7724,7 +7760,7 @@ function processEndpoint(endpoint) {
7724
7760
 
7725
7761
  // src/api.ts
7726
7762
  var import_bn7 = __toESM(require_bn());
7727
- var SDK_VERSION = 1001100;
7763
+ var SDK_VERSION = 1001101;
7728
7764
  function getRouterResult(endpoint, apiKey, params, overlayFee, overlayFeeReceiver) {
7729
7765
  return __async(this, null, function* () {
7730
7766
  let response;
@@ -7933,6 +7969,7 @@ exports.AFTERMATH = AFTERMATH;
7933
7969
  exports.AGGREGATOR_V2 = AGGREGATOR_V2;
7934
7970
  exports.AGGREGATOR_V2_EXTEND = AGGREGATOR_V2_EXTEND;
7935
7971
  exports.AGGREGATOR_V2_EXTEND2 = AGGREGATOR_V2_EXTEND2;
7972
+ exports.ALL_DEXES = ALL_DEXES;
7936
7973
  exports.ALPHAFI = ALPHAFI;
7937
7974
  exports.AggregatorClient = AggregatorClient26;
7938
7975
  exports.BLUEFIN = BLUEFIN;
@@ -7982,7 +8019,10 @@ exports.fixSuiObjectId = fixSuiObjectId;
7982
8019
  exports.getAggregatorV2Extend2PublishedAt = getAggregatorV2Extend2PublishedAt;
7983
8020
  exports.getAggregatorV2ExtendPublishedAt = getAggregatorV2ExtendPublishedAt;
7984
8021
  exports.getAggregatorV2PublishedAt = getAggregatorV2PublishedAt;
8022
+ exports.getAllProviders = getAllProviders;
7985
8023
  exports.getDeepbookV3Config = getDeepbookV3Config;
8024
+ exports.getProvidersExcluding = getProvidersExcluding;
8025
+ exports.getProvidersIncluding = getProvidersIncluding;
7986
8026
  exports.getRouterResult = getRouterResult;
7987
8027
  exports.isSortedSymbols = isSortedSymbols;
7988
8028
  exports.mintZeroCoin = mintZeroCoin;
package/dist/index.mjs CHANGED
@@ -6781,12 +6781,48 @@ var STEAMM_OMM = "STEAMM_OMM";
6781
6781
  var MOMENTUM = "MOMENTUM";
6782
6782
  var STEAMM_OMM_V2 = "STEAMM_OMM_V2";
6783
6783
  var DEFAULT_ENDPOINT = "https://api-sui.cetus.zone/router_v2";
6784
+ var ALL_DEXES = [
6785
+ CETUS,
6786
+ KRIYA,
6787
+ FLOWXV2,
6788
+ FLOWXV3,
6789
+ KRIYAV3,
6790
+ TURBOS,
6791
+ AFTERMATH,
6792
+ HAEDAL,
6793
+ VOLO,
6794
+ AFSUI,
6795
+ BLUEMOVE,
6796
+ DEEPBOOKV3,
6797
+ SCALLOP,
6798
+ SUILEND,
6799
+ BLUEFIN,
6800
+ HAEDALPMM,
6801
+ ALPHAFI,
6802
+ SPRINGSUI,
6803
+ STEAMM,
6804
+ METASTABLE,
6805
+ OBRIC,
6806
+ HAWAL,
6807
+ MOMENTUM,
6808
+ STEAMM_OMM,
6809
+ STEAMM_OMM_V2
6810
+ ];
6784
6811
  function isBuilderRouterSwapParams(params) {
6785
6812
  return Array.isArray(params.routers);
6786
6813
  }
6787
6814
  function isBuilderFastRouterSwapParams(params) {
6788
6815
  return Array.isArray(params.routers);
6789
6816
  }
6817
+ function getAllProviders() {
6818
+ return ALL_DEXES;
6819
+ }
6820
+ function getProvidersExcluding(excludeProviders) {
6821
+ return ALL_DEXES.filter((provider) => !excludeProviders.includes(provider));
6822
+ }
6823
+ function getProvidersIncluding(includeProviders) {
6824
+ return ALL_DEXES.filter((provider) => includeProviders.includes(provider));
6825
+ }
6790
6826
  var _AggregatorClient = class _AggregatorClient {
6791
6827
  constructor(params) {
6792
6828
  var _a, _b;
@@ -7722,7 +7758,7 @@ function processEndpoint(endpoint) {
7722
7758
 
7723
7759
  // src/api.ts
7724
7760
  var import_bn7 = __toESM(require_bn());
7725
- var SDK_VERSION = 1001100;
7761
+ var SDK_VERSION = 1001101;
7726
7762
  function getRouterResult(endpoint, apiKey, params, overlayFee, overlayFeeReceiver) {
7727
7763
  return __async(this, null, function* () {
7728
7764
  let response;
@@ -7926,4 +7962,4 @@ decimal.js/decimal.mjs:
7926
7962
  *)
7927
7963
  */
7928
7964
 
7929
- export { AFSUI, AFTERMATH, AGGREGATOR_V2, AGGREGATOR_V2_EXTEND, AGGREGATOR_V2_EXTEND2, ALPHAFI, AggregatorClient26 as AggregatorClient, BLUEFIN, BLUEMOVE, CETUS, CLOCK_ADDRESS, DEEPBOOKV2, DEEPBOOKV3, DEFAULT_ENDPOINT, Env, FLOWXV2, FLOWXV3, HAEDAL, HAEDALPMM, HAWAL, KRIYA, KRIYAV3, METASTABLE, MOMENTUM, OBRIC, ONE, SCALLOP, 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, getDeepbookV3Config, getRouterResult, isSortedSymbols, mintZeroCoin, normalizeCoinType, parseRouterResponse, patchFixSuiObjectId, printTransaction, processEndpoint, restituteMsafeFastRouterSwapParams };
7965
+ export { AFSUI, AFTERMATH, AGGREGATOR_V2, AGGREGATOR_V2_EXTEND, AGGREGATOR_V2_EXTEND2, ALL_DEXES, ALPHAFI, AggregatorClient26 as AggregatorClient, BLUEFIN, BLUEMOVE, CETUS, CLOCK_ADDRESS, DEEPBOOKV2, DEEPBOOKV3, DEFAULT_ENDPOINT, Env, FLOWXV2, FLOWXV3, HAEDAL, HAEDALPMM, HAWAL, KRIYA, KRIYAV3, METASTABLE, MOMENTUM, OBRIC, ONE, SCALLOP, 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.11.0",
3
+ "version": "0.11.1",
4
4
  "sideEffects": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",