@rhea-finance/confidential-swap 0.3.2 → 0.3.3

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, auth = "bearer") {
649
+ async request(url, method = "GET", body, token, signal) {
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 && auth === "bearer" ? { Authorization: `Bearer ${token}` } : {},
661
- ...token && auth === "authentication" ? { Authentication: token } : {}
660
+ ...token ? { authorization: `Bearer ${token}` } : {}
662
661
  },
663
662
  ...body !== void 0 ? { body: JSON.stringify(body) } : {}
664
663
  });
@@ -787,8 +786,8 @@ var HttpConfidentialApi = class {
787
786
  const data = record(await this.request(`${this.proxy}/submit-intent`, "POST", { type: "swap_transfer", signedData }, void 0, signal));
788
787
  return text(data.intentHash, "Intent hash");
789
788
  }
790
- async privateRequest(path, method, body, token, signal, auth = "bearer") {
791
- const data = await this.request(`${this.indexer}/v3/private/${path}`, method, body, token, signal, auth);
789
+ async privateRequest(path, method, body, token, signal) {
790
+ const data = await this.request(`${this.indexer}/v3/private/${path}`, method, body, token, signal);
792
791
  if (data && typeof data === "object" && "code" in data) {
793
792
  const envelope = record(data);
794
793
  responseAssert(envelope.code === 0, "Indexer returned an unsuccessful envelope.");
@@ -802,8 +801,7 @@ var HttpConfidentialApi = class {
802
801
  "POST",
803
802
  request,
804
803
  this.config.withdrawAuthorization === "bearer" ? token : void 0,
805
- signal,
806
- "authentication"
804
+ signal
807
805
  ));
808
806
  return text(data.order_id, "Private order id");
809
807
  }