@cetusprotocol/aggregator-sdk 0.8.0 → 0.9.0

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
@@ -5991,23 +5991,20 @@ var Volo = class {
5991
5991
  if (env !== 0 /* Mainnet */) {
5992
5992
  throw new Error("Volo only supported on mainnet");
5993
5993
  }
5994
- this.nativePool = "0x7fa2faa111b8c65bea48a23049bfd81ca8f971a262d981dcd9a17c3825cb5baf";
5994
+ this.stakePool = "0x2d914e23d82fedef1b5f56a32d5c64bdcc3087ccfea2b4d6ea51a71f587840e5";
5995
5995
  this.metadata = "0x680cd26af32b2bde8d3361e804c53ec1d1cfe24c7f039eb7f549e8dfde389a60";
5996
5996
  }
5997
5997
  swap(client, txb, path, inputCoin, packages) {
5998
5998
  return __async(this, null, function* () {
5999
5999
  const { direction } = path;
6000
- if (!direction) {
6001
- throw new Error("Volo not support b2a swap");
6002
- }
6003
- const func = "swap_a2b";
6000
+ const func = direction ? "swap_a2b" : "swap_b2a";
6004
6001
  const args = [
6005
- txb.object(this.nativePool),
6002
+ txb.object(this.stakePool),
6006
6003
  txb.object(this.metadata),
6007
6004
  txb.object("0x5"),
6008
6005
  inputCoin
6009
6006
  ];
6010
- const publishedAt = getAggregatorV2PublishedAt(client.publishedAtV2(), packages);
6007
+ const publishedAt = getAggregatorV2Extend2PublishedAt(client.publishedAtV2Extend2(), packages);
6011
6008
  const res = txb.moveCall({
6012
6009
  target: `${publishedAt}::volo::${func}`,
6013
6010
  typeArguments: [],
@@ -7192,14 +7189,14 @@ var _AggregatorClient = class _AggregatorClient {
7192
7189
  // Include deepbookv3, scallop, bluefin
7193
7190
  publishedAtV2Extend() {
7194
7191
  if (this.env === 0 /* Mainnet */) {
7195
- return "0x39402d188b7231036e52266ebafad14413b4bf3daea4ac17115989444e6cd516";
7192
+ return "0xa2fe8e900d719813fee1ffaea14d5a2b5516a4d15b75f14aa0cf27c531c20ae3";
7196
7193
  } else {
7197
7194
  return "0xabb6a81c8a216828e317719e06125de5bb2cb0fe8f9916ff8c023ca5be224c78";
7198
7195
  }
7199
7196
  }
7200
7197
  publishedAtV2Extend2() {
7201
7198
  if (this.env === 0 /* Mainnet */) {
7202
- return "0x0018f7bbbece22f4272ed2281b290f745e5aa69d870f599810a30b4eeffc1a5e";
7199
+ return "0x1727de5223a86156c0fd4ee290aaabaea7f0ffeff485c367c2eb0dcbdfc0061a";
7203
7200
  } else {
7204
7201
  return "0x0";
7205
7202
  }
@@ -7596,7 +7593,7 @@ function processEndpoint(endpoint) {
7596
7593
 
7597
7594
  // src/api.ts
7598
7595
  var import_bn7 = __toESM(require_bn());
7599
- var SDK_VERSION = 1000800;
7596
+ var SDK_VERSION = 1000900;
7600
7597
  function getRouterResult(endpoint, apiKey, params, overlayFee, overlayFeeReceiver) {
7601
7598
  return __async(this, null, function* () {
7602
7599
  let response;
@@ -7643,7 +7640,6 @@ function getRouterResult(endpoint, apiKey, params, overlayFee, overlayFeeReceive
7643
7640
  };
7644
7641
  }
7645
7642
  if (data.data != null) {
7646
- console.log("data: ", JSON.stringify(data.data, null, 2));
7647
7643
  const res = parseRouterResponse(data.data, params.byAmountIn);
7648
7644
  if (overlayFee > 0 && overlayFeeReceiver !== "0x0") {
7649
7645
  if (params.byAmountIn) {
package/dist/index.mjs CHANGED
@@ -5989,23 +5989,20 @@ var Volo = class {
5989
5989
  if (env !== 0 /* Mainnet */) {
5990
5990
  throw new Error("Volo only supported on mainnet");
5991
5991
  }
5992
- this.nativePool = "0x7fa2faa111b8c65bea48a23049bfd81ca8f971a262d981dcd9a17c3825cb5baf";
5992
+ this.stakePool = "0x2d914e23d82fedef1b5f56a32d5c64bdcc3087ccfea2b4d6ea51a71f587840e5";
5993
5993
  this.metadata = "0x680cd26af32b2bde8d3361e804c53ec1d1cfe24c7f039eb7f549e8dfde389a60";
5994
5994
  }
5995
5995
  swap(client, txb, path, inputCoin, packages) {
5996
5996
  return __async(this, null, function* () {
5997
5997
  const { direction } = path;
5998
- if (!direction) {
5999
- throw new Error("Volo not support b2a swap");
6000
- }
6001
- const func = "swap_a2b";
5998
+ const func = direction ? "swap_a2b" : "swap_b2a";
6002
5999
  const args = [
6003
- txb.object(this.nativePool),
6000
+ txb.object(this.stakePool),
6004
6001
  txb.object(this.metadata),
6005
6002
  txb.object("0x5"),
6006
6003
  inputCoin
6007
6004
  ];
6008
- const publishedAt = getAggregatorV2PublishedAt(client.publishedAtV2(), packages);
6005
+ const publishedAt = getAggregatorV2Extend2PublishedAt(client.publishedAtV2Extend2(), packages);
6009
6006
  const res = txb.moveCall({
6010
6007
  target: `${publishedAt}::volo::${func}`,
6011
6008
  typeArguments: [],
@@ -7190,14 +7187,14 @@ var _AggregatorClient = class _AggregatorClient {
7190
7187
  // Include deepbookv3, scallop, bluefin
7191
7188
  publishedAtV2Extend() {
7192
7189
  if (this.env === 0 /* Mainnet */) {
7193
- return "0x39402d188b7231036e52266ebafad14413b4bf3daea4ac17115989444e6cd516";
7190
+ return "0xa2fe8e900d719813fee1ffaea14d5a2b5516a4d15b75f14aa0cf27c531c20ae3";
7194
7191
  } else {
7195
7192
  return "0xabb6a81c8a216828e317719e06125de5bb2cb0fe8f9916ff8c023ca5be224c78";
7196
7193
  }
7197
7194
  }
7198
7195
  publishedAtV2Extend2() {
7199
7196
  if (this.env === 0 /* Mainnet */) {
7200
- return "0x0018f7bbbece22f4272ed2281b290f745e5aa69d870f599810a30b4eeffc1a5e";
7197
+ return "0x1727de5223a86156c0fd4ee290aaabaea7f0ffeff485c367c2eb0dcbdfc0061a";
7201
7198
  } else {
7202
7199
  return "0x0";
7203
7200
  }
@@ -7594,7 +7591,7 @@ function processEndpoint(endpoint) {
7594
7591
 
7595
7592
  // src/api.ts
7596
7593
  var import_bn7 = __toESM(require_bn());
7597
- var SDK_VERSION = 1000800;
7594
+ var SDK_VERSION = 1000900;
7598
7595
  function getRouterResult(endpoint, apiKey, params, overlayFee, overlayFeeReceiver) {
7599
7596
  return __async(this, null, function* () {
7600
7597
  let response;
@@ -7641,7 +7638,6 @@ function getRouterResult(endpoint, apiKey, params, overlayFee, overlayFeeReceive
7641
7638
  };
7642
7639
  }
7643
7640
  if (data.data != null) {
7644
- console.log("data: ", JSON.stringify(data.data, null, 2));
7645
7641
  const res = parseRouterResponse(data.data, params.byAmountIn);
7646
7642
  if (overlayFee > 0 && overlayFeeReceiver !== "0x0") {
7647
7643
  if (params.byAmountIn) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cetusprotocol/aggregator-sdk",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "sideEffects": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",