@lydianpay/sdk-web 3.5.0 → 3.6.0
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/chunks/{index-Jy1rNN_e.js → index-9i2S104v.js} +21 -18
- package/dist/chunks/{index-p0lBvolb.js → index-bKFtUHLc.js} +1 -1
- package/dist/chunks/{metamask-sdk-DWaj3Api.js → metamask-sdk-CK1SAg_K.js} +1 -1
- package/dist/chunks/{mountEngine-DI19rA1h.js → mountEngine-CVnwr305.js} +9582 -9379
- package/dist/lydian.js +1 -1
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/services/lydianConnectService.d.ts +3 -3
- package/dist/types/ui/networkListHelpers.d.ts +16 -0
- package/dist/types/ui/react/checkoutActions.d.ts +5 -0
- package/dist/types/ui/react/checkoutStore.d.ts +6 -0
- package/dist/types/ui/walletConnection.d.ts +3 -0
- package/dist/types/ui/walletRejection.d.ts +1 -0
- package/package.json +2 -2
|
@@ -190,20 +190,20 @@ function ee({
|
|
|
190
190
|
}) {
|
|
191
191
|
return !a && e !== null && t !== null && c(t);
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function C(t, e, a) {
|
|
194
194
|
try {
|
|
195
195
|
t == null || t(e, a);
|
|
196
196
|
} catch (n) {
|
|
197
197
|
console.error(`onEvent("${e}") threw:`, n);
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
|
-
async function
|
|
200
|
+
async function F({
|
|
201
201
|
api: t,
|
|
202
202
|
options: e,
|
|
203
203
|
emit: a
|
|
204
204
|
}) {
|
|
205
205
|
try {
|
|
206
|
-
const n = await
|
|
206
|
+
const n = await W({ api: t, options: e }), { session: o, sessionPromoted: r } = await x({ api: t, sessionID: n });
|
|
207
207
|
a("session.loaded", $(o));
|
|
208
208
|
const s = await M({
|
|
209
209
|
api: t,
|
|
@@ -214,7 +214,7 @@ async function W({
|
|
|
214
214
|
return { ok: !1 };
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
async function
|
|
217
|
+
async function W({
|
|
218
218
|
api: t,
|
|
219
219
|
options: e
|
|
220
220
|
}) {
|
|
@@ -230,16 +230,16 @@ async function x({
|
|
|
230
230
|
sessionID: e
|
|
231
231
|
}) {
|
|
232
232
|
const a = await t.getSession(e);
|
|
233
|
-
return { session: a, sessionPromoted:
|
|
233
|
+
return { session: a, sessionPromoted: k(a) };
|
|
234
234
|
}
|
|
235
235
|
function $(t) {
|
|
236
236
|
return {
|
|
237
237
|
sessionID: t.sessionID,
|
|
238
238
|
merchantName: t.merchantName,
|
|
239
|
-
alreadyPromoted:
|
|
239
|
+
alreadyPromoted: k(t)
|
|
240
240
|
};
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function k(t) {
|
|
243
243
|
return !!t.transactionID;
|
|
244
244
|
}
|
|
245
245
|
async function M({
|
|
@@ -315,6 +315,9 @@ const B = {
|
|
|
315
315
|
"wallet.manualQrName": "Manual QR Code",
|
|
316
316
|
"wallet.otherWallets": "Other wallets",
|
|
317
317
|
"wallet.connectingTo": "Connecting to {wallet}",
|
|
318
|
+
"wallet.discoveryFailedTitle": "Couldn't connect to {wallet}",
|
|
319
|
+
"wallet.discoveryFailedHint": "The connection didn't go through. Try again, or choose another way to pay.",
|
|
320
|
+
"wallet.tryAgain": "Try again",
|
|
318
321
|
"wallet.approveInApp": "Open {wallet} to connect your wallet, then navigate back to this page.",
|
|
319
322
|
"wallet.openFailedHint": "Didn't see {wallet} open? Tap the button above to try again, or make sure it's installed.",
|
|
320
323
|
"wallet.openApp": "Open {wallet}",
|
|
@@ -550,7 +553,7 @@ function K() {
|
|
|
550
553
|
setOptions: (e) => {
|
|
551
554
|
t = e;
|
|
552
555
|
},
|
|
553
|
-
emit: (e, a) =>
|
|
556
|
+
emit: (e, a) => C(t == null ? void 0 : t.onEvent, e, a),
|
|
554
557
|
paymentFailed: (e, a) => {
|
|
555
558
|
var n;
|
|
556
559
|
return (n = t == null ? void 0 : t.paymentFailedListener) == null ? void 0 : n.call(t, e, a);
|
|
@@ -565,7 +568,7 @@ function K() {
|
|
|
565
568
|
}
|
|
566
569
|
};
|
|
567
570
|
}
|
|
568
|
-
class
|
|
571
|
+
class H extends HTMLElement {
|
|
569
572
|
constructor() {
|
|
570
573
|
super(), this.engine = null, this.engineLoadPromise = null, this.isTornDown = !1, this.shadow = this.attachShadow({ mode: "open" });
|
|
571
574
|
}
|
|
@@ -575,7 +578,7 @@ class j extends HTMLElement {
|
|
|
575
578
|
this.isTornDown = !1;
|
|
576
579
|
}
|
|
577
580
|
async initialize(e) {
|
|
578
|
-
const a =
|
|
581
|
+
const a = j(e), n = G({ api: a, options: e }), o = await this.loadEngine(e, n);
|
|
579
582
|
!o || this.isTornDown || (this.engine = o, await o.initialize(e, { api: a, sessionLoad: n }));
|
|
580
583
|
}
|
|
581
584
|
async loadEngine(e, a) {
|
|
@@ -603,7 +606,7 @@ class j extends HTMLElement {
|
|
|
603
606
|
// Not started in the constructor: a page can carry the tag and never check out.
|
|
604
607
|
// Overlapping initialize() calls share one download.
|
|
605
608
|
getOrLoadEngine() {
|
|
606
|
-
return this.engineLoadPromise ?? (this.engineLoadPromise = import("./mountEngine-
|
|
609
|
+
return this.engineLoadPromise ?? (this.engineLoadPromise = import("./mountEngine-CVnwr305.js").then((e) => e.m).then((e) => {
|
|
607
610
|
const a = e.mountCheckoutEngine({
|
|
608
611
|
host: this,
|
|
609
612
|
shadowRoot: this.shadow
|
|
@@ -668,23 +671,23 @@ class j extends HTMLElement {
|
|
|
668
671
|
e == null || e.teardown(), e == null || e.unmount(), this.engine = null, this.engineLoadPromise = null;
|
|
669
672
|
}
|
|
670
673
|
}
|
|
671
|
-
function
|
|
674
|
+
function j(t) {
|
|
672
675
|
return new R(
|
|
673
676
|
O(t),
|
|
674
677
|
c(t) ? void 0 : t.publishableKey
|
|
675
678
|
);
|
|
676
679
|
}
|
|
677
|
-
function
|
|
680
|
+
function G({
|
|
678
681
|
api: t,
|
|
679
682
|
options: e
|
|
680
683
|
}) {
|
|
681
|
-
return
|
|
684
|
+
return F({
|
|
682
685
|
api: t,
|
|
683
686
|
options: e,
|
|
684
|
-
emit: (a, n) =>
|
|
687
|
+
emit: (a, n) => C(e.onEvent, a, n)
|
|
685
688
|
});
|
|
686
689
|
}
|
|
687
|
-
customElements.get("lydian-checkout") || customElements.define("lydian-checkout",
|
|
690
|
+
customElements.get("lydian-checkout") || customElements.define("lydian-checkout", H);
|
|
688
691
|
function h() {
|
|
689
692
|
return document.querySelector("lydian-checkout");
|
|
690
693
|
}
|
|
@@ -738,12 +741,12 @@ export {
|
|
|
738
741
|
S as i,
|
|
739
742
|
q as j,
|
|
740
743
|
_ as k,
|
|
741
|
-
|
|
744
|
+
k as l,
|
|
742
745
|
ee as m,
|
|
743
746
|
Y as n,
|
|
744
747
|
X as o,
|
|
745
748
|
K as p,
|
|
746
|
-
|
|
749
|
+
W as r,
|
|
747
750
|
m as s,
|
|
748
751
|
v as t
|
|
749
752
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as Fe, I as ft, g as Qt, h as pt, b as jn, s as Bn } from "./mountEngine-
|
|
1
|
+
import { i as Fe, I as ft, g as Qt, h as pt, b as jn, s as Bn } from "./mountEngine-CVnwr305.js";
|
|
2
2
|
function Wn(t, e) {
|
|
3
3
|
if (!Fe(t, { strict: !1 }))
|
|
4
4
|
throw new ft({ address: t });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Gf = Object.defineProperty;
|
|
2
2
|
var Yf = (t, e, n) => e in t ? Gf(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
3
|
var Ht = (t, e, n) => Yf(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
-
import { c as ei, g as ga } from "./mountEngine-
|
|
4
|
+
import { c as ei, g as ga } from "./mountEngine-CVnwr305.js";
|
|
5
5
|
var ti = { exports: {} }, cc;
|
|
6
6
|
function Zf() {
|
|
7
7
|
return cc || (cc = 1, (function(t, e) {
|