@rhea-finance/confidential-swap 0.3.3 → 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,7 +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}` } : {}
660
+ ...token ? { [accessHeader]: `Bearer ${token}` } : {}
661
661
  },
662
662
  ...body !== void 0 ? { body: JSON.stringify(body) } : {}
663
663
  });
@@ -740,7 +740,14 @@ var HttpConfidentialApi = class {
740
740
  });
741
741
  }
742
742
  async getBalances(token, signal) {
743
- 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
+ ));
744
751
  responseAssert(Array.isArray(data.balances), "Invalid balances.");
745
752
  return data.balances.map((b) => {
746
753
  const r = record(b);