@openreceive/browser 0.3.2 → 0.4.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 +18 -36
- package/dist/{chunk-D4S2GCC4.js → chunk-64ROVMMY.js} +60 -46
- package/dist/headless.d.ts +20 -15
- package/dist/headless.js +10 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/{status-BMYd00Xn.d.ts → status-CzIEJWjS.d.ts} +15 -5
- package/dist/styles.css +1 -1
- package/package.json +6 -4
- package/skills/debug-openreceive-payment/SKILL.md +89 -0
- package/skills/integrate-openreceive/SKILL.md +116 -0
- package/skills/integrate-openreceive/references/node.md +484 -0
- package/skills/integrate-openreceive/references/rails.md +577 -0
package/dist/headless.js
CHANGED
|
@@ -70,10 +70,13 @@ import {
|
|
|
70
70
|
formatUnixTime,
|
|
71
71
|
getExplorerNetwork,
|
|
72
72
|
getNetworkIcon,
|
|
73
|
+
getNetworkIconId,
|
|
73
74
|
getPaymentMethodIcon,
|
|
75
|
+
getPaymentMethodIconId,
|
|
74
76
|
getRouteIconPath,
|
|
75
77
|
getRouteNetworkLabel,
|
|
76
78
|
getSwapOptionIcon,
|
|
79
|
+
getSwapOptionIconId,
|
|
77
80
|
getSwapRefundFormError,
|
|
78
81
|
getWizardEmptyMessage,
|
|
79
82
|
isPaidCheckoutSnapshot,
|
|
@@ -96,6 +99,7 @@ import {
|
|
|
96
99
|
parseThemePreference,
|
|
97
100
|
paymentAccentId,
|
|
98
101
|
paymentIconPaths,
|
|
102
|
+
paymentIconSvgs,
|
|
99
103
|
paymentIconUrls,
|
|
100
104
|
paymentMethods,
|
|
101
105
|
postJson,
|
|
@@ -115,7 +119,7 @@ import {
|
|
|
115
119
|
swapOptionLimitSentence,
|
|
116
120
|
swapPickerKey,
|
|
117
121
|
updatePaymentWizardSelection
|
|
118
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-64ROVMMY.js";
|
|
119
123
|
|
|
120
124
|
// src/headless.ts
|
|
121
125
|
import { createAssetBaseUrlResolver, getPaymentWizardRoutes } from "@openreceive/provider-data";
|
|
@@ -328,7 +332,7 @@ function getNextThemePreference(theme, options = {}) {
|
|
|
328
332
|
return resolveTheme(theme, options) === "dark" ? "light" : "dark";
|
|
329
333
|
}
|
|
330
334
|
function getThemeToggleLabel(resolvedTheme) {
|
|
331
|
-
return
|
|
335
|
+
return `switch to ${resolvedTheme === "dark" ? "light" : "dark"} mode`;
|
|
332
336
|
}
|
|
333
337
|
function createThemeModel(theme, options = {}) {
|
|
334
338
|
const resolvedTheme = resolveTheme(theme, options);
|
|
@@ -688,11 +692,14 @@ export {
|
|
|
688
692
|
formatUnixTime,
|
|
689
693
|
getExplorerNetwork,
|
|
690
694
|
getNetworkIcon,
|
|
695
|
+
getNetworkIconId,
|
|
691
696
|
getPaymentMethodIcon,
|
|
697
|
+
getPaymentMethodIconId,
|
|
692
698
|
getPaymentWizardRoutes,
|
|
693
699
|
getRouteIconPath,
|
|
694
700
|
getRouteNetworkLabel,
|
|
695
701
|
getSwapOptionIcon,
|
|
702
|
+
getSwapOptionIconId,
|
|
696
703
|
getSwapRefundFormError,
|
|
697
704
|
getWizardEmptyMessage,
|
|
698
705
|
isReusableLightningInvoice,
|
|
@@ -713,6 +720,7 @@ export {
|
|
|
713
720
|
parseThemePreference,
|
|
714
721
|
paymentAccentId,
|
|
715
722
|
paymentIconPaths,
|
|
723
|
+
paymentIconSvgs,
|
|
716
724
|
paymentIconUrls,
|
|
717
725
|
paymentMethods,
|
|
718
726
|
postJson,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { aT as BrowserLogLevel } from './status-CzIEJWjS.js';
|
|
2
|
+
export { aU as BrowserLogEntry, X as BrowserLogger, B as BrowserLoggerOption, Y as BrowserRequestError, Z as CheckoutController, _ as CheckoutControllerOptions, h as CheckoutSnapshot, j as CheckoutState, aV as CopyInvoiceOptions, aW as GuestCheckoutResumeController, aX as GuestCheckoutResumeOptions, aY as OpenWalletOptions, aZ as PrepareCheckoutOptions, a_ as QrOptions, a$ as RequestCheckoutOptions, ao as Status, b0 as StatusInvoiceLike, U as UnixSeconds, at as copyInvoice, av as createCheckoutController, b1 as createGuestCheckoutResume, b2 as createGuestOrderFetcher, b3 as createLightningUri, b4 as createQrPngDataUrl, aA as createQrSvg, aG as deriveStatus, aH as enterCheckoutResumePath, aP as openWallet, aR as prepareCheckout, aS as requestCheckout } from './status-CzIEJWjS.js';
|
|
3
3
|
import '@openreceive/provider-data';
|
|
4
4
|
import '@openreceive/core';
|
|
5
5
|
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { PaymentWizardRoute, AssetIndexEntry } from '@openreceive/provider-data';
|
|
2
2
|
import { TransactionSettlementStatus } from '@openreceive/core';
|
|
3
3
|
|
|
4
|
+
declare const OPENRECEIVE_PAYMENT_ICON_IDS: readonly ["btc", "crypto", "eth", "lightning", "ltc", "sol", "trx", "usdc", "usdt", "xmr", "xrp"];
|
|
5
|
+
type PaymentIconId = (typeof OPENRECEIVE_PAYMENT_ICON_IDS)[number];
|
|
6
|
+
/** Each packaged payment icon as minified SVG markup, keyed by id. */
|
|
7
|
+
declare const paymentIconSvgs: Readonly<Record<PaymentIconId, string>>;
|
|
8
|
+
|
|
4
9
|
/**
|
|
5
10
|
* Trim insignificant trailing zeros from a decimal crypto amount for display,
|
|
6
11
|
* e.g. "12.25900000" -> "12.259" and "5.000" -> "5". Only fractional digits are
|
|
@@ -282,9 +287,11 @@ declare const OPENRECEIVE_CHECKOUT_ELEMENT_ATTRIBUTES: {
|
|
|
282
287
|
* Vue/Svelte/Angular wrappers can reach it (a function cannot cross an HTML
|
|
283
288
|
* attribute). Every packaged key is a relative path under one `assets/` root,
|
|
284
289
|
* so the value is joined to it directly: `asset-base-url="/openreceive-assets"`
|
|
285
|
-
* makes `assets/icons/
|
|
286
|
-
* `/openreceive-assets/assets/icons/
|
|
287
|
-
*
|
|
290
|
+
* makes `assets/provider-icons/strike.png` load from
|
|
291
|
+
* `/openreceive-assets/assets/provider-icons/strike.png`. Only the provider
|
|
292
|
+
* images need it; the payment-method icons are compiled in and drawn inline
|
|
293
|
+
* unless a base URL is set, in which case they are served as files too. A
|
|
294
|
+
* `resolveAssetUrl` passed to `defineElements` wins over it.
|
|
288
295
|
*/
|
|
289
296
|
readonly assetBaseUrl: "asset-base-url";
|
|
290
297
|
/** `polling="false"` renders the snapshot without status polling (no POST /payments/check). */
|
|
@@ -1013,8 +1020,11 @@ interface WizardRouteAssetDisplay {
|
|
|
1013
1020
|
readonly id: string;
|
|
1014
1021
|
readonly label: string;
|
|
1015
1022
|
readonly subtitle: string;
|
|
1023
|
+
/** The icon as a URL: the packaged `data:` URI, or the host resolver's answer. */
|
|
1016
1024
|
readonly icon: string;
|
|
1017
|
-
/** The
|
|
1025
|
+
/** The key behind `icon`, into `paymentIconSvgs` for a renderer drawing it inline. */
|
|
1026
|
+
readonly iconId: PaymentIconId;
|
|
1027
|
+
/** The packaged path behind `icon`, for a host serving the files itself. */
|
|
1018
1028
|
readonly iconPath: string;
|
|
1019
1029
|
readonly selected: boolean;
|
|
1020
1030
|
}
|
|
@@ -1281,4 +1291,4 @@ declare function deriveStatus(invoice: StatusInvoiceLike, options?: {
|
|
|
1281
1291
|
readonly now?: UnixSeconds;
|
|
1282
1292
|
}): Status;
|
|
1283
1293
|
|
|
1284
|
-
export { type
|
|
1294
|
+
export { type CheckoutPhase as $, type ThemeToggleElementAttributeOptions as A, type BrowserLoggerOption as B, type CheckoutInvoiceSnapshot as C, type ThemeToggleElementAttributes as D, type StoredThemeModelOptions as E, type ThemeModel as F, type ThemeModelOptions as G, type ReadThemePreferenceOptions as H, type ThemeControlTargets as I, type ThemeStorageOptions as J, type PaymentWizardControllerOptions as K, type PaymentWizardController as L, type PaymentWizardSelection as M, type PaymentWizardModel as N, type WizardRouteDisplay as O, type PaymentIconId as P, type PaymentWizardSelectionAction as Q, type ResolvedTheme as R, type SwapDisplayModel as S, type ThemePreference as T, type UnixSeconds as U, type BrowserLogContext as V, type WizardRouteAssetDisplay as W, type BrowserLogger as X, BrowserRequestError as Y, type CheckoutController as Z, type CheckoutControllerOptions as _, type ParseOpenReceiveOptionalIntegerOptions as a, type RequestCheckoutOptions as a$, type CheckoutStatusRefresh as a0, OPENRECEIVE_CHECKOUT_DATA_ATTRIBUTES as a1, OPENRECEIVE_CHECKOUT_DATA_SELECTORS as a2, OPENRECEIVE_CHECKOUT_ELEMENT_ATTRIBUTES as a3, OPENRECEIVE_CHECKOUT_ELEMENT_EVENTS as a4, OPENRECEIVE_CHECKOUT_ELEMENT_PARTS as a5, OPENRECEIVE_CHECKOUT_ELEMENT_PART_SELECTORS as a6, OPENRECEIVE_CHECKOUT_ELEMENT_SLOTS as a7, OPENRECEIVE_CHECKOUT_ELEMENT_TAG_NAME as a8, OPENRECEIVE_COPY_FEEDBACK_MS as a9, createQrSvg as aA, createQrSvgController as aB, createStatusFetcher as aC, createThemeChangeEvent as aD, currentCheckoutUrl as aE, deriveCheckoutStateLabels as aF, deriveStatus as aG, enterCheckoutResumePath as aH, escapeHtml as aI, formatAmountCaption as aJ, formatDepositAmount as aK, formatFiatAmount as aL, formatMsats as aM, formatSwapLimit as aN, formatUnixTime as aO, openWallet as aP, paymentIconSvgs as aQ, prepareCheckout as aR, requestCheckout as aS, type BrowserLogLevel as aT, type BrowserLogEntry as aU, type CopyInvoiceOptions as aV, type GuestCheckoutResumeController as aW, type GuestCheckoutResumeOptions as aX, type OpenWalletOptions as aY, type PrepareCheckoutOptions as aZ, type QrOptions as a_, OPENRECEIVE_DEFAULT_POLL_INTERVAL_MS as aa, OPENRECEIVE_DEFAULT_PREFIX as ab, OPENRECEIVE_PAYMENT_WIZARD_ATTRIBUTES as ac, OPENRECEIVE_PAYMENT_WIZARD_SELECTORS as ad, OPENRECEIVE_PROVIDER_PREVIEW_LIMIT as ae, OPENRECEIVE_THEME_STORAGE_KEY as af, OPENRECEIVE_THEME_TOGGLE_ELEMENT_ATTRIBUTES as ag, OPENRECEIVE_THEME_TOGGLE_ELEMENT_EVENTS as ah, OPENRECEIVE_THEME_TOGGLE_ELEMENT_PARTS as ai, OPENRECEIVE_THEME_TOGGLE_ELEMENT_PART_SELECTORS as aj, OPENRECEIVE_THEME_TOGGLE_ELEMENT_TAG_NAME as ak, type QrEncoder as al, type QrSvgController as am, type QrSvgControllerOptions as an, type Status as ao, type SwapCopyRow as ap, type SwapRefundStaging as aq, type WizardProviderDisplay as ar, assertDisplayInvoice as as, copyInvoice as at, createCheckoutActionEvent as au, createCheckoutController as av, createCheckoutErrorEvent as aw, createCheckoutProviderCopyEvent as ax, createCheckoutStateEvent as ay, createQrPayloadSvg as az, type PaymentMethod as b, type StatusInvoiceLike as b0, createGuestCheckoutResume as b1, createGuestOrderFetcher as b2, createLightningUri as b3, createQrPngDataUrl as b4, type PaymentMethodOption as c, type TickingValueOptions as d, type TickingValueController as e, type TransientFeedbackOptions as f, type TransientFeedbackController as g, type CheckoutSnapshot as h, type SwapDepositRisk as i, type CheckoutState as j, type TransactionDetailsInput as k, type TransactionDetailRow as l, type CreateCheckoutStateOptions as m, type CheckoutStatusModelInput as n, type CheckoutStatusModel as o, type CheckoutPaymentMethod as p, type ThemeAttributeTarget as q, type CheckoutElementAttributes as r, type CheckoutElementAttributeOptions as s, type CheckoutElementEventHandlers as t, type CheckoutElementListeners as u, type CreateCheckoutShellOptions as v, type CheckoutShellElements as w, type CheckoutShellOptions as x, type CheckoutShellModel as y, type CreateOpenReceiveThemeToggleElementOptions as z };
|