@pollar/react 0.12.0 → 0.12.1-rc.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts 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, TransactionState, TxBuildBody, BuildOutcome, SubmitOutcome, SignOutcome, SendPaymentParams, StellarNetwork, WalletBalanceState, EnabledAssetsState, TrustlineOutcome, TxHistoryState, SwapVenue, SwapToken, SwapQuoteParams, SwapQuote, EarnProviderId, EarnOpportunity, EarnPositionParams, EarnPosition, EarnTxParams, PollarAdapter, PasskeyCeremony, PasskeySigner, RecoveryPasskeyCeremony, WalletChain, CosignRequest, CosignVerification, CosignQuorumReport, CosignDevicesContent, KycStatus as KycStatus$1, RampQuoteRejection, RampQuoteRequirement, RampWalletStep, RampQuote, WalletId, AuthState, KycProvider, KycStartResponse, RampDirection, RampFiat, RampAsset, RampField, RampOrder, EnabledAssetRecord, WalletBalanceRecord, SwapProvider, DistributionRulesState, DistributionRule } from '@pollar/core';
2
+ import { WalletChain, pollarPaths, WalletBalanceRecord, TransactionState, WalletId, PollarLanguage, SwapQuoteParams, 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, EarnOpportunity, EarnPositionParams, EarnPosition, EarnTxParams, 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 { ReactNode, CSSProperties } from 'react';
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,315 @@ 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
+ }
232
+ interface SwapModalTemplateProps {
233
+ theme: string;
234
+ accentColor: string;
235
+ styleOverrides?: ModalStyleOverrides;
236
+ step: 'form' | 'tx';
237
+ txTitle: string;
238
+ sellOptions: SwapAssetOption[];
239
+ buyOptions: SwapAssetOption[];
240
+ selectedSell: SwapAssetOption | null;
241
+ selectedBuy: SwapAssetOption | null;
242
+ amount: string;
243
+ /** The chains the app offers swaps on; a selector shows when there are two. */
244
+ chains: SwapChain[];
245
+ chain: SwapChain;
246
+ provider: string;
247
+ providers: string[];
248
+ quote: SwapQuoteView | null;
249
+ quoteLoading: boolean;
250
+ quoteError: string;
251
+ formError: string;
252
+ isLoadingData: boolean;
253
+ smartUnsupported: boolean;
254
+ configLoading: boolean;
255
+ swapUnavailable: boolean;
256
+ buyNeedsTrustline: boolean;
257
+ transaction: TransactionState;
258
+ showXdr: boolean;
259
+ copied: boolean;
260
+ explorerUrl: string | null;
261
+ walletType?: WalletId | null | undefined;
262
+ showBack: boolean;
263
+ isInProgress: boolean;
264
+ /** Language of the modal's text; the device's when not given. */
265
+ language?: PollarLanguage | undefined;
266
+ onClose: () => void;
267
+ onBack: () => void;
268
+ onRefresh: () => void;
269
+ onSelectSell: (o: SwapAssetOption) => void;
270
+ onSelectBuy: (o: SwapAssetOption) => void;
271
+ onReverse: () => void;
272
+ onMax: () => void;
273
+ onAddCustomToken: (code: string, issuer: string) => string | null;
274
+ onAmountChange: (value: string) => void;
275
+ onChainChange: (chain: SwapChain) => void;
276
+ onProviderChange: (p: string) => void;
277
+ onSwap: () => void;
278
+ onToggleXdr: () => void;
279
+ onCopyHash: () => void;
280
+ onRetry: () => void;
281
+ onDone: () => void;
282
+ }
283
+ declare function SwapModalTemplate({ theme, accentColor, styleOverrides, step, txTitle, sellOptions, buyOptions, selectedSell, selectedBuy, amount, chains, chain, 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, onProviderChange, onSwap, onToggleXdr, onCopyHash, onRetry, onDone, }: SwapModalTemplateProps): react_jsx_runtime.JSX.Element;
284
+
285
+ /** Where the swap modal opens: a starting point the user can change. An option the app does not offer is left out. */
286
+ interface SwapModalOptions {
287
+ chain?: SwapChain;
288
+ /** Code of the asset sold, e.g. 'XLM'. */
289
+ sell?: string;
290
+ /** Code of the asset bought, e.g. 'USDC'. */
291
+ buy?: string;
292
+ amount?: string;
293
+ /** Called once the swap lands, with its transaction hash. */
294
+ onSuccess?: (result: {
295
+ hash: string;
296
+ }) => void;
297
+ }
298
+ interface SwapModalProps {
299
+ onClose: () => void;
300
+ initial?: SwapModalOptions | undefined;
301
+ }
302
+ declare function SwapModal({ onClose, initial }: SwapModalProps): react_jsx_runtime.JSX.Element;
303
+
304
+ /** Where the bridge modal opens: a starting point the user can change, never a lock. */
305
+ interface BridgeModalOptions {
306
+ /** Used only when the user can bridge from that chain. */
307
+ fromChain?: BridgeChain;
308
+ /** Used only when the user can bridge to it from the chain the modal opens on. */
309
+ toChain?: BridgeChain;
310
+ /** USDC, e.g. '25'. */
311
+ amount?: string;
312
+ /** Called once the USDC arrives on the destination, with the completed transfer. */
313
+ onSuccess?: (transfer: BridgeTransfer) => void;
314
+ }
315
+ interface BridgeModalProps {
316
+ onClose: () => void;
317
+ initial?: BridgeModalOptions | undefined;
318
+ }
319
+ declare function BridgeModal({ onClose, initial }: BridgeModalProps): react_jsx_runtime.JSX.Element;
320
+
321
+ /** Where the earn modal opens: a starting point the user can change. An option the app does not offer is left out. */
322
+ interface EarnModalOptions {
323
+ provider?: EarnProviderId;
324
+ /** The vault or pool, as `getEarnOpportunities` names it. */
325
+ opportunityId?: string;
326
+ tab?: 'deposit' | 'withdraw';
327
+ amount?: string;
328
+ /** Called once the deposit or withdrawal lands, with its transaction hash. */
329
+ onSuccess?: (result: {
330
+ hash: string;
331
+ }) => void;
332
+ }
333
+ interface EarnModalProps {
334
+ onClose: () => void;
335
+ initial?: EarnModalOptions | undefined;
336
+ }
337
+ declare function EarnModal({ onClose, initial }: EarnModalProps): react_jsx_runtime.JSX.Element;
338
+
339
+ /** Where the card modal opens: a starting point the user can change. An option the user cannot use is left out. */
340
+ interface CardModalOptions {
341
+ /** 'fund' opens the funding panel once the user's card has loaded; a user without a card stays on the card screen. */
342
+ panel?: 'fund';
343
+ amount?: string;
344
+ /** Network to fund from, when it is one the user can fund from. */
345
+ chain?: CardFundingChain;
346
+ /** Called with each funding the user sends from the modal. */
347
+ onFunded?: (funding: CardFunding) => void;
348
+ }
349
+ interface CardModalProps {
350
+ onClose: () => void;
351
+ initial?: CardModalOptions | undefined;
352
+ }
353
+ declare function CardModal({ onClose, initial }: CardModalProps): react_jsx_runtime.JSX.Element;
354
+
355
+ /** Where the history opens: the network whose transactions it lists. A network the app does not offer is left out. */
356
+ interface TxHistoryModalOptions {
357
+ chain?: WalletChain;
358
+ }
359
+
21
360
  interface PollarContextValue {
22
361
  /**
23
362
  * The authenticated user's wallet as a discriminated union over `custody`
@@ -153,12 +492,16 @@ interface PollarContextValue {
153
492
  level?: 'basic' | 'intermediate' | 'enhanced';
154
493
  onApproved?: () => void;
155
494
  }) => void;
156
- openRampModal: () => void;
495
+ /** Opens the ramp widget, on the direction, country, fiat, asset and amount given; without options, on its defaults. */
496
+ openRampModal: (options?: RampModalOptions) => void;
157
497
  txHistory: TxHistoryState;
158
- openTxHistoryModal: () => void;
498
+ /** Opens the history, on the network given; without options, on the app's first network. */
499
+ openTxHistoryModal: (options?: TxHistoryModalOptions) => void;
159
500
  openWalletBalanceModal: () => void;
160
- openSendModal: () => void;
161
- openReceiveModal: () => void;
501
+ /** Opens the send modal, prefilled with the options given; `onSuccess` hears the payment land. */
502
+ openSendModal: (options?: SendModalOptions) => void;
503
+ /** Opens the receive modal, on the network given. */
504
+ openReceiveModal: (options?: ReceiveModalOptions) => void;
162
505
  /**
163
506
  * The swap venues this app exposes to end-users (empty = swap disabled, hide
164
507
  * swap UI). Mirrors {@link PollarClient.getSwapConfig}.
@@ -181,8 +524,19 @@ interface PollarContextValue {
181
524
  swap: (quote: SwapQuote, opts?: {
182
525
  autoTrustline?: boolean;
183
526
  }) => Promise<SubmitOutcome>;
527
+ /** The Solana venues this app exposes (`jupiter`, `titan`). Mirrors {@link PollarClient.getSolanaSwapConfig}. */
528
+ getSolanaSwapConfig: () => Promise<SolanaSwapVenue[]>;
529
+ /** Quote a swap from the user's Solana wallet, in base units. Mirrors {@link PollarClient.getSolanaSwapQuote}. */
530
+ getSolanaSwapQuote: (params: SolanaSwapQuoteParams) => Promise<SolanaSwapQuote[]>;
531
+ /** Run a Solana swap from a quote. Drives the transaction state machine. Mirrors {@link PollarClient.swapSolana}. */
532
+ swapSolana: (quote: SolanaSwapQuote, opts?: {
533
+ slippageBps?: number;
534
+ }) => Promise<SubmitOutcome>;
184
535
  /** Open the swap modal. */
185
- openSwapModal: () => void;
536
+ /** Opens the swap modal, on the network, assets and amount given; `onSuccess` hears the swap land. */
537
+ openSwapModal: (options?: SwapModalOptions) => void;
538
+ /** 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. */
539
+ openBridgeModal: (options?: BridgeModalOptions) => void;
186
540
  /**
187
541
  * The yield providers this app exposes to end-users (empty = Earn disabled,
188
542
  * hide Earn UI). Mirrors {@link PollarClient.getEarnProviders}.
@@ -209,13 +563,15 @@ interface PollarContextValue {
209
563
  */
210
564
  earnWithdraw: (params: EarnTxParams) => Promise<SubmitOutcome>;
211
565
  /** Open the Earn modal. */
212
- openEarnModal: () => void;
566
+ /** Opens the earn modal, on the provider, opportunity, tab and amount given; `onSuccess` hears the transaction land. */
567
+ openEarnModal: (options?: EarnModalOptions) => void;
213
568
  /**
214
569
  * Open the Cards modal: sign-up, identity verification, issuing, the card
215
570
  * itself and its activity. The card calls live on {@link PollarClient}
216
571
  * (`getCardProviders`, `issueCard`, `revealCardSecrets`, ...).
217
572
  */
218
- openCardModal: () => void;
573
+ /** Opens the card modal, on its funding panel when asked; `onFunded` hears each funding sent. */
574
+ openCardModal: (options?: CardModalOptions) => void;
219
575
  openDistributionRulesModal: () => void;
220
576
  adapters?: PollarAdapters;
221
577
  }
