@rhea-finance/confidential-swap 0.3.2 → 0.3.4

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