@interest-protocol/vortex-sdk 11.1.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.js CHANGED
@@ -39593,7 +39593,7 @@ class VortexAPI {
39593
39593
  if (args.excludeHidden !== undefined) {
39594
39594
  params.set('exclude_hidden', args.excludeHidden.toString());
39595
39595
  }
39596
- const response = await __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_get).call(this, `/api/v1/accounts?${params.toString()}`);
39596
+ const response = await __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_get).call(this, `/api/v1/accounts?${params.toString()}`, args.apiKey);
39597
39597
  __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_assertSuccess).call(this, response);
39598
39598
  return response;
39599
39599
  }
@@ -39601,7 +39601,7 @@ class VortexAPI {
39601
39601
  const response = await __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_post).call(this, '/api/v1/accounts', {
39602
39602
  owner: args.owner,
39603
39603
  hashedSecret: args.hashedSecret,
39604
- });
39604
+ }, args.apiKey);
39605
39605
  __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_assertSuccess).call(this, response);
39606
39606
  return response;
39607
39607
  }
@@ -39630,7 +39630,7 @@ class VortexAPI {
39630
39630
  }
39631
39631
  const query = params.toString();
39632
39632
  const path = query ? `/api/v1/pools?${query}` : '/api/v1/pools';
39633
- const response = await __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_get).call(this, path);
39633
+ const response = await __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_get).call(this, path, args.apiKey);
39634
39634
  __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_assertSuccess).call(this, response);
39635
39635
  return response;
39636
39636
  }
@@ -39648,7 +39648,7 @@ class VortexAPI {
39648
39648
  if (args.limit) {
39649
39649
  params.set('limit', args.limit.toString());
39650
39650
  }
39651
- const response = await __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_get).call(this, `/api/v1/commitments?${params.toString()}`);
39651
+ const response = await __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_get).call(this, `/api/v1/commitments?${params.toString()}`, args.apiKey);
39652
39652
  __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_assertSuccess).call(this, response);
39653
39653
  return response;
39654
39654
  }
@@ -39657,7 +39657,7 @@ class VortexAPI {
39657
39657
  let page = 1;
39658
39658
  let hasNext = true;
39659
39659
  while (hasNext) {
39660
- const response = await this.getCommitments({ ...args, page });
39660
+ const response = await this.getCommitments({ ...args, page, apiKey: args.apiKey });
39661
39661
  allCommitments.push(...response.data.items);
39662
39662
  hasNext = response.data.pagination.hasNext;
39663
39663
  page++;
@@ -39672,7 +39672,7 @@ class VortexAPI {
39672
39672
  public_key: args.publicKey,
39673
39673
  blinding: args.blinding,
39674
39674
  vortex_pool: args.vortexPool,
39675
- });
39675
+ }, args.apiKey);
39676
39676
  __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_assertSuccess).call(this, response);
39677
39677
  return response;
39678
39678
  }
@@ -39689,21 +39689,28 @@ class VortexAPI {
39689
39689
  return response;
39690
39690
  }
39691
39691
  }
39692
- _VortexAPI_apiUrl = new WeakMap(), _VortexAPI_instances = new WeakSet(), _VortexAPI_get = async function _VortexAPI_get(path) {
39692
+ _VortexAPI_apiUrl = new WeakMap(), _VortexAPI_instances = new WeakSet(), _VortexAPI_get = async function _VortexAPI_get(path, apiKey) {
39693
+ const headers = {
39694
+ 'Content-Type': 'application/json',
39695
+ };
39696
+ if (apiKey) {
39697
+ headers['x-api-key'] = apiKey;
39698
+ }
39693
39699
  const response = await fetch(`${__classPrivateFieldGet(this, _VortexAPI_apiUrl, "f")}${path}`, {
39694
39700
  method: 'GET',
39695
- headers: {
39696
- 'Content-Type': 'application/json',
39697
- },
39701
+ headers,
39698
39702
  });
39699
39703
  return response.json();
39700
39704
  }, _VortexAPI_post = async function _VortexAPI_post(path, body, apiKey) {
39705
+ const headers = {
39706
+ 'Content-Type': 'application/json',
39707
+ };
39708
+ if (apiKey) {
39709
+ headers['x-api-key'] = apiKey;
39710
+ }
39701
39711
  const response = await fetch(`${__classPrivateFieldGet(this, _VortexAPI_apiUrl, "f")}${path}`, {
39702
39712
  method: 'POST',
39703
- headers: {
39704
- 'Content-Type': 'application/json',
39705
- 'x-api-key': apiKey ?? '',
39706
- },
39713
+ headers,
39707
39714
  body: JSON.stringify(body),
39708
39715
  });
39709
39716
  return response.json();