@pollar/react 0.11.3-rc.1 → 0.11.4-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { pollarPaths, PollarClient, PollarClientConfig, PollarAdapters, OnStorageDegrade, WalletInfo, PollarLoginOptions, SessionsState, TransactionState, TxBuildBody, BuildOutcome, SubmitOutcome, SignOutcome, SendPaymentParams, StellarNetwork, WalletBalanceState, EnabledAssetsState, TrustlineOutcome, TxHistoryState, SwapVenue, SwapToken, SwapQuoteParams, SwapQuote, EarnProviderId, EarnOpportunity, EarnPositionParams, EarnPosition, EarnTxParams, PollarAdapter, PasskeyCeremony, PasskeySigner, WalletId, WalletChain, KycStatus as KycStatus$1, RampQuote, AuthState, KycProvider, KycStartResponse, RampDirection, RampCountry, RampTxStatus, RampDepositInstructions, EnabledAssetRecord, WalletBalanceRecord, SwapProvider, DistributionRulesState, DistributionRule } from '@pollar/core';
2
+ import { pollarPaths, PollarClient, PollarClientConfig, PollarAdapters, OnStorageDegrade, WalletInfo, PollarLoginOptions, SessionsState, TransactionState, TxBuildBody, BuildOutcome, SubmitOutcome, SignOutcome, SendPaymentParams, StellarNetwork, WalletBalanceState, EnabledAssetsState, TrustlineOutcome, TxHistoryState, SwapVenue, SwapToken, SwapQuoteParams, SwapQuote, EarnProviderId, EarnOpportunity, EarnPositionParams, EarnPosition, EarnTxParams, PollarAdapter, PasskeyCeremony, PasskeySigner, WalletChain, KycStatus as KycStatus$1, RampQuote, WalletId, AuthState, KycProvider, KycStartResponse, RampDirection, RampCountry, RampQuoteRequirement, RampTxStatus, RampDepositInstructions, EnabledAssetRecord, WalletBalanceRecord, SwapProvider, DistributionRulesState, DistributionRule } from '@pollar/core';
3
3
  export { AuthProviderContext, PollarAuthProvider, SessionsState } from '@pollar/core';
4
4
  import { ReactNode, CSSProperties } from 'react';
5
5
 