@@ -234,6 +590,14 @@ interface PollarProviderProps {
234
590
  * always kept.
235
591
  */
236
592
  client: PollarClient | PollarClientConfig;
593
+ /**
594
+ * Language of the modals, a BCP 47 tag such as `'es'` or `'pt-BR'`: typically
595
+ * the app's current language. Unlike `client`, it is followed on every render,
596
+ * so open modals switch when it changes. It wins over the client's `locale`; a
597
+ * language pinned in the dashboard wins over it, and a tag the modals have no
598
+ * translation for is skipped.
599
+ */
600
+ language?: string | undefined;
237
601
  /**
238
602
  * Local REPLACEMENT for the `/applications/config` response, not a patch over
239
603
  * it. Passing anything at all skips the remote fetch entirely; what you pass
@@ -273,11 +637,12 @@ interface PollarProviderProps {
273
637
  onStorageDegrade?: OnStorageDegrade;
274
638
  children: ReactNode;
275
639
  }
276
- declare function PollarProvider({ client, appConfig: appConfigProp, adapters, onStorageDegrade, children, }: PollarProviderProps): react_jsx_runtime.JSX.Element;
640
+ declare function PollarProvider({ client, language, appConfig: appConfigProp, adapters, onStorageDegrade, children, }: PollarProviderProps): react_jsx_runtime.JSX.Element;
277
641
  declare function usePollar(): PollarContextValue;
278
642
 
643
+ /** A transaction adapter answers with the submit; an auth-entry one with what its `complete` returned. */
279
644
  type WrappedAdapter<T extends PollarAdapter> = {
280
- [K in keyof T]: (params: Parameters<T[K]>[0]) => Promise<SubmitOutcome>;
645
+ [K in keyof T]: (params: Parameters<T[K]>[0]) => Promise<Awaited<ReturnType<T[K]>> extends AuthEntryAdapterStep<infer R> ? AuthEntryAdapterOutcome<R> : SubmitOutcome>;
281
646
  };
282
647
  declare function createPollarAdapterHook<T extends PollarAdapter>(key: string): () => WrappedAdapter<T>;
283
648
 
@@ -333,67 +698,10 @@ declare const browserRecoveryPasskey: RecoveryPasskeyCeremony;
333
698
  * Returns null when the wallet is usable, so a caller reads it as "no reason to
334
699
  * block".
335
700
  */
336
- declare function walletNotReadyReason(wallet: WalletInfo | null | undefined, chain: WalletChain | null | undefined): string | null;
701
+ declare function walletNotReadyReason(wallet: WalletInfo | null | undefined, chain: WalletChain | null | undefined, language?: PollarLanguage): string | null;
337
702
 
338
703
  declare function WalletButton(): react_jsx_runtime.JSX.Element;
339
704
 
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
705
  interface WalletButtonTemplateProps {
398
706
  walletAddress: string | null;
399
707
  theme: string;
@@ -410,7 +718,7 @@ interface WalletButtonTemplateProps {
410
718
  * Why the wallet cannot act on-chain yet (its account is being created, or
411
719
  * that failed), or null when it can. Shown as a banner in the dropdown, since
412
720
  * the address itself is valid and worth copying either way. Optional, so a
413
- * custom template written before this existed keeps compiling.
721
+ * custom template that does not read it keeps compiling.
414
722
  */
415
723
  notReadyReason?: string | null;
416
724
  /**
@@ -425,7 +733,7 @@ interface WalletButtonTemplateProps {
425
733
  * Signed in with no wallet yet (an app that creates wallets on demand, or
426
734
  * none). The button then shows the account menu instead of Login, with Create
427
735
  * wallet only when `onCreateWallet` is set. Optional, so a custom template
428
- * written before this existed keeps compiling.
736
+ * that does not read it keeps compiling.
429
737
  */
430
738
  signedIn?: boolean;
431
739
  creatingWallet?: boolean;
@@ -450,8 +758,10 @@ interface WalletButtonTemplateProps {
450
758
  onDistributionRules: () => void;
451
759
  onLogout: () => void;
452
760
  onLogin: () => void;
761
+ /** Language of the button and its menu. Defaults to the user's device; the button passes the resolved one. */
762
+ language?: PollarLanguage | undefined;
453
763
  }
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;
764
+ 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
765
 
456
766
  /**
457
767
  * The chain a record lives on, with the legacy shape folded in: sessions and
@@ -487,8 +797,9 @@ interface ChainSelectProps {
487
797
  options: WalletChain[];
488
798
  onChange: (chain: WalletChain) => void;
489
799
  disabled?: boolean;
800
+ language?: PollarLanguage | undefined;
490
801
  }
491
- declare function ChainSelect({ label, value, options, onChange, disabled }: ChainSelectProps): react_jsx_runtime.JSX.Element | null;
802
+ declare function ChainSelect({ label, value, options, onChange, disabled, language: languageProp }: ChainSelectProps): react_jsx_runtime.JSX.Element | null;
492
803
 
493
804
  interface UseChainsResult {
494
805
  /**
@@ -557,8 +868,10 @@ interface KycModalProps {
557
868
  level?: 'basic' | 'intermediate' | 'enhanced';
558
869
  /** Called when KYC is successfully approved. */
559
870
  onApproved?: () => void;
871
+ /** Language of the modal, as a BCP 47 tag. A language pinned in the dashboard wins over it. */
872
+ language?: string | undefined;
560
873
  }
561
- declare function KycModal({ onClose, country, level, onApproved, corridorId, cardProviderId, providerId, }: KycModalProps): react_jsx_runtime.JSX.Element;
874
+ declare function KycModal({ onClose, country, level, onApproved, corridorId, cardProviderId, providerId, language: languageProp, }: KycModalProps): react_jsx_runtime.JSX.Element;
562
875
 
563
876
  interface RequirementFormModalProps {
564
877
  formId: string;
@@ -570,9 +883,11 @@ interface RequirementFormModalProps {
570
883
  onClose: () => void;
571
884
  /** Called once the answers are stored. */
572
885
  onSubmitted: () => void;
886
+ /** Language of the modal, as a BCP 47 tag. A language pinned in the dashboard wins over it. */
887
+ language?: string | undefined;
573
888
  }
574
889
  /** 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;
890
+ declare function RequirementFormModal({ formId, progress, onClose, onSubmitted, language: languageProp, }: RequirementFormModalProps): react_jsx_runtime.JSX.Element;
576
891
 
577
892
  interface RegistryCheckModalProps {
578
893
  optionId: string;
@@ -584,12 +899,14 @@ interface RegistryCheckModalProps {
584
899
  onClose: () => void;
585
900
  /** Called once the registry confirmed the data. */
586
901
  onApproved: () => void;
902
+ /** Language of the modal, as a BCP 47 tag. A language pinned in the dashboard wins over it. */
903
+ language?: string | undefined;
587
904
  }
588
905
  /**
589
906
  * One REGISTRY_CHECK step (SEGIP): the user's verified data, prefilled and read-only
590
907
  * except for the surname split and the CI complement, sent to the registry on confirm.
591
908
  */
592
- declare function RegistryCheckModal({ optionId, progress, onClose, onApproved }: RegistryCheckModalProps): react_jsx_runtime.JSX.Element;
909
+ declare function RegistryCheckModal({ optionId, progress, onClose, onApproved, language: languageProp, }: RegistryCheckModalProps): react_jsx_runtime.JSX.Element;
593
910
 
594
911
  interface ProviderRegistrationModalProps {
595
912
  /** The route whose ramp the user registers with. */
@@ -604,25 +921,24 @@ interface ProviderRegistrationModalProps {
604
921
  onClose: () => void;
605
922
  /** Called once the user is registered with the provider. */
606
923
  onRegistered: () => void;
924
+ /** Language of the modal, as a BCP 47 tag. A language pinned in the dashboard wins over it. */
925
+ language?: string | undefined;
607
926
  }
608
927
  /**
609
928
  * One PROVIDER_REGISTRATION step: what the ramp provider receives, listed before the
610
929
  * user consents. Registering is the consent; nothing is sent until then.
611
930
  */
612
- declare function ProviderRegistrationModal({ corridorId, cardProviderId, progress, onClose, onRegistered, }: ProviderRegistrationModalProps): react_jsx_runtime.JSX.Element;
931
+ declare function ProviderRegistrationModal({ corridorId, cardProviderId, progress, onClose, onRegistered, language: languageProp, }: ProviderRegistrationModalProps): react_jsx_runtime.JSX.Element;
613
932
 
614
933
  interface KycStatusProps {
615
934
  status: KycStatus$1;
616
935
  /** Replaces the status label, keeping its color. */
617
936
  label?: string;
618
937
  className?: string;
938
+ /** Language of the status label. Defaults to the user's device. */
939
+ language?: PollarLanguage | undefined;
619
940
  }
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;
941
+ declare function KycStatus({ status, label, className, language: languageProp }: KycStatusProps): react_jsx_runtime.JSX.Element;
626
942
 
627
943
  interface RouteDisplayProps {
628
944
  quote: RampQuote;
@@ -633,13 +949,15 @@ interface RouteDisplayProps {
633
949
  /** Another route is starting, so this one is not selectable meanwhile. */
634
950
  disabled?: boolean;
635
951
  onSelect: (quote: RampQuote) => void;
952
+ /** Defaults to the user's device; the widget passes the resolved one. */
953
+ language?: PollarLanguage;
636
954
  }
637
- declare function RouteDisplay({ quote, best, busy, disabled, onSelect }: RouteDisplayProps): react_jsx_runtime.JSX.Element;
955
+ declare function RouteDisplay({ quote, best, busy, disabled, onSelect, language: languageProp, }: RouteDisplayProps): react_jsx_runtime.JSX.Element;
638
956
  /**
639
957
  * A route that was planned and dropped, and what the user can do about it: a
640
958
  * verification step opens from its button, a missing trustline is added from its own.
641
959
  */
642
- declare function RejectedRouteDisplay({ rejection, disabled, trusting, walletBusy, custodyChoice, onVerify, onTrust, onWalletStep, }: {
960
+ declare function RejectedRouteDisplay({ rejection, disabled, trusting, walletBusy, custodyChoice, onVerify, onTrust, onWalletStep, language: languageProp, }: {
643
961
  rejection: RampQuoteRejection;
644
962
  /** A route is starting, a trustline or a wallet is being added, so nothing else opens meanwhile. */
645
963
  disabled?: boolean;
@@ -662,6 +980,8 @@ declare function RejectedRouteDisplay({ rejection, disabled, trusting, walletBus
662
980
  * the custody to the user creates the wallet from the wallet menu instead.
663
981
  */
664
982
  onWalletStep?: ((step: RampWalletStep, custody?: CosignCustody) => void) | undefined;
983
+ /** Defaults to the user's device; the widget passes the resolved one. */
984
+ language?: PollarLanguage;
665
985
  }): react_jsx_runtime.JSX.Element;
666
986
 
667
987
  interface WalletBalanceModalProps {
@@ -674,31 +994,6 @@ interface EnabledAssetsModalProps {
674
994
  }
675
995
  declare function EnabledAssetsModal({ onClose }: EnabledAssetsModalProps): react_jsx_runtime.JSX.Element;
676
996
 
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
997
  interface SessionsModalProps {
703
998
  onClose: () => void;
704
999
  }
@@ -777,8 +1072,10 @@ interface LoginModalTemplateProps {
777
1072
  onBack: () => void;
778
1073
  onCancel: () => void;
779
1074
  onRetry: () => void;
1075
+ /** Language of the modal's text. Defaults to the user's device; the modal passes the resolved one. */
1076
+ language?: PollarLanguage | undefined;
780
1077
  }
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;
1078
+ 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
1079
 
783
1080
  type KycStep = 'select_provider' | 'verifying' | 'polling' | 'done';
784
1081
  interface KycModalTemplateProps {
@@ -808,11 +1105,15 @@ interface KycModalTemplateProps {
808
1105
  onStartAgain?: () => void;
809
1106
  onRefresh: () => void;
810
1107
  onClose: () => void;
1108
+ /** Defaults to the user's device; the modal passes the resolved one. */
1109
+ language?: PollarLanguage | undefined;
811
1110
  }
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;
1111
+ 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
1112
 
814
1113
  type RampStep = 'input' | 'loading_quote' | 'select_route' | 'contact' | 'status' | 'error';
815
1114
  interface RampWidgetTemplateProps {
1115
+ /** Language of the widget's text and rail labels. Defaults to the user's device; the widget passes the resolved one. */
1116
+ language?: PollarLanguage;
816
1117
  theme: string;
817
1118
  accentColor: string;
818
1119
  /** Per-app modal chrome overrides (background, card + button radius). */
@@ -883,6 +1184,8 @@ interface RampWidgetTemplateProps {
883
1184
  retrying?: boolean;
884
1185
  /** Runs the user's held order again; absent, a held order only says what happened. */
885
1186
  onRetryOrder?: (() => void) | undefined;
1187
+ /** Quotes the same amount again when the price changed before anything moved; absent, only a new operation is offered. */
1188
+ onRequote?: (() => void) | undefined;
886
1189
  /** Opens the wallet's recovery setup, for an order held until the wallet has a way to be recovered. */
887
1190
  onSetUpRecovery?: (() => void) | undefined;
888
1191
  /** Whether the wallet still has no way to be recovered; null while its state is unread. */
@@ -907,7 +1210,7 @@ interface RampWidgetTemplateProps {
907
1210
  onRefresh: () => void;
908
1211
  onClose: () => void;
909
1212
  }
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;
1213
+ 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
1214
 
912
1215
  interface TransactionModalTemplateProps {
913
1216
  theme: string;
@@ -924,22 +1227,30 @@ interface TransactionModalTemplateProps {
924
1227
  onToggleXdr: () => void;
925
1228
  onCopyHash: () => void;
926
1229
  onRetry?: () => void;
1230
+ /** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
1231
+ language?: PollarLanguage | undefined;
927
1232
  }
928
- declare function TransactionModalTemplate({ theme, accentColor, styleOverrides, transaction, showXdr, copied, explorerUrl, walletType, onClose, onSignAndSend, onToggleXdr, onCopyHash, onRetry, }: TransactionModalTemplateProps): react_jsx_runtime.JSX.Element;
1233
+ 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
1234
 
930
1235
  interface TxStatusViewProps {
931
1236
  transaction: TransactionState;
1237
+ /** Whether the details (addresses, network, fee, raw transaction, hash) are unfolded. */
932
1238
  showXdr: boolean;
1239
+ /** Unused: the hash copies from the details. */
933
1240
  copied: boolean;
934
1241
  explorerUrl: string | null;
935
1242
  walletType?: WalletId | null | undefined;
936
1243
  onSignAndSend: () => void;
1244
+ /** Folds and unfolds the details. */
937
1245
  onToggleXdr: () => void;
1246
+ /** Unused: the hash copies from the details. */
938
1247
  onCopyHash: () => void;
939
1248
  onRetry?: (() => void) | undefined;
940
1249
  onDone: () => void;
1250
+ /** Language of the status text. Defaults to the user's device; the modals pass the resolved one. */
1251
+ language?: PollarLanguage | undefined;
941
1252
  }
942
- declare function TxStatusView({ transaction, showXdr, copied, explorerUrl, walletType, onSignAndSend, onToggleXdr, onCopyHash, onRetry, onDone, }: TxStatusViewProps): react_jsx_runtime.JSX.Element;
1253
+ declare function TxStatusView({ transaction, showXdr, explorerUrl, walletType, onSignAndSend, onToggleXdr, onRetry, onDone, language: languageProp, }: TxStatusViewProps): react_jsx_runtime.JSX.Element;
943
1254
 
944
1255
  interface TxHistoryModalTemplateProps {
945
1256
  theme: string;
@@ -958,8 +1269,10 @@ interface TxHistoryModalTemplateProps {
958
1269
  onPrev: () => void;
959
1270
  onNext: () => void;
960
1271
  onClose: () => void;
1272
+ /** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
1273
+ language?: PollarLanguage | undefined;
961
1274
  }
962
- declare function TxHistoryModalTemplate({ theme, accentColor, styleOverrides, txHistory, offset, chains, selectedChain, walletAddress, onSelectChain, onRefresh, onPrev, onNext, onClose, }: TxHistoryModalTemplateProps): react_jsx_runtime.JSX.Element;
1275
+ 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
1276
 
964
1277
  interface WalletBalanceModalTemplateProps {
965
1278
  theme: string;
@@ -982,8 +1295,10 @@ interface WalletBalanceModalTemplateProps {
982
1295
  onSelectChain?: (chain: WalletChain) => void;
983
1296
  onRefresh: () => void;
984
1297
  onClose: () => void;
1298
+ /** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
1299
+ language?: PollarLanguage | undefined;
985
1300
  }
986
- declare function WalletBalanceModalTemplate({ theme, accentColor, styleOverrides, walletBalance, walletAddress, assetMetadata, chains, selectedChain, network, onSelectChain, onRefresh, onClose, }: WalletBalanceModalTemplateProps): react_jsx_runtime.JSX.Element;
1301
+ declare function WalletBalanceModalTemplate({ theme, accentColor, styleOverrides, walletBalance, walletAddress, assetMetadata, chains, selectedChain, network, onSelectChain, onRefresh, onClose, language: languageProp, }: WalletBalanceModalTemplateProps): react_jsx_runtime.JSX.Element;
987
1302
 
988
1303
  interface EnabledAssetsModalTemplateProps {
989
1304
  theme: string;
@@ -1004,8 +1319,10 @@ interface EnabledAssetsModalTemplateProps {
1004
1319
  onClose: () => void;
1005
1320
  onToggleTrustline: (record: EnabledAssetRecord) => void;
1006
1321
  onAddCustom: () => void;
1322
+ /** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
1323
+ language?: PollarLanguage | undefined;
1007
1324
  }
1008
- declare function EnabledAssetsModalTemplate({ theme, accentColor, styleOverrides, enabledAssets, walletAddress, chains, selectedChain, onSelectChain, busyKey, actionError, onRefresh, onClose, onToggleTrustline, onAddCustom, }: EnabledAssetsModalTemplateProps): react_jsx_runtime.JSX.Element;
1325
+ 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
1326
  interface CustomTrustlineModalTemplateProps {
1010
1327
  theme: string;
1011
1328
  accentColor: string;
@@ -1020,142 +1337,47 @@ interface CustomTrustlineModalTemplateProps {
1020
1337
  issuer: string;
1021
1338
  limit?: string;
1022
1339
  }) => void;
1340
+ /** Language of the form. Defaults to the user's device; the modal passes the resolved one. */
1341
+ language?: PollarLanguage | undefined;
1023
1342
  }
1024
1343
 
1025
- /** The memo types the backend accepts on a Stellar payment. */
1026
- type SendMemoType = 'text' | 'id';
1027
- interface SendModalTemplateProps {
1344
+ type BridgeModalStep = 'loading' | 'unavailable' | 'form' | 'transfer';
1345
+ interface BridgeModalTemplateProps {
1028
1346
  theme: string;
1029
1347
  accentColor: string;
1030
- /** Per-app modal chrome overrides (background, card + button radius). */
1031
1348
  styleOverrides?: ModalStyleOverrides;
1032
- /**
1033
- * `create-account`: the Stellar destination has no account yet, so the user
1034
- * chooses between creating it with the XLM being sent and waiting for someone
1035
- * else to fund it.
1036
- */
1037
- step: 'form' | 'create-account' | 'tx';
1038
- txTitle: string;
1039
- assets: WalletBalanceRecord[];
1040
- selectedAsset: WalletBalanceRecord | null;
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;
1349
+ step: BridgeModalStep;
1350
+ /** Why the form is not offered: off mainnet, or no pair of wallets to bridge between. */
1351
+ unavailableReason: 'mainnet_only' | 'no_directions' | null;
1352
+ sources: BridgeChain[];
1353
+ targets: BridgeChain[];
1354
+ fromChain: BridgeChain | null;
1355
+ toChain: BridgeChain | null;
1356
+ onFromChange: (chain: BridgeChain) => void;
1357
+ onToChange: (chain: BridgeChain) => void;
1063
1358
  amount: string;
1064
- destination: string;
1065
- formError: string;
1066
- isLoadingBalance: boolean;
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;
1359
+ onAmountChange: (amount: string) => void;
1360
+ /** USDC available on `fromChain`; null while unknown. */
1361
+ balance: string | null;
1085
1362
  onMax: () => void;
1086
- onPaste: () => void;
1087
- onDestinationChange: (value: string) => void;
1088
- /**
1089
- * Optional Stellar memo. The field renders only on Stellar and only when
1090
- * {@link onMemoChange} is passed, so a custom template written before it
1091
- * existed keeps compiling.
1092
- */
1093
- memo?: string;
1094
- memoType?: SendMemoType;
1095
- onMemoChange?: (value: string) => void;
1096
- onMemoTypeChange?: (type: SendMemoType) => void;
1363
+ quote: BridgeQuote | null;
1364
+ quoting: boolean;
1365
+ /** What is wrong with the form or what the server refused, ready to show. */
1366
+ formError: string | null;
1367
+ canSubmit: boolean;
1368
+ submitting: boolean;
1097
1369
  onSubmit: () => void;
1098
- onSignAndSend: () => void;
1099
- onToggleXdr: () => void;
1100
- onCopyHash: () => void;
1101
- onRetry: () => void;
1102
- onDone: () => void;
1103
- }
1104
- 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, }: SendModalTemplateProps): react_jsx_runtime.JSX.Element;
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;
1370
+ transfer: BridgeTransfer | null;
1371
+ signing: boolean;
1372
+ onAuthorize: () => void;
1373
+ onApprove: () => void;
1374
+ actionError: string | null;
1375
+ pollTrouble: boolean;
1376
+ onNewBridge: () => void;
1142
1377
  onClose: () => void;
1143
- onBack: () => void;
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;
1378
+ language?: PollarLanguage | undefined;
1157
1379
  }
1158
- declare function SwapModalTemplate({ theme, accentColor, styleOverrides, step, txTitle, sellOptions, buyOptions, selectedSell, selectedBuy, amount, provider, providers, quote, quoteLoading, quoteError, formError, isLoadingData, smartUnsupported, configLoading, swapUnavailable, buyNeedsTrustline, transaction, showXdr, copied, explorerUrl, walletType, showBack, isInProgress, onClose, onBack, onRefresh, onSelectSell, onSelectBuy, onAddCustomToken, onReverse, onMax, onAmountChange, onProviderChange, onSwap, onToggleXdr, onCopyHash, onRetry, onDone, }: SwapModalTemplateProps): react_jsx_runtime.JSX.Element;
1380
+ declare function BridgeModalTemplate(props: BridgeModalTemplateProps): react_jsx_runtime.JSX.Element;
1159
1381
 
1160
1382
  interface ReceiveModalTemplateProps {
1161
1383
  theme: string;
@@ -1178,7 +1400,7 @@ interface ReceiveModalTemplateProps {
1178
1400
  *
1179
1401
  * The address itself is valid either way - what is missing is the account
1180
1402
  * behind it, so a payment sent now is rejected by the network. Optional, so a
1181
- * custom template written before this existed keeps compiling.
1403
+ * custom template that does not read it keeps compiling.
1182
1404
  */
1183
1405
  notReadyReason?: string | null;
1184
1406
  /**
@@ -1190,8 +1412,10 @@ interface ReceiveModalTemplateProps {
1190
1412
  onSetupRecovery?: () => void;
1191
1413
  onCopy: () => void;
1192
1414
  onClose: () => void;
1415
+ /** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
1416
+ language?: PollarLanguage | undefined;
1193
1417
  }
1194
- declare function ReceiveModalTemplate({ theme, accentColor, styleOverrides, walletAddress, chains, selectedChain, onSelectChain, copied, notReadyReason, recoveryLocked, onSetupRecovery, onCopy, onClose, }: ReceiveModalTemplateProps): react_jsx_runtime.JSX.Element;
1418
+ 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
1419
 
1196
1420
  interface SessionsModalTemplateProps {
1197
1421
  theme: string;
@@ -1206,8 +1430,10 @@ interface SessionsModalTemplateProps {
1206
1430
  onRevoke: (familyId: string) => void;
1207
1431
  onLogoutEverywhere: () => void;
1208
1432
  onClose: () => void;
1433
+ /** Language of the modal's text. Defaults to the user's device; the modal passes the resolved one. */
1434
+ language?: PollarLanguage | undefined;
1209
1435
  }
1210
- declare function SessionsModalTemplate({ theme, accentColor, styleOverrides, state, revokingFamilyId, signingOutEverywhere, revokeError, onRefresh, onRevoke, onLogoutEverywhere, onClose, }: SessionsModalTemplateProps): react_jsx_runtime.JSX.Element;
1436
+ declare function SessionsModalTemplate({ theme, accentColor, styleOverrides, state, revokingFamilyId, signingOutEverywhere, revokeError, onRefresh, onRevoke, onLogoutEverywhere, onClose, language: languageProp, }: SessionsModalTemplateProps): react_jsx_runtime.JSX.Element;
1211
1437
 
1212
1438
  interface CosignModalTemplateProps {
1213
1439
  theme: string;
@@ -1224,6 +1450,10 @@ interface CosignModalTemplateProps {
1224
1450
  error: string | null;
1225
1451
  /** Approve stays off for a request whose approval just failed. */
1226
1452
  approveBlocked?: boolean;
1453
+ /** This device is not one of the wallet's devices: it cannot vote, only reject, until it is added. */
1454
+ deviceNotLinked?: boolean;
1455
+ /** Opens where this device gets added; the button shows only with it. */
1456
+ onLinkDevice?: () => void;
1227
1457
  /** The last request that reached a final state, shown once the list is empty. */
1228
1458
  lastResolved?: CosignRequest;
1229
1459
  /** Explorer page of {@link lastResolved}'s transaction, when it was sent. */
@@ -1232,12 +1462,16 @@ interface CosignModalTemplateProps {
1232
1462
  closesIn?: number | null;
1233
1463
  /** The approval coming next in the same flow, shown while the modal waits for it. */
1234
1464
  nextStep?: string | null;
1465
+ /** Language of the modal's text; the device's when not given. */
1466
+ language?: PollarLanguage | undefined;
1467
+ /** The app's network, shown next to the chain in the details. */
1468
+ network?: StellarNetwork | undefined;
1235
1469
  onSelect: (request: CosignRequest) => void;
1236
1470
  onApprove: (request: CosignRequest) => void;
1237
1471
  onReject: (request: CosignRequest) => void;
1238
1472
  onClose: () => void;
1239
1473
  }
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;
1474
+ 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
1475
 
1242
1476
  interface CustodyMigrationModalProps {
1243
1477
  state: CustodyMigrationState;
@@ -1261,6 +1495,8 @@ interface CustodyMigrationModalTemplateProps {
1261
1495
  /** Only offered while a wallet is blocked: the move waits for what is pending. */
1262
1496
  onLater: () => void;
1263
1497
  onLogout: () => void;
1498
+ /** Language of the modal's text. Defaults to the user's device; the modal passes the resolved one. */
1499
+ language?: PollarLanguage | undefined;
1264
1500
  }
1265
1501
  /**
1266
1502
  * The move of the wallets Pollar custodies to ones the user's device signs for.
@@ -1308,6 +1544,8 @@ interface RecoveryModalTemplateProps {
1308
1544
  onRecoverWithCode: (code: string) => void;
1309
1545
  onExport: () => void;
1310
1546
  onClose: () => void;
1547
+ /** Language of the modal's text. Defaults to the user's device; the modal passes the resolved one. */
1548
+ language?: PollarLanguage | undefined;
1311
1549
  }
1312
1550
  declare function RecoveryModalTemplate(p: RecoveryModalTemplateProps): react_jsx_runtime.JSX.Element;
1313
1551
 
@@ -1320,10 +1558,12 @@ interface DistributionRulesModalTemplateProps {
1320
1558
  claimingId: string | null;
1321
1559
  claimErrors: Record<string, string>;
1322
1560
  claimedIds: Set<string>;
1561
+ /** Language of the modal's text; the device's when not given. */
1562
+ language?: PollarLanguage | undefined;
1323
1563
  onRefresh: () => void;
1324
1564
  onClaim: (rule: DistributionRule) => void;
1325
1565
  onClose: () => void;
1326
1566
  }
1327
- declare function DistributionRulesModalTemplate({ theme, accentColor, styleOverrides, state, claimingId, claimErrors, claimedIds, onRefresh, onClaim, onClose, }: DistributionRulesModalTemplateProps): react_jsx_runtime.JSX.Element;
1567
+ declare function DistributionRulesModalTemplate({ theme, accentColor, styleOverrides, state, claimingId, claimErrors, claimedIds, language: languageProp, onRefresh, onClaim, onClose, }: DistributionRulesModalTemplateProps): react_jsx_runtime.JSX.Element;
1328
1568
 
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 };
1569
+ 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, 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 };