@rhea-finance/confidential-swap 0.3.4 → 0.3.5

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.cjs CHANGED
@@ -646,7 +646,7 @@ var HttpConfidentialApi = class {
646
646
  proxy;
647
647
  indexer;
648
648
  appFees;
649
- async request(url, method = "GET", body, token, signal) {
649
+ async request(url, method = "GET", body, token, signal, accessHeader = "authentication") {
650
650
  throwIfAborted(signal);
651
651
  const timeout = AbortSignal.timeout(this.config.requestTimeoutMs ?? 3e4);
652
652
  const combined = signal ? AbortSignal.any([signal, timeout]) : timeout;
@@ -657,8 +657,7 @@ var HttpConfidentialApi = class {
657
657
  headers: {
658
658
  Accept: "application/json",
659
659
  ...body !== void 0 ? { "Content-Type": "application/json" } : {},
660
- // ...(token ? { authorization: `Bearer ${token}` } : {}),
661
- ...token ? { authentication: `Bearer ${token}` } : {}
660
+ ...token ? { [accessHeader]: `Bearer ${token}` } : {}
662
661
  },
663
662
  ...body !== void 0 ? { body: JSON.stringify(body) } : {}
664
663
  });
@@ -741,7 +740,14 @@ var HttpConfidentialApi = class {
741
740
  });
742
741
  }
743
742
  async getBalances(token, signal) {
744
- const data = record(await this.request(`${this.direct}/account/balances`, "GET", void 0, text(token, "Access token"), signal));
743
+ const data = record(await this.request(
744
+ `${this.direct}/account/balances`,
745
+ "GET",
746
+ void 0,
747
+ text(token, "Access token"),
748
+ signal,
749
+ "authorization"
750
+ ));
745
751
  responseAssert(Array.isArray(data.balances), "Invalid balances.");
746
752
  return data.balances.map((b) => {
747
753
  const r = record(b);