@pollar/react 0.12.0 → 0.12.1-rc.11
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 +255 -157
- package/dist/index.css +359 -150
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +534 -250
- package/dist/index.d.ts +534 -250
- package/dist/index.js +6395 -1541
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6396 -1544
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,37 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { pollarPaths, PollarClient, PollarClientConfig, PollarAdapters, OnStorageDegrade, WalletInfo, CosignCustody, PollarLoginOptions, SessionsState, CosignState, RecoveryState, CustodyMigrationState, PendingConfirmation,
|
|
2
|
+
import { WalletChain, pollarPaths, WalletBalanceRecord, TransactionState, WalletId, PollarLanguage, SwapQuoteParams, SwapDestinationChain, BridgeChain, BridgeTransfer, EarnProviderId, CardFundingChain, CardFunding, PollarClient, PollarClientConfig, PollarAdapters, OnStorageDegrade, WalletInfo, CosignCustody, PollarLoginOptions, SessionsState, CosignState, RecoveryState, CustodyMigrationState, PendingConfirmation, TxBuildBody, BuildOutcome, SubmitOutcome, SignOutcome, SendPaymentParams, StellarNetwork, WalletBalanceState, EnabledAssetsState, TrustlineOutcome, TxHistoryState, SwapVenue, SwapToken, SwapQuote, SolanaSwapVenue, SolanaSwapQuoteParams, SolanaSwapQuote, SolanaSwapOptions, SwapStatus, EarnOpportunity, EarnPositionParams, EarnPosition, EarnTxParams, SolanaEarnProviderId, SolanaEarnOpportunity, SolanaEarnPosition, SolanaEarnTxParams, PollarAdapter, AuthEntryAdapterStep, AuthEntryAdapterOutcome, PasskeyCeremony, PasskeySigner, RecoveryPasskeyCeremony, CosignRequest, CosignVerification, CosignQuorumReport, CosignDevicesContent, KycStatus as KycStatus$1, RampQuoteRejection, RampQuoteRequirement, RampWalletStep, RampQuote, AuthState, KycProvider, KycStartResponse, RampDirection, RampFiat, RampAsset, RampField, RampOrder, EnabledAssetRecord, BridgeQuote, DistributionRulesState, DistributionRule } from '@pollar/core';
|
|
3
3
|
export { AuthProviderContext, PollarAuthProvider, SessionsState } from '@pollar/core';
|
|
4
|
-
import {
|
|
4
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
5
|
+
|
|
6
|
+
/** Where the ramp widget opens: a starting point the user can change, never a lock. */
|
|
7
|
+
interface RampModalOptions {
|
|
8
|
+
direction?: 'buy' | 'sell';
|
|
9
|
+
/** ISO 3166-1 alpha-2, e.g. 'BR'. */
|
|
10
|
+
country?: string;
|
|
11
|
+
/** e.g. 'BRL'; the country's first fiat when left out or not offered there. */
|
|
12
|
+
fiat?: string;
|
|
13
|
+
/** e.g. 'USDC'. */
|
|
14
|
+
asset?: string;
|
|
15
|
+
amount?: string;
|
|
16
|
+
}
|
|
17
|
+
interface RampWidgetProps {
|
|
18
|
+
onClose: () => void;
|
|
19
|
+
/** Initial direction, country, fiat, asset and amount. A country that does not route in that direction opens on the defaults. */
|
|
20
|
+
initial?: RampModalOptions | undefined;
|
|
21
|
+
/** Language of the widget and the steps it opens, as a BCP 47 tag. A language pinned in the dashboard wins over it. */
|
|
22
|
+
language?: string | undefined;
|
|
23
|
+
}
|
|
24
|
+
declare function RampWidget({ onClose, language: languageProp, initial }: RampWidgetProps): react_jsx_runtime.JSX.Element;
|
|
25
|
+
|
|
26
|
+
/** Where the receive modal opens: the network whose address it shows. A network the app does not offer is left out. */
|
|
27
|
+
interface ReceiveModalOptions {
|
|
28
|
+
chain?: WalletChain;
|
|
29
|
+
}
|
|
30
|
+
interface ReceiveModalProps {
|
|
31
|
+
onClose: () => void;
|
|
32
|
+
initial?: ReceiveModalOptions | undefined;
|
|
33
|
+
}
|
|
34
|
+
declare function ReceiveModal({ onClose, initial }: ReceiveModalProps): react_jsx_runtime.JSX.Element;
|
|
5
35
|
|
|
6
36
|
type ConfigResponse = pollarPaths['/applications/config']['get']['responses'][200]['content']['application/json'];
|
|
7
37
|
type PollarConfig = ConfigResponse['content'];
|
|
@@ -18,6 +48,344 @@ interface AuthModalProps {
|
|
|
18
48
|
onSuccess?: () => void;
|
|
19
49
|
}
|
|
20
50
|
|
|
51
|
+
/** Per-app overrides for the modal chrome, configured in the dashboard's
|
|
52
|
+
* Branding screen. Every field is optional: absent means "use the value the
|
|
53
|
+
* theme derives", which is what every modal rendered before these existed. */
|
|
54
|
+
interface ModalStyleOverrides {
|
|
55
|
+
/** Card background. Overrides the theme's white / #1a1a1a. */
|
|
56
|
+
backgroundColor?: string | null | undefined;
|
|
57
|
+
/** Body text. Overrides the theme's #111827 / white. With a background or a
|
|
58
|
+
* text color set, borders, secondary ("muted") text and input fills are
|
|
59
|
+
* blended from the pair instead of taken from the theme. */
|
|
60
|
+
textColor?: string | null | undefined;
|
|
61
|
+
/** Fill of the SECONDARY buttons (the wallet / social / provider entries, the
|
|
62
|
+
* retry button). The primary button is the accent's job. Unset => the theme's
|
|
63
|
+
* own surface color, which is what these buttons always used. */
|
|
64
|
+
buttonColor?: string | null | undefined;
|
|
65
|
+
/** Radius of the modal card itself, in px. */
|
|
66
|
+
modalBorderRadius?: number | null | undefined;
|
|
67
|
+
/** Radius of the buttons inside the modal, in px. Independent of the card's. */
|
|
68
|
+
buttonBorderRadius?: number | null | undefined;
|
|
69
|
+
}
|
|
70
|
+
/** Text color that stays legible on `background`. The primary button's label was
|
|
71
|
+
* hardcoded white, which a light fill (the Amber accent preset, say) turns
|
|
72
|
+
* invisible - so it follows the fill's luminance instead. Unparseable colors
|
|
73
|
+
* keep white, the pre-existing behavior. */
|
|
74
|
+
declare function readableTextOn(background: string): string;
|
|
75
|
+
/** How much room a modal gives its header. 'hero' is the identity-forward set
|
|
76
|
+
* (login, KYC, ramp, the Privy sub-modal): roomier padding and a larger
|
|
77
|
+
* centered heading. 'compact' is every utility modal (send, balance, history,
|
|
78
|
+
* ...), which keeps the card's own 1.75rem padding. */
|
|
79
|
+
type ModalVariant = 'hero' | 'compact';
|
|
80
|
+
/** The app's Branding as inline CSS custom properties for a Pollar root (a modal
|
|
81
|
+
* card, the wallet button).
|
|
82
|
+
*
|
|
83
|
+
* Everything is written under the private `--pollar-brand-*` names, never the
|
|
84
|
+
* public `--pollar-*` ones: `shared.css` maps brand onto public inside a
|
|
85
|
+
* zero-specificity `:where()`, so a host stylesheet that sets a public variable
|
|
86
|
+
* on a Pollar root beats the Branding, and the Branding beats the theme
|
|
87
|
+
* defaults. An inline `--pollar-*` would beat every stylesheet instead.
|
|
88
|
+
*
|
|
89
|
+
* The palette (background, text, borders, status colors) is only written when
|
|
90
|
+
* the app pinned it: a dark theme, or a background or text color of its own.
|
|
91
|
+
* Left out, the light defaults in `shared.css` apply, and a host `html.dark`
|
|
92
|
+
* swaps them for the dark ones. */
|
|
93
|
+
declare function buildModalCssVars(theme: string, accentColor: string, overrides?: ModalStyleOverrides, variant?: ModalVariant): CSSProperties;
|
|
94
|
+
/** Everything a modal wrapper needs to dress itself from the app's branding:
|
|
95
|
+
* the theme pair its template already took, the overrides to forward to that
|
|
96
|
+
* template, and the inline style for the fixed overlay behind it. */
|
|
97
|
+
interface ModalChrome {
|
|
98
|
+
theme: string;
|
|
99
|
+
accentColor: string;
|
|
100
|
+
styleOverrides: ModalStyleOverrides;
|
|
101
|
+
overlayStyle: CSSProperties;
|
|
102
|
+
}
|
|
103
|
+
/** Resolve the branding config into the props/styles a modal wrapper applies.
|
|
104
|
+
* Called by every `.pollar-overlay` renderer so the z-index and the card
|
|
105
|
+
* overrides can't drift apart between modals. */
|
|
106
|
+
declare function modalChrome(styles: PollarStyles): ModalChrome;
|
|
107
|
+
|
|
108
|
+
/** The memo types the backend accepts on a Stellar payment. */
|
|
109
|
+
type SendMemoType = 'text' | 'id' | 'hash';
|
|
110
|
+
interface SendModalTemplateProps {
|
|
111
|
+
theme: string;
|
|
112
|
+
accentColor: string;
|
|
113
|
+
/** Per-app modal chrome overrides (background, card + button radius). */
|
|
114
|
+
styleOverrides?: ModalStyleOverrides;
|
|
115
|
+
/**
|
|
116
|
+
* `create-account`: the Stellar destination has no account yet, so the user
|
|
117
|
+
* chooses between creating it with the XLM being sent and waiting for someone
|
|
118
|
+
* else to fund it.
|
|
119
|
+
*/
|
|
120
|
+
step: 'form' | 'create-account' | 'tx';
|
|
121
|
+
txTitle: string;
|
|
122
|
+
assets: WalletBalanceRecord[];
|
|
123
|
+
selectedAsset: WalletBalanceRecord | null;
|
|
124
|
+
selectedChain: WalletChain | null;
|
|
125
|
+
/**
|
|
126
|
+
* The networks the user can send from, in the app's configured order. The
|
|
127
|
+
* picker renders only with two or more, so a single-chain app shows none.
|
|
128
|
+
*/
|
|
129
|
+
chains?: WalletChain[];
|
|
130
|
+
/** @deprecated The sender address is not shown; kept so existing templates compile. */
|
|
131
|
+
walletAddress?: string;
|
|
132
|
+
/** Can a payment be built on {@link selectedChain}? Stellar and Solana only. */
|
|
133
|
+
canSendOnChain: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* Why the wallet cannot act on-chain right now (its Stellar account is still
|
|
136
|
+
* being created, or its creation failed), or null when it can.
|
|
137
|
+
*
|
|
138
|
+
* Separate from {@link canSendOnChain}: that one is about the NETWORK not
|
|
139
|
+
* having a transfer path, this one about the user's own account. Collapsing
|
|
140
|
+
* them would tell someone waiting on a brand-new wallet that Stellar does not
|
|
141
|
+
* support sending. Optional, so a custom template that does not read it keeps
|
|
142
|
+
* compiling.
|
|
143
|
+
*/
|
|
144
|
+
notReadyReason?: string | null;
|
|
145
|
+
onSelectChain?: (chain: WalletChain) => void;
|
|
146
|
+
amount: string;
|
|
147
|
+
destination: string;
|
|
148
|
+
formError: string;
|
|
149
|
+
isLoadingBalance: boolean;
|
|
150
|
+
/** The destination's account is being looked up; the form waits for it. */
|
|
151
|
+
isCheckingDestination?: boolean;
|
|
152
|
+
/** The least XLM a new Stellar account can start with. */
|
|
153
|
+
minStartingBalance?: number;
|
|
154
|
+
/** Builds a `create_account` for the destination, funded with the amount. Required for the `create-account` step. */
|
|
155
|
+
onCreateAccount?: () => void;
|
|
156
|
+
transaction: TransactionState;
|
|
157
|
+
showXdr: boolean;
|
|
158
|
+
copied: boolean;
|
|
159
|
+
explorerUrl: string | null;
|
|
160
|
+
walletType?: WalletId | null | undefined;
|
|
161
|
+
showBack: boolean;
|
|
162
|
+
isInProgress: boolean;
|
|
163
|
+
onClose: () => void;
|
|
164
|
+
onBack: () => void;
|
|
165
|
+
onRefresh: () => void;
|
|
166
|
+
onSelectAsset: (asset: WalletBalanceRecord) => void;
|
|
167
|
+
onAmountChange: (value: string) => void;
|
|
168
|
+
onMax: () => void;
|
|
169
|
+
onPaste: () => void;
|
|
170
|
+
onDestinationChange: (value: string) => void;
|
|
171
|
+
/**
|
|
172
|
+
* Optional Stellar memo. The field renders only on Stellar and only when
|
|
173
|
+
* {@link onMemoChange} is passed, so a custom template without a memo field
|
|
174
|
+
* keeps compiling.
|
|
175
|
+
*/
|
|
176
|
+
memo?: string;
|
|
177
|
+
memoType?: SendMemoType;
|
|
178
|
+
onMemoChange?: (value: string) => void;
|
|
179
|
+
onMemoTypeChange?: (type: SendMemoType) => void;
|
|
180
|
+
onSubmit: () => void;
|
|
181
|
+
onSignAndSend: () => void;
|
|
182
|
+
onToggleXdr: () => void;
|
|
183
|
+
onCopyHash: () => void;
|
|
184
|
+
onRetry: () => void;
|
|
185
|
+
onDone: () => void;
|
|
186
|
+
/** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
|
|
187
|
+
language?: PollarLanguage | undefined;
|
|
188
|
+
}
|
|
189
|
+
declare function SendModalTemplate({ theme, accentColor, styleOverrides, step, txTitle, assets, selectedAsset, selectedChain, canSendOnChain, notReadyReason, chains, onSelectChain, amount, destination, formError, isLoadingBalance, isCheckingDestination, minStartingBalance, onCreateAccount, transaction, showXdr, copied, explorerUrl, walletType, showBack, isInProgress, onClose, onBack, onRefresh, onSelectAsset, onAmountChange, onMax, onPaste, onDestinationChange, memo, memoType, onMemoChange, onMemoTypeChange, onSubmit, onSignAndSend, onToggleXdr, onCopyHash, onRetry, onDone, language: languageProp, }: SendModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
190
|
+
|
|
191
|
+
/** Where the send modal opens: a starting point the user can change. An option the wallet cannot use is left out. */
|
|
192
|
+
interface SendModalOptions {
|
|
193
|
+
chain?: WalletChain;
|
|
194
|
+
/** Asset code, e.g. 'USDC'. */
|
|
195
|
+
asset?: string;
|
|
196
|
+
destination?: string;
|
|
197
|
+
amount?: string;
|
|
198
|
+
memo?: string;
|
|
199
|
+
memoType?: SendMemoType;
|
|
200
|
+
/** Called once the payment lands, with its transaction hash. */
|
|
201
|
+
onSuccess?: (result: {
|
|
202
|
+
hash: string;
|
|
203
|
+
}) => void;
|
|
204
|
+
}
|
|
205
|
+
interface SendModalProps {
|
|
206
|
+
onClose: () => void;
|
|
207
|
+
initial?: SendModalOptions | undefined;
|
|
208
|
+
}
|
|
209
|
+
declare function SendModal({ onClose, initial }: SendModalProps): react_jsx_runtime.JSX.Element;
|
|
210
|
+
|
|
211
|
+
/** The chain a swap runs on; the modal shows a selector when the app offers both. */
|
|
212
|
+
type SwapChain = 'STELLAR' | 'SOLANA';
|
|
213
|
+
interface SwapAssetOption {
|
|
214
|
+
/** Stellar: the asset ref the quote takes. */
|
|
215
|
+
ref?: SwapQuoteParams['sellAsset'] | undefined;
|
|
216
|
+
code: string;
|
|
217
|
+
/** Stellar: the issuer. Solana: the mint (wrapped SOL for SOL). */
|
|
218
|
+
issuer?: string | undefined;
|
|
219
|
+
/** Solana: the mint's decimals, to turn a decimal amount into base units. */
|
|
220
|
+
decimals?: number | undefined;
|
|
221
|
+
available?: string | undefined;
|
|
222
|
+
enabledInApp?: boolean | undefined;
|
|
223
|
+
}
|
|
224
|
+
/** A quote as the form shows it, whichever chain priced it: decimal amounts. */
|
|
225
|
+
interface SwapQuoteView {
|
|
226
|
+
provider: string;
|
|
227
|
+
amountOut: string;
|
|
228
|
+
minReceived: string;
|
|
229
|
+
/** Percent; null when the venue does not report it. */
|
|
230
|
+
priceImpactPct: string | null;
|
|
231
|
+
/** What the route charges, labelled. */
|
|
232
|
+
fees?: Array<{
|
|
233
|
+
label: string;
|
|
234
|
+
value: string;
|
|
235
|
+
}>;
|
|
236
|
+
totalFeesUsd?: number | null;
|
|
237
|
+
/** Seconds the price is good for; null when it has no window. */
|
|
238
|
+
expiresInSeconds?: number | null;
|
|
239
|
+
}
|
|
240
|
+
/** A cross-chain swap's delivery on the destination chain, once its Solana transaction landed. */
|
|
241
|
+
interface SwapSettlementView {
|
|
242
|
+
kind: 'pending' | 'completed' | 'held' | 'refunded' | 'failed';
|
|
243
|
+
text: string;
|
|
244
|
+
/** The user's wallet it delivers to. */
|
|
245
|
+
address: string | null;
|
|
246
|
+
explorerUrl: string | null;
|
|
247
|
+
}
|
|
248
|
+
interface SwapModalTemplateProps {
|
|
249
|
+
theme: string;
|
|
250
|
+
accentColor: string;
|
|
251
|
+
styleOverrides?: ModalStyleOverrides;
|
|
252
|
+
step: 'form' | 'tx';
|
|
253
|
+
txTitle: string;
|
|
254
|
+
sellOptions: SwapAssetOption[];
|
|
255
|
+
buyOptions: SwapAssetOption[];
|
|
256
|
+
selectedSell: SwapAssetOption | null;
|
|
257
|
+
selectedBuy: SwapAssetOption | null;
|
|
258
|
+
amount: string;
|
|
259
|
+
/** The chains the app offers swaps on; a selector shows when there are two. */
|
|
260
|
+
chains: SwapChain[];
|
|
261
|
+
chain: SwapChain;
|
|
262
|
+
/** Where a Solana swap can deliver; a selector shows when there is more than one. */
|
|
263
|
+
destinations?: SwapDestinationChain[];
|
|
264
|
+
destination?: SwapDestinationChain;
|
|
265
|
+
/** USDC to USDC across chains: a transfer, which the swap does not do. */
|
|
266
|
+
usdcAcross?: boolean;
|
|
267
|
+
settlement?: SwapSettlementView | null;
|
|
268
|
+
provider: string;
|
|
269
|
+
providers: string[];
|
|
270
|
+
quote: SwapQuoteView | null;
|
|
271
|
+
quoteLoading: boolean;
|
|
272
|
+
quoteError: string;
|
|
273
|
+
formError: string;
|
|
274
|
+
isLoadingData: boolean;
|
|
275
|
+
smartUnsupported: boolean;
|
|
276
|
+
configLoading: boolean;
|
|
277
|
+
swapUnavailable: boolean;
|
|
278
|
+
buyNeedsTrustline: boolean;
|
|
279
|
+
transaction: TransactionState;
|
|
280
|
+
showXdr: boolean;
|
|
281
|
+
copied: boolean;
|
|
282
|
+
explorerUrl: string | null;
|
|
283
|
+
walletType?: WalletId | null | undefined;
|
|
284
|
+
showBack: boolean;
|
|
285
|
+
isInProgress: boolean;
|
|
286
|
+
/** Language of the modal's text; the device's when not given. */
|
|
287
|
+
language?: PollarLanguage | undefined;
|
|
288
|
+
onClose: () => void;
|
|
289
|
+
onBack: () => void;
|
|
290
|
+
onRefresh: () => void;
|
|
291
|
+
onSelectSell: (o: SwapAssetOption) => void;
|
|
292
|
+
onSelectBuy: (o: SwapAssetOption) => void;
|
|
293
|
+
onReverse: () => void;
|
|
294
|
+
onMax: () => void;
|
|
295
|
+
onAddCustomToken: (code: string, issuer: string) => string | null;
|
|
296
|
+
onAmountChange: (value: string) => void;
|
|
297
|
+
onChainChange: (chain: SwapChain) => void;
|
|
298
|
+
onDestinationChange?: (chain: SwapDestinationChain) => void;
|
|
299
|
+
onProviderChange: (p: string) => void;
|
|
300
|
+
onSwap: () => void;
|
|
301
|
+
onToggleXdr: () => void;
|
|
302
|
+
onCopyHash: () => void;
|
|
303
|
+
onRetry: () => void;
|
|
304
|
+
onDone: () => void;
|
|
305
|
+
}
|
|
306
|
+
declare function SwapModalTemplate({ theme, accentColor, styleOverrides, step, txTitle, sellOptions, buyOptions, selectedSell, selectedBuy, amount, chains, chain, destinations, destination, usdcAcross, settlement, provider, providers, quote, quoteLoading, quoteError, formError, isLoadingData, smartUnsupported, configLoading, swapUnavailable, buyNeedsTrustline, transaction, showXdr, copied, explorerUrl, walletType, showBack, isInProgress, language: languageProp, onClose, onBack, onRefresh, onSelectSell, onSelectBuy, onAddCustomToken, onReverse, onMax, onAmountChange, onChainChange, onDestinationChange, onProviderChange, onSwap, onToggleXdr, onCopyHash, onRetry, onDone, }: SwapModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
307
|
+
|
|
308
|
+
/** Where the swap modal opens: a starting point the user can change. An option the app does not offer is left out. */
|
|
309
|
+
interface SwapModalOptions {
|
|
310
|
+
chain?: SwapChain;
|
|
311
|
+
/** Code of the asset sold, e.g. 'XLM'. */
|
|
312
|
+
sell?: string;
|
|
313
|
+
/** Code of the asset bought, e.g. 'USDC'. */
|
|
314
|
+
buy?: string;
|
|
315
|
+
amount?: string;
|
|
316
|
+
/** Solana only: deliver to the user's own wallet on this chain, when the app offers it. */
|
|
317
|
+
destinationChain?: SwapDestinationChain;
|
|
318
|
+
/** Called once the swap lands, with its transaction hash. */
|
|
319
|
+
onSuccess?: (result: {
|
|
320
|
+
hash: string;
|
|
321
|
+
}) => void;
|
|
322
|
+
}
|
|
323
|
+
interface SwapModalProps {
|
|
324
|
+
onClose: () => void;
|
|
325
|
+
initial?: SwapModalOptions | undefined;
|
|
326
|
+
}
|
|
327
|
+
declare function SwapModal({ onClose, initial }: SwapModalProps): react_jsx_runtime.JSX.Element;
|
|
328
|
+
|
|
329
|
+
/** Where the bridge modal opens: a starting point the user can change, never a lock. */
|
|
330
|
+
interface BridgeModalOptions {
|
|
331
|
+
/** Used only when the user can bridge from that chain. */
|
|
332
|
+
fromChain?: BridgeChain;
|
|
333
|
+
/** Used only when the user can bridge to it from the chain the modal opens on. */
|
|
334
|
+
toChain?: BridgeChain;
|
|
335
|
+
/** USDC, e.g. '25'. */
|
|
336
|
+
amount?: string;
|
|
337
|
+
/** Called once the USDC arrives on the destination, with the completed transfer. */
|
|
338
|
+
onSuccess?: (transfer: BridgeTransfer) => void;
|
|
339
|
+
}
|
|
340
|
+
interface BridgeModalProps {
|
|
341
|
+
onClose: () => void;
|
|
342
|
+
initial?: BridgeModalOptions | undefined;
|
|
343
|
+
}
|
|
344
|
+
declare function BridgeModal({ onClose, initial }: BridgeModalProps): react_jsx_runtime.JSX.Element;
|
|
345
|
+
|
|
346
|
+
/** Where the earn modal opens: a starting point the user can change. An option the app does not offer is left out. */
|
|
347
|
+
interface EarnModalOptions {
|
|
348
|
+
/** The network the modal opens on, when the app offers Earn on both. */
|
|
349
|
+
chain?: EarnNetwork;
|
|
350
|
+
provider?: EarnProviderId;
|
|
351
|
+
/** The vault or pool, as `getEarnOpportunities` names it. */
|
|
352
|
+
opportunityId?: string;
|
|
353
|
+
tab?: 'deposit' | 'withdraw';
|
|
354
|
+
amount?: string;
|
|
355
|
+
/** Called once the deposit or withdrawal lands, with its transaction hash. */
|
|
356
|
+
onSuccess?: (result: {
|
|
357
|
+
hash: string;
|
|
358
|
+
}) => void;
|
|
359
|
+
}
|
|
360
|
+
interface EarnModalProps {
|
|
361
|
+
onClose: () => void;
|
|
362
|
+
initial?: EarnModalOptions | undefined;
|
|
363
|
+
}
|
|
364
|
+
/** The networks Earn runs on; the modal shows a selector when the app offers both. */
|
|
365
|
+
type EarnNetwork = 'STELLAR' | 'SOLANA';
|
|
366
|
+
declare function EarnModal({ onClose, initial }: EarnModalProps): react_jsx_runtime.JSX.Element;
|
|
367
|
+
|
|
368
|
+
/** Where the card modal opens: a starting point the user can change. An option the user cannot use is left out. */
|
|
369
|
+
interface CardModalOptions {
|
|
370
|
+
/** 'fund' opens the funding panel once the user's card has loaded; a user without a card stays on the card screen. */
|
|
371
|
+
panel?: 'fund';
|
|
372
|
+
amount?: string;
|
|
373
|
+
/** Network to fund from, when it is one the user can fund from. */
|
|
374
|
+
chain?: CardFundingChain;
|
|
375
|
+
/** Called with each funding the user sends from the modal. */
|
|
376
|
+
onFunded?: (funding: CardFunding) => void;
|
|
377
|
+
}
|
|
378
|
+
interface CardModalProps {
|
|
379
|
+
onClose: () => void;
|
|
380
|
+
initial?: CardModalOptions | undefined;
|
|
381
|
+
}
|
|
382
|
+
declare function CardModal({ onClose, initial }: CardModalProps): react_jsx_runtime.JSX.Element;
|
|
383
|
+
|
|
384
|
+
/** Where the history opens: the network whose transactions it lists. A network the app does not offer is left out. */
|
|
385
|
+
interface TxHistoryModalOptions {
|
|
386
|
+
chain?: WalletChain;
|
|
387
|
+
}
|
|
388
|
+
|
|
21
389
|
interface PollarContextValue {
|
|
22
390
|
/**
|
|
23
391
|
* The authenticated user's wallet as a discriminated union over `custody`
|
|
@@ -153,12 +521,16 @@ interface PollarContextValue {
|
|
|
153
521
|
level?: 'basic' | 'intermediate' | 'enhanced';
|
|
154
522
|
onApproved?: () => void;
|
|
155
523
|
}) => void;
|
|
156
|
-
|
|
524
|
+
/** Opens the ramp widget, on the direction, country, fiat, asset and amount given; without options, on its defaults. */
|
|
525
|
+
openRampModal: (options?: RampModalOptions) => void;
|
|
157
526
|
txHistory: TxHistoryState;
|
|
158
|
-
|
|
527
|
+
/** Opens the history, on the network given; without options, on the app's first network. */
|
|
528
|
+
openTxHistoryModal: (options?: TxHistoryModalOptions) => void;
|
|
159
529
|
openWalletBalanceModal: () => void;
|
|
160
|
-
|
|
161
|
-
|
|
530
|
+
/** Opens the send modal, prefilled with the options given; `onSuccess` hears the payment land. */
|
|
531
|
+
openSendModal: (options?: SendModalOptions) => void;
|
|
532
|
+
/** Opens the receive modal, on the network given. */
|
|
533
|
+
openReceiveModal: (options?: ReceiveModalOptions) => void;
|
|
162
534
|
/**
|
|
163
535
|
* The swap venues this app exposes to end-users (empty = swap disabled, hide
|
|
164
536
|
* swap UI). Mirrors {@link PollarClient.getSwapConfig}.
|
|
@@ -181,8 +553,24 @@ interface PollarContextValue {
|
|
|
181
553
|
swap: (quote: SwapQuote, opts?: {
|
|
182
554
|
autoTrustline?: boolean;
|
|
183
555
|
}) => Promise<SubmitOutcome>;
|
|
556
|
+
/** The Solana venues this app exposes (`jupiter`, `titan`). Mirrors {@link PollarClient.getSolanaSwapConfig}. */
|
|
557
|
+
getSolanaSwapConfig: () => Promise<SolanaSwapVenue[]>;
|
|
558
|
+
/** Quote a swap from the user's Solana wallet, in base units. Mirrors {@link PollarClient.getSolanaSwapQuote}. */
|
|
559
|
+
getSolanaSwapQuote: (params: SolanaSwapQuoteParams) => Promise<SolanaSwapQuote[]>;
|
|
560
|
+
/** Run a Solana swap from a quote. Drives the transaction state machine. Mirrors {@link PollarClient.swapSolana}. */
|
|
561
|
+
swapSolana: (quote: SolanaSwapQuote, opts?: {
|
|
562
|
+
slippageBps?: number;
|
|
563
|
+
idempotencyKey?: string;
|
|
564
|
+
}) => Promise<SubmitOutcome>;
|
|
565
|
+
/** The Solana venues and the chains a Solana swap delivers to. Mirrors {@link PollarClient.getSolanaSwapOptions}. */
|
|
566
|
+
getSolanaSwapOptions: () => Promise<SolanaSwapOptions>;
|
|
567
|
+
/** Where a swap built under a key stands, its settlement included. Mirrors {@link PollarClient.getSwapStatus}. */
|
|
568
|
+
getSwapStatus: (idempotencyKey: string) => Promise<SwapStatus>;
|
|
184
569
|
/** Open the swap modal. */
|
|
185
|
-
|
|
570
|
+
/** Opens the swap modal, on the network, assets and amount given; `onSuccess` hears the swap land. */
|
|
571
|
+
openSwapModal: (options?: SwapModalOptions) => void;
|
|
572
|
+
/** Opens the modal that moves USDC between the user's wallets on different networks (mainnet), on the direction and amount given; `onSuccess` hears the USDC arrive. */
|
|
573
|
+
openBridgeModal: (options?: BridgeModalOptions) => void;
|
|
186
574
|
/**
|
|
187
575
|
* The yield providers this app exposes to end-users (empty = Earn disabled,
|
|
188
576
|
* hide Earn UI). Mirrors {@link PollarClient.getEarnProviders}.
|
|
@@ -208,14 +596,26 @@ interface PollarContextValue {
|
|
|
208
596
|
* {@link PollarClient.earnWithdraw}.
|
|
209
597
|
*/
|
|
210
598
|
earnWithdraw: (params: EarnTxParams) => Promise<SubmitOutcome>;
|
|
599
|
+
/** The Earn providers on Solana (empty = no Earn there). Mirrors {@link PollarClient.getSolanaEarnProviders}. */
|
|
600
|
+
getSolanaEarnProviders: () => Promise<SolanaEarnProviderId[]>;
|
|
601
|
+
/** The Solana opportunities, APY after fees. Mirrors {@link PollarClient.getSolanaEarnOpportunities}. */
|
|
602
|
+
getSolanaEarnOpportunities: () => Promise<SolanaEarnOpportunity[]>;
|
|
603
|
+
/** The user's position in a Solana opportunity. Mirrors {@link PollarClient.getSolanaEarnPosition}. */
|
|
604
|
+
getSolanaEarnPosition: (opportunity: string) => Promise<SolanaEarnPosition>;
|
|
605
|
+
/** Deposit into a Solana opportunity. Mirrors {@link PollarClient.earnSolanaDeposit}. */
|
|
606
|
+
earnSolanaDeposit: (params: SolanaEarnTxParams) => Promise<SubmitOutcome>;
|
|
607
|
+
/** Withdraw from a Solana opportunity. Mirrors {@link PollarClient.earnSolanaWithdraw}. */
|
|
608
|
+
earnSolanaWithdraw: (params: SolanaEarnTxParams) => Promise<SubmitOutcome>;
|
|
211
609
|
/** Open the Earn modal. */
|
|
212
|
-
|
|
610
|
+
/** Opens the earn modal, on the provider, opportunity, tab and amount given; `onSuccess` hears the transaction land. */
|
|
611
|
+
openEarnModal: (options?: EarnModalOptions) => void;
|
|
213
612
|
/**
|
|
214
613
|
* Open the Cards modal: sign-up, identity verification, issuing, the card
|
|
215
614
|
* itself and its activity. The card calls live on {@link PollarClient}
|
|
216
615
|
* (`getCardProviders`, `issueCard`, `revealCardSecrets`, ...).
|
|
217
616
|
*/
|
|
218
|
-
|
|
617
|
+
/** Opens the card modal, on its funding panel when asked; `onFunded` hears each funding sent. */
|
|
618
|
+
openCardModal: (options?: CardModalOptions) => void;
|
|
219
619
|
openDistributionRulesModal: () => void;
|
|
220
620
|
adapters?: PollarAdapters;
|
|
221
621
|
}
|
|
@@ -234,6 +634,14 @@ interface PollarProviderProps {
|
|
|
234
634
|
* always kept.
|
|
235
635
|
*/
|
|
236
636
|
client: PollarClient | PollarClientConfig;
|
|
637
|
+
/**
|
|
638
|
+
* Language of the modals, a BCP 47 tag such as `'es'` or `'pt-BR'`: typically
|
|
639
|
+
* the app's current language. Unlike `client`, it is followed on every render,
|
|
640
|
+
* so open modals switch when it changes. It wins over the client's `locale`; a
|
|
641
|
+
* language pinned in the dashboard wins over it, and a tag the modals have no
|
|
642
|
+
* translation for is skipped.
|
|
643
|
+
*/
|
|
644
|
+
language?: string | undefined;
|
|
237
645
|
/**
|
|
238
646
|
* Local REPLACEMENT for the `/applications/config` response, not a patch over
|
|
239
647
|
* it. Passing anything at all skips the remote fetch entirely; what you pass
|
|
@@ -273,11 +681,12 @@ interface PollarProviderProps {
|
|
|
273
681
|
onStorageDegrade?: OnStorageDegrade;
|
|
274
682
|
children: ReactNode;
|
|
275
683
|
}
|
|
276
|
-
declare function PollarProvider({ client, appConfig: appConfigProp, adapters, onStorageDegrade, children, }: PollarProviderProps): react_jsx_runtime.JSX.Element;
|
|
684
|
+
declare function PollarProvider({ client, language, appConfig: appConfigProp, adapters, onStorageDegrade, children, }: PollarProviderProps): react_jsx_runtime.JSX.Element;
|
|
277
685
|
declare function usePollar(): PollarContextValue;
|
|
278
686
|
|
|
687
|
+
/** A transaction adapter answers with the submit; an auth-entry one with what its `complete` returned. */
|
|
279
688
|
type WrappedAdapter<T extends PollarAdapter> = {
|
|
280
|
-
[K in keyof T]: (params: Parameters<T[K]>[0]) => Promise<SubmitOutcome>;
|
|
689
|
+
[K in keyof T]: (params: Parameters<T[K]>[0]) => Promise<Awaited<ReturnType<T[K]>> extends AuthEntryAdapterStep<infer R> ? AuthEntryAdapterOutcome<R> : SubmitOutcome>;
|
|
281
690
|
};
|
|
282
691
|
declare function createPollarAdapterHook<T extends PollarAdapter>(key: string): () => WrappedAdapter<T>;
|
|
283
692
|
|
|
@@ -333,67 +742,10 @@ declare const browserRecoveryPasskey: RecoveryPasskeyCeremony;
|
|
|
333
742
|
* Returns null when the wallet is usable, so a caller reads it as "no reason to
|
|
334
743
|
* block".
|
|
335
744
|
*/
|
|
336
|
-
declare function walletNotReadyReason(wallet: WalletInfo | null | undefined, chain: WalletChain | null | undefined): string | null;
|
|
745
|
+
declare function walletNotReadyReason(wallet: WalletInfo | null | undefined, chain: WalletChain | null | undefined, language?: PollarLanguage): string | null;
|
|
337
746
|
|
|
338
747
|
declare function WalletButton(): react_jsx_runtime.JSX.Element;
|
|
339
748
|
|
|
340
|
-
/** Per-app overrides for the modal chrome, configured in the dashboard's
|
|
341
|
-
* Branding screen. Every field is optional: absent means "use the value the
|
|
342
|
-
* theme derives", which is what every modal rendered before these existed. */
|
|
343
|
-
interface ModalStyleOverrides {
|
|
344
|
-
/** Card background. Overrides the theme's white / #1a1a1a. */
|
|
345
|
-
backgroundColor?: string | null | undefined;
|
|
346
|
-
/** Body text. Overrides the theme's #111827 / white. With a background or a
|
|
347
|
-
* text color set, borders, secondary ("muted") text and input fills are
|
|
348
|
-
* blended from the pair instead of taken from the theme. */
|
|
349
|
-
textColor?: string | null | undefined;
|
|
350
|
-
/** Fill of the SECONDARY buttons (the wallet / social / provider entries, the
|
|
351
|
-
* retry button). The primary button is the accent's job. Unset => the theme's
|
|
352
|
-
* own surface color, which is what these buttons always used. */
|
|
353
|
-
buttonColor?: string | null | undefined;
|
|
354
|
-
/** Radius of the modal card itself, in px. */
|
|
355
|
-
modalBorderRadius?: number | null | undefined;
|
|
356
|
-
/** Radius of the buttons inside the modal, in px. Independent of the card's. */
|
|
357
|
-
buttonBorderRadius?: number | null | undefined;
|
|
358
|
-
}
|
|
359
|
-
/** Text color that stays legible on `background`. The primary button's label was
|
|
360
|
-
* hardcoded white, which a light fill (the Amber accent preset, say) turns
|
|
361
|
-
* invisible - so it follows the fill's luminance instead. Unparseable colors
|
|
362
|
-
* keep white, the pre-existing behavior. */
|
|
363
|
-
declare function readableTextOn(background: string): string;
|
|
364
|
-
/** How much room a modal gives its header. 'hero' is the identity-forward set
|
|
365
|
-
* (login, KYC, ramp, the Privy sub-modal): roomier padding and a larger
|
|
366
|
-
* centered heading. 'compact' is every utility modal (send, balance, history,
|
|
367
|
-
* ...), which keeps the card's own 1.75rem padding. */
|
|
368
|
-
type ModalVariant = 'hero' | 'compact';
|
|
369
|
-
/** The app's Branding as inline CSS custom properties for a Pollar root (a modal
|
|
370
|
-
* card, the wallet button).
|
|
371
|
-
*
|
|
372
|
-
* Everything is written under the private `--pollar-brand-*` names, never the
|
|
373
|
-
* public `--pollar-*` ones: `shared.css` maps brand onto public inside a
|
|
374
|
-
* zero-specificity `:where()`, so a host stylesheet that sets a public variable
|
|
375
|
-
* on a Pollar root beats the Branding, and the Branding beats the theme
|
|
376
|
-
* defaults. An inline `--pollar-*` would beat every stylesheet instead.
|
|
377
|
-
*
|
|
378
|
-
* The palette (background, text, borders, status colors) is only written when
|
|
379
|
-
* the app pinned it: a dark theme, or a background or text color of its own.
|
|
380
|
-
* Left out, the light defaults in `shared.css` apply, and a host `html.dark`
|
|
381
|
-
* swaps them for the dark ones. */
|
|
382
|
-
declare function buildModalCssVars(theme: string, accentColor: string, overrides?: ModalStyleOverrides, variant?: ModalVariant): CSSProperties;
|
|
383
|
-
/** Everything a modal wrapper needs to dress itself from the app's branding:
|
|
384
|
-
* the theme pair its template already took, the overrides to forward to that
|
|
385
|
-
* template, and the inline style for the fixed overlay behind it. */
|
|
386
|
-
interface ModalChrome {
|
|
387
|
-
theme: string;
|
|
388
|
-
accentColor: string;
|
|
389
|
-
styleOverrides: ModalStyleOverrides;
|
|
390
|
-
overlayStyle: CSSProperties;
|
|
391
|
-
}
|
|
392
|
-
/** Resolve the branding config into the props/styles a modal wrapper applies.
|
|
393
|
-
* Called by every `.pollar-overlay` renderer so the z-index and the card
|
|
394
|
-
* overrides can't drift apart between modals. */
|
|
395
|
-
declare function modalChrome(styles: PollarStyles): ModalChrome;
|
|
396
|
-
|
|
397
749
|
interface WalletButtonTemplateProps {
|
|
398
750
|
walletAddress: string | null;
|
|
399
751
|
theme: string;
|
|
@@ -410,7 +762,7 @@ interface WalletButtonTemplateProps {
|
|
|
410
762
|
* Why the wallet cannot act on-chain yet (its account is being created, or
|
|
411
763
|
* that failed), or null when it can. Shown as a banner in the dropdown, since
|
|
412
764
|
* the address itself is valid and worth copying either way. Optional, so a
|
|
413
|
-
* custom template
|
|
765
|
+
* custom template that does not read it keeps compiling.
|
|
414
766
|
*/
|
|
415
767
|
notReadyReason?: string | null;
|
|
416
768
|
/**
|
|
@@ -425,7 +777,7 @@ interface WalletButtonTemplateProps {
|
|
|
425
777
|
* Signed in with no wallet yet (an app that creates wallets on demand, or
|
|
426
778
|
* none). The button then shows the account menu instead of Login, with Create
|
|
427
779
|
* wallet only when `onCreateWallet` is set. Optional, so a custom template
|
|
428
|
-
*
|
|
780
|
+
* that does not read it keeps compiling.
|
|
429
781
|
*/
|
|
430
782
|
signedIn?: boolean;
|
|
431
783
|
creatingWallet?: boolean;
|
|
@@ -450,8 +802,10 @@ interface WalletButtonTemplateProps {
|
|
|
450
802
|
onDistributionRules: () => void;
|
|
451
803
|
onLogout: () => void;
|
|
452
804
|
onLogin: () => void;
|
|
805
|
+
/** Language of the button and its menu. Defaults to the user's device; the button passes the resolved one. */
|
|
806
|
+
language?: PollarLanguage | undefined;
|
|
453
807
|
}
|
|
454
|
-
declare function WalletButtonTemplate({ walletAddress, theme, accentColor, styleOverrides, open, copied, wrapperRef, isInProgress, showCreateAccount, notReadyReason, recoveryLocked, onRecovery, creatingAccount, onToggleOpen, onCreateAccount, onCopy, onWalletBalance, onTxHistory, onSend, onReceive, onSessions, onKyc, onRamp, onDistributionRules, onLogout, onLogin, signedIn, creatingWallet, createWalletError, custodyChoice, onCreateWallet, }: WalletButtonTemplateProps): react_jsx_runtime.JSX.Element;
|
|
808
|
+
declare function WalletButtonTemplate({ walletAddress, theme, accentColor, styleOverrides, open, copied, wrapperRef, isInProgress, showCreateAccount, notReadyReason, recoveryLocked, onRecovery, creatingAccount, onToggleOpen, onCreateAccount, onCopy, onWalletBalance, onTxHistory, onSend, onReceive, onSessions, onKyc, onRamp, onDistributionRules, onLogout, onLogin, signedIn, creatingWallet, createWalletError, custodyChoice, onCreateWallet, language: languageProp, }: WalletButtonTemplateProps): react_jsx_runtime.JSX.Element;
|
|
455
809
|
|
|
456
810
|
/**
|
|
457
811
|
* The chain a record lives on, with the legacy shape folded in: sessions and
|
|
@@ -487,8 +841,9 @@ interface ChainSelectProps {
|
|
|
487
841
|
options: WalletChain[];
|
|
488
842
|
onChange: (chain: WalletChain) => void;
|
|
489
843
|
disabled?: boolean;
|
|
844
|
+
language?: PollarLanguage | undefined;
|
|
490
845
|
}
|
|
491
|
-
declare function ChainSelect({ label, value, options, onChange, disabled }: ChainSelectProps): react_jsx_runtime.JSX.Element | null;
|
|
846
|
+
declare function ChainSelect({ label, value, options, onChange, disabled, language: languageProp }: ChainSelectProps): react_jsx_runtime.JSX.Element | null;
|
|
492
847
|
|
|
493
848
|
interface UseChainsResult {
|
|
494
849
|
/**
|
|
@@ -557,8 +912,10 @@ interface KycModalProps {
|
|
|
557
912
|
level?: 'basic' | 'intermediate' | 'enhanced';
|
|
558
913
|
/** Called when KYC is successfully approved. */
|
|
559
914
|
onApproved?: () => void;
|
|
915
|
+
/** Language of the modal, as a BCP 47 tag. A language pinned in the dashboard wins over it. */
|
|
916
|
+
language?: string | undefined;
|
|
560
917
|
}
|
|
561
|
-
declare function KycModal({ onClose, country, level, onApproved, corridorId, cardProviderId, providerId, }: KycModalProps): react_jsx_runtime.JSX.Element;
|
|
918
|
+
declare function KycModal({ onClose, country, level, onApproved, corridorId, cardProviderId, providerId, language: languageProp, }: KycModalProps): react_jsx_runtime.JSX.Element;
|
|
562
919
|
|
|
563
920
|
interface RequirementFormModalProps {
|
|
564
921
|
formId: string;
|
|
@@ -570,9 +927,11 @@ interface RequirementFormModalProps {
|
|
|
570
927
|
onClose: () => void;
|
|
571
928
|
/** Called once the answers are stored. */
|
|
572
929
|
onSubmitted: () => void;
|
|
930
|
+
/** Language of the modal, as a BCP 47 tag. A language pinned in the dashboard wins over it. */
|
|
931
|
+
language?: string | undefined;
|
|
573
932
|
}
|
|
574
933
|
/** One FORM requirement step: the form a route asks for, prefilled with the user's previous answers. */
|
|
575
|
-
declare function RequirementFormModal({ formId, progress, onClose, onSubmitted }: RequirementFormModalProps): react_jsx_runtime.JSX.Element;
|
|
934
|
+
declare function RequirementFormModal({ formId, progress, onClose, onSubmitted, language: languageProp, }: RequirementFormModalProps): react_jsx_runtime.JSX.Element;
|
|
576
935
|
|
|
577
936
|
interface RegistryCheckModalProps {
|
|
578
937
|
optionId: string;
|
|
@@ -584,12 +943,14 @@ interface RegistryCheckModalProps {
|
|
|
584
943
|
onClose: () => void;
|
|
585
944
|
/** Called once the registry confirmed the data. */
|
|
586
945
|
onApproved: () => void;
|
|
946
|
+
/** Language of the modal, as a BCP 47 tag. A language pinned in the dashboard wins over it. */
|
|
947
|
+
language?: string | undefined;
|
|
587
948
|
}
|
|
588
949
|
/**
|
|
589
950
|
* One REGISTRY_CHECK step (SEGIP): the user's verified data, prefilled and read-only
|
|
590
951
|
* except for the surname split and the CI complement, sent to the registry on confirm.
|
|
591
952
|
*/
|
|
592
|
-
declare function RegistryCheckModal({ optionId, progress, onClose, onApproved }: RegistryCheckModalProps): react_jsx_runtime.JSX.Element;
|
|
953
|
+
declare function RegistryCheckModal({ optionId, progress, onClose, onApproved, language: languageProp, }: RegistryCheckModalProps): react_jsx_runtime.JSX.Element;
|
|
593
954
|
|
|
594
955
|
interface ProviderRegistrationModalProps {
|
|
595
956
|
/** The route whose ramp the user registers with. */
|
|
@@ -604,25 +965,24 @@ interface ProviderRegistrationModalProps {
|
|
|
604
965
|
onClose: () => void;
|
|
605
966
|
/** Called once the user is registered with the provider. */
|
|
606
967
|
onRegistered: () => void;
|
|
968
|
+
/** Language of the modal, as a BCP 47 tag. A language pinned in the dashboard wins over it. */
|
|
969
|
+
language?: string | undefined;
|
|
607
970
|
}
|
|
608
971
|
/**
|
|
609
972
|
* One PROVIDER_REGISTRATION step: what the ramp provider receives, listed before the
|
|
610
973
|
* user consents. Registering is the consent; nothing is sent until then.
|
|
611
974
|
*/
|
|
612
|
-
declare function ProviderRegistrationModal({ corridorId, cardProviderId, progress, onClose, onRegistered, }: ProviderRegistrationModalProps): react_jsx_runtime.JSX.Element;
|
|
975
|
+
declare function ProviderRegistrationModal({ corridorId, cardProviderId, progress, onClose, onRegistered, language: languageProp, }: ProviderRegistrationModalProps): react_jsx_runtime.JSX.Element;
|
|
613
976
|
|
|
614
977
|
interface KycStatusProps {
|
|
615
978
|
status: KycStatus$1;
|
|
616
979
|
/** Replaces the status label, keeping its color. */
|
|
617
980
|
label?: string;
|
|
618
981
|
className?: string;
|
|
982
|
+
/** Language of the status label. Defaults to the user's device. */
|
|
983
|
+
language?: PollarLanguage | undefined;
|
|
619
984
|
}
|
|
620
|
-
declare function KycStatus({ status, label, className }: KycStatusProps): react_jsx_runtime.JSX.Element;
|
|
621
|
-
|
|
622
|
-
interface RampWidgetProps {
|
|
623
|
-
onClose: () => void;
|
|
624
|
-
}
|
|
625
|
-
declare function RampWidget({ onClose }: RampWidgetProps): react_jsx_runtime.JSX.Element;
|
|
985
|
+
declare function KycStatus({ status, label, className, language: languageProp }: KycStatusProps): react_jsx_runtime.JSX.Element;
|
|
626
986
|
|
|
627
987
|
interface RouteDisplayProps {
|
|
628
988
|
quote: RampQuote;
|
|
@@ -633,13 +993,15 @@ interface RouteDisplayProps {
|
|
|
633
993
|
/** Another route is starting, so this one is not selectable meanwhile. */
|
|
634
994
|
disabled?: boolean;
|
|
635
995
|
onSelect: (quote: RampQuote) => void;
|
|
996
|
+
/** Defaults to the user's device; the widget passes the resolved one. */
|
|
997
|
+
language?: PollarLanguage;
|
|
636
998
|
}
|
|
637
|
-
declare function RouteDisplay({ quote, best, busy, disabled, onSelect }: RouteDisplayProps): react_jsx_runtime.JSX.Element;
|
|
999
|
+
declare function RouteDisplay({ quote, best, busy, disabled, onSelect, language: languageProp, }: RouteDisplayProps): react_jsx_runtime.JSX.Element;
|
|
638
1000
|
/**
|
|
639
1001
|
* A route that was planned and dropped, and what the user can do about it: a
|
|
640
1002
|
* verification step opens from its button, a missing trustline is added from its own.
|
|
641
1003
|
*/
|
|
642
|
-
declare function RejectedRouteDisplay({ rejection, disabled, trusting, walletBusy, custodyChoice, onVerify, onTrust, onWalletStep, }: {
|
|
1004
|
+
declare function RejectedRouteDisplay({ rejection, disabled, trusting, walletBusy, custodyChoice, onVerify, onTrust, onWalletStep, language: languageProp, }: {
|
|
643
1005
|
rejection: RampQuoteRejection;
|
|
644
1006
|
/** A route is starting, a trustline or a wallet is being added, so nothing else opens meanwhile. */
|
|
645
1007
|
disabled?: boolean;
|
|
@@ -662,6 +1024,8 @@ declare function RejectedRouteDisplay({ rejection, disabled, trusting, walletBus
|
|
|
662
1024
|
* the custody to the user creates the wallet from the wallet menu instead.
|
|
663
1025
|
*/
|
|
664
1026
|
onWalletStep?: ((step: RampWalletStep, custody?: CosignCustody) => void) | undefined;
|
|
1027
|
+
/** Defaults to the user's device; the widget passes the resolved one. */
|
|
1028
|
+
language?: PollarLanguage;
|
|
665
1029
|
}): react_jsx_runtime.JSX.Element;
|
|
666
1030
|
|
|
667
1031
|
interface WalletBalanceModalProps {
|
|
@@ -674,31 +1038,6 @@ interface EnabledAssetsModalProps {
|
|
|
674
1038
|
}
|
|
675
1039
|
declare function EnabledAssetsModal({ onClose }: EnabledAssetsModalProps): react_jsx_runtime.JSX.Element;
|
|
676
1040
|
|
|
677
|
-
interface SendModalProps {
|
|
678
|
-
onClose: () => void;
|
|
679
|
-
}
|
|
680
|
-
declare function SendModal({ onClose }: SendModalProps): react_jsx_runtime.JSX.Element;
|
|
681
|
-
|
|
682
|
-
interface SwapModalProps {
|
|
683
|
-
onClose: () => void;
|
|
684
|
-
}
|
|
685
|
-
declare function SwapModal({ onClose }: SwapModalProps): react_jsx_runtime.JSX.Element;
|
|
686
|
-
|
|
687
|
-
interface EarnModalProps {
|
|
688
|
-
onClose: () => void;
|
|
689
|
-
}
|
|
690
|
-
declare function EarnModal({ onClose }: EarnModalProps): react_jsx_runtime.JSX.Element;
|
|
691
|
-
|
|
692
|
-
interface CardModalProps {
|
|
693
|
-
onClose: () => void;
|
|
694
|
-
}
|
|
695
|
-
declare function CardModal({ onClose }: CardModalProps): react_jsx_runtime.JSX.Element;
|
|
696
|
-
|
|
697
|
-
interface ReceiveModalProps {
|
|
698
|
-
onClose: () => void;
|
|
699
|
-
}
|
|
700
|
-
declare function ReceiveModal({ onClose }: ReceiveModalProps): react_jsx_runtime.JSX.Element;
|
|
701
|
-
|
|
702
1041
|
interface SessionsModalProps {
|
|
703
1042
|
onClose: () => void;
|
|
704
1043
|
}
|
|
@@ -777,8 +1116,10 @@ interface LoginModalTemplateProps {
|
|
|
777
1116
|
onBack: () => void;
|
|
778
1117
|
onCancel: () => void;
|
|
779
1118
|
onRetry: () => void;
|
|
1119
|
+
/** Language of the modal's text. Defaults to the user's device; the modal passes the resolved one. */
|
|
1120
|
+
language?: PollarLanguage | undefined;
|
|
780
1121
|
}
|
|
781
|
-
declare function LoginModalTemplate({ theme, accentColor, styleOverrides, logoUrl, emailEnabled, embeddedWallets, smartWallet, providers, walletAdapters, appName, email, onEmailChange, onEmailSubmit, onSocialLogin, onWalletConnect, onLoginSmartWallet, onCreateSmartWallet, authState, codeInputKey, onCodeSubmit, onBack, onCancel, onRetry, }: LoginModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1122
|
+
declare function LoginModalTemplate({ theme, accentColor, styleOverrides, logoUrl, emailEnabled, embeddedWallets, smartWallet, providers, walletAdapters, appName, email, onEmailChange, onEmailSubmit, onSocialLogin, onWalletConnect, onLoginSmartWallet, onCreateSmartWallet, authState, codeInputKey, onCodeSubmit, onBack, onCancel, onRetry, language: languageProp, }: LoginModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
782
1123
|
|
|
783
1124
|
type KycStep = 'select_provider' | 'verifying' | 'polling' | 'done';
|
|
784
1125
|
interface KycModalTemplateProps {
|
|
@@ -808,11 +1149,15 @@ interface KycModalTemplateProps {
|
|
|
808
1149
|
onStartAgain?: () => void;
|
|
809
1150
|
onRefresh: () => void;
|
|
810
1151
|
onClose: () => void;
|
|
1152
|
+
/** Defaults to the user's device; the modal passes the resolved one. */
|
|
1153
|
+
language?: PollarLanguage | undefined;
|
|
811
1154
|
}
|
|
812
|
-
declare function KycModalTemplate({ theme, accentColor, styleOverrides, step, providers, selectedProvider, session, kycStatus, reviewReason, processing, isLoading, startingProviderId, directOpen, error, onSelectProvider, onDoneVerifying, onStartAgain, onRefresh, onClose, }: KycModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1155
|
+
declare function KycModalTemplate({ theme, accentColor, styleOverrides, step, providers, selectedProvider, session, kycStatus, reviewReason, processing, isLoading, startingProviderId, directOpen, error, onSelectProvider, onDoneVerifying, onStartAgain, onRefresh, onClose, language, }: KycModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
813
1156
|
|
|
814
1157
|
type RampStep = 'input' | 'loading_quote' | 'select_route' | 'contact' | 'status' | 'error';
|
|
815
1158
|
interface RampWidgetTemplateProps {
|
|
1159
|
+
/** Language of the widget's text and rail labels. Defaults to the user's device; the widget passes the resolved one. */
|
|
1160
|
+
language?: PollarLanguage;
|
|
816
1161
|
theme: string;
|
|
817
1162
|
accentColor: string;
|
|
818
1163
|
/** Per-app modal chrome overrides (background, card + button radius). */
|
|
@@ -883,6 +1228,8 @@ interface RampWidgetTemplateProps {
|
|
|
883
1228
|
retrying?: boolean;
|
|
884
1229
|
/** Runs the user's held order again; absent, a held order only says what happened. */
|
|
885
1230
|
onRetryOrder?: (() => void) | undefined;
|
|
1231
|
+
/** Quotes the same amount again when the price changed before anything moved; absent, only a new operation is offered. */
|
|
1232
|
+
onRequote?: (() => void) | undefined;
|
|
886
1233
|
/** Opens the wallet's recovery setup, for an order held until the wallet has a way to be recovered. */
|
|
887
1234
|
onSetUpRecovery?: (() => void) | undefined;
|
|
888
1235
|
/** Whether the wallet still has no way to be recovered; null while its state is unread. */
|
|
@@ -907,7 +1254,7 @@ interface RampWidgetTemplateProps {
|
|
|
907
1254
|
onRefresh: () => void;
|
|
908
1255
|
onClose: () => void;
|
|
909
1256
|
}
|
|
910
|
-
declare function RampWidgetTemplate({ theme, accentColor, styleOverrides, network, step, flowSteps, flowStepIndex, direction, routesLoading, countries, country, fiats, fiat, assets, asset, amount, sellAvailable, quotes, rejected, startingQuoteId, fields, fieldValues, order, pendingOrders, isLoading, refreshing, signing, errorMsg, notice, onDirectionChange, onCountryChange, onFiatChange, onAssetChange, onAmountChange, onFindRoute, onSelectQuote, onVerifyRoute, trustingAsset, onTrustAsset, walletBusy, custodyChoice, onWalletStep, noChains, retrying, onRetryOrder, onSetUpRecovery, recoveryMissing, checkingPayment, onCheckPayment, pollTrouble, onFieldChange, onContactContinue, onSign, onApprove, onResumeOrder, onNewOrder, onBack, onStepSelect, onRetry, onRefresh, onClose, }: RampWidgetTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1257
|
+
declare function RampWidgetTemplate({ theme, accentColor, styleOverrides, network, step, flowSteps, flowStepIndex, direction, routesLoading, countries, country, fiats, fiat, assets, asset, amount, sellAvailable, quotes, rejected, startingQuoteId, fields, fieldValues, order, pendingOrders, isLoading, refreshing, signing, errorMsg, notice, onDirectionChange, onCountryChange, onFiatChange, onAssetChange, onAmountChange, onFindRoute, onSelectQuote, onVerifyRoute, trustingAsset, onTrustAsset, walletBusy, custodyChoice, onWalletStep, noChains, retrying, onRetryOrder, onRequote, onSetUpRecovery, recoveryMissing, checkingPayment, onCheckPayment, pollTrouble, onFieldChange, onContactContinue, onSign, onApprove, onResumeOrder, onNewOrder, onBack, onStepSelect, onRetry, onRefresh, onClose, language: languageProp, }: RampWidgetTemplateProps): react_jsx_runtime.JSX.Element;
|
|
911
1258
|
|
|
912
1259
|
interface TransactionModalTemplateProps {
|
|
913
1260
|
theme: string;
|
|
@@ -924,22 +1271,30 @@ interface TransactionModalTemplateProps {
|
|
|
924
1271
|
onToggleXdr: () => void;
|
|
925
1272
|
onCopyHash: () => void;
|
|
926
1273
|
onRetry?: () => void;
|
|
1274
|
+
/** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
|
|
1275
|
+
language?: PollarLanguage | undefined;
|
|
927
1276
|
}
|
|
928
|
-
declare function TransactionModalTemplate({ theme, accentColor, styleOverrides, transaction, showXdr, copied, explorerUrl, walletType, onClose, onSignAndSend, onToggleXdr, onCopyHash, onRetry, }: TransactionModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1277
|
+
declare function TransactionModalTemplate({ theme, accentColor, styleOverrides, transaction, showXdr, copied, explorerUrl, walletType, onClose, onSignAndSend, onToggleXdr, onCopyHash, onRetry, language: languageProp, }: TransactionModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
929
1278
|
|
|
930
1279
|
interface TxStatusViewProps {
|
|
931
1280
|
transaction: TransactionState;
|
|
1281
|
+
/** Whether the details (addresses, network, fee, raw transaction, hash) are unfolded. */
|
|
932
1282
|
showXdr: boolean;
|
|
1283
|
+
/** Unused: the hash copies from the details. */
|
|
933
1284
|
copied: boolean;
|
|
934
1285
|
explorerUrl: string | null;
|
|
935
1286
|
walletType?: WalletId | null | undefined;
|
|
936
1287
|
onSignAndSend: () => void;
|
|
1288
|
+
/** Folds and unfolds the details. */
|
|
937
1289
|
onToggleXdr: () => void;
|
|
1290
|
+
/** Unused: the hash copies from the details. */
|
|
938
1291
|
onCopyHash: () => void;
|
|
939
1292
|
onRetry?: (() => void) | undefined;
|
|
940
1293
|
onDone: () => void;
|
|
1294
|
+
/** Language of the status text. Defaults to the user's device; the modals pass the resolved one. */
|
|
1295
|
+
language?: PollarLanguage | undefined;
|
|
941
1296
|
}
|
|
942
|
-
declare function TxStatusView({ transaction, showXdr,
|
|
1297
|
+
declare function TxStatusView({ transaction, showXdr, explorerUrl, walletType, onSignAndSend, onToggleXdr, onRetry, onDone, language: languageProp, }: TxStatusViewProps): react_jsx_runtime.JSX.Element;
|
|
943
1298
|
|
|
944
1299
|
interface TxHistoryModalTemplateProps {
|
|
945
1300
|
theme: string;
|
|
@@ -958,8 +1313,10 @@ interface TxHistoryModalTemplateProps {
|
|
|
958
1313
|
onPrev: () => void;
|
|
959
1314
|
onNext: () => void;
|
|
960
1315
|
onClose: () => void;
|
|
1316
|
+
/** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
|
|
1317
|
+
language?: PollarLanguage | undefined;
|
|
961
1318
|
}
|
|
962
|
-
declare function TxHistoryModalTemplate({ theme, accentColor, styleOverrides, txHistory, offset, chains, selectedChain, walletAddress, onSelectChain, onRefresh, onPrev, onNext, onClose, }: TxHistoryModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1319
|
+
declare function TxHistoryModalTemplate({ theme, accentColor, styleOverrides, txHistory, offset, chains, selectedChain, walletAddress, onSelectChain, onRefresh, onPrev, onNext, onClose, language: languageProp, }: TxHistoryModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
963
1320
|
|
|
964
1321
|
interface WalletBalanceModalTemplateProps {
|
|
965
1322
|
theme: string;
|
|
@@ -982,8 +1339,10 @@ interface WalletBalanceModalTemplateProps {
|
|
|
982
1339
|
onSelectChain?: (chain: WalletChain) => void;
|
|
983
1340
|
onRefresh: () => void;
|
|
984
1341
|
onClose: () => void;
|
|
1342
|
+
/** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
|
|
1343
|
+
language?: PollarLanguage | undefined;
|
|
985
1344
|
}
|
|
986
|
-
declare function WalletBalanceModalTemplate({ theme, accentColor, styleOverrides, walletBalance, walletAddress, assetMetadata, chains, selectedChain, network, onSelectChain, onRefresh, onClose, }: WalletBalanceModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1345
|
+
declare function WalletBalanceModalTemplate({ theme, accentColor, styleOverrides, walletBalance, walletAddress, assetMetadata, chains, selectedChain, network, onSelectChain, onRefresh, onClose, language: languageProp, }: WalletBalanceModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
987
1346
|
|
|
988
1347
|
interface EnabledAssetsModalTemplateProps {
|
|
989
1348
|
theme: string;
|
|
@@ -1004,8 +1363,10 @@ interface EnabledAssetsModalTemplateProps {
|
|
|
1004
1363
|
onClose: () => void;
|
|
1005
1364
|
onToggleTrustline: (record: EnabledAssetRecord) => void;
|
|
1006
1365
|
onAddCustom: () => void;
|
|
1366
|
+
/** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
|
|
1367
|
+
language?: PollarLanguage | undefined;
|
|
1007
1368
|
}
|
|
1008
|
-
declare function EnabledAssetsModalTemplate({ theme, accentColor, styleOverrides, enabledAssets, walletAddress, chains, selectedChain, onSelectChain, busyKey, actionError, onRefresh, onClose, onToggleTrustline, onAddCustom, }: EnabledAssetsModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1369
|
+
declare function EnabledAssetsModalTemplate({ theme, accentColor, styleOverrides, enabledAssets, walletAddress, chains, selectedChain, onSelectChain, busyKey, actionError, onRefresh, onClose, onToggleTrustline, onAddCustom, language: languageProp, }: EnabledAssetsModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1009
1370
|
interface CustomTrustlineModalTemplateProps {
|
|
1010
1371
|
theme: string;
|
|
1011
1372
|
accentColor: string;
|
|
@@ -1020,142 +1381,47 @@ interface CustomTrustlineModalTemplateProps {
|
|
|
1020
1381
|
issuer: string;
|
|
1021
1382
|
limit?: string;
|
|
1022
1383
|
}) => void;
|
|
1384
|
+
/** Language of the form. Defaults to the user's device; the modal passes the resolved one. */
|
|
1385
|
+
language?: PollarLanguage | undefined;
|
|
1023
1386
|
}
|
|
1024
1387
|
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
interface SendModalTemplateProps {
|
|
1388
|
+
type BridgeModalStep = 'loading' | 'unavailable' | 'form' | 'transfer';
|
|
1389
|
+
interface BridgeModalTemplateProps {
|
|
1028
1390
|
theme: string;
|
|
1029
1391
|
accentColor: string;
|
|
1030
|
-
/** Per-app modal chrome overrides (background, card + button radius). */
|
|
1031
1392
|
styleOverrides?: ModalStyleOverrides;
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
selectedChain: WalletChain | null;
|
|
1042
|
-
/**
|
|
1043
|
-
* The networks the user can send from, in the app's configured order. The
|
|
1044
|
-
* picker renders only with two or more, so a single-chain app shows none.
|
|
1045
|
-
*/
|
|
1046
|
-
chains?: WalletChain[];
|
|
1047
|
-
/** @deprecated Kept for compatibility; the sender address is no longer shown. */
|
|
1048
|
-
walletAddress?: string;
|
|
1049
|
-
/** Can a payment be built on {@link selectedChain}? Stellar and Solana only. */
|
|
1050
|
-
canSendOnChain: boolean;
|
|
1051
|
-
/**
|
|
1052
|
-
* Why the wallet cannot act on-chain right now (its Stellar account is still
|
|
1053
|
-
* being created, or its creation failed), or null when it can.
|
|
1054
|
-
*
|
|
1055
|
-
* Separate from {@link canSendOnChain}: that one is about the NETWORK not
|
|
1056
|
-
* having a transfer path, this one about the user's own account. Collapsing
|
|
1057
|
-
* them would tell someone waiting on a brand-new wallet that Stellar does not
|
|
1058
|
-
* support sending. Optional, so a custom template written before this existed
|
|
1059
|
-
* keeps compiling.
|
|
1060
|
-
*/
|
|
1061
|
-
notReadyReason?: string | null;
|
|
1062
|
-
onSelectChain?: (chain: WalletChain) => void;
|
|
1393
|
+
step: BridgeModalStep;
|
|
1394
|
+
/** Why the form is not offered: off mainnet, or no pair of wallets to bridge between. */
|
|
1395
|
+
unavailableReason: 'mainnet_only' | 'no_directions' | null;
|
|
1396
|
+
sources: BridgeChain[];
|
|
1397
|
+
targets: BridgeChain[];
|
|
1398
|
+
fromChain: BridgeChain | null;
|
|
1399
|
+
toChain: BridgeChain | null;
|
|
1400
|
+
onFromChange: (chain: BridgeChain) => void;
|
|
1401
|
+
onToChange: (chain: BridgeChain) => void;
|
|
1063
1402
|
amount: string;
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
/** The destination's account is being looked up; the form waits for it. */
|
|
1068
|
-
isCheckingDestination?: boolean;
|
|
1069
|
-
/** The least XLM a new Stellar account can start with. */
|
|
1070
|
-
minStartingBalance?: number;
|
|
1071
|
-
/** Builds a `create_account` for the destination, funded with the amount. Required for the `create-account` step. */
|
|
1072
|
-
onCreateAccount?: () => void;
|
|
1073
|
-
transaction: TransactionState;
|
|
1074
|
-
showXdr: boolean;
|
|
1075
|
-
copied: boolean;
|
|
1076
|
-
explorerUrl: string | null;
|
|
1077
|
-
walletType?: WalletId | null | undefined;
|
|
1078
|
-
showBack: boolean;
|
|
1079
|
-
isInProgress: boolean;
|
|
1080
|
-
onClose: () => void;
|
|
1081
|
-
onBack: () => void;
|
|
1082
|
-
onRefresh: () => void;
|
|
1083
|
-
onSelectAsset: (asset: WalletBalanceRecord) => void;
|
|
1084
|
-
onAmountChange: (value: string) => void;
|
|
1403
|
+
onAmountChange: (amount: string) => void;
|
|
1404
|
+
/** USDC available on `fromChain`; null while unknown. */
|
|
1405
|
+
balance: string | null;
|
|
1085
1406
|
onMax: () => void;
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
/**
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
*/
|
|
1093
|
-
memo?: string;
|
|
1094
|
-
memoType?: SendMemoType;
|
|
1095
|
-
onMemoChange?: (value: string) => void;
|
|
1096
|
-
onMemoTypeChange?: (type: SendMemoType) => void;
|
|
1407
|
+
quote: BridgeQuote | null;
|
|
1408
|
+
quoting: boolean;
|
|
1409
|
+
/** What is wrong with the form or what the server refused, ready to show. */
|
|
1410
|
+
formError: string | null;
|
|
1411
|
+
canSubmit: boolean;
|
|
1412
|
+
submitting: boolean;
|
|
1097
1413
|
onSubmit: () => void;
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
interface SwapAssetOption {
|
|
1107
|
-
ref: SwapQuoteParams['sellAsset'];
|
|
1108
|
-
code: string;
|
|
1109
|
-
issuer?: string | undefined;
|
|
1110
|
-
available?: string | undefined;
|
|
1111
|
-
enabledInApp?: boolean | undefined;
|
|
1112
|
-
}
|
|
1113
|
-
interface SwapModalTemplateProps {
|
|
1114
|
-
theme: string;
|
|
1115
|
-
accentColor: string;
|
|
1116
|
-
styleOverrides?: ModalStyleOverrides;
|
|
1117
|
-
step: 'form' | 'tx';
|
|
1118
|
-
txTitle: string;
|
|
1119
|
-
sellOptions: SwapAssetOption[];
|
|
1120
|
-
buyOptions: SwapAssetOption[];
|
|
1121
|
-
selectedSell: SwapAssetOption | null;
|
|
1122
|
-
selectedBuy: SwapAssetOption | null;
|
|
1123
|
-
amount: string;
|
|
1124
|
-
provider: SwapProvider;
|
|
1125
|
-
providers: SwapProvider[];
|
|
1126
|
-
quote: SwapQuote | null;
|
|
1127
|
-
quoteLoading: boolean;
|
|
1128
|
-
quoteError: string;
|
|
1129
|
-
formError: string;
|
|
1130
|
-
isLoadingData: boolean;
|
|
1131
|
-
smartUnsupported: boolean;
|
|
1132
|
-
configLoading: boolean;
|
|
1133
|
-
swapUnavailable: boolean;
|
|
1134
|
-
buyNeedsTrustline: boolean;
|
|
1135
|
-
transaction: TransactionState;
|
|
1136
|
-
showXdr: boolean;
|
|
1137
|
-
copied: boolean;
|
|
1138
|
-
explorerUrl: string | null;
|
|
1139
|
-
walletType?: WalletId | null | undefined;
|
|
1140
|
-
showBack: boolean;
|
|
1141
|
-
isInProgress: boolean;
|
|
1414
|
+
transfer: BridgeTransfer | null;
|
|
1415
|
+
signing: boolean;
|
|
1416
|
+
onAuthorize: () => void;
|
|
1417
|
+
onApprove: () => void;
|
|
1418
|
+
actionError: string | null;
|
|
1419
|
+
pollTrouble: boolean;
|
|
1420
|
+
onNewBridge: () => void;
|
|
1142
1421
|
onClose: () => void;
|
|
1143
|
-
|
|
1144
|
-
onRefresh: () => void;
|
|
1145
|
-
onSelectSell: (o: SwapAssetOption) => void;
|
|
1146
|
-
onSelectBuy: (o: SwapAssetOption) => void;
|
|
1147
|
-
onReverse: () => void;
|
|
1148
|
-
onMax: () => void;
|
|
1149
|
-
onAddCustomToken: (code: string, issuer: string) => string | null;
|
|
1150
|
-
onAmountChange: (value: string) => void;
|
|
1151
|
-
onProviderChange: (p: SwapProvider) => void;
|
|
1152
|
-
onSwap: () => void;
|
|
1153
|
-
onToggleXdr: () => void;
|
|
1154
|
-
onCopyHash: () => void;
|
|
1155
|
-
onRetry: () => void;
|
|
1156
|
-
onDone: () => void;
|
|
1422
|
+
language?: PollarLanguage | undefined;
|
|
1157
1423
|
}
|
|
1158
|
-
declare function
|
|
1424
|
+
declare function BridgeModalTemplate(props: BridgeModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1159
1425
|
|
|
1160
1426
|
interface ReceiveModalTemplateProps {
|
|
1161
1427
|
theme: string;
|
|
@@ -1178,7 +1444,7 @@ interface ReceiveModalTemplateProps {
|
|
|
1178
1444
|
*
|
|
1179
1445
|
* The address itself is valid either way - what is missing is the account
|
|
1180
1446
|
* behind it, so a payment sent now is rejected by the network. Optional, so a
|
|
1181
|
-
* custom template
|
|
1447
|
+
* custom template that does not read it keeps compiling.
|
|
1182
1448
|
*/
|
|
1183
1449
|
notReadyReason?: string | null;
|
|
1184
1450
|
/**
|
|
@@ -1190,8 +1456,10 @@ interface ReceiveModalTemplateProps {
|
|
|
1190
1456
|
onSetupRecovery?: () => void;
|
|
1191
1457
|
onCopy: () => void;
|
|
1192
1458
|
onClose: () => void;
|
|
1459
|
+
/** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
|
|
1460
|
+
language?: PollarLanguage | undefined;
|
|
1193
1461
|
}
|
|
1194
|
-
declare function ReceiveModalTemplate({ theme, accentColor, styleOverrides, walletAddress, chains, selectedChain, onSelectChain, copied, notReadyReason, recoveryLocked, onSetupRecovery, onCopy, onClose, }: ReceiveModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1462
|
+
declare function ReceiveModalTemplate({ theme, accentColor, styleOverrides, walletAddress, chains, selectedChain, onSelectChain, copied, notReadyReason, recoveryLocked, onSetupRecovery, onCopy, onClose, language: languageProp, }: ReceiveModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1195
1463
|
|
|
1196
1464
|
interface SessionsModalTemplateProps {
|
|
1197
1465
|
theme: string;
|
|
@@ -1206,8 +1474,10 @@ interface SessionsModalTemplateProps {
|
|
|
1206
1474
|
onRevoke: (familyId: string) => void;
|
|
1207
1475
|
onLogoutEverywhere: () => void;
|
|
1208
1476
|
onClose: () => void;
|
|
1477
|
+
/** Language of the modal's text. Defaults to the user's device; the modal passes the resolved one. */
|
|
1478
|
+
language?: PollarLanguage | undefined;
|
|
1209
1479
|
}
|
|
1210
|
-
declare function SessionsModalTemplate({ theme, accentColor, styleOverrides, state, revokingFamilyId, signingOutEverywhere, revokeError, onRefresh, onRevoke, onLogoutEverywhere, onClose, }: SessionsModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1480
|
+
declare function SessionsModalTemplate({ theme, accentColor, styleOverrides, state, revokingFamilyId, signingOutEverywhere, revokeError, onRefresh, onRevoke, onLogoutEverywhere, onClose, language: languageProp, }: SessionsModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1211
1481
|
|
|
1212
1482
|
interface CosignModalTemplateProps {
|
|
1213
1483
|
theme: string;
|
|
@@ -1224,6 +1494,10 @@ interface CosignModalTemplateProps {
|
|
|
1224
1494
|
error: string | null;
|
|
1225
1495
|
/** Approve stays off for a request whose approval just failed. */
|
|
1226
1496
|
approveBlocked?: boolean;
|
|
1497
|
+
/** This device is not one of the wallet's devices: it cannot vote, only reject, until it is added. */
|
|
1498
|
+
deviceNotLinked?: boolean;
|
|
1499
|
+
/** Opens where this device gets added; the button shows only with it. */
|
|
1500
|
+
onLinkDevice?: () => void;
|
|
1227
1501
|
/** The last request that reached a final state, shown once the list is empty. */
|
|
1228
1502
|
lastResolved?: CosignRequest;
|
|
1229
1503
|
/** Explorer page of {@link lastResolved}'s transaction, when it was sent. */
|
|
@@ -1232,12 +1506,16 @@ interface CosignModalTemplateProps {
|
|
|
1232
1506
|
closesIn?: number | null;
|
|
1233
1507
|
/** The approval coming next in the same flow, shown while the modal waits for it. */
|
|
1234
1508
|
nextStep?: string | null;
|
|
1509
|
+
/** Language of the modal's text; the device's when not given. */
|
|
1510
|
+
language?: PollarLanguage | undefined;
|
|
1511
|
+
/** The app's network, shown next to the chain in the details. */
|
|
1512
|
+
network?: StellarNetwork | undefined;
|
|
1235
1513
|
onSelect: (request: CosignRequest) => void;
|
|
1236
1514
|
onApprove: (request: CosignRequest) => void;
|
|
1237
1515
|
onReject: (request: CosignRequest) => void;
|
|
1238
1516
|
onClose: () => void;
|
|
1239
1517
|
}
|
|
1240
|
-
declare function CosignModalTemplate({ theme, accentColor, styleOverrides, pending, current, verification, busy, error, approveBlocked, lastResolved, explorerUrl, closesIn, nextStep, onSelect, onApprove, onReject, onClose, }: CosignModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1518
|
+
declare function CosignModalTemplate({ theme, accentColor, styleOverrides, pending, current, verification, busy, error, approveBlocked, deviceNotLinked, onLinkDevice, lastResolved, explorerUrl, closesIn, nextStep, language: languageProp, network, onSelect, onApprove, onReject, onClose, }: CosignModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1241
1519
|
|
|
1242
1520
|
interface CustodyMigrationModalProps {
|
|
1243
1521
|
state: CustodyMigrationState;
|
|
@@ -1261,6 +1539,8 @@ interface CustodyMigrationModalTemplateProps {
|
|
|
1261
1539
|
/** Only offered while a wallet is blocked: the move waits for what is pending. */
|
|
1262
1540
|
onLater: () => void;
|
|
1263
1541
|
onLogout: () => void;
|
|
1542
|
+
/** Language of the modal's text. Defaults to the user's device; the modal passes the resolved one. */
|
|
1543
|
+
language?: PollarLanguage | undefined;
|
|
1264
1544
|
}
|
|
1265
1545
|
/**
|
|
1266
1546
|
* The move of the wallets Pollar custodies to ones the user's device signs for.
|
|
@@ -1308,6 +1588,8 @@ interface RecoveryModalTemplateProps {
|
|
|
1308
1588
|
onRecoverWithCode: (code: string) => void;
|
|
1309
1589
|
onExport: () => void;
|
|
1310
1590
|
onClose: () => void;
|
|
1591
|
+
/** Language of the modal's text. Defaults to the user's device; the modal passes the resolved one. */
|
|
1592
|
+
language?: PollarLanguage | undefined;
|
|
1311
1593
|
}
|
|
1312
1594
|
declare function RecoveryModalTemplate(p: RecoveryModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1313
1595
|
|
|
@@ -1320,10 +1602,12 @@ interface DistributionRulesModalTemplateProps {
|
|
|
1320
1602
|
claimingId: string | null;
|
|
1321
1603
|
claimErrors: Record<string, string>;
|
|
1322
1604
|
claimedIds: Set<string>;
|
|
1605
|
+
/** Language of the modal's text; the device's when not given. */
|
|
1606
|
+
language?: PollarLanguage | undefined;
|
|
1323
1607
|
onRefresh: () => void;
|
|
1324
1608
|
onClaim: (rule: DistributionRule) => void;
|
|
1325
1609
|
onClose: () => void;
|
|
1326
1610
|
}
|
|
1327
|
-
declare function DistributionRulesModalTemplate({ theme, accentColor, styleOverrides, state, claimingId, claimErrors, claimedIds, onRefresh, onClaim, onClose, }: DistributionRulesModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1611
|
+
declare function DistributionRulesModalTemplate({ theme, accentColor, styleOverrides, state, claimingId, claimErrors, claimedIds, language: languageProp, onRefresh, onClaim, onClose, }: DistributionRulesModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1328
1612
|
|
|
1329
|
-
export { type AuthModalProps, CardModal, ChainSelect, type ChainSelectProps, CosignModal, CosignModalTemplate, type CosignModalTemplateProps, CustodyMigrationModal, CustodyMigrationModalTemplate, type CustodyMigrationModalTemplateProps, type CustomTrustlineModalTemplateProps, DistributionRulesModal, DistributionRulesModalTemplate, EarnModal, EnabledAssetsModal, EnabledAssetsModalTemplate, type EnabledAssetsModalTemplateProps, KycModal, KycModalTemplate, KycStatus, type KycStep, type LoginButtonProps, LoginModalTemplate, type ModalChrome, type ModalStyleOverrides, type ModalVariant, type PollarConfig, PollarProvider, type PollarStyles, ProviderRegistrationModal, type RampStep, RampWidget, RampWidgetTemplate, ReceiveModal, ReceiveModalTemplate, type ReceiveModalTemplateProps, RecoveryModal, RecoveryModalTemplate, type RecoveryModalTemplateProps, type RecoveryView, RegistryCheckModal, RejectedRouteDisplay, RequirementFormModal, RouteDisplay, type SendMemoType, SendModal, SendModalTemplate, type SendModalTemplateProps, SessionsModal, SessionsModalTemplate, type SessionsModalTemplateProps, type SwapAssetOption, SwapModal, SwapModalTemplate, type SwapModalTemplateProps, TransactionModalTemplate, type TransactionModalTemplateProps, TxHistoryModalTemplate, TxStatusView, type TxStatusViewProps, type UseChainsResult, type UseCosignResult, WalletBalanceModal, WalletBalanceModalTemplate, type WalletBalanceModalTemplateProps, WalletButton, WalletButtonTemplate, type WalletButtonTemplateProps, addressForChain, browserPasskeyCeremony, browserPasskeySigner, browserRecoveryPasskey, buildModalCssVars, chainsOf, createPollarAdapterHook, modalChrome, readableTextOn, resolveChain, useChains, useCosign, usePollar, walletNotReadyReason };
|
|
1613
|
+
export { type AuthModalProps, BridgeModal, type BridgeModalOptions, type BridgeModalStep, BridgeModalTemplate, type BridgeModalTemplateProps, CardModal, type CardModalOptions, ChainSelect, type ChainSelectProps, CosignModal, CosignModalTemplate, type CosignModalTemplateProps, CustodyMigrationModal, CustodyMigrationModalTemplate, type CustodyMigrationModalTemplateProps, type CustomTrustlineModalTemplateProps, DistributionRulesModal, DistributionRulesModalTemplate, EarnModal, type EarnModalOptions, type EarnNetwork, EnabledAssetsModal, EnabledAssetsModalTemplate, type EnabledAssetsModalTemplateProps, KycModal, KycModalTemplate, KycStatus, type KycStep, type LoginButtonProps, LoginModalTemplate, type ModalChrome, type ModalStyleOverrides, type ModalVariant, type PollarConfig, PollarProvider, type PollarStyles, ProviderRegistrationModal, type RampModalOptions, type RampStep, RampWidget, RampWidgetTemplate, ReceiveModal, type ReceiveModalOptions, ReceiveModalTemplate, type ReceiveModalTemplateProps, RecoveryModal, RecoveryModalTemplate, type RecoveryModalTemplateProps, type RecoveryView, RegistryCheckModal, RejectedRouteDisplay, RequirementFormModal, RouteDisplay, type SendMemoType, SendModal, type SendModalOptions, SendModalTemplate, type SendModalTemplateProps, SessionsModal, SessionsModalTemplate, type SessionsModalTemplateProps, type SwapAssetOption, SwapModal, type SwapModalOptions, SwapModalTemplate, type SwapModalTemplateProps, TransactionModalTemplate, type TransactionModalTemplateProps, type TxHistoryModalOptions, TxHistoryModalTemplate, TxStatusView, type TxStatusViewProps, type UseChainsResult, type UseCosignResult, WalletBalanceModal, WalletBalanceModalTemplate, type WalletBalanceModalTemplateProps, WalletButton, WalletButtonTemplate, type WalletButtonTemplateProps, addressForChain, browserPasskeyCeremony, browserPasskeySigner, browserRecoveryPasskey, buildModalCssVars, chainsOf, createPollarAdapterHook, modalChrome, readableTextOn, resolveChain, useChains, useCosign, usePollar, walletNotReadyReason };
|