openreceive-rails 0.4.11 → 0.4.13

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.
@@ -1,6 +1,6 @@
1
1
  # OpenReceive agent directions (Fastify)
2
2
 
3
- These directions describe OpenReceive 0.4.11.
3
+ These directions describe OpenReceive 0.4.13.
4
4
 
5
5
  Add OpenReceive to a Fastify application — the app you are already working in.
6
6
  You do not need a copy of the OpenReceive source: the packages are on npm, and
@@ -34,62 +34,90 @@ The one required credential is a receive-only NWC code (Nostr Wallet Connect):
34
34
  a string from the merchant's wallet that can create invoices and read their
35
35
  status, and cannot spend. A swap provider (an "LSC" code) optionally lets the
36
36
  payer send USDT, USDC, ETH or SOL instead, converted into that same
37
- Lightning payment. You supply those credentials and three hooks — `authorize`, `amountFor`,
37
+ Lightning payment. Step 0 collects those credentials from the user; you write three hooks — `authorize`, `amountFor`,
38
38
  `onPaid`;
39
39
  OpenReceive supplies invoices, polling, settlement and the checkout UI. It never
40
40
  owns orders, users, prices, or fulfillment.
41
41
 
42
- ## Step 0 — check the environment before you write code
43
-
44
- Do this before installing packages or editing files.
45
-
46
- 1. Look for `NWC_URI` in this app's server environment — `.env`, the process
47
- env, the deploy config, whatever this app already uses. If the app runs in a
48
- container the value is in none of those: ask the running process
49
- (`docker exec <container> printenv NWC_URI`), because finding the NAME in a
50
- compose file proves nothing about the value. Never print or echo the value
51
- itself; only report whether it is set. Check for `LSC_URI_PRIMARY` in the
52
- same pass.
53
- 2. If BOTH are already set — the common case in an existing app — say so and go
54
- straight to the quickstart. Steps 3 and 4 are for an environment that is
55
- missing one; do not stop to ask about altcoins that are already configured.
56
- If only `NWC_URI` is set, Bitcoin already works: continue, and raise the
57
- altcoin question at step 4 rather than blocking on it.
58
- 3. If `NWC_URI` is missing or empty, stop and tell the user exactly what to
59
- create:
60
-
61
- > OpenReceive cannot issue an invoice without a receive-only NWC code. Get
62
- > one at https://openreceive.org/get_a_nwc_code_to_receive_payments, then
63
- > put `NWC_URI=<the code>` in this app's server environment — for most apps
64
- > that is a `.env` file in the project root — and tell me when it's set.
65
-
66
- Wait for the user before wiring OpenReceive; do not invent a placeholder
67
- value. Waiting is not idleness: you may write `.env.example` with the
68
- variable NAMES only (`NWC_URI=`, `LSC_URI_PRIMARY=`) so the merchant has a
69
- file to copy, and keep building the parts of the host that do not touch
70
- OpenReceive — the order model, the cart, the routes. The stop guards the
71
- credential, not the rest of the app.
72
- 4. If `LSC_URI_PRIMARY` was not already set, ask the user: "Do you want to
73
- accept altcoins and stablecoins (USDT, USDC, ETH, SOL) as well as
74
- Bitcoin?"
75
-
76
- - Yes → send them to https://openreceive.org/set_up_swap_provider for a
77
- swap-provider (LSC) code, to set as `LSC_URI_PRIMARY` in the same server
78
- environment. Do NOT wait for it: no application code reads the value, so
79
- the integration is identical with or without it — the library picks it up
80
- from the environment and swaps switch on. What a yes DOES change is the
81
- refund route back (the swap non-negotiable below): build it as part of
82
- this integration, not when the code arrives.
83
- - No → skip it. Bitcoin over Lightning works with `NWC_URI` alone, and you
84
- can add a swap provider later without changing application code.
85
- 5. Check the environment again and confirm `NWC_URI` is present.
86
- `LSC_URI_PRIMARY` may land later; swaps stay off until it does, and no code
87
- changes when it arrives.
88
- 6. If OpenReceive is ALREADY installed here, check the installed versions of
89
- `@openreceive/node` and `@openreceive/browser` against the release named at
90
- the top of this file. The headless display models below do not exist in
91
- older versions, and the first tile click throws with nothing saying why.
92
- Upgrade first.
42
+ ## Step 0 — ask for the two codes, one question at a time
43
+
44
+ Before anything else, look at one file: the project's `.env`, if it exists.
45
+ Read it only far enough to see whether `NWC_URI` and `LSC_URI_PRIMARY` are
46
+ there and non-empty, and never print the values. A code that is already
47
+ set is not asked for again; if both are set, skip to step 5
48
+ (making the server load the file), then the quickstart.
49
+
50
+ Otherwise your next action is a question to the user. Do not install packages,
51
+ edit the app, write `.env.example`, or search anywhere else before asking
52
+ it. Do not read deploy config (compose files, platform secrets), Docker containers, or process environments, and never run
53
+ `printenv`. A new shop has neither code yet: hunting for one burns the turn and
54
+ can leak other secrets into the transcript.
55
+
56
+ Two server-only URIs are needed before the quickstart:
57
+
58
+ - `NWC_URI` — a receive-only Nostr Wallet Connect code,
59
+ `nostr+walletconnect://…`. Required for Bitcoin.
60
+ - `LSC_URI_PRIMARY` — a Lightning Swap Connect URI,
61
+ `lightning+swapconnect://…`. Required for USDT, USDC, ETH and SOL. Skip it
62
+ only when the user says they want Bitcoin alone.
63
+
64
+ The user never edits an environment file. They paste each code into the chat;
65
+ you store it. Ask one question per message.
66
+
67
+ 1. **First message — the NWC code, and nothing else.** Ask for it and walk them
68
+ through getting it:
69
+
70
+ > To receive payments I need a receive-only wallet code. In Rizful: open
71
+ > the menu, tap NWC, choose Receive-only NWC code, and tap Copy
72
+ > (https://openreceive.org/get_a_nwc_code_to_receive_payments). If you would
73
+ > rather run your own wallet, Alby Hub works too: Connections → Add
74
+ > Connection → Read Only. Paste the code here and I will store it.
75
+
76
+ Do not mention `.env`, exports, or "tell me when it's set".
77
+ 2. **When they paste it.** If it does not start with `nostr+walletconnect://`,
78
+ ask them to copy the receive-only code again. Otherwise write
79
+ `NWC_URI=<paste>` into the project's `.env`, creating the file if needed.
80
+ Make sure `.gitignore` covers `.env` (and `.dockerignore`, if the app has
81
+ one). Never echo the value, commit it, or put it in client code. Reply only
82
+ that it is saved, then ask the next question.
83
+ 3. **Second message — swaps.** If the user already asked for stablecoins or
84
+ altcoins, skip the yes/no and go straight to the walkthrough. Otherwise ask
85
+ whether payers should also be able to pay with USDT, USDC, ETH or SOL. The
86
+ walkthrough:
87
+
88
+ > Go to https://lightning-swap.com, sign in for API keys, create a key, and
89
+ > copy the whole URI (https://openreceive.org/set_up_swap_provider). Paste
90
+ > it here and I will store it — or say "Bitcoin only" and I will continue
91
+ > without it.
92
+
93
+ Mention FixedFloat only if they already use it.
94
+ 4. **When they paste it.** If it does not start with
95
+ `lightning+swapconnect://`, ask them to copy it again. Otherwise add
96
+ `LSC_URI_PRIMARY=<paste>` to the same `.env`, without echoing it. Swaps
97
+ are now on, so build the refund route back (the swap non-negotiable below) as
98
+ part of this integration. If they chose Bitcoin only, leave
99
+ `LSC_URI_PRIMARY` unset and skip that route.
100
+ 5. **Make the server load the file — yourself.** OpenReceive reads
101
+ `process.env`, and a `.env` file on disk is not in it. Put
102
+ `import "dotenv/config";` at the top of the server entry, as the quickstart
103
+ does. When the app is started with Docker Compose, give the service
104
+ `env_file: .env`. Restart the server after writing the file.
105
+
106
+ Do not invent placeholder URIs. Start the quickstart only once `NWC_URI` is
107
+ saved and `LSC_URI_PRIMARY` is saved or explicitly declined. The first boot
108
+ runs the receive-only preflight: if it reports spend methods such as
109
+ `pay_invoice`, remove `NWC_URI` from `.env` and ask for a receive-only code
110
+ again. Never set the spend-capable override to get past it.
111
+
112
+ ### Upgrading an existing install
113
+
114
+ This is not the opening move of a new integration. When OpenReceive is ALREADY
115
+ installed here, `npx openreceive doctor` reports every credential as set/unset
116
+ (never the value) and probes the wallet. Check the installed
117
+ `@openreceive/node` and `@openreceive/browser` against the release named at the
118
+ top of this file: the headless display models below do not exist in older
119
+ versions, and the first tile click throws with nothing saying why. Upgrade
120
+ first.
93
121
 
94
122
  Only then start the quickstart.
95
123
 
@@ -303,11 +331,11 @@ Fastify + React. Requires Node ≥ 22.
303
331
  npm install @openreceive/fastify @openreceive/react
304
332
  ```
305
333
 
306
- Install the adapter for your server and the UI package for your frontend; the
334
+ Install the adapter for your server and the UI package for your frontend. The
307
335
  wallet client, HTTP handler, and contracts come along as dependencies. The
308
- `openreceive` package is the CLI only — `npx openreceive …` below needs no
309
- install. Different stack? Swap the two packages; the rest of this guide is
310
- identical.
336
+ `openreceive` package is only the CLI, and `npx openreceive …` below needs no
337
+ install. On a different stack, swap the two packages; the rest of this guide
338
+ stays the same.
311
339
 
312
340
  | | Packages |
313
341
  | -------- | ----------------------------------------------------------------------------------------------------------------------------- |
@@ -317,15 +345,17 @@ identical.
317
345
  Express: [quickstart-node.md](https://openreceive.org/guides/quickstart-node.md) · Next.js:
318
346
  [quickstart-next.md](https://openreceive.org/guides/quickstart-next.md). This page is the Fastify one.
319
347
 
320
- On a fresh project, also install what this guide assumes is already there: the
348
+ On a fresh project, also install what this guide assumes you already have: the
321
349
  framework, a static-file plugin for the checkout page, and an env loader
322
- (`npm install fastify @fastify/static dotenv`), plus your ORM before step 2
323
- (`npm install prisma @prisma/client` on the Prisma path) —
324
- `openreceive scaffold` emits files for the ORM you name but never installs it.
350
+ (`npm install fastify @fastify/static dotenv`). Install your ORM before step 2
351
+ too (`npm install prisma @prisma/client` on the Prisma path).
352
+ `openreceive scaffold` emits files for the ORM you name, but it never installs
353
+ that ORM.
325
354
 
326
- npm environments that run with `ignore-scripts` (some editor sandboxes) skip
327
- Prisma's engine download and esbuild's binary postinstall, so a typecheck or
328
- build that fails only there is environmental, not a code problem.
355
+ Some editor sandboxes run npm with `ignore-scripts`. That setting skips
356
+ Prisma's engine download and esbuild's binary postinstall. If a typecheck or
357
+ build fails only in such an environment, the environment is the cause, not
358
+ your code.
329
359
 
330
360
  ### 2. Migrate the payment tables
331
361
 
@@ -333,19 +363,19 @@ build that fails only there is environmental, not a code problem.
333
363
  npx openreceive scaffold payments --orm prisma # or drizzle | typeorm | sequelize | knex
334
364
  ```
335
365
 
336
- `openreceive scaffold payments` emits one schema/migration file for your ORM
337
- and a wiring guide. It never touches a database.
366
+ `openreceive scaffold payments` writes one schema or migration file for your
367
+ ORM, plus a wiring guide. It never touches a database.
338
368
  → [openreceive scaffold payments](https://openreceive.org/guides/api-reference.md#openreceive-scaffold-payments)
339
369
 
340
- Then run the emitted migration through your normal workflow (for example
341
- `npx prisma migrate dev`). OpenReceive owns the tables' logic at runtime; there
342
- is nothing else to generate. Details:
370
+ Then run the generated migration the way you normally do (for example
371
+ `npx prisma migrate dev`). OpenReceive runs the tables' logic at runtime, so
372
+ there is nothing else to generate. Details:
343
373
  [Payment storage](https://openreceive.org/guides/storage.md), [Node ORM recipes](https://openreceive.org/guides/node-orms.md).
344
374
 
345
- No ORM? A bare driver handle (`pg`, `node:sqlite`, `better-sqlite3`) is a
346
- supported `db` in step 4, and there is no scaffold flavor for it — execute the
347
- same DDL once yourself with `paymentsSchemaSql(dialect)` from
348
- `@openreceive/http` instead of scaffolding.
375
+ No ORM? You can pass a bare driver handle (`pg`, `node:sqlite`,
376
+ `better-sqlite3`) as the `db` in step 4. The scaffold has no flavor for it.
377
+ Instead of scaffolding, run the same DDL once yourself, using
378
+ `paymentsSchemaSql(dialect)` from `@openreceive/http`.
349
379
 
350
380
  ### 3. Add wallet credentials
351
381
 
@@ -358,28 +388,33 @@ LSC_URI_BACKUP=
358
388
  ```
359
389
 
360
390
  1. Get a receive-only NWC code from a compatible wallet
361
- ([get one here](https://openreceive.org/get_a_nwc_code_to_receive_payments))
362
- → `NWC_URI`.
363
- 2. Optionally set up a [swap provider](https://openreceive.org/set_up_swap_provider)
364
- → `LSC_URI_PRIMARY` (and `LSC_URI_BACKUP` if you have one).
391
+ ([get one here](https://openreceive.org/get_a_nwc_code_to_receive_payments)).
392
+ Put it in `NWC_URI`.
393
+ 2. Optional: set up a [swap provider](https://openreceive.org/set_up_swap_provider).
394
+ Put its connection string in `LSC_URI_PRIMARY`, and a second one in
395
+ `LSC_URI_BACKUP` if you have one.
365
396
 
366
- Never put these values in browser code. Your application refuses to start if
367
- the NWC code also advertises spend methods such as `pay_invoice`; mint a
368
- receive-only code ([Security](https://openreceive.org/guides/security.md)).
397
+ Never put these values in browser code. Your app refuses to start if the NWC
398
+ code also advertises spend methods such as `pay_invoice`. Create a
399
+ receive-only code instead ([Security](https://openreceive.org/guides/security.md)).
369
400
 
370
- OpenReceive reads `process.env`; creating a `.env` file is not enough on its
371
- own. How that file (or production secrets) get into the process —
372
- `dotenv` on Express/Fastify, Next.js auto-load, secret managers in
373
- production — is on [Environment variables](https://openreceive.org/guides/environment-variables.md).
401
+ OpenReceive reads `process.env`, so creating a `.env` file is not enough on
402
+ its own. [Environment variables](https://openreceive.org/guides/environment-variables.md) explains how that
403
+ file or your production secrets get into the process: `dotenv` on
404
+ Express/Fastify, auto-load on Next.js, and secret managers in production.
374
405
 
375
406
  ### 4. Wire OpenReceive
376
407
 
377
- One plugin: your hooks plus a database handle. The plugin builds the wallet
378
- client and the host; there is no background reconciler — settlement
379
- piggybacks on requests through the durable gate. Two things are Fastify's
380
- own: the mount prefix is passed **at `register()`**, so Fastify scopes the
381
- plugin's routes to it, and there is no body parser to add — Fastify parses
382
- JSON itself.
408
+ One plugin takes your hooks and a database handle. The plugin builds the
409
+ wallet client and the host. There is no background reconciler, meaning no job that checks pending
410
+ payments on a timer. Settlement runs during normal requests instead, through
411
+ the durable reconcile gate.
412
+
413
+ Two things are specific to Fastify:
414
+
415
+ - You pass the mount prefix **at `register()`**, so Fastify scopes the
416
+ plugin's routes to it.
417
+ - You add no body parser, because Fastify parses JSON itself.
383
418
 
384
419
  ```ts
385
420
  import "dotenv/config"; // loads .env into process.env; nothing else does
@@ -448,11 +483,11 @@ await app.register(openReceiveFastify, {
448
483
  });
449
484
  ```
450
485
 
451
- Register the plugin after whatever plugin gives you sessions or auth
452
- decorations, since `authorize` sees the same request object. Shutdown is
453
- handled for you: the plugin registers an `onClose` hook that closes the wallet
454
- client with the app, so there is no `ready`/`close` pair to hold — a deploy
455
- health check awaits `fastify.ready()` instead.
486
+ Register the plugin after whichever plugin gives you sessions or auth
487
+ decorations, because `authorize` sees the same request object. The plugin
488
+ handles shutdown for you. It registers an `onClose` hook that closes the
489
+ wallet client together with the app, so you have no `ready`/`close` pair to
490
+ manage. A deploy health check awaits `fastify.ready()` instead.
456
491
 
457
492
  The first request checks the wallet. Later OpenReceive requests also settle
458
493
  pending invoices, so a payer who closes the tab is still covered.
@@ -467,25 +502,34 @@ An optional worker, `startNotificationWorker({ service, host })`, listens for
467
502
  wallet payment notifications so settlement does not wait for the next page
468
503
  load. → [startNotificationWorker](https://openreceive.org/guides/api-reference.md#startnotificationworker)
469
504
 
470
- Composing the pieces yourself (`createOpenReceive` + `createHost`) is
471
- supported when you need a shared wallet client or a custom repository.
505
+ You can also compose the pieces yourself (`createOpenReceive` + `createHost`)
506
+ when you need a shared wallet client or a custom repository.
472
507
  → [createOpenReceive](https://openreceive.org/guides/api-reference.md#createopenreceive) ·
473
508
  [createHost](https://openreceive.org/guides/api-reference.md#createhost)
474
509
 
475
- Your app also needs an ordinary order-creation route that validates the cart,
476
- prices with exact decimal math, and returns the order id the page will pass as
477
- the `reference`. OpenReceive never prices from payer input.
510
+ Your app also needs an ordinary route that creates the order. It validates the
511
+ cart, computes the price with exact decimal math, and returns the order id.
512
+ The page passes that id as the `reference`. OpenReceive never takes a price
513
+ from payer input.
514
+
515
+ The `reference` is a string you choose, and it identifies what gets fulfilled.
516
+ Use your order id. Make it:
478
517
 
479
- The `reference` is a string you choose, and it is the fulfillment identity:
480
- your order id — one per thing you fulfill, created before checkout, kept
481
- across retries, never reused. OpenReceive never looks inside it, but `onPaid`
482
- commits fulfillment once per reference, a new checkout under a reference that already
483
- settled is refused with 409, and a fresh id per page load lets one order be
484
- paid twice.
518
+ - one per thing you fulfill,
519
+ - created before checkout,
520
+ - kept across retries,
521
+ - never reused.
522
+
523
+ OpenReceive never looks inside the `reference`, but it relies on it:
524
+
525
+ - `onPaid` commits fulfillment once per reference.
526
+ - A new checkout under a reference that already settled is refused with 409.
527
+ - A fresh id on every page load would let one order be paid twice.
485
528
 
486
529
  Naming boundary: TypeScript APIs use camelCase fields (`paymentHash`,
487
- `amountMsats`); everything on the wire — the mounted HTTP routes and the
488
- browser snapshots — is snake_case (`payment_hash`, `amount_msats`).
530
+ `amountMsats`). Everything on the wire is snake_case (`payment_hash`,
531
+ `amount_msats`). The wire means the mounted HTTP routes and the browser
532
+ snapshots.
489
533
 
490
534
  ### 5. Render checkout
491
535
 
@@ -496,46 +540,52 @@ import "@openreceive/react/styles.css";
496
540
  <Checkout reference={order.id} prefix="/openreceive" />;
497
541
  ```
498
542
 
499
- The checkout renders, polls, and settles itself. The compiled `styles.css`
500
- sheets (`@openreceive/react`, `@openreceive/elements`) are self-contained — a
501
- plain `<link rel="stylesheet">` works with no build step — and scoped: every
543
+ The checkout renders, polls, and settles itself.
544
+
545
+ `@openreceive/react` and `@openreceive/elements` each ship a compiled
546
+ `styles.css`. Each sheet is self-contained, so a plain
547
+ `<link rel="stylesheet">` works with no build step. Each is also scoped: every
502
548
  rule applies only inside what OpenReceive renders.
503
549
 
504
- Serve the compiled `styles.css` without Tailwind processing: import it from
505
- JavaScript (with a CSS-capable bundler) or use a plain `<link rel="stylesheet">`.
506
- Do not `@import` it into the host Tailwind entry. Its zero-specificity rules
507
- allow host styles to override checkout styles; scoping does not prevent that.
550
+ Serve the compiled `styles.css` without Tailwind processing. Import it from
551
+ JavaScript if your bundler handles CSS, or use a plain
552
+ `<link rel="stylesheet">`. Do not `@import` it into your app's Tailwind entry.
553
+ Its rules have zero specificity, so your page's styles can override checkout
554
+ styles. Scoping does not prevent that.
508
555
 
509
- `<Checkout>` is complete as rendered: it already shows the `description` from
556
+ `<Checkout>` is complete as rendered. It already shows the `description` from
510
557
  `amountFor` and the collapsed transaction-details panel. Do not build a custom
511
- UI to satisfy those rules — they only become your job if you replace the
512
- drop-in ([Checkout UX](https://openreceive.org/guides/checkout-ux.md)).
558
+ UI to show them. The display rules for them become your job only if you
559
+ replace the drop-in component ([Checkout UX](https://openreceive.org/guides/checkout-ux.md)).
513
560
 
514
- Match the host page's theme: by default the checkout follows the payer's
515
- stored choice, then the system scheme. If this page is always one theme, lock
516
- it — `<Checkout theme="dark" … />` (`theme` attribute on the custom element) —
517
- so a white card never lands on a dark page. The checkout is styled by CSS
518
- variables under `data-theme`; [Frontend checkout](https://openreceive.org/guides/frontend-checkout.md) has
519
- the knobs.
561
+ Match the host page's theme. By default the checkout follows the payer's
562
+ stored choice, then the system color scheme. If this page always uses one
563
+ theme, lock it with `<Checkout theme="dark" … />`. On the custom element, set
564
+ the `theme` attribute. Locking the theme keeps a white card off a dark page.
565
+ CSS variables under `data-theme` style the checkout.
566
+ [Frontend checkout](https://openreceive.org/guides/frontend-checkout.md) lists the settings you can change.
520
567
 
521
568
  Everything the checkout draws ships inside the JavaScript: the payment-method
522
- icons, the wallet logos and the pay tutorials. There is no image file to copy
523
- or serve and no asset option to set. Deploy your normal JavaScript and CSS
569
+ icons, the wallet logos, and the pay tutorials. There is no image file to copy
570
+ or serve, and no asset option to set. Deploy your normal JavaScript and CSS
524
571
  build output, including any generated JavaScript chunks. Bundlers with code
525
- splitting can defer tutorial screenshots until first open; single-file builds
526
- (including the standalone checkout) include them upfront. If your
527
- Content-Security-Policy has a strict `img-src`, allow `data:`
572
+ splitting can wait to load tutorial screenshots until a tutorial first opens.
573
+ Single-file builds, including the standalone checkout, include them from the
574
+ start. If your Content-Security-Policy has a strict `img-src`, allow `data:`
528
575
  ([Provider registry](https://openreceive.org/guides/provider-registry.md#assets)).
529
576
 
530
- That is the whole loop: your server owns the price and the order, the payer gets
531
- an invoice, and `onPaid` runs inside the settlement transaction. Rolled-back transactions may retry the callback; use a host outbox for external delivery.
577
+ That is the whole loop. Your server owns the price and the order. The payer
578
+ gets an invoice. `onPaid` runs inside the settlement transaction. If that
579
+ transaction rolls back, the callback may run again. For delivery to outside
580
+ systems, use an outbox in your app: record the message in the transaction and
581
+ send it after commit.
532
582
 
533
- A runnable illustration of this boundary — not a template to copy models from —
534
- is Buy a Button
583
+ Buy a Button is a runnable illustration of this boundary
535
584
  (`examples/buttons/server/fastify`).
536
- It has products, visitors, and orders, with the three hooks as the only bridge,
537
- and its host is the smallest correct Fastify integration of the packaged
538
- checkout. Map that shape onto the models in THIS app.
585
+ It is not a template to copy models from. It has products, visitors, and
586
+ orders, and the three hooks are the only bridge to OpenReceive. Its host is
587
+ the smallest correct Fastify integration of the packaged checkout. Map that
588
+ shape onto the models in THIS app.
539
589
 
540
590
  ### 6. Verify
541
591
 
@@ -543,16 +593,17 @@ checkout. Map that shape onto the models in THIS app.
543
593
  npx openreceive doctor
544
594
  ```
545
595
 
546
- `openreceive doctor` checks Node, `NWC_URI`, and swap-provider configuration,
547
- and probes the wallet relay to confirm the code is receive-only. Add
548
- `--db <file-or-url>` to confirm the migration ran, and
549
- `--url http://localhost:3000` to confirm the routes are mounted; every failing
596
+ `openreceive doctor` checks Node, `NWC_URI`, and the swap-provider
597
+ configuration. It also probes the wallet relay to confirm the code is
598
+ receive-only. Add `--db <file-or-url>` to confirm the migration ran. Add
599
+ `--url http://localhost:3000` to confirm the routes are mounted. Every failing
550
600
  line states its own fix.
551
601
  → [openreceive doctor](https://openreceive.org/guides/api-reference.md#openreceive-doctor)
552
602
 
553
- Then open the checkout in a browser, confirm the payment-method icons and
554
- wallet logos render, and open a wallet's pay tutorial to check its screenshots.
555
- If an image is missing, inspect the console for CSP violations and the Network
556
- panel for failed JavaScript chunks. Allow `data:` in `img-src` and deploy the
557
- complete build output. Do not add image routes, copy package source images, or
558
- use registry `icon_path` / tutorial `path` keys as browser URLs.
603
+ Then open the checkout in a browser. Confirm the payment-method icons and
604
+ wallet logos render. Open a wallet's pay tutorial to check its screenshots.
605
+ If an image is missing, look in the console for CSP violations and in the
606
+ Network panel for failed JavaScript chunks. To fix it, allow `data:` in
607
+ `img-src` and deploy the complete build output. Do not add image routes or
608
+ copy package source images. Do not use registry `icon_path` or tutorial
609
+ `path` keys as browser URLs.