@pollar/react 0.12.0 → 0.12.1-rc.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { pollarPaths, PollarClient, PollarClientConfig, PollarAdapters, OnStorageDegrade, WalletInfo, CosignCustody, PollarLoginOptions, SessionsState, CosignState, RecoveryState, CustodyMigrationState, PendingConfirmation, TransactionState, TxBuildBody, BuildOutcome, SubmitOutcome, SignOutcome, SendPaymentParams, StellarNetwork, WalletBalanceState, EnabledAssetsState, TrustlineOutcome, TxHistoryState, SwapVenue, SwapToken, SwapQuoteParams, SwapQuote, EarnProviderId, EarnOpportunity, EarnPositionParams, EarnPosition, EarnTxParams, PollarAdapter, PasskeyCeremony, PasskeySigner, RecoveryPasskeyCeremony, WalletChain, CosignRequest, CosignVerification, CosignQuorumReport, CosignDevicesContent, KycStatus as KycStatus$1, RampQuoteRejection, RampQuoteRequirement, RampWalletStep, RampQuote, WalletId, AuthState, KycProvider, KycStartResponse, RampDirection, RampFiat, RampAsset, RampField, RampOrder, EnabledAssetRecord, WalletBalanceRecord, SwapProvider, DistributionRulesState, DistributionRule } from '@pollar/core';
2
+ import { 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';
3
3
  export { AuthProviderContext, PollarAuthProvider, SessionsState } from '@pollar/core';
4
4
  import { ReactNode, CSSProperties } from 'react';
5
5
 
@@ -181,6 +181,14 @@ interface PollarContextValue {
181
181
  swap: (quote: SwapQuote, opts?: {
182
182
  autoTrustline?: boolean;
183
183
  }) => Promise<SubmitOutcome>;
184
+ /** The Solana venues this app exposes (`jupiter`, `titan`). Mirrors {@link PollarClient.getSolanaSwapConfig}. */
185
+ getSolanaSwapConfig: () => Promise<SolanaSwapVenue[]>;
186
+ /** Quote a swap from the user's Solana wallet, in base units. Mirrors {@link PollarClient.getSolanaSwapQuote}. */
187
+ getSolanaSwapQuote: (params: SolanaSwapQuoteParams) => Promise<SolanaSwapQuote[]>;
188
+ /** Run a Solana swap from a quote. Drives the transaction state machine. Mirrors {@link PollarClient.swapSolana}. */
189
+ swapSolana: (quote: SolanaSwapQuote, opts?: {
190
+ slippageBps?: number;
191
+ }) => Promise<SubmitOutcome>;
184
192
  /** Open the swap modal. */
185
193
  openSwapModal: () => void;
186
194
  /**
@@ -276,8 +284,9 @@ interface PollarProviderProps {
276
284
  declare function PollarProvider({ client, appConfig: appConfigProp, adapters, onStorageDegrade, children, }: PollarProviderProps): react_jsx_runtime.JSX.Element;
277
285
  declare function usePollar(): PollarContextValue;
278
286
 
287
+ /** A transaction adapter answers with the submit; an auth-entry one with what its `complete` returned. */
279
288
  type WrappedAdapter<T extends PollarAdapter> = {
280
- [K in keyof T]: (params: Parameters<T[K]>[0]) => Promise<SubmitOutcome>;
289
+ [K in keyof T]: (params: Parameters<T[K]>[0]) => Promise<Awaited<ReturnType<T[K]>> extends AuthEntryAdapterStep<infer R> ? AuthEntryAdapterOutcome<R> : SubmitOutcome>;
281
290
  };
282
291
  declare function createPollarAdapterHook<T extends PollarAdapter>(key: string): () => WrappedAdapter<T>;
283
292
 
@@ -333,7 +342,7 @@ declare const browserRecoveryPasskey: RecoveryPasskeyCeremony;
333
342
  * Returns null when the wallet is usable, so a caller reads it as "no reason to
334
343
  * block".
335
344
  */
336
- declare function walletNotReadyReason(wallet: WalletInfo | null | undefined, chain: WalletChain | null | undefined): string | null;
345
+ declare function walletNotReadyReason(wallet: WalletInfo | null | undefined, chain: WalletChain | null | undefined, language?: PollarLanguage): string | null;
337
346
 
338
347
  declare function WalletButton(): react_jsx_runtime.JSX.Element;
339
348
 
@@ -410,7 +419,7 @@ interface WalletButtonTemplateProps {
410
419
  * Why the wallet cannot act on-chain yet (its account is being created, or
411
420
  * that failed), or null when it can. Shown as a banner in the dropdown, since
412
421
  * the address itself is valid and worth copying either way. Optional, so a
413
- * custom template written before this existed keeps compiling.
422
+ * custom template that does not read it keeps compiling.
414
423
  */
415
424
  notReadyReason?: string | null;
416
425
  /**
@@ -425,7 +434,7 @@ interface WalletButtonTemplateProps {
425
434
  * Signed in with no wallet yet (an app that creates wallets on demand, or
426
435
  * none). The button then shows the account menu instead of Login, with Create
427
436
  * wallet only when `onCreateWallet` is set. Optional, so a custom template
428
- * written before this existed keeps compiling.
437
+ * that does not read it keeps compiling.
429
438
  */
430
439
  signedIn?: boolean;
431
440
  creatingWallet?: boolean;
@@ -450,8 +459,10 @@ interface WalletButtonTemplateProps {
450
459
  onDistributionRules: () => void;
451
460
  onLogout: () => void;
452
461
  onLogin: () => void;
462
+ /** Language of the button and its menu. Defaults to the user's device; the button passes the resolved one. */
463
+ language?: PollarLanguage | undefined;
453
464
  }
454
- declare function WalletButtonTemplate({ walletAddress, theme, accentColor, styleOverrides, open, copied, wrapperRef, isInProgress, showCreateAccount, notReadyReason, recoveryLocked, onRecovery, creatingAccount, onToggleOpen, onCreateAccount, onCopy, onWalletBalance, onTxHistory, onSend, onReceive, onSessions, onKyc, onRamp, onDistributionRules, onLogout, onLogin, signedIn, creatingWallet, createWalletError, custodyChoice, onCreateWallet, }: WalletButtonTemplateProps): react_jsx_runtime.JSX.Element;
465
+ declare function WalletButtonTemplate({ walletAddress, theme, accentColor, styleOverrides, open, copied, wrapperRef, isInProgress, showCreateAccount, notReadyReason, recoveryLocked, onRecovery, creatingAccount, onToggleOpen, onCreateAccount, onCopy, onWalletBalance, onTxHistory, onSend, onReceive, onSessions, onKyc, onRamp, onDistributionRules, onLogout, onLogin, signedIn, creatingWallet, createWalletError, custodyChoice, onCreateWallet, language: languageProp, }: WalletButtonTemplateProps): react_jsx_runtime.JSX.Element;
455
466
 
456
467
  /**
457
468
  * The chain a record lives on, with the legacy shape folded in: sessions and
@@ -487,8 +498,9 @@ interface ChainSelectProps {
487
498
  options: WalletChain[];
488
499
  onChange: (chain: WalletChain) => void;
489
500
  disabled?: boolean;
501
+ language?: PollarLanguage | undefined;
490
502
  }
491
- declare function ChainSelect({ label, value, options, onChange, disabled }: ChainSelectProps): react_jsx_runtime.JSX.Element | null;
503
+ declare function ChainSelect({ label, value, options, onChange, disabled, language: languageProp }: ChainSelectProps): react_jsx_runtime.JSX.Element | null;
492
504
 
493
505
  interface UseChainsResult {
494
506
  /**
@@ -557,8 +569,10 @@ interface KycModalProps {
557
569
  level?: 'basic' | 'intermediate' | 'enhanced';
558
570
  /** Called when KYC is successfully approved. */
559
571
  onApproved?: () => void;
572
+ /** Language of the modal, as a BCP 47 tag. A language pinned in the dashboard wins over it. */
573
+ language?: string | undefined;
560
574
  }
561
- declare function KycModal({ onClose, country, level, onApproved, corridorId, cardProviderId, providerId, }: KycModalProps): react_jsx_runtime.JSX.Element;
575
+ declare function KycModal({ onClose, country, level, onApproved, corridorId, cardProviderId, providerId, language: languageProp, }: KycModalProps): react_jsx_runtime.JSX.Element;
562
576
 
563
577
  interface RequirementFormModalProps {
564
578
  formId: string;
@@ -570,9 +584,11 @@ interface RequirementFormModalProps {
570
584
  onClose: () => void;
571
585
  /** Called once the answers are stored. */
572
586
  onSubmitted: () => void;
587
+ /** Language of the modal, as a BCP 47 tag. A language pinned in the dashboard wins over it. */
588
+ language?: string | undefined;
573
589
  }
574
590
  /** One FORM requirement step: the form a route asks for, prefilled with the user's previous answers. */
575
- declare function RequirementFormModal({ formId, progress, onClose, onSubmitted }: RequirementFormModalProps): react_jsx_runtime.JSX.Element;
591
+ declare function RequirementFormModal({ formId, progress, onClose, onSubmitted, language: languageProp, }: RequirementFormModalProps): react_jsx_runtime.JSX.Element;
576
592
 
577
593
  interface RegistryCheckModalProps {
578
594
  optionId: string;
@@ -584,12 +600,14 @@ interface RegistryCheckModalProps {
584
600
  onClose: () => void;
585
601
  /** Called once the registry confirmed the data. */
586
602
  onApproved: () => void;
603
+ /** Language of the modal, as a BCP 47 tag. A language pinned in the dashboard wins over it. */
604
+ language?: string | undefined;
587
605
  }
588
606
  /**
589
607
  * One REGISTRY_CHECK step (SEGIP): the user's verified data, prefilled and read-only
590
608
  * except for the surname split and the CI complement, sent to the registry on confirm.
591
609
  */
592
- declare function RegistryCheckModal({ optionId, progress, onClose, onApproved }: RegistryCheckModalProps): react_jsx_runtime.JSX.Element;
610
+ declare function RegistryCheckModal({ optionId, progress, onClose, onApproved, language: languageProp, }: RegistryCheckModalProps): react_jsx_runtime.JSX.Element;
593
611
 
594
612
  interface ProviderRegistrationModalProps {
595
613
  /** The route whose ramp the user registers with. */
@@ -604,25 +622,31 @@ interface ProviderRegistrationModalProps {
604
622
  onClose: () => void;
605
623
  /** Called once the user is registered with the provider. */
606
624
  onRegistered: () => void;
625
+ /** Language of the modal, as a BCP 47 tag. A language pinned in the dashboard wins over it. */
626
+ language?: string | undefined;
607
627
  }
608
628
  /**
609
629
  * One PROVIDER_REGISTRATION step: what the ramp provider receives, listed before the
610
630
  * user consents. Registering is the consent; nothing is sent until then.
611
631
  */
612
- declare function ProviderRegistrationModal({ corridorId, cardProviderId, progress, onClose, onRegistered, }: ProviderRegistrationModalProps): react_jsx_runtime.JSX.Element;
632
+ declare function ProviderRegistrationModal({ corridorId, cardProviderId, progress, onClose, onRegistered, language: languageProp, }: ProviderRegistrationModalProps): react_jsx_runtime.JSX.Element;
613
633
 
614
634
  interface KycStatusProps {
615
635
  status: KycStatus$1;
616
636
  /** Replaces the status label, keeping its color. */
617
637
  label?: string;
618
638
  className?: string;
639
+ /** Language of the status label. Defaults to the user's device. */
640
+ language?: PollarLanguage | undefined;
619
641
  }
620
- declare function KycStatus({ status, label, className }: KycStatusProps): react_jsx_runtime.JSX.Element;
642
+ declare function KycStatus({ status, label, className, language: languageProp }: KycStatusProps): react_jsx_runtime.JSX.Element;
621
643
 
622
644
  interface RampWidgetProps {
623
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;
624
648
  }
625
- declare function RampWidget({ onClose }: RampWidgetProps): react_jsx_runtime.JSX.Element;
649
+ declare function RampWidget({ onClose, language: languageProp }: RampWidgetProps): react_jsx_runtime.JSX.Element;
626
650
 
627
651
  interface RouteDisplayProps {
628
652
  quote: RampQuote;
@@ -633,13 +657,15 @@ interface RouteDisplayProps {
633
657
  /** Another route is starting, so this one is not selectable meanwhile. */
634
658
  disabled?: boolean;
635
659
  onSelect: (quote: RampQuote) => void;
660
+ /** Defaults to the user's device; the widget passes the resolved one. */
661
+ language?: PollarLanguage;
636
662
  }
637
- declare function RouteDisplay({ quote, best, busy, disabled, onSelect }: RouteDisplayProps): react_jsx_runtime.JSX.Element;
663
+ declare function RouteDisplay({ quote, best, busy, disabled, onSelect, language: languageProp, }: RouteDisplayProps): react_jsx_runtime.JSX.Element;
638
664
  /**
639
665
  * A route that was planned and dropped, and what the user can do about it: a
640
666
  * verification step opens from its button, a missing trustline is added from its own.
641
667
  */
642
- declare function RejectedRouteDisplay({ rejection, disabled, trusting, walletBusy, custodyChoice, onVerify, onTrust, onWalletStep, }: {
668
+ declare function RejectedRouteDisplay({ rejection, disabled, trusting, walletBusy, custodyChoice, onVerify, onTrust, onWalletStep, language: languageProp, }: {
643
669
  rejection: RampQuoteRejection;
644
670
  /** A route is starting, a trustline or a wallet is being added, so nothing else opens meanwhile. */
645
671
  disabled?: boolean;
@@ -662,6 +688,8 @@ declare function RejectedRouteDisplay({ rejection, disabled, trusting, walletBus
662
688
  * the custody to the user creates the wallet from the wallet menu instead.
663
689
  */
664
690
  onWalletStep?: ((step: RampWalletStep, custody?: CosignCustody) => void) | undefined;
691
+ /** Defaults to the user's device; the widget passes the resolved one. */
692
+ language?: PollarLanguage;
665
693
  }): react_jsx_runtime.JSX.Element;
666
694
 
667
695
  interface WalletBalanceModalProps {
@@ -777,8 +805,10 @@ interface LoginModalTemplateProps {
777
805
  onBack: () => void;
778
806
  onCancel: () => void;
779
807
  onRetry: () => void;
808
+ /** Language of the modal's text. Defaults to the user's device; the modal passes the resolved one. */
809
+ language?: PollarLanguage | undefined;
780
810
  }
781
- declare function LoginModalTemplate({ theme, accentColor, styleOverrides, logoUrl, emailEnabled, embeddedWallets, smartWallet, providers, walletAdapters, appName, email, onEmailChange, onEmailSubmit, onSocialLogin, onWalletConnect, onLoginSmartWallet, onCreateSmartWallet, authState, codeInputKey, onCodeSubmit, onBack, onCancel, onRetry, }: LoginModalTemplateProps): react_jsx_runtime.JSX.Element;
811
+ declare function LoginModalTemplate({ theme, accentColor, styleOverrides, logoUrl, emailEnabled, embeddedWallets, smartWallet, providers, walletAdapters, appName, email, onEmailChange, onEmailSubmit, onSocialLogin, onWalletConnect, onLoginSmartWallet, onCreateSmartWallet, authState, codeInputKey, onCodeSubmit, onBack, onCancel, onRetry, language: languageProp, }: LoginModalTemplateProps): react_jsx_runtime.JSX.Element;
782
812
 
783
813
  type KycStep = 'select_provider' | 'verifying' | 'polling' | 'done';
784
814
  interface KycModalTemplateProps {
@@ -808,11 +838,15 @@ interface KycModalTemplateProps {
808
838
  onStartAgain?: () => void;
809
839
  onRefresh: () => void;
810
840
  onClose: () => void;
841
+ /** Defaults to the user's device; the modal passes the resolved one. */
842
+ language?: PollarLanguage | undefined;
811
843
  }
812
- declare function KycModalTemplate({ theme, accentColor, styleOverrides, step, providers, selectedProvider, session, kycStatus, reviewReason, processing, isLoading, startingProviderId, directOpen, error, onSelectProvider, onDoneVerifying, onStartAgain, onRefresh, onClose, }: KycModalTemplateProps): react_jsx_runtime.JSX.Element;
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;
813
845
 
814
846
  type RampStep = 'input' | 'loading_quote' | 'select_route' | 'contact' | 'status' | 'error';
815
847
  interface RampWidgetTemplateProps {
848
+ /** Language of the widget's text and rail labels. Defaults to the user's device; the widget passes the resolved one. */
849
+ language?: PollarLanguage;
816
850
  theme: string;
817
851
  accentColor: string;
818
852
  /** Per-app modal chrome overrides (background, card + button radius). */
@@ -883,6 +917,8 @@ interface RampWidgetTemplateProps {
883
917
  retrying?: boolean;
884
918
  /** Runs the user's held order again; absent, a held order only says what happened. */
885
919
  onRetryOrder?: (() => void) | undefined;
920
+ /** Quotes the same amount again when the price changed before anything moved; absent, only a new operation is offered. */
921
+ onRequote?: (() => void) | undefined;
886
922
  /** Opens the wallet's recovery setup, for an order held until the wallet has a way to be recovered. */
887
923
  onSetUpRecovery?: (() => void) | undefined;
888
924
  /** Whether the wallet still has no way to be recovered; null while its state is unread. */
@@ -907,7 +943,7 @@ interface RampWidgetTemplateProps {
907
943
  onRefresh: () => void;
908
944
  onClose: () => void;
909
945
  }
910
- declare function RampWidgetTemplate({ theme, accentColor, styleOverrides, network, step, flowSteps, flowStepIndex, direction, routesLoading, countries, country, fiats, fiat, assets, asset, amount, sellAvailable, quotes, rejected, startingQuoteId, fields, fieldValues, order, pendingOrders, isLoading, refreshing, signing, errorMsg, notice, onDirectionChange, onCountryChange, onFiatChange, onAssetChange, onAmountChange, onFindRoute, onSelectQuote, onVerifyRoute, trustingAsset, onTrustAsset, walletBusy, custodyChoice, onWalletStep, noChains, retrying, onRetryOrder, onSetUpRecovery, recoveryMissing, checkingPayment, onCheckPayment, pollTrouble, onFieldChange, onContactContinue, onSign, onApprove, onResumeOrder, onNewOrder, onBack, onStepSelect, onRetry, onRefresh, onClose, }: RampWidgetTemplateProps): react_jsx_runtime.JSX.Element;
946
+ declare function RampWidgetTemplate({ theme, accentColor, styleOverrides, network, step, flowSteps, flowStepIndex, direction, routesLoading, countries, country, fiats, fiat, assets, asset, amount, sellAvailable, quotes, rejected, startingQuoteId, fields, fieldValues, order, pendingOrders, isLoading, refreshing, signing, errorMsg, notice, onDirectionChange, onCountryChange, onFiatChange, onAssetChange, onAmountChange, onFindRoute, onSelectQuote, onVerifyRoute, trustingAsset, onTrustAsset, walletBusy, custodyChoice, onWalletStep, noChains, retrying, onRetryOrder, onRequote, onSetUpRecovery, recoveryMissing, checkingPayment, onCheckPayment, pollTrouble, onFieldChange, onContactContinue, onSign, onApprove, onResumeOrder, onNewOrder, onBack, onStepSelect, onRetry, onRefresh, onClose, language: languageProp, }: RampWidgetTemplateProps): react_jsx_runtime.JSX.Element;
911
947
 
912
948
  interface TransactionModalTemplateProps {
913
949
  theme: string;
@@ -924,22 +960,30 @@ interface TransactionModalTemplateProps {
924
960
  onToggleXdr: () => void;
925
961
  onCopyHash: () => void;
926
962
  onRetry?: () => void;
963
+ /** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
964
+ language?: PollarLanguage | undefined;
927
965
  }
928
- declare function TransactionModalTemplate({ theme, accentColor, styleOverrides, transaction, showXdr, copied, explorerUrl, walletType, onClose, onSignAndSend, onToggleXdr, onCopyHash, onRetry, }: TransactionModalTemplateProps): react_jsx_runtime.JSX.Element;
966
+ declare function TransactionModalTemplate({ theme, accentColor, styleOverrides, transaction, showXdr, copied, explorerUrl, walletType, onClose, onSignAndSend, onToggleXdr, onCopyHash, onRetry, language: languageProp, }: TransactionModalTemplateProps): react_jsx_runtime.JSX.Element;
929
967
 
930
968
  interface TxStatusViewProps {
931
969
  transaction: TransactionState;
970
+ /** Whether the details (addresses, network, fee, raw transaction, hash) are unfolded. */
932
971
  showXdr: boolean;
972
+ /** Unused: the hash copies from the details. */
933
973
  copied: boolean;
934
974
  explorerUrl: string | null;
935
975
  walletType?: WalletId | null | undefined;
936
976
  onSignAndSend: () => void;
977
+ /** Folds and unfolds the details. */
937
978
  onToggleXdr: () => void;
979
+ /** Unused: the hash copies from the details. */
938
980
  onCopyHash: () => void;
939
981
  onRetry?: (() => void) | undefined;
940
982
  onDone: () => void;
983
+ /** Language of the status text. Defaults to the user's device; the modals pass the resolved one. */
984
+ language?: PollarLanguage | undefined;
941
985
  }
942
- declare function TxStatusView({ transaction, showXdr, copied, explorerUrl, walletType, onSignAndSend, onToggleXdr, onCopyHash, onRetry, onDone, }: TxStatusViewProps): react_jsx_runtime.JSX.Element;
986
+ declare function TxStatusView({ transaction, showXdr, explorerUrl, walletType, onSignAndSend, onToggleXdr, onRetry, onDone, language: languageProp, }: TxStatusViewProps): react_jsx_runtime.JSX.Element;
943
987
 
944
988
  interface TxHistoryModalTemplateProps {
945
989
  theme: string;
@@ -958,8 +1002,10 @@ interface TxHistoryModalTemplateProps {
958
1002
  onPrev: () => void;
959
1003
  onNext: () => void;
960
1004
  onClose: () => void;
1005
+ /** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
1006
+ language?: PollarLanguage | undefined;
961
1007
  }
962
- declare function TxHistoryModalTemplate({ theme, accentColor, styleOverrides, txHistory, offset, chains, selectedChain, walletAddress, onSelectChain, onRefresh, onPrev, onNext, onClose, }: TxHistoryModalTemplateProps): react_jsx_runtime.JSX.Element;
1008
+ declare function TxHistoryModalTemplate({ theme, accentColor, styleOverrides, txHistory, offset, chains, selectedChain, walletAddress, onSelectChain, onRefresh, onPrev, onNext, onClose, language: languageProp, }: TxHistoryModalTemplateProps): react_jsx_runtime.JSX.Element;
963
1009
 
964
1010
  interface WalletBalanceModalTemplateProps {
965
1011
  theme: string;
@@ -982,8 +1028,10 @@ interface WalletBalanceModalTemplateProps {
982
1028
  onSelectChain?: (chain: WalletChain) => void;
983
1029
  onRefresh: () => void;
984
1030
  onClose: () => void;
1031
+ /** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
1032
+ language?: PollarLanguage | undefined;
985
1033
  }
986
- declare function WalletBalanceModalTemplate({ theme, accentColor, styleOverrides, walletBalance, walletAddress, assetMetadata, chains, selectedChain, network, onSelectChain, onRefresh, onClose, }: WalletBalanceModalTemplateProps): react_jsx_runtime.JSX.Element;
1034
+ declare function WalletBalanceModalTemplate({ theme, accentColor, styleOverrides, walletBalance, walletAddress, assetMetadata, chains, selectedChain, network, onSelectChain, onRefresh, onClose, language: languageProp, }: WalletBalanceModalTemplateProps): react_jsx_runtime.JSX.Element;
987
1035
 
988
1036
  interface EnabledAssetsModalTemplateProps {
989
1037
  theme: string;
@@ -1004,8 +1052,10 @@ interface EnabledAssetsModalTemplateProps {
1004
1052
  onClose: () => void;
1005
1053
  onToggleTrustline: (record: EnabledAssetRecord) => void;
1006
1054
  onAddCustom: () => void;
1055
+ /** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
1056
+ language?: PollarLanguage | undefined;
1007
1057
  }
1008
- declare function EnabledAssetsModalTemplate({ theme, accentColor, styleOverrides, enabledAssets, walletAddress, chains, selectedChain, onSelectChain, busyKey, actionError, onRefresh, onClose, onToggleTrustline, onAddCustom, }: EnabledAssetsModalTemplateProps): react_jsx_runtime.JSX.Element;
1058
+ declare function EnabledAssetsModalTemplate({ theme, accentColor, styleOverrides, enabledAssets, walletAddress, chains, selectedChain, onSelectChain, busyKey, actionError, onRefresh, onClose, onToggleTrustline, onAddCustom, language: languageProp, }: EnabledAssetsModalTemplateProps): react_jsx_runtime.JSX.Element;
1009
1059
  interface CustomTrustlineModalTemplateProps {
1010
1060
  theme: string;
1011
1061
  accentColor: string;
@@ -1020,10 +1070,12 @@ interface CustomTrustlineModalTemplateProps {
1020
1070
  issuer: string;
1021
1071
  limit?: string;
1022
1072
  }) => void;
1073
+ /** Language of the form. Defaults to the user's device; the modal passes the resolved one. */
1074
+ language?: PollarLanguage | undefined;
1023
1075
  }
1024
1076
 
1025
1077
  /** The memo types the backend accepts on a Stellar payment. */
1026
- type SendMemoType = 'text' | 'id';
1078
+ type SendMemoType = 'text' | 'id' | 'hash';
1027
1079
  interface SendModalTemplateProps {
1028
1080
  theme: string;
1029
1081
  accentColor: string;
@@ -1044,7 +1096,7 @@ interface SendModalTemplateProps {
1044
1096
  * picker renders only with two or more, so a single-chain app shows none.
1045
1097
  */
1046
1098
  chains?: WalletChain[];
1047
- /** @deprecated Kept for compatibility; the sender address is no longer shown. */
1099
+ /** @deprecated The sender address is not shown; kept so existing templates compile. */
1048
1100
  walletAddress?: string;
1049
1101
  /** Can a payment be built on {@link selectedChain}? Stellar and Solana only. */
1050
1102
  canSendOnChain: boolean;
@@ -1055,8 +1107,8 @@ interface SendModalTemplateProps {
1055
1107
  * Separate from {@link canSendOnChain}: that one is about the NETWORK not
1056
1108
  * having a transfer path, this one about the user's own account. Collapsing
1057
1109
  * them would tell someone waiting on a brand-new wallet that Stellar does not
1058
- * support sending. Optional, so a custom template written before this existed
1059
- * keeps compiling.
1110
+ * support sending. Optional, so a custom template that does not read it keeps
1111
+ * compiling.
1060
1112
  */
1061
1113
  notReadyReason?: string | null;
1062
1114
  onSelectChain?: (chain: WalletChain) => void;
@@ -1087,8 +1139,8 @@ interface SendModalTemplateProps {
1087
1139
  onDestinationChange: (value: string) => void;
1088
1140
  /**
1089
1141
  * Optional Stellar memo. The field renders only on Stellar and only when
1090
- * {@link onMemoChange} is passed, so a custom template written before it
1091
- * existed keeps compiling.
1142
+ * {@link onMemoChange} is passed, so a custom template without a memo field
1143
+ * keeps compiling.
1092
1144
  */
1093
1145
  memo?: string;
1094
1146
  memoType?: SendMemoType;
@@ -1100,16 +1152,32 @@ interface SendModalTemplateProps {
1100
1152
  onCopyHash: () => void;
1101
1153
  onRetry: () => void;
1102
1154
  onDone: () => void;
1155
+ /** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
1156
+ language?: PollarLanguage | undefined;
1103
1157
  }
1104
- declare function SendModalTemplate({ theme, accentColor, styleOverrides, step, txTitle, assets, selectedAsset, selectedChain, canSendOnChain, notReadyReason, chains, onSelectChain, amount, destination, formError, isLoadingBalance, isCheckingDestination, minStartingBalance, onCreateAccount, transaction, showXdr, copied, explorerUrl, walletType, showBack, isInProgress, onClose, onBack, onRefresh, onSelectAsset, onAmountChange, onMax, onPaste, onDestinationChange, memo, memoType, onMemoChange, onMemoTypeChange, onSubmit, onSignAndSend, onToggleXdr, onCopyHash, onRetry, onDone, }: SendModalTemplateProps): react_jsx_runtime.JSX.Element;
1158
+ 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;
1105
1159
 
1160
+ /** The chain a swap runs on; the modal shows a selector when the app offers both. */
1161
+ type SwapChain = 'STELLAR' | 'SOLANA';
1106
1162
  interface SwapAssetOption {
1107
- ref: SwapQuoteParams['sellAsset'];
1163
+ /** Stellar: the asset ref the quote takes. */
1164
+ ref?: SwapQuoteParams['sellAsset'] | undefined;
1108
1165
  code: string;
1166
+ /** Stellar: the issuer. Solana: the mint (wrapped SOL for SOL). */
1109
1167
  issuer?: string | undefined;
1168
+ /** Solana: the mint's decimals, to turn a decimal amount into base units. */
1169
+ decimals?: number | undefined;
1110
1170
  available?: string | undefined;
1111
1171
  enabledInApp?: boolean | undefined;
1112
1172
  }
1173
+ /** A quote as the form shows it, whichever chain priced it: decimal amounts. */
1174
+ interface SwapQuoteView {
1175
+ provider: string;
1176
+ amountOut: string;
1177
+ minReceived: string;
1178
+ /** Percent; null when the venue does not report it. */
1179
+ priceImpactPct: string | null;
1180
+ }
1113
1181
  interface SwapModalTemplateProps {
1114
1182
  theme: string;
1115
1183
  accentColor: string;
@@ -1121,9 +1189,12 @@ interface SwapModalTemplateProps {
1121
1189
  selectedSell: SwapAssetOption | null;
1122
1190
  selectedBuy: SwapAssetOption | null;
1123
1191
  amount: string;
1124
- provider: SwapProvider;
1125
- providers: SwapProvider[];
1126
- quote: SwapQuote | null;
1192
+ /** The chains the app offers swaps on; a selector shows when there are two. */
1193
+ chains: SwapChain[];
1194
+ chain: SwapChain;
1195
+ provider: string;
1196
+ providers: string[];
1197
+ quote: SwapQuoteView | null;
1127
1198
  quoteLoading: boolean;
1128
1199
  quoteError: string;
1129
1200
  formError: string;
@@ -1139,6 +1210,8 @@ interface SwapModalTemplateProps {
1139
1210
  walletType?: WalletId | null | undefined;
1140
1211
  showBack: boolean;
1141
1212
  isInProgress: boolean;
1213
+ /** Language of the modal's text; the device's when not given. */
1214
+ language?: PollarLanguage | undefined;
1142
1215
  onClose: () => void;
1143
1216
  onBack: () => void;
1144
1217
  onRefresh: () => void;
@@ -1148,14 +1221,15 @@ interface SwapModalTemplateProps {
1148
1221
  onMax: () => void;
1149
1222
  onAddCustomToken: (code: string, issuer: string) => string | null;
1150
1223
  onAmountChange: (value: string) => void;
1151
- onProviderChange: (p: SwapProvider) => void;
1224
+ onChainChange: (chain: SwapChain) => void;
1225
+ onProviderChange: (p: string) => void;
1152
1226
  onSwap: () => void;
1153
1227
  onToggleXdr: () => void;
1154
1228
  onCopyHash: () => void;
1155
1229
  onRetry: () => void;
1156
1230
  onDone: () => void;
1157
1231
  }
1158
- declare function SwapModalTemplate({ theme, accentColor, styleOverrides, step, txTitle, sellOptions, buyOptions, selectedSell, selectedBuy, amount, provider, providers, quote, quoteLoading, quoteError, formError, isLoadingData, smartUnsupported, configLoading, swapUnavailable, buyNeedsTrustline, transaction, showXdr, copied, explorerUrl, walletType, showBack, isInProgress, onClose, onBack, onRefresh, onSelectSell, onSelectBuy, onAddCustomToken, onReverse, onMax, onAmountChange, onProviderChange, onSwap, onToggleXdr, onCopyHash, onRetry, onDone, }: SwapModalTemplateProps): react_jsx_runtime.JSX.Element;
1232
+ 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;
1159
1233
 
1160
1234
  interface ReceiveModalTemplateProps {
1161
1235
  theme: string;
@@ -1178,7 +1252,7 @@ interface ReceiveModalTemplateProps {
1178
1252
  *
1179
1253
  * The address itself is valid either way - what is missing is the account
1180
1254
  * behind it, so a payment sent now is rejected by the network. Optional, so a
1181
- * custom template written before this existed keeps compiling.
1255
+ * custom template that does not read it keeps compiling.
1182
1256
  */
1183
1257
  notReadyReason?: string | null;
1184
1258
  /**
@@ -1190,8 +1264,10 @@ interface ReceiveModalTemplateProps {
1190
1264
  onSetupRecovery?: () => void;
1191
1265
  onCopy: () => void;
1192
1266
  onClose: () => void;
1267
+ /** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
1268
+ language?: PollarLanguage | undefined;
1193
1269
  }
1194
- declare function ReceiveModalTemplate({ theme, accentColor, styleOverrides, walletAddress, chains, selectedChain, onSelectChain, copied, notReadyReason, recoveryLocked, onSetupRecovery, onCopy, onClose, }: ReceiveModalTemplateProps): react_jsx_runtime.JSX.Element;
1270
+ declare function ReceiveModalTemplate({ theme, accentColor, styleOverrides, walletAddress, chains, selectedChain, onSelectChain, copied, notReadyReason, recoveryLocked, onSetupRecovery, onCopy, onClose, language: languageProp, }: ReceiveModalTemplateProps): react_jsx_runtime.JSX.Element;
1195
1271
 
1196
1272
  interface SessionsModalTemplateProps {
1197
1273
  theme: string;
@@ -1206,8 +1282,10 @@ interface SessionsModalTemplateProps {
1206
1282
  onRevoke: (familyId: string) => void;
1207
1283
  onLogoutEverywhere: () => void;
1208
1284
  onClose: () => void;
1285
+ /** Language of the modal's text. Defaults to the user's device; the modal passes the resolved one. */
1286
+ language?: PollarLanguage | undefined;
1209
1287
  }
1210
- declare function SessionsModalTemplate({ theme, accentColor, styleOverrides, state, revokingFamilyId, signingOutEverywhere, revokeError, onRefresh, onRevoke, onLogoutEverywhere, onClose, }: SessionsModalTemplateProps): react_jsx_runtime.JSX.Element;
1288
+ declare function SessionsModalTemplate({ theme, accentColor, styleOverrides, state, revokingFamilyId, signingOutEverywhere, revokeError, onRefresh, onRevoke, onLogoutEverywhere, onClose, language: languageProp, }: SessionsModalTemplateProps): react_jsx_runtime.JSX.Element;
1211
1289
 
1212
1290
  interface CosignModalTemplateProps {
1213
1291
  theme: string;
@@ -1232,12 +1310,16 @@ interface CosignModalTemplateProps {
1232
1310
  closesIn?: number | null;
1233
1311
  /** The approval coming next in the same flow, shown while the modal waits for it. */
1234
1312
  nextStep?: string | null;
1313
+ /** Language of the modal's text; the device's when not given. */
1314
+ language?: PollarLanguage | undefined;
1315
+ /** The app's network, shown next to the chain in the details. */
1316
+ network?: StellarNetwork | undefined;
1235
1317
  onSelect: (request: CosignRequest) => void;
1236
1318
  onApprove: (request: CosignRequest) => void;
1237
1319
  onReject: (request: CosignRequest) => void;
1238
1320
  onClose: () => void;
1239
1321
  }
1240
- declare function CosignModalTemplate({ theme, accentColor, styleOverrides, pending, current, verification, busy, error, approveBlocked, lastResolved, explorerUrl, closesIn, nextStep, onSelect, onApprove, onReject, onClose, }: CosignModalTemplateProps): react_jsx_runtime.JSX.Element;
1322
+ declare function CosignModalTemplate({ theme, accentColor, styleOverrides, pending, current, verification, busy, error, approveBlocked, lastResolved, explorerUrl, closesIn, nextStep, language: languageProp, network, onSelect, onApprove, onReject, onClose, }: CosignModalTemplateProps): react_jsx_runtime.JSX.Element;
1241
1323
 
1242
1324
  interface CustodyMigrationModalProps {
1243
1325
  state: CustodyMigrationState;
@@ -1261,6 +1343,8 @@ interface CustodyMigrationModalTemplateProps {
1261
1343
  /** Only offered while a wallet is blocked: the move waits for what is pending. */
1262
1344
  onLater: () => void;
1263
1345
  onLogout: () => void;
1346
+ /** Language of the modal's text. Defaults to the user's device; the modal passes the resolved one. */
1347
+ language?: PollarLanguage | undefined;
1264
1348
  }
1265
1349
  /**
1266
1350
  * The move of the wallets Pollar custodies to ones the user's device signs for.
@@ -1308,6 +1392,8 @@ interface RecoveryModalTemplateProps {
1308
1392
  onRecoverWithCode: (code: string) => void;
1309
1393
  onExport: () => void;
1310
1394
  onClose: () => void;
1395
+ /** Language of the modal's text. Defaults to the user's device; the modal passes the resolved one. */
1396
+ language?: PollarLanguage | undefined;
1311
1397
  }
1312
1398
  declare function RecoveryModalTemplate(p: RecoveryModalTemplateProps): react_jsx_runtime.JSX.Element;
1313
1399
 
@@ -1320,10 +1406,12 @@ interface DistributionRulesModalTemplateProps {
1320
1406
  claimingId: string | null;
1321
1407
  claimErrors: Record<string, string>;
1322
1408
  claimedIds: Set<string>;
1409
+ /** Language of the modal's text; the device's when not given. */
1410
+ language?: PollarLanguage | undefined;
1323
1411
  onRefresh: () => void;
1324
1412
  onClaim: (rule: DistributionRule) => void;
1325
1413
  onClose: () => void;
1326
1414
  }
1327
- declare function DistributionRulesModalTemplate({ theme, accentColor, styleOverrides, state, claimingId, claimErrors, claimedIds, onRefresh, onClaim, onClose, }: DistributionRulesModalTemplateProps): react_jsx_runtime.JSX.Element;
1415
+ declare function DistributionRulesModalTemplate({ theme, accentColor, styleOverrides, state, claimingId, claimErrors, claimedIds, language: languageProp, onRefresh, onClaim, onClose, }: DistributionRulesModalTemplateProps): react_jsx_runtime.JSX.Element;
1328
1416
 
1329
1417
  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 };