@interest-protocol/vortex-sdk 11.0.0 → 11.2.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.mjs CHANGED
@@ -3378,7 +3378,7 @@ const SECRET_PACKAGE_ID = '0x2d57ed0dd0d5f44d91f865fee3bc33d13ef3ce97c7daf88ad5f
3378
3378
  const INITIAL_SHARED_VERSION = '692442863';
3379
3379
  const LSK_FETCH_OFFSET = 'fetch_offset';
3380
3380
  const LSK_ENCRYPTED_OUTPUTS = 'encrypted_outputs';
3381
- const VORTEX_SIGNATURE_DOMAIN = 'https://vortexfi.xyz/'.toUpperCase();
3381
+ const VORTEX_SIGNATURE_DOMAIN = 'https://vortexfi.xyz/ | https://vtx.cash/ | https://vtx.money/'.toUpperCase();
3382
3382
  const TREASURY_ADDRESS = '0x894261575b948c035d002adc3ca4d73c683c01a1bfafac183870940bf9afef1a';
3383
3383
  // 0.5% deposit fee
3384
3384
  const DEPOSIT_FEE_IN_BASIS_POINTS = 50n;
@@ -39591,7 +39591,7 @@ class VortexAPI {
39591
39591
  if (args.excludeHidden !== undefined) {
39592
39592
  params.set('exclude_hidden', args.excludeHidden.toString());
39593
39593
  }
39594
- const response = await __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_get).call(this, `/api/v1/accounts?${params.toString()}`);
39594
+ const response = await __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_get).call(this, `/api/v1/accounts?${params.toString()}`, args.apiKey);
39595
39595
  __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_assertSuccess).call(this, response);
39596
39596
  return response;
39597
39597
  }
@@ -39599,7 +39599,7 @@ class VortexAPI {
39599
39599
  const response = await __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_post).call(this, '/api/v1/accounts', {
39600
39600
  owner: args.owner,
39601
39601
  hashedSecret: args.hashedSecret,
39602
- });
39602
+ }, args.apiKey);
39603
39603
  __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_assertSuccess).call(this, response);
39604
39604
  return response;
39605
39605
  }
@@ -39628,7 +39628,7 @@ class VortexAPI {
39628
39628
  }
39629
39629
  const query = params.toString();
39630
39630
  const path = query ? `/api/v1/pools?${query}` : '/api/v1/pools';
39631
- const response = await __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_get).call(this, path);
39631
+ const response = await __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_get).call(this, path, args.apiKey);
39632
39632
  __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_assertSuccess).call(this, response);
39633
39633
  return response;
39634
39634
  }
@@ -39646,7 +39646,7 @@ class VortexAPI {
39646
39646
  if (args.limit) {
39647
39647
  params.set('limit', args.limit.toString());
39648
39648
  }
39649
- const response = await __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_get).call(this, `/api/v1/commitments?${params.toString()}`);
39649
+ const response = await __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_get).call(this, `/api/v1/commitments?${params.toString()}`, args.apiKey);
39650
39650
  __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_assertSuccess).call(this, response);
39651
39651
  return response;
39652
39652
  }
@@ -39655,7 +39655,7 @@ class VortexAPI {
39655
39655
  let page = 1;
39656
39656
  let hasNext = true;
39657
39657
  while (hasNext) {
39658
- const response = await this.getCommitments({ ...args, page });
39658
+ const response = await this.getCommitments({ ...args, page, apiKey: args.apiKey });
39659
39659
  allCommitments.push(...response.data.items);
39660
39660
  hasNext = response.data.pagination.hasNext;
39661
39661
  page++;
@@ -39670,7 +39670,7 @@ class VortexAPI {
39670
39670
  public_key: args.publicKey,
39671
39671
  blinding: args.blinding,
39672
39672
  vortex_pool: args.vortexPool,
39673
- });
39673
+ }, args.apiKey);
39674
39674
  __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_assertSuccess).call(this, response);
39675
39675
  return response;
39676
39676
  }
@@ -39687,21 +39687,28 @@ class VortexAPI {
39687
39687
  return response;
39688
39688
  }
39689
39689
  }
39690
- _VortexAPI_apiUrl = new WeakMap(), _VortexAPI_instances = new WeakSet(), _VortexAPI_get = async function _VortexAPI_get(path) {
39690
+ _VortexAPI_apiUrl = new WeakMap(), _VortexAPI_instances = new WeakSet(), _VortexAPI_get = async function _VortexAPI_get(path, apiKey) {
39691
+ const headers = {
39692
+ 'Content-Type': 'application/json',
39693
+ };
39694
+ if (apiKey) {
39695
+ headers['x-api-key'] = apiKey;
39696
+ }
39691
39697
  const response = await fetch(`${__classPrivateFieldGet(this, _VortexAPI_apiUrl, "f")}${path}`, {
39692
39698
  method: 'GET',
39693
- headers: {
39694
- 'Content-Type': 'application/json',
39695
- },
39699
+ headers,
39696
39700
  });
39697
39701
  return response.json();
39698
39702
  }, _VortexAPI_post = async function _VortexAPI_post(path, body, apiKey) {
39703
+ const headers = {
39704
+ 'Content-Type': 'application/json',
39705
+ };
39706
+ if (apiKey) {
39707
+ headers['x-api-key'] = apiKey;
39708
+ }
39699
39709
  const response = await fetch(`${__classPrivateFieldGet(this, _VortexAPI_apiUrl, "f")}${path}`, {
39700
39710
  method: 'POST',
39701
- headers: {
39702
- 'Content-Type': 'application/json',
39703
- 'x-api-key': apiKey ?? '',
39704
- },
39711
+ headers,
39705
39712
  body: JSON.stringify(body),
39706
39713
  });
39707
39714
  return response.json();