@tuwaio/nova-payments 0.1.0 → 0.3.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 +4 -4
- package/dist/chunk-4HBN6N7D.cjs +1 -0
- package/dist/chunk-A2WIFZQB.js +1 -0
- package/dist/de-5UOOKHHH.cjs +1 -0
- package/dist/de-U3SERR3Y.js +1 -0
- package/dist/es-J6MJIGEI.js +1 -0
- package/dist/es-WSJ36B6Y.cjs +1 -0
- package/dist/evm/index.cjs +1 -1
- package/dist/evm/index.d.cts +6 -3
- package/dist/evm/index.d.ts +6 -3
- package/dist/evm/index.js +1 -1
- package/dist/i18n/index.cjs +1 -1
- package/dist/i18n/index.d.cts +2 -2
- package/dist/i18n/index.d.ts +2 -2
- package/dist/i18n/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.css +0 -3
- package/dist/index.d.cts +38 -140
- package/dist/index.d.ts +38 -140
- package/dist/index.js +2 -2
- package/dist/it-KX7WWME3.js +1 -0
- package/dist/it-QORQLELA.cjs +1 -0
- package/dist/{locales-DP2jStIs.d.cts → locales-dTcrLl9B.d.cts} +3 -92
- package/dist/{locales-DP2jStIs.d.ts → locales-dTcrLl9B.d.ts} +3 -92
- package/dist/{types-Bp6JUt56.d.cts → types-DOxwRLyU.d.cts} +18 -49
- package/dist/{types-Bp6JUt56.d.ts → types-DOxwRLyU.d.ts} +18 -49
- package/dist/uk-GMKBC44N.js +1 -0
- package/dist/uk-R2A3XIGT.cjs +1 -0
- package/dist/zhCN-5JP4MWXH.cjs +1 -0
- package/dist/zhCN-AX2E4I6A.js +1 -0
- package/package.json +2 -2
- package/dist/chunk-EMYW4LI7.js +0 -1
- package/dist/chunk-HRTXVGBJ.cjs +0 -1
- package/dist/de-DXFDX3GR.js +0 -1
- package/dist/de-TJ6BGSUG.cjs +0 -1
- package/dist/es-DCARFZ3R.js +0 -1
- package/dist/es-I4V64VEP.cjs +0 -1
- package/dist/it-N36S2FXH.js +0 -1
- package/dist/it-RQJGHQPP.cjs +0 -1
- package/dist/uk-FFP4RBO4.js +0 -1
- package/dist/uk-HYM26VN5.cjs +0 -1
- package/dist/zhCN-EKUFCQTZ.js +0 -1
- package/dist/zhCN-Q5DO4HXO.cjs +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { P as PaymentsAdapter, a as PaymentFamily, C as CheckoutWallet, N as NativeFee } from './types-
|
|
2
|
-
export { b as PulsarTransactionParams, c as canPayWithQr, d as connectedWallet, f as familyOf, i as isWalletIconUrl, m as methodFamily, e as methodToken, n as networkName, p as payerFor, g as priceAdjustment, w as walletLabel } from './types-
|
|
1
|
+
import { P as PaymentsAdapter, a as PaymentFamily, C as CheckoutWallet, N as NativeFee } from './types-DOxwRLyU.js';
|
|
2
|
+
export { b as PulsarTransactionParams, c as canPayWithQr, d as connectedWallet, f as familyOf, i as isWalletIconUrl, m as methodFamily, e as methodToken, n as networkName, p as payerFor, g as priceAdjustment, w as walletLabel } from './types-DOxwRLyU.js';
|
|
3
3
|
import * as react from 'react';
|
|
4
4
|
import { ReactNode, ComponentType, ButtonHTMLAttributes, Context } from 'react';
|
|
5
|
-
import { CheckoutMethod, CheckoutView, CheckoutPhase, CheckoutQuote, CheckoutError, CheckoutState, PaymentInstructions, CheckoutApi, EventSourceConstructor, CheckoutStore, RefundPhase, RefundState, RefundStore, PayerProofMessage,
|
|
5
|
+
import { CheckoutMethod, CheckoutView, CheckoutPhase, CheckoutQuote, CheckoutError, CheckoutState, PaymentInstructions, CheckoutApi, EventSourceConstructor, CheckoutStore, RefundPhase, RefundState, RefundStore, PayerProofMessage, CheckoutMerchant } from '@tuwaio/quasar-sdk/checkout';
|
|
6
6
|
import { NovaPaymentsLabels, CheckoutLocale, NovaPaymentsLabelOverrides } from './i18n/index.js';
|
|
7
7
|
import { Transaction } from '@tuwaio/pulsar-core';
|
|
8
8
|
import { StatusTone, StatusEdgeProps } from '@tuwaio/nova-core';
|
|
@@ -12,26 +12,6 @@ import { NovaConnectProviderPropsWithCustomization } from '@tuwaio/nova-connect'
|
|
|
12
12
|
import { SatelliteConnectProviderProps } from '@tuwaio/satellite-react';
|
|
13
13
|
export { shortAddress } from '@tuwaio/orbit-core';
|
|
14
14
|
|
|
15
|
-
/**
|
|
16
|
-
* The automatic payments offer of a subscription, after a paid period: the limit the seller may take each period, the
|
|
17
|
-
* period, the paying wallet and the seller's wallet the charges are paid to, until when, that Quasar sends each charge
|
|
18
|
-
* for the seller, and how to turn it off. "Allow" takes the wallet through what it needs: to the network of the
|
|
19
|
-
* permission, from a plain account to its smart account (see `smartAccountStatus`: the offer says so first, and MetaMask
|
|
20
|
-
* asks only then), then the ERC-7715 permission, which Quasar takes (the paid outcome then says automatic payments are
|
|
21
|
-
* on); "Not now" keeps paying each invoice. Without a wallet the main button connects one.
|
|
22
|
-
*
|
|
23
|
-
* Each press is a try with a number: Cancel closes the window, and an answer the wallet gives later changes nothing on
|
|
24
|
-
* the page, except that a permission it grants still reaches Quasar. A request still open in the wallet is not asked
|
|
25
|
-
* again, so the buyer never approves two; what the wallet already granted is not asked again after a refusal of the free
|
|
26
|
-
* confirmation.
|
|
27
|
-
*
|
|
28
|
-
* Side effects: wallet prompts and, for a plain account, a transaction whose fee the buyer pays; `POST permission` of
|
|
29
|
-
* the checkout; network and wallet reads for the kind of account.
|
|
30
|
-
*
|
|
31
|
-
* @returns The automatic payments step.
|
|
32
|
-
*/
|
|
33
|
-
declare function AutoPayScreen(): react.JSX.Element | null;
|
|
34
|
-
|
|
35
15
|
/**
|
|
36
16
|
* The buyer details step, shown when the merchant's settings ask for the buyer and the invoice was issued without
|
|
37
17
|
* them: the email, then a company invoice on request (a card under the email), then the details — the name, the
|
|
@@ -49,19 +29,15 @@ declare function BuyerScreen(): react.JSX.Element | null;
|
|
|
49
29
|
|
|
50
30
|
/**
|
|
51
31
|
* A screen of the checkout: the steps of a payment (`buyer`, `method`, `confirmWallet` — the paying wallet confirms the
|
|
52
|
-
* invoice with a free signature before the price —, `pay` or `qr`, `confirm
|
|
32
|
+
* invoice with a free signature before the price —, `pay` or `qr`, `confirm`), a payment Quasar could not
|
|
53
33
|
* confirm (`unconfirmed`: it may still arrive, so the buyer checks the wallet before paying again), a payment that
|
|
54
34
|
* failed for good while the invoice still takes one (`failed`: the buyer may pay again) or its outcome.
|
|
55
35
|
*/
|
|
56
|
-
type CheckoutScreen = 'loading' | 'error' | 'buyer' | 'method' | 'confirmWallet' | 'pay' | 'qr' | 'confirm' | 'unconfirmed' | 'failed' | 'paid' | '
|
|
36
|
+
type CheckoutScreen = 'loading' | 'error' | 'buyer' | 'method' | 'confirmWallet' | 'pay' | 'qr' | 'confirm' | 'unconfirmed' | 'failed' | 'paid' | 'underpaid' | 'held' | 'refunded' | 'expired' | 'cancelled' | 'replaced' | 'blocked';
|
|
57
37
|
/** Choices of the buyer that the checkout store does not hold. */
|
|
58
38
|
interface CheckoutScreenChoices {
|
|
59
39
|
/** Pay from a wallet in this browser (default) or scan a QR code with a phone. */
|
|
60
40
|
payWith?: 'wallet' | 'qr';
|
|
61
|
-
/** The buyer opened the automatic payments offer after paying the first period of a subscription. */
|
|
62
|
-
autoPay?: boolean;
|
|
63
|
-
/** The buyer opened the screen that turns automatic payments off, while they are on. */
|
|
64
|
-
autoPayOff?: boolean;
|
|
65
41
|
/**
|
|
66
42
|
* The buyer continues on a phone: with `payWith` `qr`, the QR code of the payment page shows before any price is
|
|
67
43
|
* locked (an EVM method, paid from the phone's wallet on that page).
|
|
@@ -84,14 +60,6 @@ interface CheckoutScreenChoices {
|
|
|
84
60
|
*/
|
|
85
61
|
afterFailure?: boolean;
|
|
86
62
|
}
|
|
87
|
-
/**
|
|
88
|
-
* Whether the permission screen can open from this phase: another wallet takes over a permission from the steps before a
|
|
89
|
-
* payment, not from an outcome that keeps its own screen.
|
|
90
|
-
*
|
|
91
|
-
* @param phase - The phase of the checkout store.
|
|
92
|
-
* @returns Whether "Use this wallet" leads somewhere.
|
|
93
|
-
*/
|
|
94
|
-
declare const takeOverOpens: (phase: string | undefined) => boolean;
|
|
95
63
|
/**
|
|
96
64
|
* The screen for the state of a checkout store.
|
|
97
65
|
*
|
|
@@ -109,7 +77,7 @@ declare const takeOverOpens: (phase: string | undefined) => boolean;
|
|
|
109
77
|
* confirm the invoice or confirms it, and after it until the price is locked (unless it was refused), also on an
|
|
110
78
|
* underpaid invoice whose rest another wallet pays, `qr` instead of `pay` when the buyer pays
|
|
111
79
|
* with a QR code (or the price was locked without a payer), `replaced` for an invoice the seller
|
|
112
|
-
* corrected, `
|
|
80
|
+
* corrected, `loading` until
|
|
113
81
|
* the labels of the invoice's language are loaded, `unconfirmed` in the phase of that name of a current
|
|
114
82
|
* `@tuwaio/quasar-sdk` (Quasar could not confirm the payment, which may still arrive). While the store hands a transaction
|
|
115
83
|
* over again (`submit_retrying`) it is `confirm`: only Quasar is out of reach, and the payment goes on.
|
|
@@ -123,8 +91,8 @@ declare function checkoutScreen(state: {
|
|
|
123
91
|
}, choices?: CheckoutScreenChoices): CheckoutScreen;
|
|
124
92
|
/** A step of the stepper in the checkout header. */
|
|
125
93
|
interface CheckoutStep {
|
|
126
|
-
/** `details` (buyer details), `method`, `pay`, `confirm
|
|
127
|
-
key: 'details' | 'method' | 'pay' | 'confirm'
|
|
94
|
+
/** `details` (buyer details), `method`, `pay`, `confirm`. */
|
|
95
|
+
key: 'details' | 'method' | 'pay' | 'confirm';
|
|
128
96
|
/** Before, at or after the current step. */
|
|
129
97
|
state: 'done' | 'current' | 'upcoming';
|
|
130
98
|
}
|
|
@@ -185,8 +153,8 @@ declare function groupMethodsByToken(methods: CheckoutMethod[], walletChainId?:
|
|
|
185
153
|
* @returns `paying` while the buyer can still pay (the countdown shows and screen readers hear the minutes left),
|
|
186
154
|
* `confirming` while the payment is on its way (the countdown shows; at zero the confirm step says that the payment
|
|
187
155
|
* sent in time is being confirmed) and while Quasar could not confirm it (`unconfirmed`: the buyer checks the wallet
|
|
188
|
-
* before paying again, so no minutes left to pay are announced), or `null` once the payment succeeded (`paid
|
|
189
|
-
*
|
|
156
|
+
* before paying again, so no minutes left to pay are announced), or `null` once the payment succeeded (`paid`), on the
|
|
157
|
+
* outcomes in
|
|
190
158
|
* which a deadline means nothing (`held`, `refunded`, `expired`, `cancelled`, `replaced`) and for an invoice that can
|
|
191
159
|
* no longer be paid. `closed` while part of an underpaid invoice arrived and its rest cannot be paid: the countdown still
|
|
192
160
|
* shows, as the time after which the seller can refund, and no minutes left to pay are announced.
|
|
@@ -207,18 +175,15 @@ declare function deadlineAnnouncement(previousMs: number | null, ms: number, ann
|
|
|
207
175
|
/** How long before a locked price ends the checkout offers to keep it (WCAG 2.2.1: 20 seconds at least). */
|
|
208
176
|
declare const QUOTE_WARNING_MS = 60000;
|
|
209
177
|
/**
|
|
210
|
-
* What the active wallet changing does to a locked price.
|
|
211
|
-
* nothing, so it changes nothing while that screen is open; back on the payment, what follows applies.
|
|
178
|
+
* What the active wallet changing does to a locked price.
|
|
212
179
|
*
|
|
213
180
|
* @param params - What the change happens over.
|
|
214
|
-
* @param params.autoPayOffOpen - The screen that turns automatic payments off is open.
|
|
215
181
|
* @param params.phase - The phase of the payment; a price is locked only in `awaitingPayment`.
|
|
216
182
|
* @param params.quotePayer - The payer the price is locked for.
|
|
217
183
|
* @param params.payer - The payer the active wallet gives for the method of that price, or `null`.
|
|
218
184
|
* @returns `keep`: nothing changes; `lock`: lock the price again for `payer`; `release`: release it, back to the methods.
|
|
219
185
|
*/
|
|
220
186
|
declare function lockedPriceOnWallet(params: {
|
|
221
|
-
autoPayOffOpen: boolean;
|
|
222
187
|
phase: string;
|
|
223
188
|
quotePayer: string | null | undefined;
|
|
224
189
|
payer: string | null;
|
|
@@ -650,7 +615,7 @@ interface PaymentCheckoutClassNames {
|
|
|
650
615
|
*/
|
|
651
616
|
body?: (params: CheckoutPartState) => string | undefined;
|
|
652
617
|
/**
|
|
653
|
-
* The content of a step screen (buyer details, method, QR code
|
|
618
|
+
* The content of a step screen (buyer details, method, QR code), with its heading.
|
|
654
619
|
*
|
|
655
620
|
* @param params - The state of the checkout.
|
|
656
621
|
* @returns Classes to add.
|
|
@@ -734,7 +699,7 @@ interface PaymentCheckoutClassNames {
|
|
|
734
699
|
required: boolean;
|
|
735
700
|
}) => string | undefined;
|
|
736
701
|
/**
|
|
737
|
-
* A card of grouped facts (the transaction, the rate and fees
|
|
702
|
+
* A card of grouped facts (the transaction, the rate and fees).
|
|
738
703
|
*
|
|
739
704
|
* @param params - The state of the checkout.
|
|
740
705
|
* @returns Classes to add.
|
|
@@ -1284,30 +1249,6 @@ interface CheckoutContextValue {
|
|
|
1284
1249
|
* @param payment - The transaction and what it pays.
|
|
1285
1250
|
*/
|
|
1286
1251
|
onPaymentSent: (payment: SentPayment) => void;
|
|
1287
|
-
/** The buyer opened the automatic payments offer after paying a subscription period. */
|
|
1288
|
-
autoPay: boolean;
|
|
1289
|
-
/**
|
|
1290
|
-
* Opens or closes the automatic payments offer.
|
|
1291
|
-
*
|
|
1292
|
-
* @param autoPay - Whether it shows.
|
|
1293
|
-
*/
|
|
1294
|
-
setAutoPay: (autoPay: boolean) => void;
|
|
1295
|
-
/** The screen that turns automatic payments off is open (`open`), or they were turned off (`done`). */
|
|
1296
|
-
autoPayOff: 'open' | 'done' | null;
|
|
1297
|
-
/**
|
|
1298
|
-
* Opens or closes the screen that turns automatic payments off, or says they were turned off.
|
|
1299
|
-
*
|
|
1300
|
-
* @param autoPayOff - The new state.
|
|
1301
|
-
*/
|
|
1302
|
-
setAutoPayOff: (autoPayOff: 'open' | 'done' | null) => void;
|
|
1303
|
-
/** Whether the wallet has sent the transaction that revokes the permission of this invoice's subscription. */
|
|
1304
|
-
revokeSent: boolean;
|
|
1305
|
-
/**
|
|
1306
|
-
* Keeps that for as long as the page shows the invoice, so the buyer leaving the screen does not send it twice.
|
|
1307
|
-
*
|
|
1308
|
-
* @param sent - Whether it was sent.
|
|
1309
|
-
*/
|
|
1310
|
-
setRevokeSent: (sent: boolean) => void;
|
|
1311
1252
|
/**
|
|
1312
1253
|
* Opens another invoice in this checkout: the one that replaced a corrected invoice.
|
|
1313
1254
|
*
|
|
@@ -1496,10 +1437,9 @@ declare function MethodScreen(): react.JSX.Element | null;
|
|
|
1496
1437
|
|
|
1497
1438
|
/**
|
|
1498
1439
|
* The paid outcome: the amount, network, time and transaction (every transfer of an invoice paid in parts, each with
|
|
1499
|
-
* its time, amount and explorer link), the steps done, a refund made later, the receipt to
|
|
1500
|
-
*
|
|
1501
|
-
*
|
|
1502
|
-
* seller's, and loading it again would close everything at once.
|
|
1440
|
+
* its time, amount and explorer link), the steps done, a refund made later, the receipt to download, and the way back
|
|
1441
|
+
* to the seller (`successUrl`) with a visible countdown and "Stay here" (WCAG 2.2.1). In a modal it offers Close
|
|
1442
|
+
* instead: the page under it is the seller's, and loading it again would close everything at once.
|
|
1503
1443
|
*
|
|
1504
1444
|
* Side effects: navigates to the seller's `successUrl` when the countdown ends.
|
|
1505
1445
|
*
|
|
@@ -1802,10 +1742,10 @@ declare function ConfirmStep({ flow, labels, locale, values, details, recordActi
|
|
|
1802
1742
|
}): react.JSX.Element;
|
|
1803
1743
|
|
|
1804
1744
|
/**
|
|
1805
|
-
* What the wallet asks for: a gasless signature, a transaction, a network switch, the
|
|
1806
|
-
*
|
|
1745
|
+
* What the wallet asks for: a gasless signature, a transaction, a network switch, the signature that confirms the
|
|
1746
|
+
* paying wallet (`proof`), or Quasar takes the payment.
|
|
1807
1747
|
*/
|
|
1808
|
-
type WalletPromptKind = 'sign' | 'confirm' | 'switch' | '
|
|
1748
|
+
type WalletPromptKind = 'sign' | 'confirm' | 'switch' | 'proof' | 'submitting';
|
|
1809
1749
|
/** Props of {@link WalletPrompt}. */
|
|
1810
1750
|
interface WalletPromptProps {
|
|
1811
1751
|
/** What the wallet asks for. */
|
|
@@ -2426,9 +2366,9 @@ declare function instructionsChainId(instructions: PaymentInstructions): string;
|
|
|
2426
2366
|
interface PayInvoiceParams {
|
|
2427
2367
|
/** The adapter of the quote's chain family. */
|
|
2428
2368
|
adapter: PaymentsAdapter;
|
|
2429
|
-
/** The checkout store (only `submit` and `
|
|
2369
|
+
/** The checkout store (only `submit`, `relay` and `relayFromPage` are used). */
|
|
2430
2370
|
store: {
|
|
2431
|
-
getState: () => Pick<CheckoutState, 'submit' | 'relay'
|
|
2371
|
+
getState: () => Pick<CheckoutState, 'submit' | 'relay'> & Partial<Pick<CheckoutState, 'relayFromPage'>>;
|
|
2432
2372
|
};
|
|
2433
2373
|
/** The locked quote. */
|
|
2434
2374
|
quote: CheckoutQuote;
|
|
@@ -2436,7 +2376,10 @@ interface PayInvoiceParams {
|
|
|
2436
2376
|
wallet: CheckoutWallet;
|
|
2437
2377
|
/** How the wallet pays, from `payPath`. */
|
|
2438
2378
|
path: PayPath;
|
|
2439
|
-
/**
|
|
2379
|
+
/**
|
|
2380
|
+
* The checkout's ERC-7677 paymaster URL: the `paymaster` path sends through it, and the `relay` path sends the
|
|
2381
|
+
* authorized call from a one-time account through it when the adapter can (`sendOneTimeRelay`).
|
|
2382
|
+
*/
|
|
2440
2383
|
paymasterUrl: string | null;
|
|
2441
2384
|
/** Called when the wallet answered, before the payment is handed to Quasar. */
|
|
2442
2385
|
onWalletDone?: () => void;
|
|
@@ -2456,8 +2399,9 @@ interface PayInvoiceParams {
|
|
|
2456
2399
|
}
|
|
2457
2400
|
/**
|
|
2458
2401
|
* Pays a locked quote: `transfer` sends the transfer and hands its key to Quasar (`submit`), `relay` signs the
|
|
2459
|
-
* authorization
|
|
2460
|
-
*
|
|
2402
|
+
* authorization and the page sends the call Quasar answers for it from a one-time account (`relayFromPage` with the
|
|
2403
|
+
* adapter's `sendOneTimeRelay`; without them, or with no paymaster URL, Quasar sends it: `relay`), `paymaster` sends
|
|
2404
|
+
* the sponsored calls and hands their transaction hash to Quasar. A transaction the wallet sent is always handed over, whatever the page shows meanwhile, with the method it
|
|
2461
2405
|
* was quoted for: the buyer may have gone on to a price on another network while the wallet asked.
|
|
2462
2406
|
*
|
|
2463
2407
|
* Side effects: a wallet prompt; requests to the checkout routes of Quasar.
|
|
@@ -2785,8 +2729,8 @@ declare function baseUnitsToDecimal(baseUnits: string, decimals: number): string
|
|
|
2785
2729
|
declare function formatCountdown(ms: number): string;
|
|
2786
2730
|
|
|
2787
2731
|
/**
|
|
2788
|
-
* @file What the outcome steps show: how to reach the seller, when to ask before leaving, what a refusal means,
|
|
2789
|
-
*
|
|
2732
|
+
* @file What the outcome steps show: how to reach the seller, when to ask before leaving, what a refusal means, what an
|
|
2733
|
+
* underpaid invoice still needs, and what arrived on an invoice.
|
|
2790
2734
|
*/
|
|
2791
2735
|
|
|
2792
2736
|
/**
|
|
@@ -2827,8 +2771,8 @@ declare function failedPaymentTx(error: CheckoutError | null | undefined): strin
|
|
|
2827
2771
|
* `pay.mismatchHeldElsewhere` when another invoice holds it for a refund only, `held`;
|
|
2828
2772
|
* `pay.mismatchOtherWallet` for a transfer from a wallet that did not confirm the invoice, `pay.mismatchOtherWalletHeld`
|
|
2829
2773
|
* when Quasar recorded it as a held transfer the seller returns, `held`; `pay.mismatchNoReferenceHeld` for a Solana Pay
|
|
2830
|
-
* transfer without the invoice's reference held on this invoice, `held`; `pay.mismatchChargeHeld` for
|
|
2831
|
-
*
|
|
2774
|
+
* transfer without the invoice's reference held on this invoice, `held`; `pay.mismatchChargeHeld` for a payment sent
|
|
2775
|
+
* under an earlier price of the invoice, `quote_changed`), a payment Quasar closed after 24 hours without a result on chain
|
|
2832
2776
|
* (`outcome.unconfirmedClosed`), a transaction another invoice handed over first (`outcome.unconfirmedTakenElsewhere`)
|
|
2833
2777
|
* and a payment the network confirmed that Quasar has not recorded yet (`outcome.unconfirmedSettlementRetrying` while
|
|
2834
2778
|
* Quasar settles it again daily, for 30 days, else `outcome.unconfirmedSettlementFailed`). Never "it failed", "only the
|
|
@@ -2863,54 +2807,6 @@ declare function needsLeaveConfirm(phase: CheckoutPhase, error?: CheckoutError |
|
|
|
2863
2807
|
* @returns The text.
|
|
2864
2808
|
*/
|
|
2865
2809
|
declare function methodErrorText(error: CheckoutError, labels: NovaPaymentsLabels, merchant?: string): string;
|
|
2866
|
-
/** The terms of an automatic payments offer, as the checkout shows them. */
|
|
2867
|
-
interface AutoPayTerms {
|
|
2868
|
-
/** The CAIP-2 chain of the charges. */
|
|
2869
|
-
chainId: string;
|
|
2870
|
-
/**
|
|
2871
|
-
* The wallet the charges are paid to: the merchant's, as the `payee` rule of the request names it (the app's
|
|
2872
|
-
* collector, which sends the charges, when the request names no payee).
|
|
2873
|
-
*/
|
|
2874
|
-
to: string;
|
|
2875
|
-
/** The most it takes in a period, in base units of the token. */
|
|
2876
|
-
limit: string;
|
|
2877
|
-
/** Decimals of the token. */
|
|
2878
|
-
decimals: number;
|
|
2879
|
-
/** Symbol of the token. */
|
|
2880
|
-
symbol: string;
|
|
2881
|
-
/** The length of a period, in seconds. */
|
|
2882
|
-
periodSeconds: number;
|
|
2883
|
-
/** When the permission ends, in milliseconds; `null` without an expiry rule. */
|
|
2884
|
-
expiresAt: number | null;
|
|
2885
|
-
}
|
|
2886
|
-
/**
|
|
2887
|
-
* What the connected wallet may ask its wallet for: the offer, or taking over an active permission that holds nothing.
|
|
2888
|
-
*
|
|
2889
|
-
* @param offer - The automatic-charge offer of the checkout.
|
|
2890
|
-
* @returns The method and the request, or `null` when nothing can be given now.
|
|
2891
|
-
*/
|
|
2892
|
-
declare function grantableOffer(offer: AutoChargeOffer | null): Extract<AutoChargeOffer, {
|
|
2893
|
-
status: 'available';
|
|
2894
|
-
}> | NonNullable<Extract<AutoChargeOffer, {
|
|
2895
|
-
status: 'active';
|
|
2896
|
-
}>['replacement']> | null;
|
|
2897
|
-
/**
|
|
2898
|
-
* The terms of an ERC-7715 automatic payments offer: the periodic limit in the token of the method, the period, the
|
|
2899
|
-
* expiry and the merchant's wallet the charges are paid to.
|
|
2900
|
-
*
|
|
2901
|
-
* @param offer - The view's `autoCharge`.
|
|
2902
|
-
* @param methods - The view's methods (for the token of the offer).
|
|
2903
|
-
* @returns The terms, or `null` when the offer is not available or its method is unknown.
|
|
2904
|
-
*/
|
|
2905
|
-
declare function autoPayTerms(offer: AutoChargeOffer | null, methods: CheckoutMethod[]): AutoPayTerms | null;
|
|
2906
|
-
/**
|
|
2907
|
-
* A period as words of the language: whole days in days, otherwise in hours.
|
|
2908
|
-
*
|
|
2909
|
-
* @param seconds - The period.
|
|
2910
|
-
* @param locale - BCP 47 language of the page.
|
|
2911
|
-
* @returns For example `30 days`, `2 hours`, `30 днів`.
|
|
2912
|
-
*/
|
|
2913
|
-
declare function formatPeriod(seconds: number, locale: string): string;
|
|
2914
2810
|
/**
|
|
2915
2811
|
* What an underpaid invoice still needs, in base units of the locked token.
|
|
2916
2812
|
*
|
|
@@ -3021,7 +2917,8 @@ interface LockPriceStore {
|
|
|
3021
2917
|
declare function lockPrice(store: LockPriceStore, showConfirmWallet: (show: boolean) => void): Promise<CheckoutQuote | null>;
|
|
3022
2918
|
/**
|
|
3023
2919
|
* Whether the error is a refusal of the wallet's confirmation (`payer_proof_*`, `payer_chain_mismatch`,
|
|
3024
|
-
* `too_many_payers`): the pay step shows only these under the confirmation, its other errors
|
|
2920
|
+
* `too_many_payers`, `payer_is_recipient`): the pay step shows only these under the confirmation, its other errors
|
|
2921
|
+
* have texts of their own.
|
|
3025
2922
|
*
|
|
3026
2923
|
* @param error - The checkout store's error, if any.
|
|
3027
2924
|
* @returns `true` for a refusal of the confirmation.
|
|
@@ -3039,7 +2936,8 @@ declare function isConfirmationError(error: CheckoutError | null | undefined): b
|
|
|
3039
2936
|
/**
|
|
3040
2937
|
* What the step that confirms the wallet says about a refusal, with what to do: the wallet's (the buyer declined, the
|
|
3041
2938
|
* wallet cannot sign messages, it failed) or Quasar's (`payer_proof_invalid`, `payer_proof_unavailable`,
|
|
3042
|
-
* `payer_chain_mismatch`, `too_many_payers`, `rate_limited`…). The buyer stays on the step and
|
|
2939
|
+
* `payer_chain_mismatch`, `too_many_payers`, `payer_is_recipient`, `rate_limited`…). The buyer stays on the step and
|
|
2940
|
+
* can try again.
|
|
3043
2941
|
*
|
|
3044
2942
|
* @param error - The checkout store's error, if any.
|
|
3045
2943
|
* @param problem - Why the wallet did not sign, when the checkout knows it.
|
|
@@ -3100,5 +2998,5 @@ declare function invoiceTotals(invoice: CheckoutView['invoice']): {
|
|
|
3100
2998
|
total: string;
|
|
3101
2999
|
};
|
|
3102
3000
|
|
|
3103
|
-
export { AmountStep,
|
|
3104
|
-
export type {
|
|
3001
|
+
export { AmountStep, BuyerScreen, CheckoutContext, CheckoutContextProvider, CheckoutFrame, CheckoutHeader, CheckoutPageRoot, CheckoutStepper, CheckoutSummary, CheckoutWallet, CompactSummary, ConfirmScreen, ConfirmStep, ConfirmWalletScreen, ContactLink, DEADLINE_ANNOUNCEMENTS, DeadlineTimer, Disclosure, FailedScreen, FailedStep, LeaveDialog, LocaleSwitcher, MerchantBadge, MethodScreen, MobileSteps, NativeFee, NovaPaymentsContext, NovaPaymentsProvider, OPEN_REQUEST_MS, OrderLines, OrderTotal, OutcomeScreen, PaidScreen, PayScreen, PaymentCheckout, PaymentFamily, PaymentWalletError, PaymentsAdapter, QUOTE_WARNING_MS, QrScreen, RefundButton, RefundDialog, RefundSteps, ScreenBody, SellerDetailsContent, SummaryFooter, WalletPrompt, addressOfWallet, balanceShortfall, baseUnitsToDecimal, buyerFields, buyerIssues, checkoutClassName, checkoutScreen, checkoutSteps, cleanBuyer, contactHref, countryOptions, deadlineAnnouncement, deadlineState, failedPaymentTx, formatCountdown, formatFeeAmount, formatFiat, formatTokenAmount, groupMethodsByToken, handOverPayment, instructionsChainId, invoiceTotals, isConfirmationError, isFinalPaymentFailure, isInvoicePaymentOnTheWay, isInvoicePaymentUnresolved, isMovedMoneyFailure, isPaidElsewhere, isPayerProofError, isPaymentAccepted, isPaymentOnTheWay, isQuoteEnding, isSameWallet, isSlow, isSmartWallet, leftTheWalletText, lockPrice, lockedPriceOnWallet, methodErrorText, minorToDecimal, needsLeaveConfirm, needsPayerProof, needsTheClock, paidSteps, payInvoice, payPath, payerProofErrorText, paymentFailedText, qrPath, quoteAmounts, quoteRate, receivedAmount, refundRateMoved, refundTransfer, refusalText, restRateText, screensPayingWallets, sentBeforeDeadline, shownLocale, unconfirmedFollowUp, unconfirmedTxKey, underpaidRest, useAsyncValue, useAutoReturn, useCheckoutContext, useCheckoutEvents, useCheckoutState, useCheckoutStore, useConnectedWallet, useNovaPayments, useNow, useOptionalCheckoutContext, usePaidCallback, usePayerProof, usePayment, usePaymentFacts, usePaymentHandOver, usePaymentsConnection, usePaymentsLabels, useRefund, useRereadValue, useWalletConnection, walletErrorKind, walletOnConfirmStep };
|
|
3002
|
+
export type { BalanceShortfall, BuyerCollect, BuyerField, BuyerIssue, CheckoutContextValue, CheckoutHeaderProps, CheckoutNetworkOptionProps, CheckoutPartState, CheckoutPrimaryButtonProps, CheckoutQrCodeProps, CheckoutScreen, CheckoutScreenChoices, CheckoutScreenProps, CheckoutStatusIconProps, CheckoutStep, CheckoutStepperProps, CheckoutTokenGroup, CheckoutTokenOptionProps, ConfirmProblem, HandOverParams, LocaleSwitcherProps, LockPriceStore, NovaPaymentsLabelsContext, NovaPaymentsOwnConnection, NovaPaymentsProviderCustomization, NovaPaymentsProviderProps, NovaPaymentsSettings, OutcomeKind, PayInvoiceParams, PayPath, PayerProofFlow, PayerProofProblem, PayerProofStep, Payment, PaymentCheckoutChildCustomizations, PaymentCheckoutClassNames, PaymentCheckoutComponents, PaymentCheckoutConfig, PaymentCheckoutCustomization, PaymentCheckoutDisplay, PaymentCheckoutHandlers, PaymentCheckoutProps, PaymentHandOverState, PaymentStatus, PaymentTransfer, PaymentWalletErrorKind, PaymentsConnectionMode, PaymentsPulsar, QuoteAmounts, RefundButtonProps, RefundDialogProps, RefundFlow, RefundInstructions, RefundProblem, RefundRequest, RefundStep, SentBeforeDeadlineParams, SentPayment, UnconfirmedFollowUp, UseAutoReturnParams, UseCheckoutEventsParams, UseCheckoutStoreOptions, UsePayerProofParams, UsePaymentHandOverParams, UsePaymentParams, UseRefundParams, WalletConnection, WalletPromptKind, WalletPromptProps };
|