@pollar/react 0.12.1-rc.2 → 0.12.1-rc.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts 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, SolanaSwapVenue, SolanaSwapQuoteParams, SolanaSwapQuote, EarnProviderId, EarnOpportunity, EarnPositionParams, EarnPosition, EarnTxParams, PollarAdapter, AuthEntryAdapterStep, AuthEntryAdapterOutcome, PasskeyCeremony, PasskeySigner, RecoveryPasskeyCeremony, WalletChain, PollarLanguage, CosignRequest, CosignVerification, CosignQuorumReport, CosignDevicesContent, KycStatus as KycStatus$1, RampQuoteRejection, RampQuoteRequirement, RampWalletStep, RampQuote, WalletId, AuthState, KycProvider, KycStartResponse, RampDirection, RampFiat, RampAsset, RampField, RampOrder, EnabledAssetRecord, WalletBalanceRecord, DistributionRulesState, DistributionRule } from '@pollar/core';
2
+ import { WalletChain, pollarPaths, WalletBalanceRecord, TransactionState, WalletId, PollarLanguage, PendingConfirmation, StellarNetwork, SwapQuoteParams, SwapDestinationChain, BridgeChain, BridgeTransfer, EarnProviderId, CardFundingChain, CardFunding, PollarClient, PollarClientConfig, PollarAdapters, OnStorageDegrade, WalletInfo, CosignCustody, PollarLoginOptions, SessionsState, CosignState, RecoveryState, CustodyMigrationState, TxBuildBody, BuildOutcome, SubmitOutcome, SignOutcome, SendPaymentParams, 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, PollarSupportContact, 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'];
@@ -12,10 +42,403 @@ interface LoginButtonProps {
12
42
  className?: string;
13
43
  children?: React.ReactNode;
14
44
  }
15
- interface AuthModalProps {
16
- open: boolean;
45
+ interface AuthModalProps {
46
+ open: boolean;
47
+ onClose: () => void;
48
+ onSuccess?: () => void;
49
+ }
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
+ /** The signature waiting for the user's yes, answered in the transaction step. */
189
+ confirmation?: PendingConfirmation | null | undefined;
190
+ /** The app's network, for the details of a confirmation. */
191
+ network?: StellarNetwork | undefined;
192
+ }
193
+ 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, confirmation, network, }: SendModalTemplateProps): react_jsx_runtime.JSX.Element;
194
+
195
+ /** Where the send modal opens: a starting point the user can change. An option the wallet cannot use is left out. */
196
+ interface SendModalOptions {
197
+ chain?: WalletChain;
198
+ /** Asset code, e.g. 'USDC'. */
199
+ asset?: string;
200
+ destination?: string;
201
+ amount?: string;
202
+ memo?: string;
203
+ memoType?: SendMemoType;
204
+ /** Called once the payment lands, with its transaction hash. */
205
+ onSuccess?: (result: {
206
+ hash: string;
207
+ }) => void;
208
+ }
209
+ interface SendModalProps {
210
+ onClose: () => void;
211
+ initial?: SendModalOptions | undefined;
212
+ }
213
+ declare function SendModal({ onClose, initial }: SendModalProps): react_jsx_runtime.JSX.Element;
214
+
215
+ /** One end of the flow: a wallet, an account or a contract, and what it sends or gets. */
216
+ interface TxParty {
217
+ chain?: WalletChain;
218
+ asset?: string;
219
+ amount?: string;
220
+ /** The amount is a floor: a swap delivers at least it. */
221
+ minimum?: boolean;
222
+ address?: string;
223
+ label?: string;
224
+ /** One of the user's own wallets. */
225
+ self?: boolean;
226
+ }
227
+ interface TxDetailRow {
228
+ label: string;
229
+ value: string;
230
+ /** What the copy button copies; the row has none when absent. */
231
+ copyValue?: string;
232
+ /** Opens this page: the value is a link (an explorer on another chain). */
233
+ href?: string;
234
+ mono?: boolean;
235
+ }
236
+ interface TxReviewData {
237
+ /** The action in plain words: what a user without crypto background reads first. */
238
+ title: string;
239
+ kind: 'send' | 'bridge' | 'approve' | 'swap' | 'payment' | 'create_account' | 'activate_wallet' | 'add_asset' | 'deposit' | 'withdraw' | 'sign_in' | 'other';
240
+ /** One line under the title that says what the action is for, when the title alone does not. */
241
+ lead?: string;
242
+ from?: TxParty;
243
+ to?: TxParty;
244
+ /**
245
+ * Who pays the network fee: after the signature, as the platform reported it;
246
+ * before, only when the transaction itself makes the app pay (`appPaysFee`).
247
+ */
248
+ fee?: {
249
+ sponsored: boolean;
250
+ free?: boolean;
251
+ };
252
+ rows: TxDetailRow[];
253
+ raw?: string;
254
+ hash?: {
255
+ value: string;
256
+ explorerUrl: string | null;
257
+ };
258
+ }
259
+
260
+ /** The chain a swap runs on; the modal shows a selector when the app offers both. */
261
+ type SwapChain = 'STELLAR' | 'SOLANA';
262
+ interface SwapAssetOption {
263
+ /** Stellar: the asset ref the quote takes. */
264
+ ref?: SwapQuoteParams['sellAsset'] | undefined;
265
+ code: string;
266
+ /** Stellar: the issuer. Solana: the mint (wrapped SOL for SOL). */
267
+ issuer?: string | undefined;
268
+ /** Solana: the mint's decimals, to turn a decimal amount into base units. */
269
+ decimals?: number | undefined;
270
+ available?: string | undefined;
271
+ enabledInApp?: boolean | undefined;
272
+ }
273
+ /** A quote as the form shows it, whichever chain priced it: decimal amounts. */
274
+ interface SwapQuoteView {
275
+ provider: string;
276
+ amountOut: string;
277
+ minReceived: string;
278
+ /** Percent; null when the venue does not report it. */
279
+ priceImpactPct: string | null;
280
+ /** What the route charges, labelled. */
281
+ fees?: Array<{
282
+ label: string;
283
+ value: string;
284
+ }>;
285
+ totalFeesUsd?: number | null;
286
+ /** Seconds the price is good for; null when it has no window. */
287
+ expiresInSeconds?: number | null;
288
+ }
289
+ /** A cross-chain swap's delivery on the destination chain, once its Solana transaction landed. */
290
+ interface SwapSettlementView {
291
+ kind: 'pending' | 'completed' | 'held' | 'refunded' | 'failed';
292
+ text: string;
293
+ /** The user's wallet it delivers to. */
294
+ address: string | null;
295
+ explorerUrl: string | null;
296
+ }
297
+ interface SwapModalTemplateProps {
298
+ theme: string;
299
+ accentColor: string;
300
+ styleOverrides?: ModalStyleOverrides;
301
+ step: 'form' | 'tx';
302
+ txTitle: string;
303
+ sellOptions: SwapAssetOption[];
304
+ buyOptions: SwapAssetOption[];
305
+ selectedSell: SwapAssetOption | null;
306
+ selectedBuy: SwapAssetOption | null;
307
+ amount: string;
308
+ /** The chains the app offers swaps on; a selector shows when there are two. */
309
+ chains: SwapChain[];
310
+ chain: SwapChain;
311
+ /** Where a Solana swap can deliver; a selector shows when there is more than one. */
312
+ destinations?: SwapDestinationChain[];
313
+ destination?: SwapDestinationChain;
314
+ /** USDC to USDC across chains: a transfer, which the swap does not do. */
315
+ usdcAcross?: boolean;
316
+ settlement?: SwapSettlementView | null;
317
+ /** The signature waiting for the user's yes, answered in the transaction step. */
318
+ confirmation?: PendingConfirmation | null | undefined;
319
+ /** What the transaction step reviews when the transaction carries no build of its own to read it from. */
320
+ review?: TxReviewData | null | undefined;
321
+ /** The app's network, for the details of a confirmation. */
322
+ network?: StellarNetwork | undefined;
323
+ provider: string;
324
+ providers: string[];
325
+ quote: SwapQuoteView | null;
326
+ quoteLoading: boolean;
327
+ quoteError: string;
328
+ formError: string;
329
+ isLoadingData: boolean;
330
+ smartUnsupported: boolean;
331
+ configLoading: boolean;
332
+ swapUnavailable: boolean;
333
+ buyNeedsTrustline: boolean;
334
+ transaction: TransactionState;
335
+ showXdr: boolean;
336
+ copied: boolean;
337
+ explorerUrl: string | null;
338
+ walletType?: WalletId | null | undefined;
339
+ showBack: boolean;
340
+ isInProgress: boolean;
341
+ /** Language of the modal's text; the device's when not given. */
342
+ language?: PollarLanguage | undefined;
343
+ onClose: () => void;
344
+ onBack: () => void;
345
+ onRefresh: () => void;
346
+ onSelectSell: (o: SwapAssetOption) => void;
347
+ onSelectBuy: (o: SwapAssetOption) => void;
348
+ onReverse: () => void;
349
+ onMax: () => void;
350
+ onAddCustomToken: (code: string, issuer: string) => string | null;
351
+ onAmountChange: (value: string) => void;
352
+ onChainChange: (chain: SwapChain) => void;
353
+ onDestinationChange?: (chain: SwapDestinationChain) => void;
354
+ onProviderChange: (p: string) => void;
355
+ onSwap: () => void;
356
+ onToggleXdr: () => void;
357
+ onCopyHash: () => void;
358
+ onRetry: () => void;
359
+ onDone: () => void;
360
+ }
361
+ declare function SwapModalTemplate({ theme, accentColor, styleOverrides, step, txTitle, sellOptions, buyOptions, selectedSell, selectedBuy, amount, chains, chain, destinations, destination, usdcAcross, settlement, confirmation, review, network, 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;
362
+
363
+ /** Where the swap modal opens: a starting point the user can change. An option the app does not offer is left out. */
364
+ interface SwapModalOptions {
365
+ chain?: SwapChain;
366
+ /** Code of the asset sold, e.g. 'XLM'. */
367
+ sell?: string;
368
+ /** Code of the asset bought, e.g. 'USDC'. */
369
+ buy?: string;
370
+ amount?: string;
371
+ /** Solana only: deliver to the user's own wallet on this chain, when the app offers it. */
372
+ destinationChain?: SwapDestinationChain;
373
+ /** Called once the swap lands, with its transaction hash. */
374
+ onSuccess?: (result: {
375
+ hash: string;
376
+ }) => void;
377
+ }
378
+ interface SwapModalProps {
379
+ onClose: () => void;
380
+ initial?: SwapModalOptions | undefined;
381
+ }
382
+ declare function SwapModal({ onClose, initial }: SwapModalProps): react_jsx_runtime.JSX.Element;
383
+
384
+ /** Where the bridge modal opens: a starting point the user can change, never a lock. */
385
+ interface BridgeModalOptions {
386
+ /** Used only when the user can bridge from that chain. */
387
+ fromChain?: BridgeChain;
388
+ /** Used only when the user can bridge to it from the chain the modal opens on. */
389
+ toChain?: BridgeChain;
390
+ /** USDC, e.g. '25'. */
391
+ amount?: string;
392
+ /** Called once the USDC arrives on the destination, with the completed transfer. */
393
+ onSuccess?: (transfer: BridgeTransfer) => void;
394
+ }
395
+ interface BridgeModalProps {
396
+ onClose: () => void;
397
+ initial?: BridgeModalOptions | undefined;
398
+ }
399
+ declare function BridgeModal({ onClose, initial }: BridgeModalProps): react_jsx_runtime.JSX.Element;
400
+
401
+ /** Where the earn modal opens: a starting point the user can change. An option the app does not offer is left out. */
402
+ interface EarnModalOptions {
403
+ /** The network the modal opens on, when the app offers Earn on both. */
404
+ chain?: EarnNetwork;
405
+ provider?: EarnProviderId;
406
+ /** The vault or pool, as `getEarnOpportunities` names it. */
407
+ opportunityId?: string;
408
+ tab?: 'deposit' | 'withdraw';
409
+ amount?: string;
410
+ /** Called once the deposit or withdrawal lands, with its transaction hash. */
411
+ onSuccess?: (result: {
412
+ hash: string;
413
+ }) => void;
414
+ }
415
+ interface EarnModalProps {
416
+ onClose: () => void;
417
+ initial?: EarnModalOptions | undefined;
418
+ }
419
+ /** The networks Earn runs on; the modal shows a selector when the app offers both. */
420
+ type EarnNetwork = 'STELLAR' | 'SOLANA';
421
+ declare function EarnModal({ onClose, initial }: EarnModalProps): react_jsx_runtime.JSX.Element;
422
+
423
+ /** Where the card modal opens: a starting point the user can change. An option the user cannot use is left out. */
424
+ interface CardModalOptions {
425
+ /** 'fund' opens the funding panel once the user's card has loaded; a user without a card stays on the card screen. */
426
+ panel?: 'fund';
427
+ amount?: string;
428
+ /** Network to fund from, when it is one the user can fund from. */
429
+ chain?: CardFundingChain;
430
+ /** Called with each funding the user sends from the modal. */
431
+ onFunded?: (funding: CardFunding) => void;
432
+ }
433
+ interface CardModalProps {
17
434
  onClose: () => void;
18
- onSuccess?: () => void;
435
+ initial?: CardModalOptions | undefined;
436
+ }
437
+ declare function CardModal({ onClose, initial }: CardModalProps): react_jsx_runtime.JSX.Element;
438
+
439
+ /** Where the history opens: the network whose transactions it lists. A network the app does not offer is left out. */
440
+ interface TxHistoryModalOptions {
441
+ chain?: WalletChain;
19
442
  }
20
443
 
21
444
  interface PollarContextValue {
@@ -91,6 +514,12 @@ interface PollarContextValue {
91
514
  refreshCustodyMigration: () => void;
92
515
  /** Signing calls waiting for the user under `confirmation: 'prompt'`; the provider shows the first one. */
93
516
  confirmations: PendingConfirmation[];
517
+ /**
518
+ * A modal that shows the transaction it signs answers the confirmation itself:
519
+ * while one is registered the provider does not open its own prompt over it.
520
+ * Returns the unregister.
521
+ */
522
+ registerConfirmationHost: () => () => void;
94
523
  appConfig: PollarConfig;
95
524
  styles: PollarStyles;
96
525
  /** Remote app-config load state. 'loading' while the initial fetch is in
@@ -153,12 +582,16 @@ interface PollarContextValue {
153
582
  level?: 'basic' | 'intermediate' | 'enhanced';
154
583
  onApproved?: () => void;
155
584
  }) => void;
156
- openRampModal: () => void;
585
+ /** Opens the ramp widget, on the direction, country, fiat, asset and amount given; without options, on its defaults. */
586
+ openRampModal: (options?: RampModalOptions) => void;
157
587
  txHistory: TxHistoryState;
158
- openTxHistoryModal: () => void;
588
+ /** Opens the history, on the network given; without options, on the app's first network. */
589
+ openTxHistoryModal: (options?: TxHistoryModalOptions) => void;
159
590
  openWalletBalanceModal: () => void;
160
- openSendModal: () => void;
161
- openReceiveModal: () => void;
591
+ /** Opens the send modal, prefilled with the options given; `onSuccess` hears the payment land. */
592
+ openSendModal: (options?: SendModalOptions) => void;
593
+ /** Opens the receive modal, on the network given. */
594
+ openReceiveModal: (options?: ReceiveModalOptions) => void;
162
595
  /**
163
596
  * The swap venues this app exposes to end-users (empty = swap disabled, hide
164
597
  * swap UI). Mirrors {@link PollarClient.getSwapConfig}.
@@ -188,9 +621,17 @@ interface PollarContextValue {
188
621
  /** Run a Solana swap from a quote. Drives the transaction state machine. Mirrors {@link PollarClient.swapSolana}. */
189
622
  swapSolana: (quote: SolanaSwapQuote, opts?: {
190
623
  slippageBps?: number;
624
+ idempotencyKey?: string;
191
625
  }) => Promise<SubmitOutcome>;
626
+ /** The Solana venues and the chains a Solana swap delivers to. Mirrors {@link PollarClient.getSolanaSwapOptions}. */
627
+ getSolanaSwapOptions: () => Promise<SolanaSwapOptions>;
628
+ /** Where a swap built under a key stands, its settlement included. Mirrors {@link PollarClient.getSwapStatus}. */
629
+ getSwapStatus: (idempotencyKey: string) => Promise<SwapStatus>;
192
630
  /** Open the swap modal. */
193
- openSwapModal: () => void;
631
+ /** Opens the swap modal, on the network, assets and amount given; `onSuccess` hears the swap land. */
632
+ openSwapModal: (options?: SwapModalOptions) => void;
633
+ /** 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. */
634
+ openBridgeModal: (options?: BridgeModalOptions) => void;
194
635
  /**
195
636
  * The yield providers this app exposes to end-users (empty = Earn disabled,
196
637
  * hide Earn UI). Mirrors {@link PollarClient.getEarnProviders}.
@@ -216,14 +657,26 @@ interface PollarContextValue {
216
657
  * {@link PollarClient.earnWithdraw}.
217
658
  */
218
659
  earnWithdraw: (params: EarnTxParams) => Promise<SubmitOutcome>;
660
+ /** The Earn providers on Solana (empty = no Earn there). Mirrors {@link PollarClient.getSolanaEarnProviders}. */
661
+ getSolanaEarnProviders: () => Promise<SolanaEarnProviderId[]>;
662
+ /** The Solana opportunities, APY after fees. Mirrors {@link PollarClient.getSolanaEarnOpportunities}. */
663
+ getSolanaEarnOpportunities: () => Promise<SolanaEarnOpportunity[]>;
664
+ /** The user's position in a Solana opportunity. Mirrors {@link PollarClient.getSolanaEarnPosition}. */
665
+ getSolanaEarnPosition: (opportunity: string) => Promise<SolanaEarnPosition>;
666
+ /** Deposit into a Solana opportunity. Mirrors {@link PollarClient.earnSolanaDeposit}. */
667
+ earnSolanaDeposit: (params: SolanaEarnTxParams) => Promise<SubmitOutcome>;
668
+ /** Withdraw from a Solana opportunity. Mirrors {@link PollarClient.earnSolanaWithdraw}. */
669
+ earnSolanaWithdraw: (params: SolanaEarnTxParams) => Promise<SubmitOutcome>;
219
670
  /** Open the Earn modal. */
220
- openEarnModal: () => void;
671
+ /** Opens the earn modal, on the provider, opportunity, tab and amount given; `onSuccess` hears the transaction land. */
672
+ openEarnModal: (options?: EarnModalOptions) => void;
221
673
  /**
222
674
  * Open the Cards modal: sign-up, identity verification, issuing, the card
223
675
  * itself and its activity. The card calls live on {@link PollarClient}
224
676
  * (`getCardProviders`, `issueCard`, `revealCardSecrets`, ...).
225
677
  */
226
- openCardModal: () => void;
678
+ /** Opens the card modal, on its funding panel when asked; `onFunded` hears each funding sent. */
679
+ openCardModal: (options?: CardModalOptions) => void;
227
680
  openDistributionRulesModal: () => void;
228
681
  adapters?: PollarAdapters;
229
682
  }
@@ -242,6 +695,14 @@ interface PollarProviderProps {
242
695
  * always kept.
243
696
  */
244
697
  client: PollarClient | PollarClientConfig;
698
+ /**
699
+ * Language of the modals, a BCP 47 tag such as `'es'` or `'pt-BR'`: typically
700
+ * the app's current language. Unlike `client`, it is followed on every render,
701
+ * so open modals switch when it changes. It wins over the client's `locale`; a
702
+ * language pinned in the dashboard wins over it, and a tag the modals have no
703
+ * translation for is skipped.
704
+ */
705
+ language?: string | undefined;
245
706
  /**
246
707
  * Local REPLACEMENT for the `/applications/config` response, not a patch over
247
708
  * it. Passing anything at all skips the remote fetch entirely; what you pass
@@ -281,7 +742,7 @@ interface PollarProviderProps {
281
742
  onStorageDegrade?: OnStorageDegrade;
282
743
  children: ReactNode;
283
744
  }
284
- declare function PollarProvider({ client, appConfig: appConfigProp, adapters, onStorageDegrade, children, }: PollarProviderProps): react_jsx_runtime.JSX.Element;
745
+ declare function PollarProvider({ client, language, appConfig: appConfigProp, adapters, onStorageDegrade, children, }: PollarProviderProps): react_jsx_runtime.JSX.Element;
285
746
  declare function usePollar(): PollarContextValue;
286
747
 
287
748
  /** A transaction adapter answers with the submit; an auth-entry one with what its `complete` returned. */
@@ -346,63 +807,6 @@ declare function walletNotReadyReason(wallet: WalletInfo | null | undefined, cha
346
807
 
347
808
  declare function WalletButton(): react_jsx_runtime.JSX.Element;
348
809
 
349
- /** Per-app overrides for the modal chrome, configured in the dashboard's
350
- * Branding screen. Every field is optional: absent means "use the value the
351
- * theme derives", which is what every modal rendered before these existed. */
352
- interface ModalStyleOverrides {
353
- /** Card background. Overrides the theme's white / #1a1a1a. */
354
- backgroundColor?: string | null | undefined;
355
- /** Body text. Overrides the theme's #111827 / white. With a background or a
356
- * text color set, borders, secondary ("muted") text and input fills are
357
- * blended from the pair instead of taken from the theme. */
358
- textColor?: string | null | undefined;
359
- /** Fill of the SECONDARY buttons (the wallet / social / provider entries, the
360
- * retry button). The primary button is the accent's job. Unset => the theme's
361
- * own surface color, which is what these buttons always used. */
362
- buttonColor?: string | null | undefined;
363
- /** Radius of the modal card itself, in px. */
364
- modalBorderRadius?: number | null | undefined;
365
- /** Radius of the buttons inside the modal, in px. Independent of the card's. */
366
- buttonBorderRadius?: number | null | undefined;
367
- }
368
- /** Text color that stays legible on `background`. The primary button's label was
369
- * hardcoded white, which a light fill (the Amber accent preset, say) turns
370
- * invisible - so it follows the fill's luminance instead. Unparseable colors
371
- * keep white, the pre-existing behavior. */
372
- declare function readableTextOn(background: string): string;
373
- /** How much room a modal gives its header. 'hero' is the identity-forward set
374
- * (login, KYC, ramp, the Privy sub-modal): roomier padding and a larger
375
- * centered heading. 'compact' is every utility modal (send, balance, history,
376
- * ...), which keeps the card's own 1.75rem padding. */
377
- type ModalVariant = 'hero' | 'compact';
378
- /** The app's Branding as inline CSS custom properties for a Pollar root (a modal
379
- * card, the wallet button).
380
- *
381
- * Everything is written under the private `--pollar-brand-*` names, never the
382
- * public `--pollar-*` ones: `shared.css` maps brand onto public inside a
383
- * zero-specificity `:where()`, so a host stylesheet that sets a public variable
384
- * on a Pollar root beats the Branding, and the Branding beats the theme
385
- * defaults. An inline `--pollar-*` would beat every stylesheet instead.
386
- *
387
- * The palette (background, text, borders, status colors) is only written when
388
- * the app pinned it: a dark theme, or a background or text color of its own.
389
- * Left out, the light defaults in `shared.css` apply, and a host `html.dark`
390
- * swaps them for the dark ones. */
391
- declare function buildModalCssVars(theme: string, accentColor: string, overrides?: ModalStyleOverrides, variant?: ModalVariant): CSSProperties;
392
- /** Everything a modal wrapper needs to dress itself from the app's branding:
393
- * the theme pair its template already took, the overrides to forward to that
394
- * template, and the inline style for the fixed overlay behind it. */
395
- interface ModalChrome {
396
- theme: string;
397
- accentColor: string;
398
- styleOverrides: ModalStyleOverrides;
399
- overlayStyle: CSSProperties;
400
- }
401
- /** Resolve the branding config into the props/styles a modal wrapper applies.
402
- * Called by every `.pollar-overlay` renderer so the z-index and the card
403
- * overrides can't drift apart between modals. */
404
- declare function modalChrome(styles: PollarStyles): ModalChrome;
405
-
406
810
  interface WalletButtonTemplateProps {
407
811
  walletAddress: string | null;
408
812
  theme: string;
@@ -419,7 +823,7 @@ interface WalletButtonTemplateProps {
419
823
  * Why the wallet cannot act on-chain yet (its account is being created, or
420
824
  * that failed), or null when it can. Shown as a banner in the dropdown, since
421
825
  * the address itself is valid and worth copying either way. Optional, so a
422
- * custom template written before this existed keeps compiling.
826
+ * custom template that does not read it keeps compiling.
423
827
  */
424
828
  notReadyReason?: string | null;
425
829
  /**
@@ -434,7 +838,7 @@ interface WalletButtonTemplateProps {
434
838
  * Signed in with no wallet yet (an app that creates wallets on demand, or
435
839
  * none). The button then shows the account menu instead of Login, with Create
436
840
  * wallet only when `onCreateWallet` is set. Optional, so a custom template
437
- * written before this existed keeps compiling.
841
+ * that does not read it keeps compiling.
438
842
  */
439
843
  signedIn?: boolean;
440
844
  creatingWallet?: boolean;
@@ -571,8 +975,24 @@ interface KycModalProps {
571
975
  onApproved?: () => void;
572
976
  /** Language of the modal, as a BCP 47 tag. A language pinned in the dashboard wins over it. */
573
977
  language?: string | undefined;
978
+ /** Render the card in the page instead of over a backdrop, without its close buttons. */
979
+ inline?: boolean;
980
+ }
981
+ declare function KycModal({ onClose, country, level, onApproved, corridorId, cardProviderId, providerId, language: languageProp, inline, }: KycModalProps): react_jsx_runtime.JSX.Element;
982
+
983
+ interface KycFlowProps {
984
+ /** Called once every step is complete; the flow then renders nothing. */
985
+ onApproved?: () => void;
986
+ country?: string;
987
+ level?: 'basic' | 'intermediate' | 'enhanced';
574
988
  }
575
- declare function KycModal({ onClose, country, level, onApproved, corridorId, cardProviderId, providerId, language: languageProp, }: KycModalProps): react_jsx_runtime.JSX.Element;
989
+ /**
990
+ * The app's own KYC, step by step, in the host's page instead of modals: for a
991
+ * page made for verifying, like a KYC link's. Each pending step shows as a card
992
+ * where it is placed (the vendor's verification, or a form) and the next one
993
+ * replaces it as soon as it is done. Signed-in users only.
994
+ */
995
+ declare function KycFlow({ onApproved, country, level }: KycFlowProps): react_jsx_runtime.JSX.Element;
576
996
 
577
997
  interface RequirementFormModalProps {
578
998
  formId: string;
@@ -586,9 +1006,11 @@ interface RequirementFormModalProps {
586
1006
  onSubmitted: () => void;
587
1007
  /** Language of the modal, as a BCP 47 tag. A language pinned in the dashboard wins over it. */
588
1008
  language?: string | undefined;
1009
+ /** Render the card in the page instead of over a backdrop, without its close buttons. */
1010
+ inline?: boolean;
589
1011
  }
590
1012
  /** One FORM requirement step: the form a route asks for, prefilled with the user's previous answers. */
591
- declare function RequirementFormModal({ formId, progress, onClose, onSubmitted, language: languageProp, }: RequirementFormModalProps): react_jsx_runtime.JSX.Element;
1013
+ declare function RequirementFormModal({ formId, progress, onClose, onSubmitted, language: languageProp, inline, }: RequirementFormModalProps): react_jsx_runtime.JSX.Element;
592
1014
 
593
1015
  interface RegistryCheckModalProps {
594
1016
  optionId: string;
@@ -641,13 +1063,6 @@ interface KycStatusProps {
641
1063
  }
642
1064
  declare function KycStatus({ status, label, className, language: languageProp }: KycStatusProps): react_jsx_runtime.JSX.Element;
643
1065
 
644
- interface RampWidgetProps {
645
- onClose: () => void;
646
- /** Language of the widget and the steps it opens, as a BCP 47 tag. A language pinned in the dashboard wins over it. */
647
- language?: string | undefined;
648
- }
649
- declare function RampWidget({ onClose, language: languageProp }: RampWidgetProps): react_jsx_runtime.JSX.Element;
650
-
651
1066
  interface RouteDisplayProps {
652
1067
  quote: RampQuote;
653
1068
  /** The first quote: the most received (or least sent) for the amount. */
@@ -702,31 +1117,6 @@ interface EnabledAssetsModalProps {
702
1117
  }
703
1118
  declare function EnabledAssetsModal({ onClose }: EnabledAssetsModalProps): react_jsx_runtime.JSX.Element;
704
1119
 
705
- interface SendModalProps {
706
- onClose: () => void;
707
- }
708
- declare function SendModal({ onClose }: SendModalProps): react_jsx_runtime.JSX.Element;
709
-
710
- interface SwapModalProps {
711
- onClose: () => void;
712
- }
713
- declare function SwapModal({ onClose }: SwapModalProps): react_jsx_runtime.JSX.Element;
714
-
715
- interface EarnModalProps {
716
- onClose: () => void;
717
- }
718
- declare function EarnModal({ onClose }: EarnModalProps): react_jsx_runtime.JSX.Element;
719
-
720
- interface CardModalProps {
721
- onClose: () => void;
722
- }
723
- declare function CardModal({ onClose }: CardModalProps): react_jsx_runtime.JSX.Element;
724
-
725
- interface ReceiveModalProps {
726
- onClose: () => void;
727
- }
728
- declare function ReceiveModal({ onClose }: ReceiveModalProps): react_jsx_runtime.JSX.Element;
729
-
730
1120
  interface SessionsModalProps {
731
1121
  onClose: () => void;
732
1122
  }
@@ -840,8 +1230,10 @@ interface KycModalTemplateProps {
840
1230
  onClose: () => void;
841
1231
  /** Defaults to the user's device; the modal passes the resolved one. */
842
1232
  language?: PollarLanguage | undefined;
1233
+ /** In the host's page rather than over a backdrop: a region, with no close buttons. */
1234
+ inline?: boolean;
843
1235
  }
844
- 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;
1236
+ declare function KycModalTemplate({ theme, accentColor, styleOverrides, step, providers, selectedProvider, session, kycStatus, reviewReason, processing, isLoading, startingProviderId, directOpen, error, onSelectProvider, onDoneVerifying, onStartAgain, onRefresh, onClose, language, inline, }: KycModalTemplateProps): react_jsx_runtime.JSX.Element;
845
1237
 
846
1238
  type RampStep = 'input' | 'loading_quote' | 'select_route' | 'contact' | 'status' | 'error';
847
1239
  interface RampWidgetTemplateProps {
@@ -892,6 +1284,15 @@ interface RampWidgetTemplateProps {
892
1284
  onAssetChange: (key: string) => void;
893
1285
  onAmountChange: (value: string) => void;
894
1286
  onFindRoute: () => void;
1287
+ /** The amount screen is quoting what was typed. */
1288
+ quoting?: boolean;
1289
+ /** `BEST_ROUTE`, or the key of the route the user picked in the details. */
1290
+ routeChoice?: string;
1291
+ /** The route Continue takes: the picked one, else the best. */
1292
+ chosenQuote?: RampQuote | null;
1293
+ onRouteChoice?: (choice: string) => void;
1294
+ /** Takes the chosen route, or opens every route when none could be quoted. */
1295
+ onContinue?: () => void;
895
1296
  onSelectQuote: (quote: RampQuote) => void;
896
1297
  /** Opens the verification step a dropped route waits on. */
897
1298
  onVerifyRoute?: (requirement: RampQuoteRequirement) => void;
@@ -917,10 +1318,14 @@ interface RampWidgetTemplateProps {
917
1318
  retrying?: boolean;
918
1319
  /** Runs the user's held order again; absent, a held order only says what happened. */
919
1320
  onRetryOrder?: (() => void) | undefined;
1321
+ /** Quotes the same amount again when the price changed before anything moved; absent, only a new operation is offered. */
1322
+ onRequote?: (() => void) | undefined;
920
1323
  /** Opens the wallet's recovery setup, for an order held until the wallet has a way to be recovered. */
921
1324
  onSetUpRecovery?: (() => void) | undefined;
922
1325
  /** Whether the wallet still has no way to be recovered; null while its state is unread. */
923
1326
  recoveryMissing?: boolean | null;
1327
+ /** The app's support contact, linked when an order asks the user to contact support. */
1328
+ support?: PollarSupportContact | null;
924
1329
  /** Reading the order keeps failing and polling is retrying. */
925
1330
  pollTrouble?: boolean;
926
1331
  /** The fiat payment the user says they made is being checked. */
@@ -940,8 +1345,10 @@ interface RampWidgetTemplateProps {
940
1345
  onRetry: () => void;
941
1346
  onRefresh: () => void;
942
1347
  onClose: () => void;
1348
+ /** A leg's signature waiting for the user's yes, answered in the status view. */
1349
+ confirmation?: PendingConfirmation | null | undefined;
943
1350
  }
944
- 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, language: languageProp, }: RampWidgetTemplateProps): react_jsx_runtime.JSX.Element;
1351
+ 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, quoting, routeChoice, chosenQuote, onRouteChoice, onContinue, onSelectQuote, onVerifyRoute, trustingAsset, onTrustAsset, walletBusy, custodyChoice, onWalletStep, noChains, retrying, onRetryOrder, onRequote, onSetUpRecovery, recoveryMissing, support, checkingPayment, onCheckPayment, pollTrouble, onFieldChange, onContactContinue, onSign, onApprove, onResumeOrder, onNewOrder, onBack, onStepSelect, onRetry, onRefresh, onClose, language: languageProp, confirmation, }: RampWidgetTemplateProps): react_jsx_runtime.JSX.Element;
945
1352
 
946
1353
  interface TransactionModalTemplateProps {
947
1354
  theme: string;
@@ -960,24 +1367,58 @@ interface TransactionModalTemplateProps {
960
1367
  onRetry?: () => void;
961
1368
  /** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
962
1369
  language?: PollarLanguage | undefined;
1370
+ /** The signature waiting for the user's yes, answered in this view. */
1371
+ confirmation?: PendingConfirmation | null | undefined;
1372
+ /** The app's network, for the details of a confirmation. */
1373
+ network?: StellarNetwork | undefined;
963
1374
  }
964
- declare function TransactionModalTemplate({ theme, accentColor, styleOverrides, transaction, showXdr, copied, explorerUrl, walletType, onClose, onSignAndSend, onToggleXdr, onCopyHash, onRetry, language: languageProp, }: TransactionModalTemplateProps): react_jsx_runtime.JSX.Element;
1375
+ declare function TransactionModalTemplate({ theme, accentColor, styleOverrides, transaction, showXdr, copied, explorerUrl, walletType, onClose, onSignAndSend, onToggleXdr, onCopyHash, onRetry, language: languageProp, confirmation, network, }: TransactionModalTemplateProps): react_jsx_runtime.JSX.Element;
965
1376
 
966
1377
  interface TxStatusViewProps {
967
1378
  transaction: TransactionState;
1379
+ /** Whether the details (addresses, network, fee, raw transaction, hash) are unfolded. */
968
1380
  showXdr: boolean;
1381
+ /** Unused: the hash copies from the details. */
969
1382
  copied: boolean;
970
1383
  explorerUrl: string | null;
971
1384
  walletType?: WalletId | null | undefined;
972
1385
  onSignAndSend: () => void;
1386
+ /** Folds and unfolds the details. */
973
1387
  onToggleXdr: () => void;
1388
+ /** Unused: the hash copies from the details. */
974
1389
  onCopyHash: () => void;
975
1390
  onRetry?: (() => void) | undefined;
976
1391
  onDone: () => void;
977
1392
  /** Language of the status text. Defaults to the user's device; the modals pass the resolved one. */
978
1393
  language?: PollarLanguage | undefined;
1394
+ /**
1395
+ * The operation as the modal knows it (an Earn deposit names its opportunity),
1396
+ * drawn instead of the build's summary. The hash and who paid the fee still
1397
+ * come from the transaction.
1398
+ */
1399
+ review?: TxReviewData | null | undefined;
1400
+ /** What the success says instead of the generic "sent" line. */
1401
+ successMessage?: string | undefined;
1402
+ /** Shown under the review once the transaction succeeds, above Done. */
1403
+ successExtra?: ReactNode;
1404
+ /** The signature waiting for the user's yes, answered here instead of in a prompt over the modal. */
1405
+ confirmation?: PendingConfirmation | null | undefined;
1406
+ /** The app's network, for the details of a confirmation. */
1407
+ network?: StellarNetwork | undefined;
1408
+ /** Rows the modal adds to the details (where a cross-chain swap delivers). */
1409
+ extraRows?: TxDetailRow[] | undefined;
1410
+ /** A second line for the outcome strip, and whether it reports a failure (a cross-chain leg). */
1411
+ outcomeNote?: {
1412
+ text: string;
1413
+ failed?: boolean;
1414
+ } | undefined;
979
1415
  }
980
- declare function TxStatusView({ transaction, showXdr, copied, explorerUrl, walletType, onSignAndSend, onToggleXdr, onCopyHash, onRetry, onDone, language: languageProp, }: TxStatusViewProps): react_jsx_runtime.JSX.Element;
1416
+ /**
1417
+ * A transaction from the user's yes to its outcome in one view: the review stays,
1418
+ * and a strip under it says where the transaction stands. The hash and every
1419
+ * address live in the details.
1420
+ */
1421
+ declare function TxStatusView({ transaction, showXdr, explorerUrl, walletType, onSignAndSend, onToggleXdr, onRetry, onDone, language: languageProp, review: reviewProp, successMessage, successExtra, confirmation, network, extraRows, outcomeNote, }: TxStatusViewProps): react_jsx_runtime.JSX.Element;
981
1422
 
982
1423
  interface TxHistoryModalTemplateProps {
983
1424
  theme: string;
@@ -1027,6 +1468,14 @@ interface WalletBalanceModalTemplateProps {
1027
1468
  }
1028
1469
  declare function WalletBalanceModalTemplate({ theme, accentColor, styleOverrides, walletBalance, walletAddress, assetMetadata, chains, selectedChain, network, onSelectChain, onRefresh, onClose, language: languageProp, }: WalletBalanceModalTemplateProps): react_jsx_runtime.JSX.Element;
1029
1470
 
1471
+ /** Adding or removing an asset from this modal, and where that trustline change stands. */
1472
+ interface AssetOutcome {
1473
+ code: string;
1474
+ removing: boolean;
1475
+ state: 'busy' | 'done' | 'failed';
1476
+ /** Why it failed, ready to show. */
1477
+ note?: string;
1478
+ }
1030
1479
  interface EnabledAssetsModalTemplateProps {
1031
1480
  theme: string;
1032
1481
  accentColor: string;
@@ -1041,7 +1490,8 @@ interface EnabledAssetsModalTemplateProps {
1041
1490
  onSelectChain: (chain: WalletChain) => void;
1042
1491
  /** Key (`code+issuer`) of the asset whose trustline action is in flight. */
1043
1492
  busyKey: string | null;
1044
- actionError: string | null;
1493
+ outcome: AssetOutcome | null;
1494
+ confirmation?: PendingConfirmation | null | undefined;
1045
1495
  onRefresh: () => void;
1046
1496
  onClose: () => void;
1047
1497
  onToggleTrustline: (record: EnabledAssetRecord) => void;
@@ -1049,14 +1499,15 @@ interface EnabledAssetsModalTemplateProps {
1049
1499
  /** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
1050
1500
  language?: PollarLanguage | undefined;
1051
1501
  }
1052
- 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;
1502
+ declare function EnabledAssetsModalTemplate({ theme, accentColor, styleOverrides, enabledAssets, walletAddress, chains, selectedChain, onSelectChain, busyKey, outcome, confirmation, onRefresh, onClose, onToggleTrustline, onAddCustom, language: languageProp, }: EnabledAssetsModalTemplateProps): react_jsx_runtime.JSX.Element;
1053
1503
  interface CustomTrustlineModalTemplateProps {
1054
1504
  theme: string;
1055
1505
  accentColor: string;
1056
1506
  /** Per-app modal chrome overrides (background, card + button radius). */
1057
1507
  styleOverrides?: ModalStyleOverrides;
1058
1508
  busy: boolean;
1059
- actionError: string | null;
1509
+ outcome: AssetOutcome | null;
1510
+ confirmation?: PendingConfirmation | null | undefined;
1060
1511
  onBack: () => void;
1061
1512
  onClose: () => void;
1062
1513
  onSubmit: (input: {
@@ -1068,162 +1519,45 @@ interface CustomTrustlineModalTemplateProps {
1068
1519
  language?: PollarLanguage | undefined;
1069
1520
  }
1070
1521
 
1071
- /** The memo types the backend accepts on a Stellar payment. */
1072
- type SendMemoType = 'text' | 'id' | 'hash';
1073
- interface SendModalTemplateProps {
1522
+ type BridgeModalStep = 'loading' | 'unavailable' | 'form' | 'transfer';
1523
+ interface BridgeModalTemplateProps {
1074
1524
  theme: string;
1075
1525
  accentColor: string;
1076
- /** Per-app modal chrome overrides (background, card + button radius). */
1077
1526
  styleOverrides?: ModalStyleOverrides;
1078
- /**
1079
- * `create-account`: the Stellar destination has no account yet, so the user
1080
- * chooses between creating it with the XLM being sent and waiting for someone
1081
- * else to fund it.
1082
- */
1083
- step: 'form' | 'create-account' | 'tx';
1084
- txTitle: string;
1085
- assets: WalletBalanceRecord[];
1086
- selectedAsset: WalletBalanceRecord | null;
1087
- selectedChain: WalletChain | null;
1088
- /**
1089
- * The networks the user can send from, in the app's configured order. The
1090
- * picker renders only with two or more, so a single-chain app shows none.
1091
- */
1092
- chains?: WalletChain[];
1093
- /** @deprecated Kept for compatibility; the sender address is no longer shown. */
1094
- walletAddress?: string;
1095
- /** Can a payment be built on {@link selectedChain}? Stellar and Solana only. */
1096
- canSendOnChain: boolean;
1097
- /**
1098
- * Why the wallet cannot act on-chain right now (its Stellar account is still
1099
- * being created, or its creation failed), or null when it can.
1100
- *
1101
- * Separate from {@link canSendOnChain}: that one is about the NETWORK not
1102
- * having a transfer path, this one about the user's own account. Collapsing
1103
- * them would tell someone waiting on a brand-new wallet that Stellar does not
1104
- * support sending. Optional, so a custom template written before this existed
1105
- * keeps compiling.
1106
- */
1107
- notReadyReason?: string | null;
1108
- onSelectChain?: (chain: WalletChain) => void;
1527
+ step: BridgeModalStep;
1528
+ /** Why the form is not offered: off mainnet, or no pair of wallets to bridge between. */
1529
+ unavailableReason: 'mainnet_only' | 'no_directions' | null;
1530
+ sources: BridgeChain[];
1531
+ targets: BridgeChain[];
1532
+ fromChain: BridgeChain | null;
1533
+ toChain: BridgeChain | null;
1534
+ onFromChange: (chain: BridgeChain) => void;
1535
+ onToChange: (chain: BridgeChain) => void;
1109
1536
  amount: string;
1110
- destination: string;
1111
- formError: string;
1112
- isLoadingBalance: boolean;
1113
- /** The destination's account is being looked up; the form waits for it. */
1114
- isCheckingDestination?: boolean;
1115
- /** The least XLM a new Stellar account can start with. */
1116
- minStartingBalance?: number;
1117
- /** Builds a `create_account` for the destination, funded with the amount. Required for the `create-account` step. */
1118
- onCreateAccount?: () => void;
1119
- transaction: TransactionState;
1120
- showXdr: boolean;
1121
- copied: boolean;
1122
- explorerUrl: string | null;
1123
- walletType?: WalletId | null | undefined;
1124
- showBack: boolean;
1125
- isInProgress: boolean;
1126
- onClose: () => void;
1127
- onBack: () => void;
1128
- onRefresh: () => void;
1129
- onSelectAsset: (asset: WalletBalanceRecord) => void;
1130
- onAmountChange: (value: string) => void;
1537
+ onAmountChange: (amount: string) => void;
1538
+ /** USDC available on `fromChain`; null while unknown. */
1539
+ balance: string | null;
1131
1540
  onMax: () => void;
1132
- onPaste: () => void;
1133
- onDestinationChange: (value: string) => void;
1134
- /**
1135
- * Optional Stellar memo. The field renders only on Stellar and only when
1136
- * {@link onMemoChange} is passed, so a custom template written before it
1137
- * existed keeps compiling.
1138
- */
1139
- memo?: string;
1140
- memoType?: SendMemoType;
1141
- onMemoChange?: (value: string) => void;
1142
- onMemoTypeChange?: (type: SendMemoType) => void;
1541
+ quote: BridgeQuote | null;
1542
+ quoting: boolean;
1543
+ /** What is wrong with the form or what the server refused, ready to show. */
1544
+ formError: string | null;
1545
+ canSubmit: boolean;
1546
+ submitting: boolean;
1143
1547
  onSubmit: () => void;
1144
- onSignAndSend: () => void;
1145
- onToggleXdr: () => void;
1146
- onCopyHash: () => void;
1147
- onRetry: () => void;
1148
- onDone: () => void;
1149
- /** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
1150
- language?: PollarLanguage | undefined;
1151
- }
1152
- 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;
1153
-
1154
- /** The chain a swap runs on; the modal shows a selector when the app offers both. */
1155
- type SwapChain = 'STELLAR' | 'SOLANA';
1156
- interface SwapAssetOption {
1157
- /** Stellar: the asset ref the quote takes. */
1158
- ref?: SwapQuoteParams['sellAsset'] | undefined;
1159
- code: string;
1160
- /** Stellar: the issuer. Solana: the mint (wrapped SOL for SOL). */
1161
- issuer?: string | undefined;
1162
- /** Solana: the mint's decimals, to turn a decimal amount into base units. */
1163
- decimals?: number | undefined;
1164
- available?: string | undefined;
1165
- enabledInApp?: boolean | undefined;
1166
- }
1167
- /** A quote as the form shows it, whichever chain priced it: decimal amounts. */
1168
- interface SwapQuoteView {
1169
- provider: string;
1170
- amountOut: string;
1171
- minReceived: string;
1172
- /** Percent; null when the venue does not report it. */
1173
- priceImpactPct: string | null;
1174
- }
1175
- interface SwapModalTemplateProps {
1176
- theme: string;
1177
- accentColor: string;
1178
- styleOverrides?: ModalStyleOverrides;
1179
- step: 'form' | 'tx';
1180
- txTitle: string;
1181
- sellOptions: SwapAssetOption[];
1182
- buyOptions: SwapAssetOption[];
1183
- selectedSell: SwapAssetOption | null;
1184
- selectedBuy: SwapAssetOption | null;
1185
- amount: string;
1186
- /** The chains the app offers swaps on; a selector shows when there are two. */
1187
- chains: SwapChain[];
1188
- chain: SwapChain;
1189
- provider: string;
1190
- providers: string[];
1191
- quote: SwapQuoteView | null;
1192
- quoteLoading: boolean;
1193
- quoteError: string;
1194
- formError: string;
1195
- isLoadingData: boolean;
1196
- smartUnsupported: boolean;
1197
- configLoading: boolean;
1198
- swapUnavailable: boolean;
1199
- buyNeedsTrustline: boolean;
1200
- transaction: TransactionState;
1201
- showXdr: boolean;
1202
- copied: boolean;
1203
- explorerUrl: string | null;
1204
- walletType?: WalletId | null | undefined;
1205
- showBack: boolean;
1206
- isInProgress: boolean;
1207
- /** Language of the modal's text; the device's when not given. */
1208
- language?: PollarLanguage | undefined;
1548
+ transfer: BridgeTransfer | null;
1549
+ signing: boolean;
1550
+ onAuthorize: () => void;
1551
+ onApprove: () => void;
1552
+ actionError: string | null;
1553
+ pollTrouble: boolean;
1554
+ onNewBridge: () => void;
1209
1555
  onClose: () => void;
1210
- onBack: () => void;
1211
- onRefresh: () => void;
1212
- onSelectSell: (o: SwapAssetOption) => void;
1213
- onSelectBuy: (o: SwapAssetOption) => void;
1214
- onReverse: () => void;
1215
- onMax: () => void;
1216
- onAddCustomToken: (code: string, issuer: string) => string | null;
1217
- onAmountChange: (value: string) => void;
1218
- onChainChange: (chain: SwapChain) => void;
1219
- onProviderChange: (p: string) => void;
1220
- onSwap: () => void;
1221
- onToggleXdr: () => void;
1222
- onCopyHash: () => void;
1223
- onRetry: () => void;
1224
- onDone: () => void;
1556
+ language?: PollarLanguage | undefined;
1557
+ /** The signature waiting for the user's yes, answered in the transfer view. */
1558
+ confirmation?: PendingConfirmation | null | undefined;
1225
1559
  }
1226
- 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;
1560
+ declare function BridgeModalTemplate(props: BridgeModalTemplateProps): react_jsx_runtime.JSX.Element;
1227
1561
 
1228
1562
  interface ReceiveModalTemplateProps {
1229
1563
  theme: string;
@@ -1246,7 +1580,7 @@ interface ReceiveModalTemplateProps {
1246
1580
  *
1247
1581
  * The address itself is valid either way - what is missing is the account
1248
1582
  * behind it, so a payment sent now is rejected by the network. Optional, so a
1249
- * custom template written before this existed keeps compiling.
1583
+ * custom template that does not read it keeps compiling.
1250
1584
  */
1251
1585
  notReadyReason?: string | null;
1252
1586
  /**
@@ -1296,22 +1630,35 @@ interface CosignModalTemplateProps {
1296
1630
  error: string | null;
1297
1631
  /** Approve stays off for a request whose approval just failed. */
1298
1632
  approveBlocked?: boolean;
1633
+ /** This device is not one of the wallet's devices: it cannot vote, only reject, until it is added. */
1634
+ deviceNotLinked?: boolean;
1635
+ /** Opens where this device gets added; the button shows only with it. */
1636
+ onLinkDevice?: () => void;
1299
1637
  /** The last request that reached a final state, shown once the list is empty. */
1300
1638
  lastResolved?: CosignRequest;
1301
- /** Explorer page of {@link lastResolved}'s transaction, when it was sent. */
1302
- explorerUrl?: string | null;
1639
+ /** The requests resolved while the modal is open, oldest first: the steps of the flow already signed. */
1640
+ history?: CosignRequest[];
1641
+ /** The explorer page of a sent request's transaction. */
1642
+ explorerUrlOf?: (request: CosignRequest) => string | null;
1303
1643
  /** Seconds until the modal closes on its own, while what it shows needs nothing from the user. */
1304
1644
  closesIn?: number | null;
1305
1645
  /** The approval coming next in the same flow, shown while the modal waits for it. */
1306
1646
  nextStep?: string | null;
1307
1647
  /** Language of the modal's text; the device's when not given. */
1308
1648
  language?: PollarLanguage | undefined;
1649
+ /** The app's network, shown next to the chain in the details. */
1650
+ network?: StellarNetwork | undefined;
1309
1651
  onSelect: (request: CosignRequest) => void;
1310
1652
  onApprove: (request: CosignRequest) => void;
1311
1653
  onReject: (request: CosignRequest) => void;
1654
+ /** The user asked to close (the X): the container closes or asks first. */
1312
1655
  onClose: () => void;
1656
+ /** Closing was asked while a request waits: the modal asks before leaving it unsigned. */
1657
+ confirmingClose?: boolean;
1658
+ onKeepOpen?: () => void;
1659
+ onCloseAnyway?: () => void;
1313
1660
  }
1314
- declare function CosignModalTemplate({ theme, accentColor, styleOverrides, pending, current, verification, busy, error, approveBlocked, lastResolved, explorerUrl, closesIn, nextStep, language: languageProp, onSelect, onApprove, onReject, onClose, }: CosignModalTemplateProps): react_jsx_runtime.JSX.Element;
1661
+ declare function CosignModalTemplate({ theme, accentColor, styleOverrides, pending, current, verification, busy, error, approveBlocked, deviceNotLinked, onLinkDevice, lastResolved, history, explorerUrlOf, closesIn, nextStep, language: languageProp, network, onSelect, onApprove, onReject, onClose, confirmingClose, onKeepOpen, onCloseAnyway, }: CosignModalTemplateProps): react_jsx_runtime.JSX.Element;
1315
1662
 
1316
1663
  interface CustodyMigrationModalProps {
1317
1664
  state: CustodyMigrationState;
@@ -1406,4 +1753,4 @@ interface DistributionRulesModalTemplateProps {
1406
1753
  }
1407
1754
  declare function DistributionRulesModalTemplate({ theme, accentColor, styleOverrides, state, claimingId, claimErrors, claimedIds, language: languageProp, onRefresh, onClaim, onClose, }: DistributionRulesModalTemplateProps): react_jsx_runtime.JSX.Element;
1408
1755
 
1409
- 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 };
1756
+ 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, KycFlow, 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 };