@pollar/react 0.12.0 → 0.12.1-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -2
- package/dist/index.css +13 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +113 -33
- package/dist/index.d.ts +113 -33
- package/dist/index.js +4453 -1315
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4455 -1317
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
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, 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,
|
|
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
|
|
|
@@ -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). */
|
|
@@ -907,7 +941,7 @@ interface RampWidgetTemplateProps {
|
|
|
907
941
|
onRefresh: () => void;
|
|
908
942
|
onClose: () => void;
|
|
909
943
|
}
|
|
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;
|
|
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;
|
|
911
945
|
|
|
912
946
|
interface TransactionModalTemplateProps {
|
|
913
947
|
theme: string;
|
|
@@ -924,8 +958,10 @@ interface TransactionModalTemplateProps {
|
|
|
924
958
|
onToggleXdr: () => void;
|
|
925
959
|
onCopyHash: () => void;
|
|
926
960
|
onRetry?: () => void;
|
|
961
|
+
/** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
|
|
962
|
+
language?: PollarLanguage | undefined;
|
|
927
963
|
}
|
|
928
|
-
declare function TransactionModalTemplate({ theme, accentColor, styleOverrides, transaction, showXdr, copied, explorerUrl, walletType, onClose, onSignAndSend, onToggleXdr, onCopyHash, onRetry, }: TransactionModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
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;
|
|
929
965
|
|
|
930
966
|
interface TxStatusViewProps {
|
|
931
967
|
transaction: TransactionState;
|
|
@@ -938,8 +974,10 @@ interface TxStatusViewProps {
|
|
|
938
974
|
onCopyHash: () => void;
|
|
939
975
|
onRetry?: (() => void) | undefined;
|
|
940
976
|
onDone: () => void;
|
|
977
|
+
/** Language of the status text. Defaults to the user's device; the modals pass the resolved one. */
|
|
978
|
+
language?: PollarLanguage | undefined;
|
|
941
979
|
}
|
|
942
|
-
declare function TxStatusView({ transaction, showXdr, copied, explorerUrl, walletType, onSignAndSend, onToggleXdr, onCopyHash, onRetry, onDone, }: TxStatusViewProps): react_jsx_runtime.JSX.Element;
|
|
980
|
+
declare function TxStatusView({ transaction, showXdr, copied, explorerUrl, walletType, onSignAndSend, onToggleXdr, onCopyHash, onRetry, onDone, language: languageProp, }: TxStatusViewProps): react_jsx_runtime.JSX.Element;
|
|
943
981
|
|
|
944
982
|
interface TxHistoryModalTemplateProps {
|
|
945
983
|
theme: string;
|
|
@@ -958,8 +996,10 @@ interface TxHistoryModalTemplateProps {
|
|
|
958
996
|
onPrev: () => void;
|
|
959
997
|
onNext: () => void;
|
|
960
998
|
onClose: () => void;
|
|
999
|
+
/** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
|
|
1000
|
+
language?: PollarLanguage | undefined;
|
|
961
1001
|
}
|
|
962
|
-
declare function TxHistoryModalTemplate({ theme, accentColor, styleOverrides, txHistory, offset, chains, selectedChain, walletAddress, onSelectChain, onRefresh, onPrev, onNext, onClose, }: TxHistoryModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1002
|
+
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
1003
|
|
|
964
1004
|
interface WalletBalanceModalTemplateProps {
|
|
965
1005
|
theme: string;
|
|
@@ -982,8 +1022,10 @@ interface WalletBalanceModalTemplateProps {
|
|
|
982
1022
|
onSelectChain?: (chain: WalletChain) => void;
|
|
983
1023
|
onRefresh: () => void;
|
|
984
1024
|
onClose: () => void;
|
|
1025
|
+
/** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
|
|
1026
|
+
language?: PollarLanguage | undefined;
|
|
985
1027
|
}
|
|
986
|
-
declare function WalletBalanceModalTemplate({ theme, accentColor, styleOverrides, walletBalance, walletAddress, assetMetadata, chains, selectedChain, network, onSelectChain, onRefresh, onClose, }: WalletBalanceModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1028
|
+
declare function WalletBalanceModalTemplate({ theme, accentColor, styleOverrides, walletBalance, walletAddress, assetMetadata, chains, selectedChain, network, onSelectChain, onRefresh, onClose, language: languageProp, }: WalletBalanceModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
987
1029
|
|
|
988
1030
|
interface EnabledAssetsModalTemplateProps {
|
|
989
1031
|
theme: string;
|
|
@@ -1004,8 +1046,10 @@ interface EnabledAssetsModalTemplateProps {
|
|
|
1004
1046
|
onClose: () => void;
|
|
1005
1047
|
onToggleTrustline: (record: EnabledAssetRecord) => void;
|
|
1006
1048
|
onAddCustom: () => void;
|
|
1049
|
+
/** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
|
|
1050
|
+
language?: PollarLanguage | undefined;
|
|
1007
1051
|
}
|
|
1008
|
-
declare function EnabledAssetsModalTemplate({ theme, accentColor, styleOverrides, enabledAssets, walletAddress, chains, selectedChain, onSelectChain, busyKey, actionError, onRefresh, onClose, onToggleTrustline, onAddCustom, }: EnabledAssetsModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
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;
|
|
1009
1053
|
interface CustomTrustlineModalTemplateProps {
|
|
1010
1054
|
theme: string;
|
|
1011
1055
|
accentColor: string;
|
|
@@ -1020,10 +1064,12 @@ interface CustomTrustlineModalTemplateProps {
|
|
|
1020
1064
|
issuer: string;
|
|
1021
1065
|
limit?: string;
|
|
1022
1066
|
}) => void;
|
|
1067
|
+
/** Language of the form. Defaults to the user's device; the modal passes the resolved one. */
|
|
1068
|
+
language?: PollarLanguage | undefined;
|
|
1023
1069
|
}
|
|
1024
1070
|
|
|
1025
1071
|
/** The memo types the backend accepts on a Stellar payment. */
|
|
1026
|
-
type SendMemoType = 'text' | 'id';
|
|
1072
|
+
type SendMemoType = 'text' | 'id' | 'hash';
|
|
1027
1073
|
interface SendModalTemplateProps {
|
|
1028
1074
|
theme: string;
|
|
1029
1075
|
accentColor: string;
|
|
@@ -1100,16 +1146,32 @@ interface SendModalTemplateProps {
|
|
|
1100
1146
|
onCopyHash: () => void;
|
|
1101
1147
|
onRetry: () => void;
|
|
1102
1148
|
onDone: () => void;
|
|
1149
|
+
/** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
|
|
1150
|
+
language?: PollarLanguage | undefined;
|
|
1103
1151
|
}
|
|
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;
|
|
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;
|
|
1105
1153
|
|
|
1154
|
+
/** The chain a swap runs on; the modal shows a selector when the app offers both. */
|
|
1155
|
+
type SwapChain = 'STELLAR' | 'SOLANA';
|
|
1106
1156
|
interface SwapAssetOption {
|
|
1107
|
-
|
|
1157
|
+
/** Stellar: the asset ref the quote takes. */
|
|
1158
|
+
ref?: SwapQuoteParams['sellAsset'] | undefined;
|
|
1108
1159
|
code: string;
|
|
1160
|
+
/** Stellar: the issuer. Solana: the mint (wrapped SOL for SOL). */
|
|
1109
1161
|
issuer?: string | undefined;
|
|
1162
|
+
/** Solana: the mint's decimals, to turn a decimal amount into base units. */
|
|
1163
|
+
decimals?: number | undefined;
|
|
1110
1164
|
available?: string | undefined;
|
|
1111
1165
|
enabledInApp?: boolean | undefined;
|
|
1112
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
|
+
}
|
|
1113
1175
|
interface SwapModalTemplateProps {
|
|
1114
1176
|
theme: string;
|
|
1115
1177
|
accentColor: string;
|
|
@@ -1121,9 +1183,12 @@ interface SwapModalTemplateProps {
|
|
|
1121
1183
|
selectedSell: SwapAssetOption | null;
|
|
1122
1184
|
selectedBuy: SwapAssetOption | null;
|
|
1123
1185
|
amount: string;
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
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;
|
|
1127
1192
|
quoteLoading: boolean;
|
|
1128
1193
|
quoteError: string;
|
|
1129
1194
|
formError: string;
|
|
@@ -1139,6 +1204,8 @@ interface SwapModalTemplateProps {
|
|
|
1139
1204
|
walletType?: WalletId | null | undefined;
|
|
1140
1205
|
showBack: boolean;
|
|
1141
1206
|
isInProgress: boolean;
|
|
1207
|
+
/** Language of the modal's text; the device's when not given. */
|
|
1208
|
+
language?: PollarLanguage | undefined;
|
|
1142
1209
|
onClose: () => void;
|
|
1143
1210
|
onBack: () => void;
|
|
1144
1211
|
onRefresh: () => void;
|
|
@@ -1148,14 +1215,15 @@ interface SwapModalTemplateProps {
|
|
|
1148
1215
|
onMax: () => void;
|
|
1149
1216
|
onAddCustomToken: (code: string, issuer: string) => string | null;
|
|
1150
1217
|
onAmountChange: (value: string) => void;
|
|
1151
|
-
|
|
1218
|
+
onChainChange: (chain: SwapChain) => void;
|
|
1219
|
+
onProviderChange: (p: string) => void;
|
|
1152
1220
|
onSwap: () => void;
|
|
1153
1221
|
onToggleXdr: () => void;
|
|
1154
1222
|
onCopyHash: () => void;
|
|
1155
1223
|
onRetry: () => void;
|
|
1156
1224
|
onDone: () => void;
|
|
1157
1225
|
}
|
|
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;
|
|
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;
|
|
1159
1227
|
|
|
1160
1228
|
interface ReceiveModalTemplateProps {
|
|
1161
1229
|
theme: string;
|
|
@@ -1190,8 +1258,10 @@ interface ReceiveModalTemplateProps {
|
|
|
1190
1258
|
onSetupRecovery?: () => void;
|
|
1191
1259
|
onCopy: () => void;
|
|
1192
1260
|
onClose: () => void;
|
|
1261
|
+
/** Language of the modal. Defaults to the user's device; the modal passes the resolved one. */
|
|
1262
|
+
language?: PollarLanguage | undefined;
|
|
1193
1263
|
}
|
|
1194
|
-
declare function ReceiveModalTemplate({ theme, accentColor, styleOverrides, walletAddress, chains, selectedChain, onSelectChain, copied, notReadyReason, recoveryLocked, onSetupRecovery, onCopy, onClose, }: ReceiveModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1264
|
+
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
1265
|
|
|
1196
1266
|
interface SessionsModalTemplateProps {
|
|
1197
1267
|
theme: string;
|
|
@@ -1206,8 +1276,10 @@ interface SessionsModalTemplateProps {
|
|
|
1206
1276
|
onRevoke: (familyId: string) => void;
|
|
1207
1277
|
onLogoutEverywhere: () => void;
|
|
1208
1278
|
onClose: () => void;
|
|
1279
|
+
/** Language of the modal's text. Defaults to the user's device; the modal passes the resolved one. */
|
|
1280
|
+
language?: PollarLanguage | undefined;
|
|
1209
1281
|
}
|
|
1210
|
-
declare function SessionsModalTemplate({ theme, accentColor, styleOverrides, state, revokingFamilyId, signingOutEverywhere, revokeError, onRefresh, onRevoke, onLogoutEverywhere, onClose, }: SessionsModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1282
|
+
declare function SessionsModalTemplate({ theme, accentColor, styleOverrides, state, revokingFamilyId, signingOutEverywhere, revokeError, onRefresh, onRevoke, onLogoutEverywhere, onClose, language: languageProp, }: SessionsModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1211
1283
|
|
|
1212
1284
|
interface CosignModalTemplateProps {
|
|
1213
1285
|
theme: string;
|
|
@@ -1232,12 +1304,14 @@ interface CosignModalTemplateProps {
|
|
|
1232
1304
|
closesIn?: number | null;
|
|
1233
1305
|
/** The approval coming next in the same flow, shown while the modal waits for it. */
|
|
1234
1306
|
nextStep?: string | null;
|
|
1307
|
+
/** Language of the modal's text; the device's when not given. */
|
|
1308
|
+
language?: PollarLanguage | undefined;
|
|
1235
1309
|
onSelect: (request: CosignRequest) => void;
|
|
1236
1310
|
onApprove: (request: CosignRequest) => void;
|
|
1237
1311
|
onReject: (request: CosignRequest) => void;
|
|
1238
1312
|
onClose: () => void;
|
|
1239
1313
|
}
|
|
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;
|
|
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;
|
|
1241
1315
|
|
|
1242
1316
|
interface CustodyMigrationModalProps {
|
|
1243
1317
|
state: CustodyMigrationState;
|
|
@@ -1261,6 +1335,8 @@ interface CustodyMigrationModalTemplateProps {
|
|
|
1261
1335
|
/** Only offered while a wallet is blocked: the move waits for what is pending. */
|
|
1262
1336
|
onLater: () => void;
|
|
1263
1337
|
onLogout: () => void;
|
|
1338
|
+
/** Language of the modal's text. Defaults to the user's device; the modal passes the resolved one. */
|
|
1339
|
+
language?: PollarLanguage | undefined;
|
|
1264
1340
|
}
|
|
1265
1341
|
/**
|
|
1266
1342
|
* The move of the wallets Pollar custodies to ones the user's device signs for.
|
|
@@ -1308,6 +1384,8 @@ interface RecoveryModalTemplateProps {
|
|
|
1308
1384
|
onRecoverWithCode: (code: string) => void;
|
|
1309
1385
|
onExport: () => void;
|
|
1310
1386
|
onClose: () => void;
|
|
1387
|
+
/** Language of the modal's text. Defaults to the user's device; the modal passes the resolved one. */
|
|
1388
|
+
language?: PollarLanguage | undefined;
|
|
1311
1389
|
}
|
|
1312
1390
|
declare function RecoveryModalTemplate(p: RecoveryModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1313
1391
|
|
|
@@ -1320,10 +1398,12 @@ interface DistributionRulesModalTemplateProps {
|
|
|
1320
1398
|
claimingId: string | null;
|
|
1321
1399
|
claimErrors: Record<string, string>;
|
|
1322
1400
|
claimedIds: Set<string>;
|
|
1401
|
+
/** Language of the modal's text; the device's when not given. */
|
|
1402
|
+
language?: PollarLanguage | undefined;
|
|
1323
1403
|
onRefresh: () => void;
|
|
1324
1404
|
onClaim: (rule: DistributionRule) => void;
|
|
1325
1405
|
onClose: () => void;
|
|
1326
1406
|
}
|
|
1327
|
-
declare function DistributionRulesModalTemplate({ theme, accentColor, styleOverrides, state, claimingId, claimErrors, claimedIds, onRefresh, onClaim, onClose, }: DistributionRulesModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1407
|
+
declare function DistributionRulesModalTemplate({ theme, accentColor, styleOverrides, state, claimingId, claimErrors, claimedIds, language: languageProp, onRefresh, onClaim, onClose, }: DistributionRulesModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1328
1408
|
|
|
1329
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 };
|