@lydianpay/sdk-web 3.18.0 → 3.18.1

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.
@@ -1,4 +1,4 @@
1
- import { g as c } from "./mountEngine-Bm7mzS_d.js";
1
+ import { g as c } from "./mountEngine-C_tda95f.js";
2
2
  function f(t, i) {
3
3
  for (var o = 0; o < i.length; o++) {
4
4
  const e = i[o];
@@ -1,8 +1,8 @@
1
1
  var Va = Object.defineProperty;
2
2
  var Ka = (e, t, r) => t in e ? Va(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var Ee = (e, t, r) => Ka(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { E as Ja } from "./index-BkSKEmfK.js";
5
- import { g as ri, c as gr } from "./mountEngine-Bm7mzS_d.js";
4
+ import { E as Ja } from "./index-CwXeUlav.js";
5
+ import { g as ri, c as gr } from "./mountEngine-C_tda95f.js";
6
6
  var _r = { exports: {} }, on, Hi;
7
7
  function Ya() {
8
8
  if (Hi) return on;
@@ -7879,7 +7879,7 @@ var Cn, Rs, Is, Fs, qe, gt, _t, xr, Bs, Os, Cr, zt, Ps, Ns, Ds, ta, ra = V({
7879
7879
  }
7880
7880
  getActiveSession() {
7881
7881
  return S(this, null, function* () {
7882
- const { kvstore: e } = this, { SessionStore: t } = yield import("./index-BBjqv--5.js").then((n) => n.i), r = yield t.create(e);
7882
+ const { kvstore: e } = this, { SessionStore: t } = yield import("./index-Cxvsb1M_.js").then((n) => n.i), r = yield t.create(e);
7883
7883
  try {
7884
7884
  const [n] = yield r.list();
7885
7885
  return n;
@@ -8058,7 +8058,7 @@ Xr(na, {
8058
8058
  });
8059
8059
  function Qd() {
8060
8060
  return S(this, null, function* () {
8061
- const { decrypt: e, encrypt: t, PrivateKey: r, PublicKey: n } = yield import("./index-CfbOkWrq.js").then((i) => i.i);
8061
+ const { decrypt: e, encrypt: t, PrivateKey: r, PublicKey: n } = yield import("./index-aLCprMse.js").then((i) => i.i);
8062
8062
  return {
8063
8063
  generateKeyPair() {
8064
8064
  const i = new r();
@@ -9329,12 +9329,12 @@ Ta = function() {
9329
9329
  Ui = function() {
9330
9330
  return S(this, null, function* () {
9331
9331
  const [e, { DappClient: t }, { createKeyManager: r }] = yield Promise.all([
9332
- import("./index-BBjqv--5.js").then((h) => h.i),
9333
- import("./index-Df3XemZg.js"),
9332
+ import("./index-Cxvsb1M_.js").then((h) => h.i),
9333
+ import("./dist-DXXffMpA.js"),
9334
9334
  Promise.resolve().then(() => (eh(), na))
9335
9335
  ]), n = yield r(), { adapter: i } = this.options.storage, o = yield e.SessionStore.create(i), l = (
9336
9336
  // eslint-disable-next-line no-negated-condition
9337
- typeof window < "u" ? WebSocket : (yield import("./browser-CpRXBrlm.js").then((h) => h.b)).WebSocket
9337
+ typeof window < "u" ? WebSocket : (yield import("./browser-BUlIfLHb.js").then((h) => h.b)).WebSocket
9338
9338
  ), c = yield e.WebSocketTransport.create({
9339
9339
  url: uh,
9340
9340
  kvstore: i,
@@ -9399,7 +9399,7 @@ Ba = function(e, t, r, n) {
9399
9399
  /* MWP */
9400
9400
  );
9401
9401
  })).catch((c) => S(this, null, function* () {
9402
- const { ProtocolError: d, ErrorCode: h } = yield import("./index-BBjqv--5.js").then((y) => y.i);
9402
+ const { ProtocolError: d, ErrorCode: h } = yield import("./index-Cxvsb1M_.js").then((y) => y.i);
9403
9403
  if (c instanceof d)
9404
9404
  c.code !== h.REQUEST_EXPIRED && (this.status = "disconnected", yield this.options.ui.factory.unload(c), i.reject(c));
9405
9405
  else {
@@ -9456,7 +9456,7 @@ Pa = function(e, t, r) {
9456
9456
  /* MWP */
9457
9457
  );
9458
9458
  } catch (i) {
9459
- const { ProtocolError: o } = yield import("./index-BBjqv--5.js").then((l) => l.i);
9459
+ const { ProtocolError: o } = yield import("./index-Cxvsb1M_.js").then((l) => l.i);
9460
9460
  throw this.status = "disconnected", yield this.storage.removeTransportType(), i instanceof o || i instanceof Error ? i : new Error(String(i));
9461
9461
  } finally {
9462
9462
  this.dappClient.off("session_request", n);
@@ -1,9 +1,9 @@
1
1
  var f = Object.defineProperty;
2
2
  var S = (e, t, n) => t in e ? f(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var h = (e, t, n) => S(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { d as s } from "./index-BBjqv--5.js";
5
- import { v as w } from "./connect-multichain-CJf52rh9.js";
6
- import { a as l } from "./mountEngine-Bm7mzS_d.js";
4
+ import { d as s } from "./index-Cxvsb1M_.js";
5
+ import { v as w } from "./connect-multichain-DVWN1OPV.js";
6
+ import { a as l } from "./mountEngine-C_tda95f.js";
7
7
  function m(e) {
8
8
  var t, n;
9
9
  return typeof ((n = (t = e == null ? void 0 : e.prototype) == null ? void 0 : t.constructor) == null ? void 0 : n.name) == "string";
@@ -1,6 +1,6 @@
1
- import { i as Te, I as Xe, h as et, g as yn, b as vn, s as kn } from "./mountEngine-Bm7mzS_d.js";
1
+ import { i as Te, I as Xe, h as et, g as yn, b as vn, s as kn } from "./mountEngine-C_tda95f.js";
2
2
  import { r as En, a as In } from "./utils-Ca8X9WUu.js";
3
- import { E as Cn } from "./index-BkSKEmfK.js";
3
+ import { E as Cn } from "./index-CwXeUlav.js";
4
4
  function Sn(t, e) {
5
5
  if (!Te(t, { strict: !1 }))
6
6
  throw new Xe({ address: t });
@@ -3207,6 +3207,5 @@ class ri {
3207
3207
  }
3208
3208
  }
3209
3209
  export {
3210
- ri as CoinbaseWalletSDK,
3211
- ri as default
3210
+ ri as CoinbaseWalletSDK
3212
3211
  };
@@ -41,7 +41,7 @@ class u {
41
41
  return this.publishableKey && (a["X-Publishable-Key"] = this.publishableKey), a;
42
42
  }
43
43
  async request(t, a) {
44
- const n = `${this.baseUri}${t}`, o = this.headers({ "Content-Type": "application/json", ...a == null ? void 0 : a.headers }), r = Object.assign({}, a, { headers: o }), s = await fetch(n, r);
44
+ const n = `${this.baseUri}${t}`, r = this.headers({ "Content-Type": "application/json", ...a == null ? void 0 : a.headers }), o = Object.assign({}, a, { headers: r }), s = await fetch(n, o);
45
45
  if (s.ok)
46
46
  return await s.json();
47
47
  throw await p(s);
@@ -50,13 +50,13 @@ class u {
50
50
  // /customer/otp -> "OTP sent"). Sends the same JSON request headers but does
51
51
  // not call response.json(), which would throw on a non-JSON body.
52
52
  async requestText(t, a) {
53
- const n = `${this.baseUri}${t}`, o = this.headers({ "Content-Type": "application/json" }), r = Object.assign({}, a, { headers: o }), s = await fetch(n, r);
53
+ const n = `${this.baseUri}${t}`, r = this.headers({ "Content-Type": "application/json" }), o = Object.assign({}, a, { headers: r }), s = await fetch(n, o);
54
54
  if (s.ok)
55
55
  return await s.text();
56
56
  throw await p(s);
57
57
  }
58
58
  async requestWithFormData(t, a) {
59
- const n = `${this.baseUri}${t}`, o = this.headers(), r = Object.assign({}, a, { headers: o }), s = await fetch(n, r);
59
+ const n = `${this.baseUri}${t}`, r = this.headers(), o = Object.assign({}, a, { headers: r }), s = await fetch(n, o);
60
60
  if (s.ok)
61
61
  return await s.json();
62
62
  throw await p(s);
@@ -80,7 +80,7 @@ const c = "transaction", B = [
80
80
  "nationalIDNumber",
81
81
  "customerIDNumber"
82
82
  ];
83
- class Y extends u {
83
+ class x extends u {
84
84
  async getCryptoTransaction(t) {
85
85
  return await this.request(`/${c}/${t}`);
86
86
  }
@@ -122,11 +122,11 @@ class Y extends u {
122
122
  }
123
123
  async kycVerification(t, a) {
124
124
  const n = new FormData();
125
- return n.append("asset", a.asset), n.append("network", a.network), B.forEach((o) => {
126
- const r = a[o];
127
- r && n.append(o, r);
125
+ return n.append("asset", a.asset), n.append("network", a.network), B.forEach((r) => {
126
+ const o = a[r];
127
+ o && n.append(r, o);
128
128
  }), n.append("storeKYC", a.storeKYC ? "true" : "false"), a.customerUUID && n.append("customerUUID", a.customerUUID), a.walletAddress && n.append("walletAddress", a.walletAddress), a.documentType && n.append("documentType", a.documentType), a.documentFiles.forEach(
129
- (o, r) => n.append("documentFiles", o, `${r + 1}-${o.name}`)
129
+ (r, o) => n.append("documentFiles", r, `${o + 1}-${r.name}`)
130
130
  ), await this.requestWithFormData(
131
131
  `/${c}/${t}/verification`,
132
132
  {
@@ -136,11 +136,11 @@ class Y extends u {
136
136
  );
137
137
  }
138
138
  }
139
- function x(e, t) {
139
+ function Y(e, t) {
140
140
  t.forEach((a) => {
141
141
  Object.getOwnPropertyNames(a.prototype).forEach((n) => {
142
- const o = Object.getOwnPropertyDescriptor(a.prototype, n);
143
- o && Object.defineProperty(e.prototype, n, o);
142
+ const r = Object.getOwnPropertyDescriptor(a.prototype, n);
143
+ r && Object.defineProperty(e.prototype, n, r);
144
144
  });
145
145
  });
146
146
  }
@@ -217,7 +217,7 @@ class _ extends u {
217
217
  }
218
218
  class D extends u {
219
219
  }
220
- x(D, [Y, M, G, _]);
220
+ Y(D, [x, M, G, _]);
221
221
  const q = D;
222
222
  var y = {
223
223
  COMPLIANCE_PENDING: -10,
@@ -255,7 +255,7 @@ function A({
255
255
  unsupportedKeys: t,
256
256
  entryPoint: a
257
257
  }) {
258
- const n = t.filter((o) => e[o] !== void 0);
258
+ const n = t.filter((r) => e[r] !== void 0);
259
259
  return n.length === 0 ? null : `${n.join(" and ")} ${n.length > 1 ? "are" : "is"} not used by ${a}. Passing it has no effect, so this is almost always a mistake.`;
260
260
  }
261
261
  function N(e) {
@@ -311,13 +311,13 @@ async function z({
311
311
  emit: a
312
312
  }) {
313
313
  try {
314
- const n = await Q({ api: e, options: t }), { session: o, sessionPromoted: r } = await X({ api: e, sessionID: n });
315
- a("session.loaded", Z(o));
314
+ const n = await Q({ api: e, options: t }), { session: r, sessionPromoted: o } = await X({ api: e, sessionID: n });
315
+ a("session.loaded", Z(r));
316
316
  const s = await V({
317
317
  api: e,
318
- transactionID: o.transactionID
318
+ transactionID: r.transactionID
319
319
  });
320
- return { ok: !0, session: o, sessionPromoted: r, linkedTransaction: s };
320
+ return { ok: !0, session: r, sessionPromoted: o, linkedTransaction: s };
321
321
  } catch (n) {
322
322
  return { ok: !1, ...await J(n) };
323
323
  }
@@ -384,7 +384,7 @@ function S({
384
384
  reason: t,
385
385
  shouldEndCheckout: a,
386
386
  transactionID: n,
387
- session: o
387
+ session: r
388
388
  }) {
389
389
  return {
390
390
  event: { reason: t, shouldEndCheckout: a, message: e },
@@ -395,7 +395,7 @@ function S({
395
395
  // Only a failure that ends the checkout carries a redirect. A retryable one
396
396
  // leaves the customer mid-flow with something still to do, and a host that
397
397
  // navigated on it would eject them on a hiccup.
398
- redirectURL: a ? h(o == null ? void 0 : o.failureURL) : void 0
398
+ redirectURL: a ? h(r == null ? void 0 : r.failureURL) : void 0
399
399
  }
400
400
  };
401
401
  }
@@ -462,18 +462,18 @@ const ee = {
462
462
  "network.noNetworksAvailable": "No networks are available for this payment. Contact the merchant if you think this is wrong.",
463
463
  "network.recommended": "RECOMMENDED",
464
464
  "network.fee": "Network fee: {fee}",
465
- "kyc.yourDetails": "Your details",
466
- "kyc.yourDetailsDescription": "This information is required to comply with applicable regulations.",
465
+ "kyc.yourDetails": "Additional info required",
467
466
  "kyc.basicDetails": "Basic details",
468
467
  "kyc.groupTitleOne": "Provide one of the following",
469
468
  "kyc.groupTitle": "Provide {count} of the following",
470
469
  "kyc.groupGuidanceAcrossForm": "Complete {required} of the {total} identity details to continue ({completed} done).",
471
470
  "kyc.groupComplete": "You've completed this section.",
472
471
  "kyc.complianceWaiting": "Your details are being verified. This can take a few moments.",
473
- "kyc.firstNamesLabel": "Legal first name",
474
- "kyc.firstNamesPlaceholder": "Enter legal first name",
475
- "kyc.lastNameLabel": "Legal last name",
476
- "kyc.lastNamePlaceholder": "Enter legal last name",
472
+ "kyc.firstNamesLabel": "First name",
473
+ "kyc.firstNamesPlaceholder": "Enter first name",
474
+ "kyc.lastNameLabel": "Last name",
475
+ "kyc.lastNamePlaceholder": "Enter last name",
476
+ "kyc.emailPlaceholder": "Enter email address",
477
477
  "kyc.addressSearchLabel": "Find your address",
478
478
  "kyc.addressSearchPlaceholder": "Start typing your address",
479
479
  "kyc.addressSearchManual": "Enter address manually",
@@ -663,7 +663,7 @@ function w(e, t) {
663
663
  const a = ((n = E[O]) == null ? void 0 : n[e]) ?? E[U][e] ?? e;
664
664
  return t ? a.replace(
665
665
  /\{(\w+)\}/g,
666
- (o, r) => t[r] != null ? String(t[r]) : `{${r}}`
666
+ (r, o) => t[o] != null ? String(t[o]) : `{${o}}`
667
667
  ) : a;
668
668
  }
669
669
  function te(e) {
@@ -673,7 +673,7 @@ function ae({
673
673
  transaction: e,
674
674
  session: t
675
675
  }) {
676
- var o, r, s;
676
+ var r, o, s;
677
677
  const a = te(e.status);
678
678
  if (a === "active")
679
679
  return null;
@@ -689,7 +689,7 @@ function ae({
689
689
  redirectURL: h(t == null ? void 0 : t.failureURL)
690
690
  }
691
691
  };
692
- const n = (o = e.payments) == null ? void 0 : o.find(
692
+ const n = (r = e.payments) == null ? void 0 : r.find(
693
693
  (i) => i.status === K.CONFIRMED
694
694
  );
695
695
  return {
@@ -701,7 +701,7 @@ function ae({
701
701
  },
702
702
  result: {
703
703
  transactionID: e.transactionID,
704
- amount: (r = e.amounts) == null ? void 0 : r.totalLocal,
704
+ amount: (o = e.amounts) == null ? void 0 : o.totalLocal,
705
705
  currency: (s = e.amounts) == null ? void 0 : s.currency,
706
706
  asset: n == null ? void 0 : n.cryptoAsset,
707
707
  network: n == null ? void 0 : n.cryptoNetwork,
@@ -731,7 +731,7 @@ function ne() {
731
731
  }
732
732
  };
733
733
  }
734
- class oe extends HTMLElement {
734
+ class re extends HTMLElement {
735
735
  constructor() {
736
736
  super(), this.engine = null, this.engineLoadPromise = null, this.isTornDown = !1, this.shadow = this.attachShadow({ mode: "open" });
737
737
  }
@@ -741,8 +741,8 @@ class oe extends HTMLElement {
741
741
  this.isTornDown = !1;
742
742
  }
743
743
  async initialize(t) {
744
- const a = re(t), n = se({ api: a, options: t }), o = await this.loadEngine(t, n);
745
- !o || this.isTornDown || (this.engine = o, await o.initialize(t, { api: a, sessionLoad: n }));
744
+ const a = oe(t), n = se({ api: a, options: t }), r = await this.loadEngine(t, n);
745
+ !r || this.isTornDown || (this.engine = r, await r.initialize(t, { api: a, sessionLoad: n }));
746
746
  }
747
747
  async loadEngine(t, a) {
748
748
  const n = this.getOrLoadEngine();
@@ -769,7 +769,7 @@ class oe extends HTMLElement {
769
769
  // Not started in the constructor: a page can carry the tag and never check out.
770
770
  // Overlapping initialize() calls share one download.
771
771
  getOrLoadEngine() {
772
- return this.engineLoadPromise ?? (this.engineLoadPromise = import("./mountEngine-Bm7mzS_d.js").then((t) => t.m).then((t) => {
772
+ return this.engineLoadPromise ?? (this.engineLoadPromise = import("./mountEngine-C_tda95f.js").then((t) => t.m).then((t) => {
773
773
  const a = t.mountCheckoutEngine({
774
774
  host: this,
775
775
  shadowRoot: this.shadow
@@ -802,26 +802,26 @@ class oe extends HTMLElement {
802
802
  const n = await a;
803
803
  if (this.isDismissedByHost)
804
804
  return;
805
- const o = ne();
806
- o.setOptions(t);
807
- const r = n.ok && n.linkedTransaction ? ae({
805
+ const r = ne();
806
+ r.setOptions(t);
807
+ const o = n.ok && n.linkedTransaction ? ae({
808
808
  transaction: n.linkedTransaction,
809
809
  session: n.session
810
810
  }) : null;
811
- if ((r == null ? void 0 : r.outcome) === "succeeded") {
812
- o.emit("payment.succeeded", r.event), o.paymentSucceeded(r.result);
811
+ if ((o == null ? void 0 : o.outcome) === "succeeded") {
812
+ r.emit("payment.succeeded", o.event), r.paymentSucceeded(o.result);
813
813
  return;
814
814
  }
815
- if (r) {
816
- o.emit("payment.failed", {
817
- reason: r.failure.reason,
815
+ if (o) {
816
+ r.emit("payment.failed", {
817
+ reason: o.failure.reason,
818
818
  shouldEndCheckout: !0,
819
- message: r.message
820
- }), o.paymentFailed(r.message, r.failure);
819
+ message: o.message
820
+ }), r.paymentFailed(o.message, o.failure);
821
821
  return;
822
822
  }
823
823
  if (!n.ok && n.cancelURL) {
824
- o.emit("payment.canceled"), o.paymentCanceled({ redirectURL: n.cancelURL });
824
+ r.emit("payment.canceled"), r.paymentCanceled({ redirectURL: n.cancelURL });
825
825
  return;
826
826
  }
827
827
  if (!n.ok && n.failureURL) {
@@ -831,7 +831,7 @@ class oe extends HTMLElement {
831
831
  shouldEndCheckout: !0,
832
832
  session: { failureURL: n.failureURL }
833
833
  });
834
- o.emit("payment.failed", b.event), o.paymentFailed(g, b.failure);
834
+ r.emit("payment.failed", b.event), r.paymentFailed(g, b.failure);
835
835
  return;
836
836
  }
837
837
  const s = w("errors.checkoutUnavailable"), i = S({
@@ -840,7 +840,7 @@ class oe extends HTMLElement {
840
840
  shouldEndCheckout: !0,
841
841
  session: n.ok ? n.session : null
842
842
  });
843
- o.emit("payment.failed", i.event), o.paymentFailed(s, i.failure);
843
+ r.emit("payment.failed", i.event), r.paymentFailed(s, i.failure);
844
844
  }
845
845
  // Always teardown and unmount together to avoid leaking the React engine.
846
846
  // Clear the cached load so a later initialize() creates a fresh engine.
@@ -848,7 +848,7 @@ class oe extends HTMLElement {
848
848
  t == null || t.teardown(), t == null || t.unmount(), this.engine = null, this.engineLoadPromise = null;
849
849
  }
850
850
  }
851
- function re(e) {
851
+ function oe(e) {
852
852
  return new q(
853
853
  j(e),
854
854
  d(e) ? void 0 : e.publishableKey
@@ -864,7 +864,7 @@ function se({
864
864
  emit: (a, n) => L(t.onEvent, a, n)
865
865
  });
866
866
  }
867
- customElements.get("lydian-checkout") || customElements.define("lydian-checkout", oe);
867
+ customElements.get("lydian-checkout") || customElements.define("lydian-checkout", re);
868
868
  function f() {
869
869
  return document.querySelector("lydian-checkout");
870
870
  }
@@ -1,4 +1,4 @@
1
- import { g as L } from "./mountEngine-Bm7mzS_d.js";
1
+ import { g as L } from "./mountEngine-C_tda95f.js";
2
2
  var x = { exports: {} }, E;
3
3
  function C() {
4
4
  return E || (E = 1, (function(g) {
@@ -1,5 +1,5 @@
1
- import { d as Si, g as wi } from "./mountEngine-Bm7mzS_d.js";
2
- import { r as Ti } from "./index-BkSKEmfK.js";
1
+ import { d as Si, g as wi } from "./mountEngine-C_tda95f.js";
2
+ import { r as Ti } from "./index-CwXeUlav.js";
3
3
  function Pi(r, u) {
4
4
  for (var f = 0; f < u.length; f++) {
5
5
  const h = u[f];
@@ -1,4 +1,4 @@
1
- import { g as cn } from "./mountEngine-Bm7mzS_d.js";
1
+ import { g as cn } from "./mountEngine-C_tda95f.js";
2
2
  import { a as Ot, r as an } from "./utils-Ca8X9WUu.js";
3
3
  function fn(t, f) {
4
4
  for (var y = 0; y < f.length; y++) {