@openreceive/react 0.2.4 → 0.3.1
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/dist/index.d.ts +29 -18
- package/dist/index.js +231 -169
- package/dist/styles.css +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { CheckoutComponentProps, CheckoutState, QrEncoder, BrowserLoggerOption, CheckoutStatusRefresh, Status, CheckoutSnapshot, AssetUrlResolver, BrowserLogContext, CheckoutInvoiceSnapshot, ThemePreference, ResolvedTheme, ThemeModel,
|
|
2
|
+
import { CheckoutComponentProps, CheckoutState, QrEncoder, BrowserLoggerOption, CheckoutStatusRefresh, Status, SwapRefundStaging, CheckoutSnapshot, AssetUrlResolver, BrowserLogContext, CheckoutInvoiceSnapshot, ThemePreference, ResolvedTheme, ThemeModel, CheckoutPhase, CheckoutStatusModel, UnixSeconds, BrowserLogger, TransactionDetailsSource } from '@openreceive/browser/headless';
|
|
3
3
|
export { TransactionDetailsSource, resolveTransactionDetailRows } from '@openreceive/browser/headless';
|
|
4
4
|
|
|
5
5
|
interface CheckoutData {
|
|
@@ -49,7 +49,7 @@ interface UseCheckoutOptions extends CheckoutData, Omit<CheckoutEventHandlers, "
|
|
|
49
49
|
readonly polling?: boolean;
|
|
50
50
|
readonly pollIntervalMs?: number;
|
|
51
51
|
}
|
|
52
|
-
interface UseCheckoutResult extends CheckoutViewModel {
|
|
52
|
+
interface UseCheckoutResult extends CheckoutViewModel, SwapRefundStaging {
|
|
53
53
|
readonly checkout: CheckoutSnapshot;
|
|
54
54
|
readonly copied: boolean;
|
|
55
55
|
readonly countdownLabel?: string;
|
|
@@ -115,7 +115,9 @@ interface CheckoutClassNames extends InvoiceSummaryClassNames {
|
|
|
115
115
|
readonly satsDetail?: string;
|
|
116
116
|
readonly lightningPane?: string;
|
|
117
117
|
readonly invoiceTitle?: string;
|
|
118
|
-
/** Applied to the
|
|
118
|
+
/** Applied to the host-supplied order description above the amount. */
|
|
119
|
+
readonly orderDescription?: string;
|
|
120
|
+
/** Applied to the settled transaction-details disclosure. */
|
|
119
121
|
readonly details?: string;
|
|
120
122
|
readonly waiting?: string;
|
|
121
123
|
readonly countdown?: string;
|
|
@@ -229,6 +231,27 @@ interface PaymentWizardProps {
|
|
|
229
231
|
* links. See docs/guides/provider-registry.md.
|
|
230
232
|
*/
|
|
231
233
|
readonly resolveAssetUrl?: AssetUrlResolver;
|
|
234
|
+
/**
|
|
235
|
+
* The string form of the same seam: where this host serves the packages'
|
|
236
|
+
* `dist/assets` trees. `resolveAssetUrl` wins when both are set.
|
|
237
|
+
*/
|
|
238
|
+
readonly assetBaseUrl?: string;
|
|
239
|
+
/**
|
|
240
|
+
* The two-step refund, from whoever owns the checkout controller —
|
|
241
|
+
* `<Checkout>` passes its `useCheckout` model. Given one, the wizard stages
|
|
242
|
+
* and confirms through it, so the address the payer is reviewing survives
|
|
243
|
+
* every poll. Standalone (a host driving its own snapshot), the wizard falls
|
|
244
|
+
* back to posting the refund itself and carrying the staging locally.
|
|
245
|
+
*/
|
|
246
|
+
readonly swapRefund?: SwapRefundStaging;
|
|
247
|
+
/**
|
|
248
|
+
* Whether this checkout has a URL the payer can come BACK to — `<Checkout
|
|
249
|
+
* syncUrl>`, or a host route of its own that carries the order. It decides
|
|
250
|
+
* which of the two refund-return warnings the deposit panel shows; see
|
|
251
|
+
* `SwapDisplayModel.refundReturnLabel`. Defaults to false, so a payer is
|
|
252
|
+
* never told to bookmark a page that will not bring them back.
|
|
253
|
+
*/
|
|
254
|
+
readonly resumable?: boolean;
|
|
232
255
|
readonly onError?: (error: unknown) => void;
|
|
233
256
|
/**
|
|
234
257
|
* Called when the payer enters or leaves the focused swap flow (a pay-in coin is
|
|
@@ -283,20 +306,6 @@ declare function QRCode(props: QRCodeProps): React.ReactElement;
|
|
|
283
306
|
declare function CopyInvoiceButton(props: CopyInvoiceButtonProps): React.ReactElement;
|
|
284
307
|
declare function OpenWalletButton(props: OpenWalletButtonProps): React.ReactElement;
|
|
285
308
|
declare function PaymentState(props: PaymentStateProps): React.ReactElement;
|
|
286
|
-
/**
|
|
287
|
-
* Collapsible "everything the client knows about this payment" panel.
|
|
288
|
-
*
|
|
289
|
-
* @deprecated Superseded by `<TransactionDetails>`, which the shipped checkout
|
|
290
|
-
* now renders on settlement. This one has no copy button, no explorer link and
|
|
291
|
-
* no truncation contract, and its rows are a strict subset — so the payer's
|
|
292
|
-
* most keep-worthy screen had the least usable copy of the values it shows.
|
|
293
|
-
* Kept exported so an integrator who mounted it directly is not broken; new
|
|
294
|
-
* code should use `<TransactionDetails>`.
|
|
295
|
-
*/
|
|
296
|
-
declare function PaymentData(props: {
|
|
297
|
-
readonly source: PaymentDataSource;
|
|
298
|
-
readonly className?: string;
|
|
299
|
-
}): React.ReactElement | null;
|
|
300
309
|
declare function WaitingState(props: {
|
|
301
310
|
readonly waiting?: boolean;
|
|
302
311
|
readonly phase?: CheckoutPhase;
|
|
@@ -321,6 +330,8 @@ declare function renderSwapDepositPanel(options: {
|
|
|
321
330
|
readonly onError?: (error: unknown) => void;
|
|
322
331
|
readonly onRefund: (attemptId: string, refundAddress: string, confirm: boolean) => Promise<void>;
|
|
323
332
|
readonly onBackToLightning: () => void;
|
|
333
|
+
/** Does this checkout have a URL to return to? See `refundReturnLabel`. */
|
|
334
|
+
readonly resumable?: boolean;
|
|
324
335
|
}): React.ReactElement | null;
|
|
325
336
|
|
|
326
337
|
declare function useTheme(options?: UseThemeOptions): UseThemeResult;
|
|
@@ -358,4 +369,4 @@ declare function createCheckoutViewModel(data: CheckoutData): CheckoutViewModel;
|
|
|
358
369
|
|
|
359
370
|
declare function PaymentWizard(props: PaymentWizardProps): React.ReactElement;
|
|
360
371
|
|
|
361
|
-
export { type ButtonComponent, Checkout, type CheckoutChildren, type CheckoutClassNames, type CheckoutComponents, type CheckoutData, type CheckoutProps, CheckoutProvider, type CheckoutProviderProps, type CheckoutViewModel, CopyInvoiceButton, type CopyInvoiceButtonProps, InvoiceSummary, type InvoiceSummaryClassNames, type InvoiceSummaryProps, OpenWalletButton, type OpenWalletButtonProps,
|
|
372
|
+
export { type ButtonComponent, Checkout, type CheckoutChildren, type CheckoutClassNames, type CheckoutComponents, type CheckoutData, type CheckoutProps, CheckoutProvider, type CheckoutProviderProps, type CheckoutViewModel, CopyInvoiceButton, type CopyInvoiceButtonProps, InvoiceSummary, type InvoiceSummaryClassNames, type InvoiceSummaryProps, OpenWalletButton, type OpenWalletButtonProps, PaymentState, type PaymentStateProps, PaymentWizard, type PaymentWizardProps, QRCode, type QRCodeProps, SatsDetail, type SatsDetailProps, ThemeScope, type ThemeScopeChildren, type ThemeScopeProps, ThemeToggle, type ThemeToggleProps, TransactionDetails, type TransactionDetailsProps, type UseCheckoutOptions, type UseCheckoutResult, type UseThemeOptions, type UseThemeResult, WaitingState, createCheckoutViewModel, renderSwapDepositPanel, useCheckout, useCheckoutContext, useTheme };
|