@interest-protocol/vortex-sdk 7.3.0 → 7.5.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.
@@ -34,7 +34,7 @@ export declare const VORTEX_SWAP_UPGRADE_CAP = "0xec0beaf1453b0e09d92f8addf25abc
34
34
  export declare const INITIAL_SHARED_VERSION = "692442863";
35
35
  export declare const LSK_FETCH_OFFSET = "fetch_offset";
36
36
  export declare const LSK_ENCRYPTED_OUTPUTS = "encrypted_outputs";
37
- export declare const VORTEX_SIGNATURE_DOMAIN = "VORTEXFI.XYZ";
37
+ export declare const VORTEX_SIGNATURE_DOMAIN: string;
38
38
  export declare const TREASURY_ADDRESS = "0x894261575b948c035d002adc3ca4d73c683c01a1bfafac183870940bf9afef1a";
39
39
  export declare const DEPOSIT_FEE_IN_BASIS_POINTS = 50n;
40
40
  export declare const BASIS_POINTS = 10000n;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,iFACgD,CAAC;AAGjF,eAAO,MAAM,UAAU,iFACyD,CAAC;AAEjF,eAAO,MAAM,gBAAgB,iFAAa,CAAC;AAE3C,eAAO,MAAM,oBAAoB,UAiChC,CAAC;AAEF,oBAAY,OAAO;IACjB,OAAO,oBAAoB;IAC3B,KAAK,iBAAiB;IACtB,MAAM,WAAW;CAClB;AAED,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;CAgBvB,CAAC;AAEF,eAAO,MAAM,iBAAiB,uEACwC,CAAC;AAEvE,eAAO,MAAM,kBAAkB,uEACuC,CAAC;AAEvE,eAAO,MAAM,kBAAkB,uEACuC,CAAC;AAEvE,eAAO,MAAM,sBAAsB,uEACmC,CAAC;AAEvE,eAAO,MAAM,uBAAuB,uEACkC,CAAC;A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AM,YAAY,SAAU,CAAC;AAEpC,eAAO,MAAM,eAAe;;CAG3B,CAAC"}
package/dist/index.js CHANGED
@@ -3380,7 +3380,7 @@ const VORTEX_SWAP_UPGRADE_CAP = '0xec0beaf1453b0e09d92f8addf25abcfb4bc6ce43ead82
3380
3380
  const INITIAL_SHARED_VERSION = '692442863';
3381
3381
  const LSK_FETCH_OFFSET = 'fetch_offset';
3382
3382
  const LSK_ENCRYPTED_OUTPUTS = 'encrypted_outputs';
3383
- const VORTEX_SIGNATURE_DOMAIN = 'VORTEXFI.XYZ';
3383
+ const VORTEX_SIGNATURE_DOMAIN = 'https://kage.money/'.toUpperCase();
3384
3384
  const TREASURY_ADDRESS = '0x894261575b948c035d002adc3ca4d73c683c01a1bfafac183870940bf9afef1a';
3385
3385
  // 0.5% deposit fee
3386
3386
  const DEPOSIT_FEE_IN_BASIS_POINTS = 50n;
@@ -39243,7 +39243,8 @@ const getUnspentUtxosWithApi = async ({ commitments, vortexKeypair, vortexSdk, v
39243
39243
  invariant(normalizeStructTag(commitment.coinType) ===
39244
39244
  normalizeStructTag(vortexObject.coinType), 'Commitment coin type does not match vortex pool coin type');
39245
39245
  try {
39246
- const utxo = vortexKeypair.decryptUtxo(commitment.encryptedOutput);
39246
+ const encryptedOutputHex = toHex(Uint8Array.from(commitment.encryptedOutput));
39247
+ const utxo = vortexKeypair.decryptUtxo(encryptedOutputHex);
39247
39248
  allUtxos.push(utxo);
39248
39249
  }
39249
39250
  catch {
@@ -39853,13 +39854,13 @@ class VortexAPI {
39853
39854
  }
39854
39855
  async getPools(args = {}) {
39855
39856
  const params = new URLSearchParams();
39856
- if (args.page !== undefined) {
39857
+ if (args.page) {
39857
39858
  params.set('page', args.page.toString());
39858
39859
  }
39859
- if (args.limit !== undefined) {
39860
+ if (args.limit) {
39860
39861
  params.set('limit', args.limit.toString());
39861
39862
  }
39862
- if (args.coinType !== undefined) {
39863
+ if (args.coinType) {
39863
39864
  params.set('coin_type', args.coinType);
39864
39865
  }
39865
39866
  const query = params.toString();
@@ -39873,19 +39874,31 @@ class VortexAPI {
39873
39874
  coin_type: args.coinType,
39874
39875
  index: args.index.toString(),
39875
39876
  });
39876
- if (args.op !== undefined) {
39877
+ if (args.op) {
39877
39878
  params.set('op', args.op);
39878
39879
  }
39879
- if (args.page !== undefined) {
39880
+ if (args.page) {
39880
39881
  params.set('page', args.page.toString());
39881
39882
  }
39882
- if (args.limit !== undefined) {
39883
+ if (args.limit) {
39883
39884
  params.set('limit', args.limit.toString());
39884
39885
  }
39885
39886
  const response = await __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_get).call(this, `/api/v1/commitments?${params.toString()}`);
39886
39887
  __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_assertSuccess).call(this, response);
39887
39888
  return response;
39888
39889
  }
39890
+ async getAllCommitments(args) {
39891
+ const allCommitments = [];
39892
+ let page = 1;
39893
+ let hasNext = true;
39894
+ while (hasNext) {
39895
+ const response = await this.getCommitments({ ...args, page });
39896
+ allCommitments.push(...response.data.items);
39897
+ hasNext = response.data.pagination.hasNext;
39898
+ page++;
39899
+ }
39900
+ return allCommitments;
39901
+ }
39889
39902
  async getMerklePath(args) {
39890
39903
  const response = await __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_post).call(this, '/api/v1/merkle/path', {
39891
39904
  coin_type: args.coinType,