@lydianpay/sdk-web 3.13.1 → 3.15.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 +49 -12
- package/dist/chunks/browser-Bt5TF15J.js +33 -0
- package/dist/chunks/connect-multichain-DZaPiBrH.js +9971 -0
- package/dist/chunks/{index-BsBqHeHy.js → index-BNr7lH3k.js} +114 -95
- package/dist/chunks/index-BqoF-MuQ.js +5944 -0
- package/dist/chunks/{index-fJBrLteK.js → index-Co-4jhyA.js} +927 -1293
- package/dist/chunks/index-DvVB0Sjv.js +114 -0
- package/dist/chunks/index-FAg0du7P.js +595 -0
- package/dist/chunks/index-KRc-DEDM.js +4716 -0
- package/dist/chunks/index-ehz3N8J3.js +314 -0
- package/dist/chunks/mm-install-modal_2.entry-Dhx9nDM_.js +1365 -0
- package/dist/chunks/{mountEngine-BIIdZhCT.js → mountEngine-0Lj7ZkFh.js} +8636 -8483
- package/dist/chunks/utils-Ca8X9WUu.js +264 -0
- package/dist/lydian.js +1 -1
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/types.d.ts +7 -0
- package/dist/types/ui/checkoutPresentation.d.ts +1 -0
- package/dist/types/ui/initConfig.d.ts +3 -0
- package/dist/types/ui/ldkCheckout.d.ts +1 -0
- package/dist/types/ui/ldkHandoff.d.ts +5 -0
- package/dist/types/ui/paymentFlow.d.ts +1 -0
- package/dist/types/ui/walletCheckoutRecord.d.ts +9 -0
- package/dist/types/utils/guards.d.ts +1 -0
- package/package.json +8 -4
- package/dist/chunks/metamask-sdk-BIbC0y1P.js +0 -15037
package/README.md
CHANGED
|
@@ -83,18 +83,19 @@ Place the checkout element where you want the UI, then initialize the SDK:
|
|
|
83
83
|
|
|
84
84
|
`window.Lydian.init(options)`
|
|
85
85
|
|
|
86
|
-
| Option | Type | Required | Description
|
|
87
|
-
| ------------------------- | --------------------------- | -------- |
|
|
88
|
-
| `publishableKey` | `string` | yes | Your Lydian publishable key (`pk_...`).
|
|
89
|
-
| `walletConnectProjectId` | `string` | yes | Your [WalletConnect/Reown](https://dashboard.reown.com) project ID, used to power wallet connections.
|
|
90
|
-
| `transaction` | `Transaction` | yes | The payment to collect (see below).
|
|
91
|
-
| `dev` | `boolean` | yes | Target the dev environment.
|
|
92
|
-
| `sandbox` | `boolean` | yes | Target sandbox. With both `dev` and `sandbox` `false`, the SDK uses production.
|
|
93
|
-
| `
|
|
94
|
-
| `
|
|
95
|
-
| `
|
|
96
|
-
| `
|
|
97
|
-
| `
|
|
86
|
+
| Option | Type | Required | Description |
|
|
87
|
+
| ------------------------- | --------------------------- | -------- | -------------------------------------------------------------------------------------------------------- |
|
|
88
|
+
| `publishableKey` | `string` | yes | Your Lydian publishable key (`pk_...`). |
|
|
89
|
+
| `walletConnectProjectId` | `string` | yes | Your [WalletConnect/Reown](https://dashboard.reown.com) project ID, used to power wallet connections. |
|
|
90
|
+
| `transaction` | `Transaction` | yes | The payment to collect (see below). |
|
|
91
|
+
| `dev` | `boolean` | yes | Target the dev environment. |
|
|
92
|
+
| `sandbox` | `boolean` | yes | Target sandbox. With both `dev` and `sandbox` `false`, the SDK uses production. |
|
|
93
|
+
| `gatewayUrl` | `string` | no | A gateway at this origin instead of the above, e.g. one running on your machine. Local development only. |
|
|
94
|
+
| `paymentSuccessListener` | `() => void` | yes | Called when the payment completes. |
|
|
95
|
+
| `paymentFailedListener` | `(message: string) => void` | yes | Called on failure, with a message. |
|
|
96
|
+
| `paymentCanceledListener` | `() => void` | yes | Called when the customer cancels. |
|
|
97
|
+
| `isEmbedded` | `boolean` | no | Render the checkout inline (embedded) instead of as a modal. |
|
|
98
|
+
| `flow` | `InitFlowOptions` | no | Per-embed flow overrides (see below). |
|
|
98
99
|
|
|
99
100
|
**`flow`**
|
|
100
101
|
|
|
@@ -161,6 +162,42 @@ Arbitrum, Base, Optimism, Solana, Bitcoin, Celo, Linea, Sonic, Unichain, ZKsync,
|
|
|
161
162
|
and more. Which assets appear at checkout is controlled by your Lydian account
|
|
162
163
|
configuration.
|
|
163
164
|
|
|
165
|
+
## Development
|
|
166
|
+
|
|
167
|
+
The dev harness is `index.html`: `npm run dev` serves the SDK source with hot
|
|
168
|
+
reload at http://localhost:5173 and renders a checkout from the values in
|
|
169
|
+
`.env.local` (copy `.env.example`; it explains each one). A publishable key is
|
|
170
|
+
the only value that needs filling in, unless a gateway on your machine is in
|
|
171
|
+
play, in which case `VITE_GATEWAY_URL` points the harness at it.
|
|
172
|
+
|
|
173
|
+
**On a phone.** Wallet deep links only happen in a phone browser, so:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
brew install cloudflared # once per machine; no account needed
|
|
177
|
+
npm run dev:phone
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
That runs the harness behind a Cloudflare quick tunnel and prints an https URL
|
|
181
|
+
and a QR code to scan with the phone camera. If `.env.local` points at a
|
|
182
|
+
gateway on your machine, the gateway gets a tunnel of its own and the page is
|
|
183
|
+
told to use it (on the phone, `localhost` is the phone); the script prints that
|
|
184
|
+
address too. Both addresses are random per run and stop working at Ctrl-C.
|
|
185
|
+
Nothing is installed on the phone. While it runs, the harness and that gateway
|
|
186
|
+
are reachable from the internet under those hostnames, so keep `.env.local` to
|
|
187
|
+
development credentials.
|
|
188
|
+
|
|
189
|
+
**With an unpublished wallet layer.** The wallet connection code lives in
|
|
190
|
+
`@lydianpay/lydianconnect` and `@lydianpay/lydianconnect-catalog`. To try a
|
|
191
|
+
change to either here before it is published, with their checkouts next to this
|
|
192
|
+
one:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
npm run use:local # build, pack and install both siblings, like npm publish would
|
|
196
|
+
npm run use:published # back to the registry versions
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Then `npm run dev` or `npm run dev:phone` as above.
|
|
200
|
+
|
|
164
201
|
## Links
|
|
165
202
|
|
|
166
203
|
- [npm package](https://www.npmjs.com/package/@lydianpay/sdk-web)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { g as c } from "./mountEngine-0Lj7ZkFh.js";
|
|
2
|
+
function f(t, i) {
|
|
3
|
+
for (var o = 0; o < i.length; o++) {
|
|
4
|
+
const e = i[o];
|
|
5
|
+
if (typeof e != "string" && !Array.isArray(e)) {
|
|
6
|
+
for (const r in e)
|
|
7
|
+
if (r !== "default" && !(r in t)) {
|
|
8
|
+
const s = Object.getOwnPropertyDescriptor(e, r);
|
|
9
|
+
s && Object.defineProperty(t, r, s.get ? s : {
|
|
10
|
+
enumerable: !0,
|
|
11
|
+
get: () => e[r]
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return Object.freeze(Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }));
|
|
17
|
+
}
|
|
18
|
+
var n, a;
|
|
19
|
+
function b() {
|
|
20
|
+
return a || (a = 1, n = function() {
|
|
21
|
+
throw new Error(
|
|
22
|
+
"ws does not work in the browser. Browser clients must use the native WebSocket object"
|
|
23
|
+
);
|
|
24
|
+
}), n;
|
|
25
|
+
}
|
|
26
|
+
var u = b();
|
|
27
|
+
const w = /* @__PURE__ */ c(u), p = /* @__PURE__ */ f({
|
|
28
|
+
__proto__: null,
|
|
29
|
+
default: w
|
|
30
|
+
}, [u]);
|
|
31
|
+
export {
|
|
32
|
+
p as b
|
|
33
|
+
};
|