@openreceive/browser 0.1.1 → 0.2.2
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 +63 -0
- package/dist/chunk-WLLNZH26.js +3051 -0
- package/dist/headless.d.ts +804 -0
- package/dist/headless.js +891 -0
- package/dist/index.d.ts +32 -4
- package/dist/index.js +32 -2
- package/dist/status-B1vDOhvh.d.ts +1001 -0
- package/dist/styles.css +3 -759
- package/package.json +57 -15
- package/dist/assets/icons/bank.svg +0 -12
- package/dist/assets/icons/bnb.svg +0 -1
- package/dist/assets/icons/card.svg +0 -14
- package/dist/assets/icons/doge.svg +0 -1
- package/dist/assets/pay_tutorials/boltz-1.webp +0 -0
- package/dist/assets/pay_tutorials/boltz-2.webp +0 -0
- package/dist/assets/pay_tutorials/cashapp-1.webp +0 -0
- package/dist/assets/pay_tutorials/cashapp-2.webp +0 -0
- package/dist/assets/pay_tutorials/cashapp-3.webp +0 -0
- package/dist/assets/pay_tutorials/cashapp-4.webp +0 -0
- package/dist/assets/pay_tutorials/cashapp-5.webp +0 -0
- package/dist/assets/pay_tutorials/cashapp-6.webp +0 -0
- package/dist/assets/pay_tutorials/coinbase-1.webp +0 -0
- package/dist/assets/pay_tutorials/coinbase-2.webp +0 -0
- package/dist/assets/pay_tutorials/fixedfloat-1.webp +0 -0
- package/dist/assets/pay_tutorials/fixedfloat-2.webp +0 -0
- package/dist/assets/pay_tutorials/kraken-1.webp +0 -0
- package/dist/assets/pay_tutorials/kraken-2.webp +0 -0
- package/dist/assets/pay_tutorials/kraken-3.webp +0 -0
- package/dist/assets/pay_tutorials/kraken-4.webp +0 -0
- package/dist/assets/pay_tutorials/strike-1.webp +0 -0
- package/dist/assets/pay_tutorials/strike-2.webp +0 -0
- package/dist/assets/pay_tutorials/strike-3.webp +0 -0
- package/dist/assets/pay_tutorials/strike-4.webp +0 -0
- package/dist/assets/provider-icons/aqua.png +0 -0
- package/dist/assets/provider-icons/belo.png +0 -0
- package/dist/assets/provider-icons/binance.png +0 -0
- package/dist/assets/provider-icons/bipa.png +0 -0
- package/dist/assets/provider-icons/bitfinex.png +0 -0
- package/dist/assets/provider-icons/bitget.png +0 -0
- package/dist/assets/provider-icons/bitnob.png +0 -0
- package/dist/assets/provider-icons/bitso.png +0 -0
- package/dist/assets/provider-icons/bity.png +0 -0
- package/dist/assets/provider-icons/blink.png +0 -0
- package/dist/assets/provider-icons/bluewallet.png +0 -0
- package/dist/assets/provider-icons/boltz.png +0 -0
- package/dist/assets/provider-icons/bringin.png +0 -0
- package/dist/assets/provider-icons/bullbitcoin.png +0 -0
- package/dist/assets/provider-icons/cakewallet.png +0 -0
- package/dist/assets/provider-icons/cashapp.png +0 -0
- package/dist/assets/provider-icons/changenow.png +0 -0
- package/dist/assets/provider-icons/chivo.png +0 -0
- package/dist/assets/provider-icons/coinbase.png +0 -0
- package/dist/assets/provider-icons/coincorner.png +0 -0
- package/dist/assets/provider-icons/fixedfloat.png +0 -0
- package/dist/assets/provider-icons/getalby.png +0 -0
- package/dist/assets/provider-icons/kraken.png +0 -0
- package/dist/assets/provider-icons/kryptex.png +0 -0
- package/dist/assets/provider-icons/kucoin.png +0 -0
- package/dist/assets/provider-icons/manifest.json +0 -207
- package/dist/assets/provider-icons/mtpelerin.png +0 -0
- package/dist/assets/provider-icons/muun.png +0 -0
- package/dist/assets/provider-icons/okcoin.png +0 -0
- package/dist/assets/provider-icons/okx.png +0 -0
- package/dist/assets/provider-icons/phoenix.png +0 -0
- package/dist/assets/provider-icons/pouch.png +0 -0
- package/dist/assets/provider-icons/ripio.png +0 -0
- package/dist/assets/provider-icons/river.png +0 -0
- package/dist/assets/provider-icons/rizful.png +0 -0
- package/dist/assets/provider-icons/shakepay.png +0 -0
- package/dist/assets/provider-icons/sideshift.png +0 -0
- package/dist/assets/provider-icons/simpleswap.png +0 -0
- package/dist/assets/provider-icons/speed.png +0 -0
- package/dist/assets/provider-icons/strike.png +0 -0
- package/dist/assets/provider-icons/trocador.png +0 -0
- package/dist/assets/provider-icons/walletofsatoshi.png +0 -0
- package/dist/assets/provider-icons/zeus.png +0 -0
- package/dist/country-map.d.ts +0 -5
- package/dist/country-map.js +0 -17
- package/dist/internal.d.ts +0 -834
- package/dist/internal.js +0 -2615
- package/dist/pay-tutorials.d.ts +0 -1
- package/dist/pay-tutorials.js +0 -1
- package/dist/provider-icons.d.ts +0 -1
- package/dist/provider-icons.js +0 -1
- package/dist/qrcode.d.ts +0 -11
- package/dist/status.d.ts +0 -9
- package/dist/status.js +0 -25
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# @openreceive/browser
|
|
2
|
+
|
|
3
|
+
Framework-free browser helpers for OpenReceive checkout: prepare/create calls, status polling, QR and wallet helpers.
|
|
4
|
+
|
|
5
|
+
Part of [OpenReceive](https://openreceive.org). Start with the [Node quickstart](https://github.com/openreceive/openreceive/blob/master/docs/guides/quickstart-node.md); the full API is in the [API reference](https://github.com/openreceive/openreceive/blob/master/docs/guides/api-reference.md).
|
|
6
|
+
|
|
7
|
+
## Two ways to integrate
|
|
8
|
+
|
|
9
|
+
- **Drop-in**: use `@openreceive/react` (`<Checkout>`) or `@openreceive/elements`
|
|
10
|
+
(custom elements) for a complete checkout UI; this package's main entry adds
|
|
11
|
+
the small helpers around them (prepare/create calls, `status`, QR, wallet,
|
|
12
|
+
copy).
|
|
13
|
+
- **Headless**: build your own UI on the engine via
|
|
14
|
+
`@openreceive/browser/headless` — a curated, semver-guaranteed surface
|
|
15
|
+
(state machine, wizard/status/swap models, formatters, labels, styling
|
|
16
|
+
tokens). See the
|
|
17
|
+
[Headless checkout guide](https://github.com/openreceive/openreceive/blob/master/docs/guides/headless-checkout.md);
|
|
18
|
+
the hello-fruit rails example is the flagship demo of this style.
|
|
19
|
+
|
|
20
|
+
There is no private subpath: `./headless` is both the integration surface and
|
|
21
|
+
the floor under `@openreceive/elements`, `@openreceive/react`, and the
|
|
22
|
+
vue/svelte/angular wrappers. It is curated symbol-by-symbol rather than a
|
|
23
|
+
re-export of the package, so a name that is not on it is package-private and
|
|
24
|
+
will move without notice.
|
|
25
|
+
|
|
26
|
+
## Icon assets
|
|
27
|
+
|
|
28
|
+
The checkout UI (used directly or via `@openreceive/react` /
|
|
29
|
+
`@openreceive/elements`) loads its payment-method icons from
|
|
30
|
+
`dist/assets/icons/*.svg` **by URL at runtime** — the SVGs are not inlined into
|
|
31
|
+
the JS. Each URL is resolved with `new URL()` against the module's own
|
|
32
|
+
`import.meta.url`:
|
|
33
|
+
|
|
34
|
+
- module emitted as `…/assets/<chunk>.js` (typical Vite/Rollup output) →
|
|
35
|
+
icons resolve to a sibling `…/assets/icons/*.svg`;
|
|
36
|
+
- any other module URL → `./assets/icons/*.svg` next to the module file.
|
|
37
|
+
|
|
38
|
+
Bundlers do not follow these dynamic URLs, so your app must serve the icon
|
|
39
|
+
files where the resolution lands. Per setup:
|
|
40
|
+
|
|
41
|
+
- **Plain `<script type="module">` / import map**: serve the package's `dist/`
|
|
42
|
+
directory as-is (e.g. `/vendor/openreceive/dist/index.js`). The icons already
|
|
43
|
+
sit at `dist/assets/icons/`, so nothing to copy.
|
|
44
|
+
- **Vite / Rollup**: chunks are emitted under `assets/`, so serve the icons at
|
|
45
|
+
`assets/icons/` in the same output — either copy
|
|
46
|
+
`node_modules/@openreceive/browser/dist/assets/icons` into
|
|
47
|
+
`public/assets/icons/`, or copy it into the build output from a small
|
|
48
|
+
`writeBundle` plugin (the repo demos use
|
|
49
|
+
`examples/hello-fruit/shared/copy-openreceive-payment-icons-plugin.ts`).
|
|
50
|
+
- **webpack / Next.js**: copy the icons next to your emitted bundles with
|
|
51
|
+
`copy-webpack-plugin` (the repo's Rails Shakapacker demo copies
|
|
52
|
+
`node_modules/@openreceive/browser/dist/assets/icons` to
|
|
53
|
+
`<packs output>/js/assets/icons`). Note webpack can compile `import.meta.url`
|
|
54
|
+
to a build-machine `file://` URL; always confirm the URLs the page actually
|
|
55
|
+
requests (see below) and place — or serve — the icons at that path.
|
|
56
|
+
|
|
57
|
+
To verify a setup, check the DevTools network panel for `…/icons/*.svg`
|
|
58
|
+
requests, or log `paymentIconUrls` (exported from
|
|
59
|
+
`@openreceive/browser/headless`) to see every resolved URL.
|
|
60
|
+
|
|
61
|
+
`@openreceive/provider-data` follows the same contract for its runtime images
|
|
62
|
+
(`dist/assets/provider-icons`, `dist/assets/pay_tutorials`); the copy recipes
|
|
63
|
+
above handle those directories the same way.
|