@@ -22,13 +22,13 @@ interface PollarContextValue {
22
22
  /**
23
23
  * The authenticated user's wallet as a discriminated union over `custody`
24
24
  * (`internal` | `smart` | `external`), or `null` when unauthenticated. Every
25
- * field is meaningful for any login method — `custody` is always present and
25
+ * field is meaningful for any login method - `custody` is always present and
26
26
  * strictly determines the shape of `provider`. Use `wallet.address` for the
27
27
  * on-chain address and `wallet.provider` for the wallet/login provider.
28
28
  */
29
29
  wallet: WalletInfo | null;
30
30
  /**
31
- * Every wallet the user holds, one per chain — a superset of {@link wallet},
31
+ * Every wallet the user holds, one per chain - a superset of {@link wallet},
32
32
  * with `chain` populated. `[]` when unauthenticated. Drives the network
33
33
  * selector in the Send / Wallet Balance / Assets modals: each entry is a
34
34
  * network the user can switch to, and the first one is the default.
@@ -40,7 +40,7 @@ interface PollarContextValue {
40
40
  /**
41
41
  * `true` once the server has confirmed the session (login / refresh /
42
42
  * `/auth/session/resume`). `false` while a cold-start session is still
43
- * optimistic — gate sensitive actions (e.g. signing) on this.
43
+ * optimistic - gate sensitive actions (e.g. signing) on this.
44
44
  */
45
45
  verified: boolean;
46
46
  login: (options: PollarLoginOptions) => void;
@@ -52,7 +52,7 @@ interface PollarContextValue {
52
52
  styles: PollarStyles;
53
53
  /** Remote app-config load state. 'loading' while the initial fetch is in
54
54
  * flight, 'error' if it failed (styles fall back to empty defaults), 'ready'
55
- * once resolved — or immediately 'ready' when `appConfig` is passed as a prop.
55
+ * once resolved - or immediately 'ready' when `appConfig` is passed as a prop.
56
56
  * The login modal shows a spinner/retry instead of an empty shell until this
57
57
  * is 'ready'. */
58
58
  configStatus: 'loading' | 'ready' | 'error';
@@ -63,17 +63,17 @@ interface PollarContextValue {
63
63
  tx: TransactionState;
64
64
  buildTx: (operation: TxBuildBody['operation'], params: TxBuildBody['params'], options?: TxBuildBody['options']) => Promise<BuildOutcome>;
65
65
  signAndSubmitTx: (unsignedXdr?: string) => Promise<SubmitOutcome>;
66
- /** External-wallet only. Custodial flows should use `signAndSubmitTx`. */
66
+ /** Sign only. Embedded sessions sign server-side, external sessions through their adapter. Smart wallets use `signAndSubmitTx`. */
67
67
  signTx: (unsignedXdr: string) => Promise<SignOutcome>;
68
68
  submitTx: (signedXdr: string) => Promise<SubmitOutcome>;
69
- /** One-shot: build → sign → submit. Drives the same TransactionState flow as the split calls. */
69
+ /** One-shot: build -> sign -> submit. Drives the same TransactionState flow as the split calls. */
70
70
  buildAndSignAndSubmitTx: (operation: TxBuildBody['operation'], params: TxBuildBody['params'], options?: TxBuildBody['options']) => Promise<SubmitOutcome>;
71
71
  /** Alias of `buildAndSignAndSubmitTx`. */
72
72
  runTx: (operation: TxBuildBody['operation'], params: TxBuildBody['params'], options?: TxBuildBody['options']) => Promise<SubmitOutcome>;
73
73
  /**
74
74
  * Send a payment on any chain the user holds a wallet on. Stellar keeps the
75
75
  * split flow (so external adapters and passkeys still work); a chain whose
76
- * signature expires goes through one server-side call and is custodial-only.
76
+ * signature expires goes through one server-side call and is embedded-only.
77
77
  */
78
78
  sendPayment: (params: SendPaymentParams) => Promise<SubmitOutcome>;
79
79
  network: StellarNetwork;
@@ -104,6 +104,8 @@ interface PollarContextValue {
104
104
  /** Open the enabled-assets / trustline-state modal. */
105
105
  openEnabledAssetsModal: () => void;
106
106
  openKycModal: (options?: {
107
+ corridorId?: string;
108
+ providerId?: string;
107
109
  country?: string;
108
110
  level?: 'basic' | 'intermediate' | 'enhanced';
109
111
  onApproved?: () => void;
@@ -194,13 +196,13 @@ interface PollarProviderProps {
194
196
  * bypass the type anyway (plain JS, or a cast), each missing field lands on a
195
197
  * default scattered across the components rather than on anything central:
196
198
  *
197
- * chains absent → the chain order/filter falls back to the order the
199
+ * chains absent -> the chain order/filter falls back to the order the
198
200
  * session listed the user's wallets in (see useChains)
199
- * name absent → 'Pollar'
200
- * theme absent → 'light'
201
- * accentColor absent → '#005DB4'
201
+ * name absent -> 'Pollar'
202
+ * theme absent -> 'light'
203
+ * accentColor absent -> '#005DB4'
202
204
  * emailEnabled, providers, embeddedWallets, smartWallet
203
- * absent → false. NOTE: that means EVERY login method is off
205
+ * absent -> false. NOTE: that means EVERY login method is off
204
206
  * and the login modal renders with no way in.
205
207
  *
206
208
  * Leave this `undefined` to have the SDK fetch `/applications/config` on
@@ -235,16 +237,16 @@ declare function createPollarAdapterHook<T extends PollarAdapter>(key: string):
235
237
  *
236
238
  * `mode` is set explicitly by the caller's button, so there's no ambiguous
237
239
  * autodetect:
238
- * - `'login'` → `get()` only (returning user — the OS shows the account
240
+ * - `'login'` -> `get()` only (returning user - the OS shows the account
239
241
  * picker for discoverable credentials on this domain). A
240
242
  * failure here is surfaced as-is; it never falls through to
241
243
  * registration, so cancelling the prompt can't accidentally
242
244
  * create a second wallet.
243
- * - `'register'` → `create()` only (new user → the server deploys the
245
+ * - `'register'` -> `create()` only (new user -> the server deploys the
244
246
  * C-address).
245
247
  *
246
248
  * rpId = the current page's hostname (the customer app's domain), which is what
247
- * the passkey is bound to — the anti-phishing guarantee.
249
+ * the passkey is bound to - the anti-phishing guarantee.
248
250
  */
249
251
  declare const browserPasskeyCeremony: PasskeyCeremony;
250
252
  /**
@@ -256,6 +258,25 @@ declare const browserPasskeyCeremony: PasskeyCeremony;
256
258
  */
257
259
  declare const browserPasskeySigner: PasskeySigner;
258
260
 
261
+ /**
262
+ * The one place the widget decides whether a wallet can act on-chain, and what
263
+ * to say when it cannot.
264
+ *
265
+ * Only STELLAR is gated: `provisioning` describes the Stellar account, and a
266
+ * Solana wallet has nothing to wait for. Only the ACCOUNT is described, never
267
+ * trustlines - an asset the app enabled yesterday is not a reason to stop a
268
+ * user from sending the one they already hold.
269
+ *
270
+ * A `null` chain is "not known yet" (the app's chain order comes from
271
+ * `/config`, which is still in flight on a cold start) and reads as no reason
272
+ * to block. Guessing STELLAR there would tell a Solana-first user their wallet
273
+ * is being prepared, next to a Solana address that sends and receives fine.
274
+ *
275
+ * Returns null when the wallet is usable, so a caller reads it as "no reason to
276
+ * block".
277
+ */
278
+ declare function walletNotReadyReason(wallet: WalletInfo | null | undefined, chain: WalletChain | null | undefined): string | null;
279
+
259
280
  declare function WalletButton(): react_jsx_runtime.JSX.Element;
260
281
 
261
282
  interface WalletButtonTemplateProps {
@@ -268,9 +289,15 @@ interface WalletButtonTemplateProps {
268
289
  itemColor: string;
269
290
  wrapperRef: React.RefObject<HTMLDivElement>;
270
291
  isInProgress: boolean;
271
- walletType: WalletId | null;
272
292
  /** Show the "Create account" action (external wallet not yet on-chain, IMMEDIATE funding). */
273
293
  showCreateAccount: boolean;
294
+ /**
295
+ * Why the wallet cannot act on-chain yet (its account is being created, or
296
+ * that failed), or null when it can. Shown as a banner in the dropdown, since
297
+ * the address itself is valid and worth copying either way. Optional, so a
298
+ * custom template written before this existed keeps compiling.
299
+ */
300
+ notReadyReason?: string | null;
274
301
  creatingAccount: boolean;
275
302
  onToggleOpen: () => void;
276
303
  onCreateAccount: () => void;
@@ -286,7 +313,7 @@ interface WalletButtonTemplateProps {
286
313
  onLogout: () => void;
287
314
  onLogin: () => void;
288
315
  }
289
- declare function WalletButtonTemplate({ walletAddress, accentColor, open, copied, dropdownBg, dropdownBorder, itemColor, wrapperRef, isInProgress, showCreateAccount, creatingAccount, onToggleOpen, onCreateAccount, onCopy, onWalletBalance, onTxHistory, onSend, onReceive, onSessions, onKyc, onRamp, onDistributionRules, onLogout, onLogin, }: WalletButtonTemplateProps): react_jsx_runtime.JSX.Element;
316
+ declare function WalletButtonTemplate({ walletAddress, accentColor, open, copied, dropdownBg, dropdownBorder, itemColor, wrapperRef, isInProgress, showCreateAccount, notReadyReason, creatingAccount, onToggleOpen, onCreateAccount, onCopy, onWalletBalance, onTxHistory, onSend, onReceive, onSessions, onKyc, onRamp, onDistributionRules, onLogout, onLogin, }: WalletButtonTemplateProps): react_jsx_runtime.JSX.Element;
290
317
 
291
318
  /**
292
319
  * The chain a record lives on, with the legacy shape folded in: sessions and
@@ -295,9 +322,9 @@ declare function WalletButtonTemplate({ walletAddress, accentColor, open, copied
295
322
  */
296
323
  declare function resolveChain(chain: WalletChain | undefined): WalletChain;
297
324
  /**
298
- * The selectable chains — the first is the default everywhere (network picker,
325
+ * The selectable chains - the first is the default everywhere (network picker,
299
326
  * the address the wallet button shows). De-duplicated because two wallets on one
300
- * chain (e.g. a custodial and a linked external Stellar wallet) are still one
327
+ * chain (e.g. an embedded and a linked external Stellar wallet) are still one
301
328
  * network choice.
302
329
  *
303
330
  * `order` is the app's chain list from `/applications/config`, as arranged in the
@@ -347,21 +374,74 @@ interface UseChainsResult {
347
374
  declare function useChains(): UseChainsResult;
348
375
 
349
376
  interface KycModalProps {
377
+ corridorId?: string;
378
+ /** Open this option directly instead of listing the choices (the one a ramp's KYC gate names). */
379
+ providerId?: string;
350
380
  onClose: () => void;
351
381
  /** ISO 3166-1 alpha-2 country code to filter providers. Defaults to 'MX'. */
352
382
  country?: string;
353
- /** KYC level required. Defaults to 'basic'. */
383
+ /** Legacy fallback for older backends. Named options select their own workflow. */
354
384
  level?: 'basic' | 'intermediate' | 'enhanced';
355
385
  /** Called when KYC is successfully approved. */
356
386
  onApproved?: () => void;
357
387
  }
358
- declare function KycModal({ onClose, country, level, onApproved }: KycModalProps): react_jsx_runtime.JSX.Element;
388
+ declare function KycModal({ onClose, country, level, onApproved, corridorId, providerId }: KycModalProps): react_jsx_runtime.JSX.Element;
389
+
390
+ interface RequirementFormModalProps {
391
+ formId: string;
392
+ /** Position of this step over the route's steps, when known. */
393
+ progress?: {
394
+ position: number;
395
+ total: number;
396
+ };
397
+ onClose: () => void;
398
+ /** Called once the answers are stored. */
399
+ onSubmitted: () => void;
400
+ }
401
+ /** One FORM requirement step: the form a route asks for, prefilled with the user's previous answers. */
402
+ declare function RequirementFormModal({ formId, progress, onClose, onSubmitted }: RequirementFormModalProps): react_jsx_runtime.JSX.Element;
403
+
404
+ interface RegistryCheckModalProps {
405
+ optionId: string;
406
+ /** Position of this step over the route's steps, when known. */
407
+ progress?: {
408
+ position: number;
409
+ total: number;
410
+ };
411
+ onClose: () => void;
412
+ /** Called once the registry confirmed the data. */
413
+ onApproved: () => void;
414
+ }
415
+ /**
416
+ * One REGISTRY_CHECK step (SEGIP): the user's verified data, prefilled and read-only
417
+ * except for the surname split and the CI complement, sent to the registry on confirm.
418
+ */
419
+ declare function RegistryCheckModal({ optionId, progress, onClose, onApproved }: RegistryCheckModalProps): react_jsx_runtime.JSX.Element;
420
+
421
+ interface ProviderRegistrationModalProps {
422
+ corridorId: string;
423
+ /** Position of this step over the route's steps, when known. */
424
+ progress?: {
425
+ position: number;
426
+ total: number;
427
+ };
428
+ onClose: () => void;
429
+ /** Called once the user is registered with the provider. */
430
+ onRegistered: () => void;
431
+ }
432
+ /**
433
+ * One PROVIDER_REGISTRATION step: what the ramp provider receives, listed before the
434
+ * user consents. Registering is the consent; nothing is sent until then.
435
+ */
436
+ declare function ProviderRegistrationModal({ corridorId, progress, onClose, onRegistered }: ProviderRegistrationModalProps): react_jsx_runtime.JSX.Element;
359
437
 
360
438
  interface KycStatusProps {
361
439
  status: KycStatus$1;
440
+ /** Replaces the status label, keeping its color. */
441
+ label?: string;
362
442
  className?: string;
363
443
  }
364
- declare function KycStatus({ status, className }: KycStatusProps): react_jsx_runtime.JSX.Element;
444
+ declare function KycStatus({ status, label, className }: KycStatusProps): react_jsx_runtime.JSX.Element;
365
445
 
366
446
  interface RampWidgetProps {
367
447
  onClose: () => void;
@@ -370,7 +450,7 @@ declare function RampWidget({ onClose }: RampWidgetProps): react_jsx_runtime.JSX
370
450
 
371
451
  interface RouteDisplayProps {
372
452
  quote: RampQuote;
373
- /** This route is the one being started — it owns the in-flight request. */
453
+ /** This route is the one being started - it owns the in-flight request. */
374
454
  busy?: boolean;
375
455
  /** Another route is starting, so this one is not selectable meanwhile. */
376
456
  disabled?: boolean;
@@ -428,7 +508,7 @@ interface ModalStyleOverrides {
428
508
  * keeps its theme color, so the two stay distinguishable. */
429
509
  textColor?: string | null | undefined;
430
510
  /** Fill of the SECONDARY buttons (the wallet / social / provider entries, the
431
- * retry button). The primary button is the accent's job. Unset ⇒ the theme's
511
+ * retry button). The primary button is the accent's job. Unset => the theme's
432
512
  * own surface color, which is what these buttons always used. */
433
513
  buttonColor?: string | null | undefined;
434
514
  /** Radius of the modal card itself, in px. */
@@ -438,17 +518,17 @@ interface ModalStyleOverrides {
438
518
  }
439
519
  /** Text color that stays legible on `background`. The primary button's label was
440
520
  * hardcoded white, which a light fill (the Amber accent preset, say) turns
441
- * invisible — so it follows the fill's luminance instead. Unparseable colors
521
+ * invisible - so it follows the fill's luminance instead. Unparseable colors
442
522
  * keep white, the pre-existing behavior. */
443
523
  declare function readableTextOn(background: string): string;
444
524
  /** How much room a modal gives its header. 'hero' is the identity-forward set
445
525
  * (login, KYC, ramp, the Privy sub-modal): roomier padding and a larger
446
526
  * centered heading. 'compact' is every utility modal (send, balance, history,
447
- * …), which keeps the card's own 1.75rem padding. */
527
+ * ...), which keeps the card's own 1.75rem padding. */
448
528
  type ModalVariant = 'hero' | 'compact';
449
529
  /** Theme-derived CSS custom properties shared by every Pollar modal, plus the
450
530
  * per-app overrides on top. One definition so the whole modal family stays
451
- * visually in lockstep — a var added here reaches all of them at once. */
531
+ * visually in lockstep - a var added here reaches all of them at once. */
452
532
  declare function buildModalCssVars(theme: string, accentColor: string, overrides?: ModalStyleOverrides, variant?: ModalVariant): CSSProperties;
453
533
  /** Everything a modal wrapper needs to dress itself from the app's branding:
454
534
  * the theme pair its template already took, the overrides to forward to that
@@ -490,7 +570,7 @@ interface LoginModalTemplateProps {
490
570
  github: boolean;
491
571
  apple: boolean;
492
572
  };
493
- /** Registered wallet adapters to render as buttons (Freighter, Albedo, Privy, …). */
573
+ /** Registered wallet adapters to render as buttons (Freighter, Albedo, Privy, ...). */
494
574
  walletAdapters: WalletAdapterEntry[];
495
575
  appName: string;
496
576
  email?: string;
@@ -522,13 +602,20 @@ interface KycModalTemplateProps {
522
602
  selectedProvider: KycProvider | null;
523
603
  session: KycStartResponse | null;
524
604
  kycStatus: KycStatus$1;
605
+ /** Set when the decision is held for manual review (e.g. DUPLICATE_DOCUMENT). */
606
+ reviewReason?: string | null;
607
+ /** The vendor approved and Pollar is still recording it (`kycStatus` stays `pending`). */
608
+ processing?: boolean;
525
609
  isLoading: boolean;
610
+ error?: string | null;
526
611
  onSelectProvider: (provider: KycProvider) => void;
527
612
  onDoneVerifying: () => void;
613
+ /** Open a new session after the previous one expired. */
614
+ onStartAgain?: () => void;
528
615
  onRefresh: () => void;
529
616
  onClose: () => void;
530
617
  }
531
- declare function KycModalTemplate({ theme, accentColor, styleOverrides, step, providers, selectedProvider, session, kycStatus, isLoading, onSelectProvider, onDoneVerifying, onRefresh, onClose, }: KycModalTemplateProps): react_jsx_runtime.JSX.Element;
618
+ declare function KycModalTemplate({ theme, accentColor, styleOverrides, step, providers, selectedProvider, session, kycStatus, reviewReason, processing, isLoading, error, onSelectProvider, onDoneVerifying, onStartAgain, onRefresh, onClose, }: KycModalTemplateProps): react_jsx_runtime.JSX.Element;
532
619
 
533
620
  type RampStep = 'input' | 'loading_quote' | 'select_route' | 'contact' | 'status' | 'error';
534
621
  /** A field a provider declares (via the quote) that the client must collect. */
@@ -537,7 +624,7 @@ interface RampFieldSpec {
537
624
  label: string;
538
625
  type: 'text' | 'email' | 'tel' | 'select';
539
626
  bankType?: 'CLABE' | 'PIX' | 'PSE' | 'ACH' | 'BREB';
540
- /** For `type: 'select'` — dropdown choices (e.g. Stereum's Bolivian banks). */
627
+ /** For `type: 'select'` - dropdown choices (e.g. Stereum's Bolivian banks). */
541
628
  options?: {
542
629
  value: string;
543
630
  label: string;
@@ -580,6 +667,8 @@ interface RampWidgetTemplateProps {
580
667
  countriesLoading: boolean;
581
668
  refreshing: boolean;
582
669
  quotes: RampQuote[];
670
+ /** Routes not quoted until the user completes the requirement step their corridor names (KYC, form, registry check or provider registration). */
671
+ kycRequired: RampQuoteRequirement[];
583
672
  isLoading: boolean;
584
673
  provider: string;
585
674
  txStatus: RampTxStatus | null;
@@ -587,7 +676,14 @@ interface RampWidgetTemplateProps {
587
676
  tosUrl: string | null;
588
677
  /** Provider gated the flow on KYC and published no link; nothing was signed. */
589
678
  kycBlocking: boolean;
590
- /** The gate has since cleared — the user needs a fresh quote to continue. */
679
+ /**
680
+ * Which part of provider onboarding is outstanding, when any is. Optional
681
+ * because this template is exported for integrators who render their own
682
+ * chrome: a required prop would break every one of them on upgrade. Omitted,
683
+ * the gate falls back to the identity-verification wording.
684
+ */
685
+ onboardingStatus?: 'kyc' | 'endorsement' | 'awaiting_provider' | null;
686
+ /** The gate has since cleared - the user needs a fresh quote to continue. */
591
687
  kycJustApproved: boolean;
592
688
  stellarTxHash: string | null;
593
689
  /** Stellar Expert URL for `stellarTxHash` (network-aware); null when unknown. */
@@ -596,12 +692,15 @@ interface RampWidgetTemplateProps {
596
692
  canComplete: boolean;
597
693
  completing: boolean;
598
694
  errorMsg: string | null;
695
+ /** Neutral guidance on the route list, e.g. after identity verification sent the user back to it. */
696
+ noticeMsg?: string | null;
599
697
  onDirectionChange: (d: RampDirection) => void;
600
698
  onAmountChange: (v: string) => void;
601
699
  onFieldChange: (key: string, value: string) => void;
602
700
  onCountryChange: (v: string) => void;
603
701
  onFindRoute: () => void;
604
702
  onSelectQuote: (q: RampQuote) => void;
703
+ onVerifyRoute: (requirement: RampQuoteRequirement) => void;
605
704
  onContactContinue: () => void;
606
705
  onOpenKyc: () => void;
607
706
  onOpenTos: () => void;
@@ -613,7 +712,7 @@ interface RampWidgetTemplateProps {
613
712
  onRefresh: () => void;
614
713
  onClose: () => void;
615
714
  }
616
- declare function RampWidgetTemplate({ theme, accentColor, styleOverrides, step, flowSteps, flowStepIndex, startingQuoteId, direction, amount, currency, country, requiredFields, fieldValues, countries, countriesLoading, refreshing, quotes, isLoading, provider, txStatus, kycUrl, tosUrl, kycBlocking, kycJustApproved, stellarTxHash, explorerUrl, depositInstructions, canComplete, completing, errorMsg, onDirectionChange, onAmountChange, onFieldChange, onCountryChange, onFindRoute, onSelectQuote, onContactContinue, onOpenKyc, onOpenTos, onCompleteWithdraw, onBack, onRetry, onRefresh, onClose, }: RampWidgetTemplateProps): react_jsx_runtime.JSX.Element;
715
+ declare function RampWidgetTemplate({ theme, accentColor, styleOverrides, step, flowSteps, flowStepIndex, startingQuoteId, direction, amount, currency, country, requiredFields, fieldValues, countries, countriesLoading, refreshing, quotes, kycRequired, isLoading, provider, txStatus, kycUrl, tosUrl, kycBlocking, onboardingStatus, kycJustApproved, stellarTxHash, explorerUrl, depositInstructions, canComplete, completing, errorMsg, noticeMsg, onDirectionChange, onAmountChange, onFieldChange, onCountryChange, onFindRoute, onSelectQuote, onVerifyRoute, onContactContinue, onOpenKyc, onOpenTos, onCompleteWithdraw, onBack, onRetry, onRefresh, onClose, }: RampWidgetTemplateProps): react_jsx_runtime.JSX.Element;
617
716
 
618
717
  interface TransactionModalTemplateProps {
619
718
  theme: string;
@@ -675,16 +774,21 @@ interface WalletBalanceModalTemplateProps {
675
774
  walletBalance: WalletBalanceState;
676
775
  /** Address of the wallet on {@link selectedChain}. */
677
776
  walletAddress: string;
678
- /** Networks the user holds a wallet on; the first one is the default. */
679
- chains: WalletChain[];
777
+ /** Asset catalog metadata, when already available in the provider. */
778
+ assetMetadata?: EnabledAssetRecord[];
779
+ /**
780
+ * The networks the user holds a wallet on, in the app's configured order.
781
+ * The picker renders only with two or more, so a single-chain app shows none.
782
+ */
783
+ chains?: WalletChain[];
680
784
  selectedChain: WalletChain | null;
681
- /** testnet vs mainnet — gates the Solana devnet faucet hint. */
785
+ /** testnet vs mainnet - gates the Solana devnet faucet hint. */
682
786
  network: StellarNetwork;
683
- onSelectChain: (chain: WalletChain) => void;
787
+ onSelectChain?: (chain: WalletChain) => void;
684
788
  onRefresh: () => void;
685
789
  onClose: () => void;
686
790
  }
687
- declare function WalletBalanceModalTemplate({ theme, accentColor, styleOverrides, walletBalance, walletAddress, chains, selectedChain, network, onSelectChain, onRefresh, onClose, }: WalletBalanceModalTemplateProps): react_jsx_runtime.JSX.Element;
791
+ declare function WalletBalanceModalTemplate({ theme, accentColor, styleOverrides, walletBalance, walletAddress, assetMetadata, chains, selectedChain, network, onSelectChain, onRefresh, onClose, }: WalletBalanceModalTemplateProps): react_jsx_runtime.JSX.Element;
688
792
 
689
793
  interface EnabledAssetsModalTemplateProps {
690
794
  theme: string;
@@ -732,14 +836,28 @@ interface SendModalTemplateProps {
732
836
  txTitle: string;
733
837
  assets: WalletBalanceRecord[];
734
838
  selectedAsset: WalletBalanceRecord | null;
735
- /** Networks the user holds a wallet on; the first one is the default. */
736
- chains: WalletChain[];
737
839
  selectedChain: WalletChain | null;
738
- /** Address of the wallet on {@link selectedChain}, shown under the picker. */
739
- walletAddress: string;
840
+ /**
841
+ * The networks the user can send from, in the app's configured order. The
842
+ * picker renders only with two or more, so a single-chain app shows none.
843
+ */
844
+ chains?: WalletChain[];
845
+ /** @deprecated Kept for compatibility; the sender address is no longer shown. */
846
+ walletAddress?: string;
740
847
  /** Can a payment be built on {@link selectedChain}? Stellar and Solana only. */
741
848
  canSendOnChain: boolean;
742
- onSelectChain: (chain: WalletChain) => void;
849
+ /**
850
+ * Why the wallet cannot act on-chain right now (its Stellar account is still
851
+ * being created, or its creation failed), or null when it can.
852
+ *
853
+ * Separate from {@link canSendOnChain}: that one is about the NETWORK not
854
+ * having a transfer path, this one about the user's own account. Collapsing
855
+ * them would tell someone waiting on a brand-new wallet that Stellar does not
856
+ * support sending. Optional, so a custom template written before this existed
857
+ * keeps compiling.
858
+ */
859
+ notReadyReason?: string | null;
860
+ onSelectChain?: (chain: WalletChain) => void;
743
861
  amount: string;
744
862
  destination: string;
745
863
  formError: string;
@@ -756,6 +874,8 @@ interface SendModalTemplateProps {
756
874
  onRefresh: () => void;
757
875
  onSelectAsset: (asset: WalletBalanceRecord) => void;
758
876
  onAmountChange: (value: string) => void;
877
+ onMax: () => void;
878
+ onPaste: () => void;
759
879
  onDestinationChange: (value: string) => void;
760
880
  onSubmit: () => void;
761
881
  onSignAndSend: () => void;
@@ -764,9 +884,8 @@ interface SendModalTemplateProps {
764
884
  onRetry: () => void;
765
885
  onDone: () => void;
766
886
  }
767
- declare function SendModalTemplate({ theme, accentColor, styleOverrides, step, txTitle, assets, selectedAsset, chains, selectedChain, walletAddress, canSendOnChain, onSelectChain, amount, destination, formError, isLoadingBalance, transaction, showXdr, copied, explorerUrl, walletType, showBack, isInProgress, onClose, onBack, onRefresh, onSelectAsset, onAmountChange, onDestinationChange, onSubmit, onSignAndSend, onToggleXdr, onCopyHash, onRetry, onDone, }: SendModalTemplateProps): react_jsx_runtime.JSX.Element;
887
+ declare function SendModalTemplate({ theme, accentColor, styleOverrides, step, txTitle, assets, selectedAsset, selectedChain, canSendOnChain, notReadyReason, chains, onSelectChain, amount, destination, formError, isLoadingBalance, transaction, showXdr, copied, explorerUrl, walletType, showBack, isInProgress, onClose, onBack, onRefresh, onSelectAsset, onAmountChange, onMax, onPaste, onDestinationChange, onSubmit, onSignAndSend, onToggleXdr, onCopyHash, onRetry, onDone, }: SendModalTemplateProps): react_jsx_runtime.JSX.Element;
768
888
 
769
- /** A selectable asset in the sell/buy pickers, normalized across balance/enabled records. */
770
889
  interface SwapAssetOption {
771
890
  ref: SwapQuoteParams['sellAsset'];
772
891
  code: string;
@@ -777,7 +896,6 @@ interface SwapAssetOption {
777
896
  interface SwapModalTemplateProps {
778
897
  theme: string;
779
898
  accentColor: string;
780
- /** Per-app modal chrome overrides (background, card + button radius). */
781
899
  styleOverrides?: ModalStyleOverrides;
782
900
  step: 'form' | 'tx';
783
901
  txTitle: string;
@@ -794,11 +912,8 @@ interface SwapModalTemplateProps {
794
912
  formError: string;
795
913
  isLoadingData: boolean;
796
914
  smartUnsupported: boolean;
797
- /** Swap config is still loading. */
798
915
  configLoading: boolean;
799
- /** Config loaded and this app exposes no swap venues — swap is disabled. */
800
916
  swapUnavailable: boolean;
801
- /** Buying the selected asset will create a trustline first (~0.5 XLM reserve). */
802
917
  buyNeedsTrustline: boolean;
803
918
  transaction: TransactionState;
804
919
  showXdr: boolean;
@@ -812,7 +927,8 @@ interface SwapModalTemplateProps {
812
927
  onRefresh: () => void;
813
928
  onSelectSell: (o: SwapAssetOption) => void;
814
929
  onSelectBuy: (o: SwapAssetOption) => void;
815
- /** Add a user-pasted token (code + issuer) to the buy list. Returns an error or null. */
930
+ onReverse: () => void;
931
+ onMax: () => void;
816
932
  onAddCustomToken: (code: string, issuer: string) => string | null;
817
933
  onAmountChange: (value: string) => void;
818
934
  onProviderChange: (p: SwapProvider) => void;
@@ -822,7 +938,7 @@ interface SwapModalTemplateProps {
822
938
  onRetry: () => void;
823
939
  onDone: () => void;
824
940
  }
825
- 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, onAmountChange, onProviderChange, onSwap, onToggleXdr, onCopyHash, onRetry, onDone, }: SwapModalTemplateProps): react_jsx_runtime.JSX.Element;
941
+ 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;
826
942
 
827
943
  interface ReceiveModalTemplateProps {
828
944
  theme: string;
@@ -831,15 +947,27 @@ interface ReceiveModalTemplateProps {
831
947
  styleOverrides?: ModalStyleOverrides;
832
948
  /** Address of the wallet on {@link selectedChain}. */
833
949
  walletAddress: string;
834
- /** Networks the user holds a wallet on; the first one is the default. */
835
- chains: WalletChain[];
950
+ /**
951
+ * The networks the user holds an address on, in the app's configured order.
952
+ * The picker renders only with two or more, so a single-chain app shows none.
953
+ */
954
+ chains?: WalletChain[];
836
955
  selectedChain: WalletChain | null;
837
- onSelectChain: (chain: WalletChain) => void;
956
+ onSelectChain?: (chain: WalletChain) => void;
838
957
  copied: boolean;
958
+ /**
959
+ * Why the wallet cannot receive yet (its Stellar account is still being
960
+ * created, or its creation failed), or null when it can.
961
+ *
962
+ * The address itself is valid either way - what is missing is the account
963
+ * behind it, so a payment sent now is rejected by the network. Optional, so a
964
+ * custom template written before this existed keeps compiling.
965
+ */
966
+ notReadyReason?: string | null;
839
967
  onCopy: () => void;
840
968
  onClose: () => void;
841
969
  }
842
- declare function ReceiveModalTemplate({ theme, accentColor, styleOverrides, walletAddress, chains, selectedChain, onSelectChain, copied, onCopy, onClose, }: ReceiveModalTemplateProps): react_jsx_runtime.JSX.Element;
970
+ declare function ReceiveModalTemplate({ theme, accentColor, styleOverrides, walletAddress, chains, selectedChain, onSelectChain, copied, notReadyReason, onCopy, onClose, }: ReceiveModalTemplateProps): react_jsx_runtime.JSX.Element;
843
971
 
844
972
  interface SessionsModalTemplateProps {
845
973
  theme: string;
@@ -849,12 +977,13 @@ interface SessionsModalTemplateProps {
849
977
  state: SessionsState;
850
978
  revokingFamilyId: string | null;
851
979
  signingOutEverywhere: boolean;
980
+ revokeError: string | null;
852
981
  onRefresh: () => void;
853
982
  onRevoke: (familyId: string) => void;
854
983
  onLogoutEverywhere: () => void;
855
984
  onClose: () => void;
856
985
  }
857
- declare function SessionsModalTemplate({ theme, accentColor, styleOverrides, state, revokingFamilyId, signingOutEverywhere, onRefresh, onRevoke, onLogoutEverywhere, onClose, }: SessionsModalTemplateProps): react_jsx_runtime.JSX.Element;
986
+ declare function SessionsModalTemplate({ theme, accentColor, styleOverrides, state, revokingFamilyId, signingOutEverywhere, revokeError, onRefresh, onRevoke, onLogoutEverywhere, onClose, }: SessionsModalTemplateProps): react_jsx_runtime.JSX.Element;
858
987
 
859
988
  interface DistributionRulesModalTemplateProps {
860
989
  theme: string;
@@ -871,4 +1000,4 @@ interface DistributionRulesModalTemplateProps {
871
1000
  }
872
1001
  declare function DistributionRulesModalTemplate({ theme, accentColor, styleOverrides, state, claimingId, claimErrors, claimedIds, onRefresh, onClaim, onClose, }: DistributionRulesModalTemplateProps): react_jsx_runtime.JSX.Element;
873
1002
 
874
- export { type AuthModalProps, ChainSelect, type ChainSelectProps, 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, type RampStep, RampWidget, RampWidgetTemplate, ReceiveModal, ReceiveModalTemplate, type ReceiveModalTemplateProps, RouteDisplay, SendModal, SendModalTemplate, type SendModalTemplateProps, SessionsModal, SessionsModalTemplate, type SessionsModalTemplateProps, type SwapAssetOption, SwapModal, SwapModalTemplate, type SwapModalTemplateProps, TransactionModalTemplate, type TransactionModalTemplateProps, TxHistoryModalTemplate, TxStatusView, type TxStatusViewProps, type UseChainsResult, WalletBalanceModal, WalletBalanceModalTemplate, type WalletBalanceModalTemplateProps, WalletButton, WalletButtonTemplate, type WalletButtonTemplateProps, addressForChain, browserPasskeyCeremony, browserPasskeySigner, buildModalCssVars, chainsOf, createPollarAdapterHook, modalChrome, readableTextOn, resolveChain, useChains, usePollar };
1003
+ export { type AuthModalProps, ChainSelect, type ChainSelectProps, 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, RegistryCheckModal, RequirementFormModal, RouteDisplay, SendModal, SendModalTemplate, type SendModalTemplateProps, SessionsModal, SessionsModalTemplate, type SessionsModalTemplateProps, type SwapAssetOption, SwapModal, SwapModalTemplate, type SwapModalTemplateProps, TransactionModalTemplate, type TransactionModalTemplateProps, TxHistoryModalTemplate, TxStatusView, type TxStatusViewProps, type UseChainsResult, WalletBalanceModal, WalletBalanceModalTemplate, type WalletBalanceModalTemplateProps, WalletButton, WalletButtonTemplate, type WalletButtonTemplateProps, addressForChain, browserPasskeyCeremony, browserPasskeySigner, buildModalCssVars, chainsOf, createPollarAdapterHook, modalChrome, readableTextOn, resolveChain, useChains, usePollar, walletNotReadyReason };