@openreceive/elements 0.4.14 → 0.4.16

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
@@ -59,3 +59,14 @@ allow `data:`. See
59
59
  [Images in `@openreceive/browser`](https://github.com/openreceive/openreceive/blob/master/packages/js/browser/README.md#images).
60
60
 
61
61
  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).
62
+
63
+ ## Agent skills
64
+
65
+ Run `npx openreceive skills install` from your application after installing an
66
+ OpenReceive server adapter. The offline copy ships in `@openreceive/node`, a
67
+ server-adapter dependency. For a frontend-only project, use
68
+ `npx skills add OpenReceive/openreceive`.
69
+ See [agent setup](https://openreceive.org/agents). The bundled installers write
70
+ to `.agents/skills/`; use `--dir .claude/skills` for Claude Code. They replace
71
+ only `integrate-openreceive` and `debug-openreceive-payment`, preserving
72
+ unrelated skills.
@@ -194,7 +194,7 @@ import {
194
194
  OPENRECEIVE_DEFAULT_PREFIX,
195
195
  prepareCheckout,
196
196
  requestCheckout,
197
- resumeSwapAttempt
197
+ resumeCheckoutAttempt
198
198
  } from "@openreceive/browser/headless";
199
199
  function createElementCheckoutSession(host) {
200
200
  let creating = false;
@@ -305,13 +305,14 @@ function createElementCheckoutSession(host) {
305
305
  });
306
306
  if (!action.isCurrent()) return;
307
307
  const resumeHash = host.resumePaymentHash();
308
- const checkout = resumeHash === void 0 ? prepared : await resumeSwapAttempt({
308
+ const checkout = resumeHash === void 0 ? prepared : await resumeCheckoutAttempt({
309
309
  signal: action.signal,
310
310
  fetch: globalThis.fetch,
311
311
  prefix,
312
312
  ...csrfHeader === void 0 ? {} : { csrfHeader },
313
313
  reference,
314
314
  paymentHash: resumeHash,
315
+ rail: host.resumePaymentRail(),
315
316
  snapshot: prepared
316
317
  });
317
318
  if (!action.isCurrent()) return;
@@ -320,6 +321,10 @@ function createElementCheckoutSession(host) {
320
321
  host.swapSelection.setDismissedInvoiceId(null);
321
322
  }
322
323
  host.handleControllerSnapshot(checkout);
324
+ if (resumeHash !== void 0 && host.resumePaymentRail() === "lightning") {
325
+ host.focusLightning();
326
+ await session.ensureLightning();
327
+ }
323
328
  applyOwnAttributes(
324
329
  createCheckoutElementAttributes(checkout, {
325
330
  prefix,
@@ -1695,6 +1700,13 @@ function defineElements(options = {}) {
1695
1700
  this.syncResumePath(reference);
1696
1701
  },
1697
1702
  resumePaymentHash: () => this.resumePaymentHash(),
1703
+ resumePaymentRail: () => this.getAttribute("resume-payment-rail") === "lightning" ? "lightning" : "swap",
1704
+ focusLightning: () => {
1705
+ this.selection = updatePaymentWizardSelection(this.selection, {
1706
+ type: "select_method",
1707
+ method: "bitcoin"
1708
+ });
1709
+ },
1698
1710
  resolvePollPrefix: (reference) => this.resolvePollPrefix(reference),
1699
1711
  dispatchError: (error) => {
1700
1712
  this.dispatchError(error);
@@ -1723,6 +1735,7 @@ function defineElements(options = {}) {
1723
1735
  OPENRECEIVE_CHECKOUT_ELEMENT_ATTRIBUTES3.resumePathPrefix,
1724
1736
  OPENRECEIVE_CHECKOUT_ELEMENT_ATTRIBUTES3.routeReference,
1725
1737
  OPENRECEIVE_CHECKOUT_ELEMENT_ATTRIBUTES3.resumePaymentHash,
1738
+ OPENRECEIVE_CHECKOUT_ELEMENT_ATTRIBUTES3.resumePaymentRail,
1726
1739
  OPENRECEIVE_CHECKOUT_ELEMENT_ATTRIBUTES3.resumable,
1727
1740
  OPENRECEIVE_CHECKOUT_ELEMENT_ATTRIBUTES3.polling,
1728
1741
  OPENRECEIVE_CHECKOUT_ELEMENT_ATTRIBUTES3.pollIntervalMs,
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  renderCheckoutHtml,
13
13
  renderThemeToggleHtml,
14
14
  renderTransactionDetailsHtml
15
- } from "./chunk-DQ6FMWVX.js";
15
+ } from "./chunk-HCRHC4CJ.js";
16
16
  export {
17
17
  OPENRECEIVE_CHECKOUT_ELEMENT_ATTRIBUTES,
18
18
  OPENRECEIVE_CHECKOUT_ELEMENT_EVENTS,
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "package": "@openreceive/elements",
3
- "version": "0.4.14",
3
+ "version": "0.4.16",
4
4
  "files": {
5
5
  "openreceive-checkout.css": {
6
6
  "bytes": 225527,
7
7
  "sha256": "41b81cddbf0732c08e408ddc011649839289d19f279015842cec06736636bfbb"
8
8
  },
9
9
  "openreceive-checkout.js": {
10
- "bytes": 738519,
11
- "sha256": "4504bcddb1282ceeee950a83983df92dedefcf295a5dcc2cb966e6bdd4c2697c"
10
+ "bytes": 739598,
11
+ "sha256": "356d0d3c60c4bed9d753976a899288fbd4541183aea1dc19a53a331a47e5bd7b"
12
12
  },
13
13
  "openreceive-checkout.js.map": {
14
- "bytes": 1233852,
15
- "sha256": "794088b38e66f79b0c6aa28eedbc0707e976f9cf8f0f2d3e9d3afb6d17372269"
14
+ "bytes": 1236471,
15
+ "sha256": "cf6398278ee4bd47f82e4419276508db29fca9c49f7c8cc71c9ae8e566a83868"
16
16
  }
17
17
  },
18
18
  "source": "https://github.com/openreceive/openreceive",