@lydianpay/sdk-web 3.0.0 → 3.1.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 +11 -11
- package/dist/chunks/{index-B-nXrLNN.js → index-DNg377cf.js} +13 -14
- package/dist/chunks/index-DSXTLyjq.js +744 -0
- package/dist/chunks/{metamask-sdk-DpI24rgz.js → metamask-sdk-BqxWzRzO.js} +1 -1
- package/dist/chunks/mountEngine-DjacHrH_.js +34956 -0
- package/dist/lydian.js +1 -1
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/constants.d.ts +6 -0
- package/dist/types/types.d.ts +1 -1
- package/dist/types/ui/Checkout.d.ts +11 -143
- package/dist/types/ui/checkoutCallbacks.d.ts +26 -0
- package/dist/types/ui/checkoutEngine.d.ts +28 -0
- package/dist/types/ui/checkoutPresentation.d.ts +24 -0
- package/dist/types/ui/checkoutSelection.d.ts +30 -0
- package/dist/types/ui/copyFields.d.ts +13 -0
- package/dist/types/ui/countdownClock.d.ts +5 -0
- package/dist/types/ui/dialogController.d.ts +35 -0
- package/dist/types/ui/failureReport.d.ts +13 -0
- package/dist/types/ui/flowConfig.d.ts +1 -1
- package/dist/types/ui/hostCallbacks.d.ts +10 -0
- package/dist/types/ui/kycFlow.d.ts +44 -0
- package/dist/types/ui/kycVerificationRequest.d.ts +17 -0
- package/dist/types/ui/paymentFlow.d.ts +49 -0
- package/dist/types/ui/pollTick.d.ts +15 -0
- package/dist/types/ui/react/AssetSelectScreen.d.ts +1 -5
- package/dist/types/ui/react/CheckoutApp.d.ts +1 -4
- package/dist/types/ui/react/CloseTransactionDialogBody.d.ts +1 -6
- package/dist/types/ui/react/ConnectWithQrScreen.d.ts +1 -5
- package/dist/types/ui/react/ConnectingWalletScreen.d.ts +1 -5
- package/dist/types/ui/react/DownloadWalletScreen.d.ts +1 -3
- package/dist/types/ui/react/KycScreen.d.ts +1 -5
- package/dist/types/ui/react/LoadingScreen.d.ts +1 -8
- package/dist/types/ui/react/NetworkSelectScreen.d.ts +1 -5
- package/dist/types/ui/react/PaymentFailureScreen.d.ts +1 -5
- package/dist/types/ui/react/PaymentHeaderSection.d.ts +1 -12
- package/dist/types/ui/react/PaymentSuccessScreen.d.ts +1 -5
- package/dist/types/ui/react/RestoreDetailsDialogBody.d.ts +1 -4
- package/dist/types/ui/react/ScanToPayScreen.d.ts +1 -5
- package/dist/types/ui/react/TimerBanner/TimerBanner.d.ts +2 -0
- package/dist/types/ui/react/TimerBanner/timerBannerHelpers.d.ts +13 -0
- package/dist/types/ui/react/WalletSelectScreen.d.ts +1 -5
- package/dist/types/ui/react/checkoutActions.d.ts +107 -0
- package/dist/types/ui/react/checkoutContext.d.ts +9 -0
- package/dist/types/ui/react/checkoutReducer.d.ts +11 -0
- package/dist/types/ui/react/checkoutStore.d.ts +16 -7
- package/dist/types/ui/react/engine/CheckoutEngine.d.ts +30 -0
- package/dist/types/ui/react/engine/checkoutShell.d.ts +3 -0
- package/dist/types/ui/react/engine/mountEngine.d.ts +10 -0
- package/dist/types/ui/react/engine/useBranding.d.ts +1 -0
- package/dist/types/ui/react/engine/useCopyFields.d.ts +1 -0
- package/dist/types/ui/react/engine/useHostCallbacks.d.ts +2 -0
- package/dist/types/ui/react/engine/useProcessingOverlay.d.ts +1 -0
- package/dist/types/ui/react/engine/useScreenNavigator.d.ts +3 -0
- package/dist/types/ui/react/mount.d.ts +7 -5
- package/dist/types/ui/react/useQrCanvas.d.ts +9 -0
- package/dist/types/ui/screenNavigator.d.ts +13 -0
- package/dist/types/ui/sessionBootstrap.d.ts +36 -0
- package/dist/types/ui/sessionHelpers.d.ts +1 -2
- package/dist/types/ui/sessionLifecycle.d.ts +37 -0
- package/dist/types/ui/sessionQuoteWatcher.d.ts +7 -8
- package/dist/types/ui/settledOutcome.d.ts +14 -0
- package/dist/types/ui/transactionOutcome.d.ts +2 -0
- package/dist/types/ui/transactionPoller.d.ts +16 -0
- package/dist/types/ui/walletConnection.d.ts +50 -0
- package/package.json +2 -1
- package/dist/chunks/index-CoARqfML.js +0 -22485
- package/dist/chunks/mount-mNbGvMK_.js +0 -12914
- package/dist/types/ui/countdownBanner.d.ts +0 -33
- package/dist/types/ui/react/TimerBanner.d.ts +0 -4
- package/dist/types/ui/react/callbacksFixture.d.ts +0 -6
package/README.md
CHANGED
|
@@ -62,7 +62,7 @@ Place the checkout element where you want the UI, then initialize the SDK:
|
|
|
62
62
|
walletConnectProjectId: 'your-walletconnect-project-id',
|
|
63
63
|
transaction: {
|
|
64
64
|
amount: 2.45,
|
|
65
|
-
currency: 'USD', // 'USD' or '
|
|
65
|
+
currency: 'USD', // 'USD', 'TRY' or 'PHP'
|
|
66
66
|
descriptor: 'Order #1234',
|
|
67
67
|
referenceNumber: 'your-unique-ref',
|
|
68
68
|
},
|
|
@@ -109,10 +109,10 @@ every checkout automatically.
|
|
|
109
109
|
Configured on your Lydian account, not here. They apply to every checkout and there
|
|
110
110
|
is no per-embed override:
|
|
111
111
|
|
|
112
|
-
| Setting
|
|
113
|
-
|
|
|
114
|
-
| `
|
|
115
|
-
| `hideNoWalletOption`
|
|
112
|
+
| Setting | Description |
|
|
113
|
+
| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
114
|
+
| `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. |
|
|
115
|
+
| `hideNoWalletOption` | Hide the "I don't have a supported wallet" link. |
|
|
116
116
|
|
|
117
117
|
```js
|
|
118
118
|
window.Lydian.init({
|
|
@@ -123,12 +123,12 @@ window.Lydian.init({
|
|
|
123
123
|
|
|
124
124
|
**`Transaction`**
|
|
125
125
|
|
|
126
|
-
| Field | Type
|
|
127
|
-
| ----------------- |
|
|
128
|
-
| `amount` | `number`
|
|
129
|
-
| `currency` | `'USD' \| 'TRY'` | yes | Fiat currency the amount is denominated in. |
|
|
130
|
-
| `referenceNumber` | `string`
|
|
131
|
-
| `descriptor` | `string`
|
|
126
|
+
| Field | Type | Required | Description |
|
|
127
|
+
| ----------------- | ------------------------- | -------- | ------------------------------------------------- |
|
|
128
|
+
| `amount` | `number` | yes | Amount to charge. |
|
|
129
|
+
| `currency` | `'USD' \| 'TRY' \| 'PHP'` | yes | Fiat currency the amount is denominated in. |
|
|
130
|
+
| `referenceNumber` | `string` | yes | Your unique reference for this payment. |
|
|
131
|
+
| `descriptor` | `string` | no | Human-readable description shown to the customer. |
|
|
132
132
|
|
|
133
133
|
## Updating the transaction
|
|
134
134
|
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as Fe, I as ft, g as Qt, h as pt, b as jn, s as Bn } from "./mountEngine-DjacHrH_.js";
|
|
2
|
+
function Wn(t, e) {
|
|
3
|
+
if (!Fe(t, { strict: !1 }))
|
|
4
|
+
throw new ft({ address: t });
|
|
5
|
+
if (!Fe(e, { strict: !1 }))
|
|
6
|
+
throw new ft({ address: e });
|
|
7
|
+
return t.toLowerCase() === e.toLowerCase();
|
|
8
|
+
}
|
|
2
9
|
var Oe = { exports: {} }, gt;
|
|
3
|
-
function
|
|
10
|
+
function qn() {
|
|
4
11
|
return gt || (gt = 1, (function(t) {
|
|
5
12
|
var e = Object.prototype.hasOwnProperty, n = "~";
|
|
6
13
|
function s() {
|
|
@@ -106,16 +113,8 @@ function Wn() {
|
|
|
106
113
|
}, l.prototype.off = l.prototype.removeListener, l.prototype.addListener = l.prototype.on, l.prefixed = n, l.EventEmitter = l, t.exports = l;
|
|
107
114
|
})(Oe)), Oe.exports;
|
|
108
115
|
}
|
|
109
|
-
var
|
|
110
|
-
const
|
|
111
|
-
function Kn(t, e) {
|
|
112
|
-
if (!Fe(t, { strict: !1 }))
|
|
113
|
-
throw new ft({ address: t });
|
|
114
|
-
if (!Fe(e, { strict: !1 }))
|
|
115
|
-
throw new ft({ address: e });
|
|
116
|
-
return t.toLowerCase() === e.toLowerCase();
|
|
117
|
-
}
|
|
118
|
-
const Fn = (t, e) => {
|
|
116
|
+
var Vn = qn();
|
|
117
|
+
const Kn = /* @__PURE__ */ Qt(Vn), Fn = (t, e) => {
|
|
119
118
|
let n;
|
|
120
119
|
switch (t) {
|
|
121
120
|
case "standard":
|
|
@@ -793,7 +792,7 @@ class ps {
|
|
|
793
792
|
async handleGetCapabilitiesRequest(e) {
|
|
794
793
|
ls(e.params);
|
|
795
794
|
const n = e.params[0], s = e.params[1];
|
|
796
|
-
if (!this.accounts.some((l) =>
|
|
795
|
+
if (!this.accounts.some((l) => Wn(l, n)))
|
|
797
796
|
throw L.provider.unauthorized("no active account found");
|
|
798
797
|
const r = this.storage.loadObject(vt);
|
|
799
798
|
if (!r)
|
|
@@ -3457,7 +3456,7 @@ function yi(t) {
|
|
|
3457
3456
|
}
|
|
3458
3457
|
return t;
|
|
3459
3458
|
}
|
|
3460
|
-
class wi extends
|
|
3459
|
+
class wi extends Kn {
|
|
3461
3460
|
}
|
|
3462
3461
|
var bi = function(t, e) {
|
|
3463
3462
|
var n = {};
|