@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 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
- | `paymentSuccessListener` | `() => void` | yes | Called when the payment completes. |
94
- | `paymentFailedListener` | `(message: string) => void` | yes | Called on failure, with a message. |
95
- | `paymentCanceledListener` | `() => void` | yes | Called when the customer cancels. |
96
- | `isEmbedded` | `boolean` | no | Render the checkout inline (embedded) instead of as a modal. |
97
- | `flow` | `InitFlowOptions` | no | Per-embed flow overrides (see below). |
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
+ };