@cetusprotocol/aggregator-sdk 0.0.0-experimental-20250630205929 → 0.0.0-experimental-20250704190819

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
@@ -337,6 +337,7 @@ type RouterData = {
337
337
  byAmountIn: boolean;
338
338
  routes: Router[];
339
339
  insufficientLiquidity: boolean;
340
+ deviationRatio: number;
340
341
  packages?: Map<string, string>;
341
342
  totalDeepFee?: number;
342
343
  error?: RouterError;
package/dist/index.d.ts CHANGED
@@ -337,6 +337,7 @@ type RouterData = {
337
337
  byAmountIn: boolean;
338
338
  routes: Router[];
339
339
  insufficientLiquidity: boolean;
340
+ deviationRatio: number;
340
341
  packages?: Map<string, string>;
341
342
  totalDeepFee?: number;
342
343
  error?: RouterError;
package/dist/index.js CHANGED
@@ -5896,6 +5896,7 @@ function swapInPools(client, params, sender, env) {
5896
5896
  const routeData = {
5897
5897
  amountIn,
5898
5898
  amountOut: new import_bn4.BN((_d = event.amount_out) != null ? _d : 0),
5899
+ deviationRatio: 0,
5899
5900
  routes: [
5900
5901
  {
5901
5902
  path: [
@@ -7473,7 +7474,7 @@ var _AggregatorClient = class _AggregatorClient {
7473
7474
  // Include cetus、deepbookv2、flowxv2 & v3、kriyav2 & v3、turbos、aftermath、haedal、afsui、volo、bluemove
7474
7475
  publishedAtV2() {
7475
7476
  if (this.env === 0 /* Mainnet */) {
7476
- return "0x47a7b90756fba96fe649c2aaa10ec60dec6b8cb8545573d621310072721133aa";
7477
+ return "0x8ae871505a80d8bf6bf9c05906cda6edfeea460c85bebe2e26a4313f5e67874a";
7477
7478
  } else {
7478
7479
  return "0x52eae33adeb44de55cfb3f281d4cc9e02d976181c0952f5323648b5717b33934";
7479
7480
  }
@@ -7481,14 +7482,14 @@ var _AggregatorClient = class _AggregatorClient {
7481
7482
  // Include deepbookv3, scallop, bluefin
7482
7483
  publishedAtV2Extend() {
7483
7484
  if (this.env === 0 /* Mainnet */) {
7484
- return "0x8093d002bba575f1378b0da206a8df1fc55c4b5b3718752304f1b67a505d2be4";
7485
+ return "0x8a2f7a5b20665eeccc79de3aa37c3b6c473eca233ada1e1cd4678ec07d4d4073";
7485
7486
  } else {
7486
7487
  return "0xabb6a81c8a216828e317719e06125de5bb2cb0fe8f9916ff8c023ca5be224c78";
7487
7488
  }
7488
7489
  }
7489
7490
  publishedAtV2Extend2() {
7490
7491
  if (this.env === 0 /* Mainnet */) {
7491
- return "0xc40b43f0aa4ba5a4d71e39770265d3698d0e6dcfd846b7d7c443207f4e919e04";
7492
+ return "0x5cb7499fc49c2642310e24a4ecffdbee00133f97e80e2b45bca90c64d55de880";
7492
7493
  } else {
7493
7494
  return "0x0";
7494
7495
  }
@@ -7762,6 +7763,7 @@ function parseRouterResponse(data, byAmountIn) {
7762
7763
  let routerData = {
7763
7764
  amountIn: new import_bn5.default(data.amount_in.toString()),
7764
7765
  amountOut: new import_bn5.default(data.amount_out.toString()),
7766
+ deviationRatio: data.deviation_ratio ? Number(data.deviation_ratio) : 0,
7765
7767
  byAmountIn,
7766
7768
  insufficientLiquidity: false,
7767
7769
  routes: data.routes.map((route) => {
@@ -7772,7 +7774,6 @@ function parseRouterResponse(data, byAmountIn) {
7772
7774
  if (path.provider === AFTERMATH) {
7773
7775
  version = path.extended_details.aftermath_pool_flatness === 0 ? "v2" : "v3";
7774
7776
  }
7775
- console.log("path", path.extended_details);
7776
7777
  let extendedDetails;
7777
7778
  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) {
7778
7779
  extendedDetails = {
@@ -7907,7 +7908,7 @@ function processEndpoint(endpoint) {
7907
7908
 
7908
7909
  // src/api.ts
7909
7910
  var import_bn7 = __toESM(require_bn());
7910
- var SDK_VERSION = 1001300;
7911
+ var SDK_VERSION = 1001400;
7911
7912
  function getRouterResult(endpoint, apiKey, params, overlayFee, overlayFeeReceiver) {
7912
7913
  return __async(this, null, function* () {
7913
7914
  let response;
@@ -7930,6 +7931,7 @@ function getRouterResult(endpoint, apiKey, params, overlayFee, overlayFeeReceive
7930
7931
  routes: [],
7931
7932
  byAmountIn: params.byAmountIn,
7932
7933
  insufficientLiquidity: false,
7934
+ deviationRatio: 0,
7933
7935
  error: {
7934
7936
  code: errorCode,
7935
7937
  msg: getAggregatorServerErrorMessage(errorCode)
@@ -7945,6 +7947,7 @@ function getRouterResult(endpoint, apiKey, params, overlayFee, overlayFeeReceive
7945
7947
  routes: [],
7946
7948
  byAmountIn: params.byAmountIn,
7947
7949
  insufficientLiquidity,
7950
+ deviationRatio: 0,
7948
7951
  error: {
7949
7952
  code: 10004 /* HoneyPot */,
7950
7953
  msg: getAggregatorServerErrorMessage(
@@ -7974,6 +7977,7 @@ function getRouterResult(endpoint, apiKey, params, overlayFee, overlayFeeReceive
7974
7977
  routes: [],
7975
7978
  insufficientLiquidity,
7976
7979
  byAmountIn: params.byAmountIn,
7980
+ deviationRatio: 0,
7977
7981
  error: {
7978
7982
  code: 10003 /* InsufficientLiquidity */,
7979
7983
  msg: getAggregatorServerErrorMessage(
package/dist/index.mjs CHANGED
@@ -5890,6 +5890,7 @@ function swapInPools(client, params, sender, env) {
5890
5890
  const routeData = {
5891
5891
  amountIn,
5892
5892
  amountOut: new import_bn4.BN((_d = event.amount_out) != null ? _d : 0),
5893
+ deviationRatio: 0,
5893
5894
  routes: [
5894
5895
  {
5895
5896
  path: [
@@ -7467,7 +7468,7 @@ var _AggregatorClient = class _AggregatorClient {
7467
7468
  // Include cetus、deepbookv2、flowxv2 & v3、kriyav2 & v3、turbos、aftermath、haedal、afsui、volo、bluemove
7468
7469
  publishedAtV2() {
7469
7470
  if (this.env === 0 /* Mainnet */) {
7470
- return "0x47a7b90756fba96fe649c2aaa10ec60dec6b8cb8545573d621310072721133aa";
7471
+ return "0x8ae871505a80d8bf6bf9c05906cda6edfeea460c85bebe2e26a4313f5e67874a";
7471
7472
  } else {
7472
7473
  return "0x52eae33adeb44de55cfb3f281d4cc9e02d976181c0952f5323648b5717b33934";
7473
7474
  }
@@ -7475,14 +7476,14 @@ var _AggregatorClient = class _AggregatorClient {
7475
7476
  // Include deepbookv3, scallop, bluefin
7476
7477
  publishedAtV2Extend() {
7477
7478
  if (this.env === 0 /* Mainnet */) {
7478
- return "0x8093d002bba575f1378b0da206a8df1fc55c4b5b3718752304f1b67a505d2be4";
7479
+ return "0x8a2f7a5b20665eeccc79de3aa37c3b6c473eca233ada1e1cd4678ec07d4d4073";
7479
7480
  } else {
7480
7481
  return "0xabb6a81c8a216828e317719e06125de5bb2cb0fe8f9916ff8c023ca5be224c78";
7481
7482
  }
7482
7483
  }
7483
7484
  publishedAtV2Extend2() {
7484
7485
  if (this.env === 0 /* Mainnet */) {
7485
- return "0xc40b43f0aa4ba5a4d71e39770265d3698d0e6dcfd846b7d7c443207f4e919e04";
7486
+ return "0x5cb7499fc49c2642310e24a4ecffdbee00133f97e80e2b45bca90c64d55de880";
7486
7487
  } else {
7487
7488
  return "0x0";
7488
7489
  }
@@ -7756,6 +7757,7 @@ function parseRouterResponse(data, byAmountIn) {
7756
7757
  let routerData = {
7757
7758
  amountIn: new import_bn5.default(data.amount_in.toString()),
7758
7759
  amountOut: new import_bn5.default(data.amount_out.toString()),
7760
+ deviationRatio: data.deviation_ratio ? Number(data.deviation_ratio) : 0,
7759
7761
  byAmountIn,
7760
7762
  insufficientLiquidity: false,
7761
7763
  routes: data.routes.map((route) => {
@@ -7766,7 +7768,6 @@ function parseRouterResponse(data, byAmountIn) {
7766
7768
  if (path.provider === AFTERMATH) {
7767
7769
  version = path.extended_details.aftermath_pool_flatness === 0 ? "v2" : "v3";
7768
7770
  }
7769
- console.log("path", path.extended_details);
7770
7771
  let extendedDetails;
7771
7772
  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) {
7772
7773
  extendedDetails = {
@@ -7901,7 +7902,7 @@ function processEndpoint(endpoint) {
7901
7902
 
7902
7903
  // src/api.ts
7903
7904
  var import_bn7 = __toESM(require_bn());
7904
- var SDK_VERSION = 1001300;
7905
+ var SDK_VERSION = 1001400;
7905
7906
  function getRouterResult(endpoint, apiKey, params, overlayFee, overlayFeeReceiver) {
7906
7907
  return __async(this, null, function* () {
7907
7908
  let response;
@@ -7924,6 +7925,7 @@ function getRouterResult(endpoint, apiKey, params, overlayFee, overlayFeeReceive
7924
7925
  routes: [],
7925
7926
  byAmountIn: params.byAmountIn,
7926
7927
  insufficientLiquidity: false,
7928
+ deviationRatio: 0,
7927
7929
  error: {
7928
7930
  code: errorCode,
7929
7931
  msg: getAggregatorServerErrorMessage(errorCode)
@@ -7939,6 +7941,7 @@ function getRouterResult(endpoint, apiKey, params, overlayFee, overlayFeeReceive
7939
7941
  routes: [],
7940
7942
  byAmountIn: params.byAmountIn,
7941
7943
  insufficientLiquidity,
7944
+ deviationRatio: 0,
7942
7945
  error: {
7943
7946
  code: 10004 /* HoneyPot */,
7944
7947
  msg: getAggregatorServerErrorMessage(
@@ -7968,6 +7971,7 @@ function getRouterResult(endpoint, apiKey, params, overlayFee, overlayFeeReceive
7968
7971
  routes: [],
7969
7972
  insufficientLiquidity,
7970
7973
  byAmountIn: params.byAmountIn,
7974
+ deviationRatio: 0,
7971
7975
  error: {
7972
7976
  code: 10003 /* InsufficientLiquidity */,
7973
7977
  msg: getAggregatorServerErrorMessage(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cetusprotocol/aggregator-sdk",
3
- "version": "0.0.0-experimental-20250630205929",
3
+ "version": "0.0.0-experimental-20250704190819",
4
4
  "sideEffects": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",