@lydianpay/sdk-web 3.9.0 → 3.11.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/README.md +5 -4
- package/dist/chunks/{index-DRxELYu4.js → index-CGkvJIU5.js} +1 -1
- package/dist/chunks/{index-wJd9PSat.js → index-DN1W8tpt.js} +17 -11
- package/dist/chunks/{metamask-sdk-BvG7yj9u.js → metamask-sdk-ByAE3QwW.js} +1 -1
- package/dist/chunks/{mountEngine-BEjbUUpt.js → mountEngine-KmqEj6j1.js} +9628 -9066
- package/dist/lydian.js +1 -1
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/constants.d.ts +7 -0
- package/dist/types/types.d.ts +1 -0
- package/dist/types/ui/brandingHelpers.d.ts +1 -0
- package/dist/types/ui/flowConfig.d.ts +1 -0
- package/dist/types/ui/react/CopyField.d.ts +2 -1
- package/dist/types/ui/react/ScanToPayScreen/CopyRow.d.ts +9 -0
- package/dist/types/ui/react/ScanToPayScreen/ScanActionButtons.d.ts +7 -0
- package/dist/types/ui/react/ScanToPayScreen/ScanNotices.d.ts +6 -0
- package/dist/types/ui/react/ScanToPayScreen/ScanPaymentDetails.d.ts +5 -0
- package/dist/types/ui/react/ScanToPayScreen/ScanQrCode.d.ts +5 -0
- package/dist/types/ui/react/ScanToPayScreen/ScanToPayEmbeddedLayout.d.ts +3 -0
- package/dist/types/ui/react/ScanToPayScreen/ScanToPayModalLayout.d.ts +3 -0
- package/dist/types/ui/react/ScanToPayScreen/UnderpaidDetails.d.ts +5 -0
- package/dist/types/ui/react/ScanToPayScreen/scanToPayLayoutProps.d.ts +10 -0
- package/dist/types/ui/react/ScanToPayScreen/useScanToPayState.d.ts +9 -0
- package/dist/types/ui/react/checkoutActions.d.ts +4 -1
- package/dist/types/ui/react/checkoutStore.d.ts +1 -0
- package/dist/types/ui/react/useTransientNotice.d.ts +4 -0
- package/dist/types/ui/walletSelection.d.ts +7 -2
- package/package.json +3 -3
- /package/dist/types/ui/react/{ScanToPayScreen.d.ts → ScanToPayScreen/ScanToPayScreen.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -110,10 +110,11 @@ every checkout automatically.
|
|
|
110
110
|
Configured on your Lydian account, not here. They apply to every checkout and there
|
|
111
111
|
is no per-embed override:
|
|
112
112
|
|
|
113
|
-
| Setting
|
|
114
|
-
|
|
|
115
|
-
| `showApprovalPage`
|
|
116
|
-
| `hideNoWalletOption`
|
|
113
|
+
| Setting | Description |
|
|
114
|
+
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
115
|
+
| `showApprovalPage` | Show the scan-to-pay screen as a confirmation step before asking a connected wallet to sign. Off by default — the wallet opens straight away. |
|
|
116
|
+
| `hideNoWalletOption` | Legacy field name retained for compatibility. When true, hides the "Other wallets" option on the wallet selection screen. |
|
|
117
|
+
| `hideChangePaymentMethod` | When true, the "Change payment method" button is not shown on the wallet selection screen even when the session has a `cancelURL`. |
|
|
117
118
|
|
|
118
119
|
```js
|
|
119
120
|
window.Lydian.init({
|
|
@@ -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-KmqEj6j1.js";
|
|
2
2
|
function Wn(t, e) {
|
|
3
3
|
if (!Fe(t, { strict: !1 }))
|
|
4
4
|
throw new ft({ address: t });
|
|
@@ -163,10 +163,10 @@ var u = {
|
|
|
163
163
|
sandbox: "https://api.sandbox.lydian.com",
|
|
164
164
|
prod: "https://api.lydian.com"
|
|
165
165
|
};
|
|
166
|
-
function
|
|
166
|
+
function F(e) {
|
|
167
167
|
return e.dev ? p.dev : e.sandbox ? p.sandbox : p.prod;
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function C({
|
|
170
170
|
options: e,
|
|
171
171
|
unsupportedKeys: t,
|
|
172
172
|
entryPoint: a
|
|
@@ -174,7 +174,7 @@ function P({
|
|
|
174
174
|
const n = t.filter((o) => e[o] !== void 0);
|
|
175
175
|
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.`;
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function P(e) {
|
|
178
178
|
var t;
|
|
179
179
|
return (t = e.flow) != null && t.walletConnect && !e.walletConnectProjectId ? "walletConnectProjectId is required when flow.walletConnect is on" : null;
|
|
180
180
|
}
|
|
@@ -198,7 +198,7 @@ function k(e, t, a) {
|
|
|
198
198
|
console.error(`onEvent("${t}") threw:`, n);
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
async function
|
|
201
|
+
async function U({
|
|
202
202
|
api: e,
|
|
203
203
|
options: t,
|
|
204
204
|
emit: a
|
|
@@ -313,6 +313,8 @@ const B = {
|
|
|
313
313
|
"header.changePaymentMethod": "Change payment method",
|
|
314
314
|
"wallet.chooseWallet": "Choose your crypto wallet",
|
|
315
315
|
"wallet.featured": "FEATURED",
|
|
316
|
+
"wallet.comingSoon": "Soon",
|
|
317
|
+
"wallet.comingSoonNotice": "{wallet} is coming soon, please select a different wallet.",
|
|
316
318
|
"wallet.manualQrName": "Manual QR Code",
|
|
317
319
|
"wallet.otherWallets": "Other wallets",
|
|
318
320
|
"wallet.connectingTo": "Connecting to {wallet}",
|
|
@@ -389,6 +391,10 @@ const B = {
|
|
|
389
391
|
"scan.downloadQr": "Download QR",
|
|
390
392
|
"scan.changeCoin": "Change coin",
|
|
391
393
|
"scan.waitingForPayment": "Waiting for payment...",
|
|
394
|
+
"scan.waitingForPaymentStatus": "Waiting for payment",
|
|
395
|
+
"scan.includeFees": "Include Fees",
|
|
396
|
+
"scan.termsAndConditions": "Terms & Conditions",
|
|
397
|
+
"scan.copy": "Copy",
|
|
392
398
|
"scan.cancelPayment": "Cancel payment",
|
|
393
399
|
"scan.openWalletToPay": "Open {wallet}",
|
|
394
400
|
"scan.payWithWallet": "Pay with your wallet",
|
|
@@ -616,7 +622,7 @@ class G extends HTMLElement {
|
|
|
616
622
|
// Not started in the constructor: a page can carry the tag and never check out.
|
|
617
623
|
// Overlapping initialize() calls share one download.
|
|
618
624
|
getOrLoadEngine() {
|
|
619
|
-
return this.engineLoadPromise ?? (this.engineLoadPromise = import("./mountEngine-
|
|
625
|
+
return this.engineLoadPromise ?? (this.engineLoadPromise = import("./mountEngine-KmqEj6j1.js").then((t) => t.m).then((t) => {
|
|
620
626
|
const a = t.mountCheckoutEngine({
|
|
621
627
|
host: this,
|
|
622
628
|
shadowRoot: this.shadow
|
|
@@ -683,7 +689,7 @@ class G extends HTMLElement {
|
|
|
683
689
|
}
|
|
684
690
|
function H(e) {
|
|
685
691
|
return new R(
|
|
686
|
-
|
|
692
|
+
F(e),
|
|
687
693
|
c(e) ? void 0 : e.publishableKey
|
|
688
694
|
);
|
|
689
695
|
}
|
|
@@ -691,7 +697,7 @@ function j({
|
|
|
691
697
|
api: e,
|
|
692
698
|
options: t
|
|
693
699
|
}) {
|
|
694
|
-
return
|
|
700
|
+
return U({
|
|
695
701
|
api: e,
|
|
696
702
|
options: t,
|
|
697
703
|
emit: (a, n) => k(t.onEvent, a, n)
|
|
@@ -704,12 +710,12 @@ function h() {
|
|
|
704
710
|
async function z(e) {
|
|
705
711
|
if (!e.publishableKey || !e.transaction.amount || !e.transaction.currency)
|
|
706
712
|
throw new Error("SDK initialization requires publishableKey and a transaction");
|
|
707
|
-
const t =
|
|
713
|
+
const t = P(e);
|
|
708
714
|
if (t)
|
|
709
715
|
throw new Error(t);
|
|
710
716
|
if (!N(e.transaction.currency))
|
|
711
717
|
throw new Error("Invalid value for currency, valid values are: " + g.join(", "));
|
|
712
|
-
const a =
|
|
718
|
+
const a = C({
|
|
713
719
|
options: e,
|
|
714
720
|
unsupportedKeys: ["sessionID"],
|
|
715
721
|
entryPoint: "init"
|
|
@@ -721,10 +727,10 @@ async function z(e) {
|
|
|
721
727
|
async function Q(e) {
|
|
722
728
|
if (!e.sessionID)
|
|
723
729
|
throw new Error("initExistingSession requires a sessionID");
|
|
724
|
-
const t =
|
|
730
|
+
const t = P(e);
|
|
725
731
|
if (t)
|
|
726
732
|
throw new Error(t);
|
|
727
|
-
const a =
|
|
733
|
+
const a = C({
|
|
728
734
|
options: e,
|
|
729
735
|
unsupportedKeys: ["publishableKey", "transaction"],
|
|
730
736
|
entryPoint: "initExistingSession"
|
|
@@ -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-KmqEj6j1.js";
|
|
5
5
|
var ti = { exports: {} }, cc;
|
|
6
6
|
function Zf() {
|
|
7
7
|
return cc || (cc = 1, (function(t, e) {
|