@pollar/react 0.12.0-rc.2 → 0.12.0-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/README.md +13 -3
- package/dist/index.css +363 -172
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +201 -162
- package/dist/index.d.ts +201 -162
- package/dist/index.js +1450 -1548
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1451 -1549
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
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, RampQuote, WalletId, AuthState, KycProvider, KycStartResponse, RampDirection,
|
|
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';
|
|
3
3
|
export { AuthProviderContext, PollarAuthProvider, SessionsState } from '@pollar/core';
|
|
4
4
|
import { ReactNode, CSSProperties } from 'react';
|
|
5
5
|
|
|
@@ -65,6 +65,12 @@ interface PollarContextValue {
|
|
|
65
65
|
cosign: CosignState;
|
|
66
66
|
/** Open the approval prompt of a co-signed wallet. Opens by itself when a request arrives. */
|
|
67
67
|
openCosignModal: () => void;
|
|
68
|
+
/**
|
|
69
|
+
* The approval a flow will ask for next (a ramp's swap after its approve),
|
|
70
|
+
* or null. While one is coming, the approval prompt stays open after a sent
|
|
71
|
+
* transaction and shows the next request when it arrives, instead of closing.
|
|
72
|
+
*/
|
|
73
|
+
setCosignNextStep: (next: string | null) => void;
|
|
68
74
|
/**
|
|
69
75
|
* The recovery state of the user's Turnkey wallet: null until read, or for a
|
|
70
76
|
* session without one. `recoveryLocked` is true while the wallet has no way
|
|
@@ -331,14 +337,71 @@ declare function walletNotReadyReason(wallet: WalletInfo | null | undefined, cha
|
|
|
331
337
|
|
|
332
338
|
declare function WalletButton(): react_jsx_runtime.JSX.Element;
|
|
333
339
|
|
|
340
|
+
/** Per-app overrides for the modal chrome, configured in the dashboard's
|
|
341
|
+
* Branding screen. Every field is optional: absent means "use the value the
|
|
342
|
+
* theme derives", which is what every modal rendered before these existed. */
|
|
343
|
+
interface ModalStyleOverrides {
|
|
344
|
+
/** Card background. Overrides the theme's white / #1a1a1a. */
|
|
345
|
+
backgroundColor?: string | null | undefined;
|
|
346
|
+
/** Body text. Overrides the theme's #111827 / white. With a background or a
|
|
347
|
+
* text color set, borders, secondary ("muted") text and input fills are
|
|
348
|
+
* blended from the pair instead of taken from the theme. */
|
|
349
|
+
textColor?: string | null | undefined;
|
|
350
|
+
/** Fill of the SECONDARY buttons (the wallet / social / provider entries, the
|
|
351
|
+
* retry button). The primary button is the accent's job. Unset => the theme's
|
|
352
|
+
* own surface color, which is what these buttons always used. */
|
|
353
|
+
buttonColor?: string | null | undefined;
|
|
354
|
+
/** Radius of the modal card itself, in px. */
|
|
355
|
+
modalBorderRadius?: number | null | undefined;
|
|
356
|
+
/** Radius of the buttons inside the modal, in px. Independent of the card's. */
|
|
357
|
+
buttonBorderRadius?: number | null | undefined;
|
|
358
|
+
}
|
|
359
|
+
/** Text color that stays legible on `background`. The primary button's label was
|
|
360
|
+
* hardcoded white, which a light fill (the Amber accent preset, say) turns
|
|
361
|
+
* invisible - so it follows the fill's luminance instead. Unparseable colors
|
|
362
|
+
* keep white, the pre-existing behavior. */
|
|
363
|
+
declare function readableTextOn(background: string): string;
|
|
364
|
+
/** How much room a modal gives its header. 'hero' is the identity-forward set
|
|
365
|
+
* (login, KYC, ramp, the Privy sub-modal): roomier padding and a larger
|
|
366
|
+
* centered heading. 'compact' is every utility modal (send, balance, history,
|
|
367
|
+
* ...), which keeps the card's own 1.75rem padding. */
|
|
368
|
+
type ModalVariant = 'hero' | 'compact';
|
|
369
|
+
/** The app's Branding as inline CSS custom properties for a Pollar root (a modal
|
|
370
|
+
* card, the wallet button).
|
|
371
|
+
*
|
|
372
|
+
* Everything is written under the private `--pollar-brand-*` names, never the
|
|
373
|
+
* public `--pollar-*` ones: `shared.css` maps brand onto public inside a
|
|
374
|
+
* zero-specificity `:where()`, so a host stylesheet that sets a public variable
|
|
375
|
+
* on a Pollar root beats the Branding, and the Branding beats the theme
|
|
376
|
+
* defaults. An inline `--pollar-*` would beat every stylesheet instead.
|
|
377
|
+
*
|
|
378
|
+
* The palette (background, text, borders, status colors) is only written when
|
|
379
|
+
* the app pinned it: a dark theme, or a background or text color of its own.
|
|
380
|
+
* Left out, the light defaults in `shared.css` apply, and a host `html.dark`
|
|
381
|
+
* swaps them for the dark ones. */
|
|
382
|
+
declare function buildModalCssVars(theme: string, accentColor: string, overrides?: ModalStyleOverrides, variant?: ModalVariant): CSSProperties;
|
|
383
|
+
/** Everything a modal wrapper needs to dress itself from the app's branding:
|
|
384
|
+
* the theme pair its template already took, the overrides to forward to that
|
|
385
|
+
* template, and the inline style for the fixed overlay behind it. */
|
|
386
|
+
interface ModalChrome {
|
|
387
|
+
theme: string;
|
|
388
|
+
accentColor: string;
|
|
389
|
+
styleOverrides: ModalStyleOverrides;
|
|
390
|
+
overlayStyle: CSSProperties;
|
|
391
|
+
}
|
|
392
|
+
/** Resolve the branding config into the props/styles a modal wrapper applies.
|
|
393
|
+
* Called by every `.pollar-overlay` renderer so the z-index and the card
|
|
394
|
+
* overrides can't drift apart between modals. */
|
|
395
|
+
declare function modalChrome(styles: PollarStyles): ModalChrome;
|
|
396
|
+
|
|
334
397
|
interface WalletButtonTemplateProps {
|
|
335
398
|
walletAddress: string | null;
|
|
399
|
+
theme: string;
|
|
336
400
|
accentColor: string;
|
|
401
|
+
/** The app's Branding, as every modal template takes it. */
|
|
402
|
+
styleOverrides?: ModalStyleOverrides;
|
|
337
403
|
open: boolean;
|
|
338
404
|
copied: boolean;
|
|
339
|
-
dropdownBg: string;
|
|
340
|
-
dropdownBorder: string;
|
|
341
|
-
itemColor: string;
|
|
342
405
|
wrapperRef: React.RefObject<HTMLDivElement>;
|
|
343
406
|
isInProgress: boolean;
|
|
344
407
|
/** Show the "Create account" action (external wallet not yet on-chain, IMMEDIATE funding). */
|
|
@@ -388,7 +451,7 @@ interface WalletButtonTemplateProps {
|
|
|
388
451
|
onLogout: () => void;
|
|
389
452
|
onLogin: () => void;
|
|
390
453
|
}
|
|
391
|
-
declare function WalletButtonTemplate({ walletAddress,
|
|
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;
|
|
392
455
|
|
|
393
456
|
/**
|
|
394
457
|
* The chain a record lives on, with the legacy shape folded in: sessions and
|
|
@@ -563,13 +626,43 @@ declare function RampWidget({ onClose }: RampWidgetProps): react_jsx_runtime.JSX
|
|
|
563
626
|
|
|
564
627
|
interface RouteDisplayProps {
|
|
565
628
|
quote: RampQuote;
|
|
629
|
+
/** The first quote: the most received (or least sent) for the amount. */
|
|
630
|
+
best?: boolean;
|
|
566
631
|
/** This route is the one being started - it owns the in-flight request. */
|
|
567
632
|
busy?: boolean;
|
|
568
633
|
/** Another route is starting, so this one is not selectable meanwhile. */
|
|
569
634
|
disabled?: boolean;
|
|
570
635
|
onSelect: (quote: RampQuote) => void;
|
|
571
636
|
}
|
|
572
|
-
declare function RouteDisplay({ quote, busy, disabled, onSelect }: RouteDisplayProps): react_jsx_runtime.JSX.Element;
|
|
637
|
+
declare function RouteDisplay({ quote, best, busy, disabled, onSelect }: RouteDisplayProps): react_jsx_runtime.JSX.Element;
|
|
638
|
+
/**
|
|
639
|
+
* A route that was planned and dropped, and what the user can do about it: a
|
|
640
|
+
* verification step opens from its button, a missing trustline is added from its own.
|
|
641
|
+
*/
|
|
642
|
+
declare function RejectedRouteDisplay({ rejection, disabled, trusting, walletBusy, custodyChoice, onVerify, onTrust, onWalletStep, }: {
|
|
643
|
+
rejection: RampQuoteRejection;
|
|
644
|
+
/** A route is starting, a trustline or a wallet is being added, so nothing else opens meanwhile. */
|
|
645
|
+
disabled?: boolean;
|
|
646
|
+
/** This row's trustline is being added. */
|
|
647
|
+
trusting?: boolean;
|
|
648
|
+
/** The wallet step this route asks for is running. */
|
|
649
|
+
walletBusy?: boolean;
|
|
650
|
+
/** The app leaves the custody to the user: a wallet set up or moved here asks which. */
|
|
651
|
+
custodyChoice?: boolean;
|
|
652
|
+
/** Without it, a verification step is described but offers no button. */
|
|
653
|
+
onVerify?: ((requirement: RampQuoteRequirement) => void) | undefined;
|
|
654
|
+
/** Without it, a missing trustline is described but offers no button. */
|
|
655
|
+
onTrust?: ((asset: {
|
|
656
|
+
code: string;
|
|
657
|
+
issuer: string;
|
|
658
|
+
}) => void) | undefined;
|
|
659
|
+
/**
|
|
660
|
+
* Runs the wallet step the route asks for (`rampWalletStep`: create, set up or move
|
|
661
|
+
* the wallet), with the user's custody pick when `custodyChoice`. An app that leaves
|
|
662
|
+
* the custody to the user creates the wallet from the wallet menu instead.
|
|
663
|
+
*/
|
|
664
|
+
onWalletStep?: ((step: RampWalletStep, custody?: CosignCustody) => void) | undefined;
|
|
665
|
+
}): react_jsx_runtime.JSX.Element;
|
|
573
666
|
|
|
574
667
|
interface WalletBalanceModalProps {
|
|
575
668
|
onClose: () => void;
|
|
@@ -612,6 +705,8 @@ interface SessionsModalProps {
|
|
|
612
705
|
declare function SessionsModal({ onClose }: SessionsModalProps): react_jsx_runtime.JSX.Element;
|
|
613
706
|
|
|
614
707
|
interface CosignModalProps {
|
|
708
|
+
/** The approval a flow asks for next (`setCosignNextStep`); the prompt waits for it instead of closing. */
|
|
709
|
+
nextStep?: string | null;
|
|
615
710
|
onClose: () => void;
|
|
616
711
|
}
|
|
617
712
|
/**
|
|
@@ -619,7 +714,7 @@ interface CosignModalProps {
|
|
|
619
714
|
* against Turnkey before enabling Approve, so the user only ever confirms a
|
|
620
715
|
* transaction the device checked itself.
|
|
621
716
|
*/
|
|
622
|
-
declare function CosignModal({ onClose }: CosignModalProps): react_jsx_runtime.JSX.Element;
|
|
717
|
+
declare function CosignModal({ nextStep, onClose }: CosignModalProps): react_jsx_runtime.JSX.Element;
|
|
623
718
|
|
|
624
719
|
interface RecoveryModalProps {
|
|
625
720
|
onClose: () => void;
|
|
@@ -638,52 +733,6 @@ interface DistributionRulesModalProps {
|
|
|
638
733
|
}
|
|
639
734
|
declare function DistributionRulesModal({ onClose }: DistributionRulesModalProps): react_jsx_runtime.JSX.Element;
|
|
640
735
|
|
|
641
|
-
/** Per-app overrides for the modal chrome, configured in the dashboard's
|
|
642
|
-
* Branding screen. Every field is optional: absent means "use the value the
|
|
643
|
-
* theme derives", which is what every modal rendered before these existed. */
|
|
644
|
-
interface ModalStyleOverrides {
|
|
645
|
-
/** Card background. Overrides the theme's white / #1a1a1a. */
|
|
646
|
-
backgroundColor?: string | null | undefined;
|
|
647
|
-
/** Body text. Overrides the theme's #111827 / white. Secondary ("muted") text
|
|
648
|
-
* keeps its theme color, so the two stay distinguishable. */
|
|
649
|
-
textColor?: string | null | undefined;
|
|
650
|
-
/** Fill of the SECONDARY buttons (the wallet / social / provider entries, the
|
|
651
|
-
* retry button). The primary button is the accent's job. Unset => the theme's
|
|
652
|
-
* own surface color, which is what these buttons always used. */
|
|
653
|
-
buttonColor?: string | null | undefined;
|
|
654
|
-
/** Radius of the modal card itself, in px. */
|
|
655
|
-
modalBorderRadius?: number | null | undefined;
|
|
656
|
-
/** Radius of the buttons inside the modal, in px. Independent of the card's. */
|
|
657
|
-
buttonBorderRadius?: number | null | undefined;
|
|
658
|
-
}
|
|
659
|
-
/** Text color that stays legible on `background`. The primary button's label was
|
|
660
|
-
* hardcoded white, which a light fill (the Amber accent preset, say) turns
|
|
661
|
-
* invisible - so it follows the fill's luminance instead. Unparseable colors
|
|
662
|
-
* keep white, the pre-existing behavior. */
|
|
663
|
-
declare function readableTextOn(background: string): string;
|
|
664
|
-
/** How much room a modal gives its header. 'hero' is the identity-forward set
|
|
665
|
-
* (login, KYC, ramp, the Privy sub-modal): roomier padding and a larger
|
|
666
|
-
* centered heading. 'compact' is every utility modal (send, balance, history,
|
|
667
|
-
* ...), which keeps the card's own 1.75rem padding. */
|
|
668
|
-
type ModalVariant = 'hero' | 'compact';
|
|
669
|
-
/** Theme-derived CSS custom properties shared by every Pollar modal, plus the
|
|
670
|
-
* per-app overrides on top. One definition so the whole modal family stays
|
|
671
|
-
* visually in lockstep - a var added here reaches all of them at once. */
|
|
672
|
-
declare function buildModalCssVars(theme: string, accentColor: string, overrides?: ModalStyleOverrides, variant?: ModalVariant): CSSProperties;
|
|
673
|
-
/** Everything a modal wrapper needs to dress itself from the app's branding:
|
|
674
|
-
* the theme pair its template already took, the overrides to forward to that
|
|
675
|
-
* template, and the inline style for the fixed overlay behind it. */
|
|
676
|
-
interface ModalChrome {
|
|
677
|
-
theme: string;
|
|
678
|
-
accentColor: string;
|
|
679
|
-
styleOverrides: ModalStyleOverrides;
|
|
680
|
-
overlayStyle: CSSProperties;
|
|
681
|
-
}
|
|
682
|
-
/** Resolve the branding config into the props/styles a modal wrapper applies.
|
|
683
|
-
* Called by every `.pollar-overlay` renderer so the z-index and the card
|
|
684
|
-
* overrides can't drift apart between modals. */
|
|
685
|
-
declare function modalChrome(styles: PollarStyles): ModalChrome;
|
|
686
|
-
|
|
687
736
|
type WalletAdapterEntry = {
|
|
688
737
|
id: WalletId;
|
|
689
738
|
meta: {
|
|
@@ -746,7 +795,12 @@ interface KycModalTemplateProps {
|
|
|
746
795
|
reviewReason?: string | null;
|
|
747
796
|
/** The vendor approved and Pollar is still recording it (`kycStatus` stays `pending`). */
|
|
748
797
|
processing?: boolean;
|
|
798
|
+
/** The provider list is loading. */
|
|
749
799
|
isLoading: boolean;
|
|
800
|
+
/** The option whose session is opening: it shows a spinner and every option waits on it. */
|
|
801
|
+
startingProviderId?: string | null;
|
|
802
|
+
/** The option was named for the user (a ramp's step), so it opens without showing the list. */
|
|
803
|
+
directOpen?: boolean;
|
|
750
804
|
error?: string | null;
|
|
751
805
|
onSelectProvider: (provider: KycProvider) => void;
|
|
752
806
|
onDoneVerifying: () => void;
|
|
@@ -755,128 +809,105 @@ interface KycModalTemplateProps {
|
|
|
755
809
|
onRefresh: () => void;
|
|
756
810
|
onClose: () => void;
|
|
757
811
|
}
|
|
758
|
-
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;
|
|
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;
|
|
759
813
|
|
|
760
814
|
type RampStep = 'input' | 'loading_quote' | 'select_route' | 'contact' | 'status' | 'error';
|
|
761
|
-
/** A field a provider declares (via the quote) that the client must collect. */
|
|
762
|
-
interface RampFieldSpec {
|
|
763
|
-
key: string;
|
|
764
|
-
label: string;
|
|
765
|
-
type: 'text' | 'email' | 'tel' | 'select';
|
|
766
|
-
bankType?: string;
|
|
767
|
-
/** For `type: 'select'` - dropdown choices (e.g. Stereum's Bolivian banks). */
|
|
768
|
-
options?: {
|
|
769
|
-
value: string;
|
|
770
|
-
label: string;
|
|
771
|
-
placeholder?: string;
|
|
772
|
-
}[];
|
|
773
|
-
/** Declared but not mandatory (Abroad's tax id). Blank must not block Continue. */
|
|
774
|
-
optional?: boolean;
|
|
775
|
-
/** Example of the expected shape, for formats a user cannot guess. */
|
|
776
|
-
placeholder?: string;
|
|
777
|
-
/**
|
|
778
|
-
* Key of a sibling `select` whose chosen option supplies the placeholder. One
|
|
779
|
-
* Pix field can then show a CPF mask, an email or a +55 number as the user
|
|
780
|
-
* switches kind, without this component knowing what a Pix key is.
|
|
781
|
-
*/
|
|
782
|
-
placeholderFrom?: string;
|
|
783
|
-
/** Secondary line under the field, for a rule the label has no room for. */
|
|
784
|
-
hint?: string;
|
|
785
|
-
}
|
|
786
815
|
interface RampWidgetTemplateProps {
|
|
787
|
-
workflowContent?: React.ReactNode;
|
|
788
|
-
routeSelector?: React.ReactNode;
|
|
789
816
|
theme: string;
|
|
790
817
|
accentColor: string;
|
|
791
818
|
/** Per-app modal chrome overrides (background, card + button radius). */
|
|
792
819
|
styleOverrides?: ModalStyleOverrides;
|
|
820
|
+
network: StellarNetwork;
|
|
793
821
|
step: RampStep;
|
|
794
|
-
/** Labels of the steps this run goes through
|
|
795
|
-
* providers that collect fields add a 'Details' step. */
|
|
822
|
+
/** Labels of the steps this run goes through: 'Details' only when the route asks for fields. */
|
|
796
823
|
flowSteps: string[];
|
|
797
|
-
/** Index into `flowSteps`, or -1
|
|
798
|
-
* (the error step) and the progress bar should be hidden. */
|
|
824
|
+
/** Index into `flowSteps`, or -1 outside the flow (the error step). */
|
|
799
825
|
flowStepIndex: number;
|
|
800
|
-
/** Quote whose start request is in flight, so its row can show it. */
|
|
801
|
-
startingQuoteId: string | null;
|
|
802
826
|
direction: RampDirection;
|
|
803
|
-
|
|
804
|
-
|
|
827
|
+
routesLoading: boolean;
|
|
828
|
+
countries: Array<{
|
|
829
|
+
country: string;
|
|
830
|
+
fiats: RampFiat[];
|
|
831
|
+
}>;
|
|
805
832
|
country: string;
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
833
|
+
fiats: RampFiat[];
|
|
834
|
+
fiat: RampFiat | null;
|
|
835
|
+
assets: RampAsset[];
|
|
836
|
+
asset: RampAsset | null;
|
|
837
|
+
amount: string;
|
|
838
|
+
/** What the wallet can spend of the asset being sold, as `useWalletAvailable` reads it; undefined hides it. */
|
|
839
|
+
sellAvailable?: string | null | undefined;
|
|
811
840
|
quotes: RampQuote[];
|
|
812
|
-
|
|
813
|
-
|
|
841
|
+
rejected: RampQuoteRejection[];
|
|
842
|
+
/** Quote whose order request is in flight, so its row can show it. */
|
|
843
|
+
startingQuoteId: string | null;
|
|
844
|
+
fields: RampField[];
|
|
845
|
+
fieldValues: Record<string, string>;
|
|
846
|
+
order: RampOrder | null;
|
|
847
|
+
/** Orders waiting on the user, to resume. */
|
|
848
|
+
pendingOrders: RampOrder[];
|
|
814
849
|
isLoading: boolean;
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
/**
|
|
837
|
-
|
|
850
|
+
refreshing: boolean;
|
|
851
|
+
signing: boolean;
|
|
852
|
+
errorMsg: string | null;
|
|
853
|
+
/** Progress the route waits on that is not a failure, shown with a spinner (an account the user approves on the device). */
|
|
854
|
+
notice?: string | null;
|
|
855
|
+
onDirectionChange: (direction: RampDirection) => void;
|
|
856
|
+
onCountryChange: (country: string) => void;
|
|
857
|
+
onFiatChange: (key: string) => void;
|
|
858
|
+
onAssetChange: (key: string) => void;
|
|
859
|
+
onAmountChange: (value: string) => void;
|
|
860
|
+
onFindRoute: () => void;
|
|
861
|
+
onSelectQuote: (quote: RampQuote) => void;
|
|
862
|
+
/** Opens the verification step a dropped route waits on. */
|
|
863
|
+
onVerifyRoute?: (requirement: RampQuoteRequirement) => void;
|
|
864
|
+
/** The Stellar asset whose trustline is being added, as `code:issuer`; null when none is. */
|
|
865
|
+
trustingAsset?: string | null;
|
|
866
|
+
/** Adds the trustline a dropped route needs, then quotes again. */
|
|
867
|
+
onTrustAsset?: (asset: {
|
|
868
|
+
code: string;
|
|
869
|
+
issuer: string;
|
|
870
|
+
}) => void;
|
|
871
|
+
/** The dropped route (its index in `rejected`) whose wallet step is running; null when none is. */
|
|
872
|
+
walletBusy?: number | null;
|
|
873
|
+
/** The app leaves the custody to the user: a wallet set up or moved from a row asks which. */
|
|
874
|
+
custodyChoice?: boolean;
|
|
838
875
|
/**
|
|
839
|
-
*
|
|
840
|
-
*
|
|
841
|
-
* not shown.
|
|
876
|
+
* Runs the wallet step a dropped route asks for (create, set up or move the wallet),
|
|
877
|
+
* then quotes again; absent, the row only says what the user needs.
|
|
842
878
|
*/
|
|
843
|
-
|
|
844
|
-
/**
|
|
879
|
+
onWalletStep?: ((step: RampWalletStep, index: number, custody?: CosignCustody) => void) | undefined;
|
|
880
|
+
/** The app serves no chain, so it has nothing to buy or sell. */
|
|
881
|
+
noChains?: boolean;
|
|
882
|
+
/** A held order the user resolves is being run again. */
|
|
845
883
|
retrying?: boolean;
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
errorMsg: string | null;
|
|
859
|
-
/** Neutral guidance on the route list, e.g. after identity verification sent the user back to it. */
|
|
860
|
-
noticeMsg?: string | null;
|
|
861
|
-
onDirectionChange: (d: RampDirection) => void;
|
|
862
|
-
onAmountChange: (v: string) => void;
|
|
884
|
+
/** Runs the user's held order again; absent, a held order only says what happened. */
|
|
885
|
+
onRetryOrder?: (() => void) | undefined;
|
|
886
|
+
/** Opens the wallet's recovery setup, for an order held until the wallet has a way to be recovered. */
|
|
887
|
+
onSetUpRecovery?: (() => void) | undefined;
|
|
888
|
+
/** Whether the wallet still has no way to be recovered; null while its state is unread. */
|
|
889
|
+
recoveryMissing?: boolean | null;
|
|
890
|
+
/** Reading the order keeps failing and polling is retrying. */
|
|
891
|
+
pollTrouble?: boolean;
|
|
892
|
+
/** The fiat payment the user says they made is being checked. */
|
|
893
|
+
checkingPayment?: boolean;
|
|
894
|
+
/** Checks the fiat payment now; absent, the order only updates at its usual pace. */
|
|
895
|
+
onCheckPayment?: (() => void) | undefined;
|
|
863
896
|
onFieldChange: (key: string, value: string) => void;
|
|
864
|
-
onCountryChange: (v: string) => void;
|
|
865
|
-
onFindRoute: () => void;
|
|
866
|
-
onSelectQuote: (q: RampQuote) => void;
|
|
867
|
-
onVerifyRoute: (requirement: RampQuoteRequirement) => void;
|
|
868
897
|
onContactContinue: () => void;
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
898
|
+
onSign: () => void;
|
|
899
|
+
onApprove: () => void;
|
|
900
|
+
onResumeOrder: (id: string) => void;
|
|
901
|
+
onNewOrder: () => void;
|
|
902
|
+
/** Step back, keeping what was entered. */
|
|
874
903
|
onBack: () => void;
|
|
904
|
+
/** Returns to an earlier step of `flowSteps`, keeping what was entered; absent, the step bar only shows progress. */
|
|
905
|
+
onStepSelect?: ((label: string) => void) | undefined;
|
|
875
906
|
onRetry: () => void;
|
|
876
907
|
onRefresh: () => void;
|
|
877
908
|
onClose: () => void;
|
|
878
909
|
}
|
|
879
|
-
declare function RampWidgetTemplate({
|
|
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;
|
|
880
911
|
|
|
881
912
|
interface TransactionModalTemplateProps {
|
|
882
913
|
theme: string;
|
|
@@ -998,7 +1029,12 @@ interface SendModalTemplateProps {
|
|
|
998
1029
|
accentColor: string;
|
|
999
1030
|
/** Per-app modal chrome overrides (background, card + button radius). */
|
|
1000
1031
|
styleOverrides?: ModalStyleOverrides;
|
|
1001
|
-
|
|
1032
|
+
/**
|
|
1033
|
+
* `create-account`: the Stellar destination has no account yet, so the user
|
|
1034
|
+
* chooses between creating it with the XLM being sent and waiting for someone
|
|
1035
|
+
* else to fund it.
|
|
1036
|
+
*/
|
|
1037
|
+
step: 'form' | 'create-account' | 'tx';
|
|
1002
1038
|
txTitle: string;
|
|
1003
1039
|
assets: WalletBalanceRecord[];
|
|
1004
1040
|
selectedAsset: WalletBalanceRecord | null;
|
|
@@ -1028,6 +1064,12 @@ interface SendModalTemplateProps {
|
|
|
1028
1064
|
destination: string;
|
|
1029
1065
|
formError: string;
|
|
1030
1066
|
isLoadingBalance: boolean;
|
|
1067
|
+
/** The destination's account is being looked up; the form waits for it. */
|
|
1068
|
+
isCheckingDestination?: boolean;
|
|
1069
|
+
/** The least XLM a new Stellar account can start with. */
|
|
1070
|
+
minStartingBalance?: number;
|
|
1071
|
+
/** Builds a `create_account` for the destination, funded with the amount. Required for the `create-account` step. */
|
|
1072
|
+
onCreateAccount?: () => void;
|
|
1031
1073
|
transaction: TransactionState;
|
|
1032
1074
|
showXdr: boolean;
|
|
1033
1075
|
copied: boolean;
|
|
@@ -1059,7 +1101,7 @@ interface SendModalTemplateProps {
|
|
|
1059
1101
|
onRetry: () => void;
|
|
1060
1102
|
onDone: () => void;
|
|
1061
1103
|
}
|
|
1062
|
-
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, memo, memoType, onMemoChange, onMemoTypeChange, onSubmit, onSignAndSend, onToggleXdr, onCopyHash, onRetry, onDone, }: SendModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
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;
|
|
1063
1105
|
|
|
1064
1106
|
interface SwapAssetOption {
|
|
1065
1107
|
ref: SwapQuoteParams['sellAsset'];
|
|
@@ -1186,12 +1228,16 @@ interface CosignModalTemplateProps {
|
|
|
1186
1228
|
lastResolved?: CosignRequest;
|
|
1187
1229
|
/** Explorer page of {@link lastResolved}'s transaction, when it was sent. */
|
|
1188
1230
|
explorerUrl?: string | null;
|
|
1231
|
+
/** Seconds until the modal closes on its own, while what it shows needs nothing from the user. */
|
|
1232
|
+
closesIn?: number | null;
|
|
1233
|
+
/** The approval coming next in the same flow, shown while the modal waits for it. */
|
|
1234
|
+
nextStep?: string | null;
|
|
1189
1235
|
onSelect: (request: CosignRequest) => void;
|
|
1190
1236
|
onApprove: (request: CosignRequest) => void;
|
|
1191
1237
|
onReject: (request: CosignRequest) => void;
|
|
1192
1238
|
onClose: () => void;
|
|
1193
1239
|
}
|
|
1194
|
-
declare function CosignModalTemplate({ theme, accentColor, styleOverrides, pending, current, verification, busy, error, approveBlocked, lastResolved, explorerUrl, onSelect, onApprove, onReject, onClose, }: CosignModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
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;
|
|
1195
1241
|
|
|
1196
1242
|
interface CustodyMigrationModalProps {
|
|
1197
1243
|
state: CustodyMigrationState;
|
|
@@ -1280,11 +1326,4 @@ interface DistributionRulesModalTemplateProps {
|
|
|
1280
1326
|
}
|
|
1281
1327
|
declare function DistributionRulesModalTemplate({ theme, accentColor, styleOverrides, state, claimingId, claimErrors, claimedIds, onRefresh, onClaim, onClose, }: DistributionRulesModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1282
1328
|
|
|
1283
|
-
|
|
1284
|
-
client: PollarClient;
|
|
1285
|
-
snapshot: RampSnapshot;
|
|
1286
|
-
onChange: (next: RampsTransactionResponse) => void;
|
|
1287
|
-
onBusyChange?: (busy: boolean) => void;
|
|
1288
|
-
}): react_jsx_runtime.JSX.Element;
|
|
1289
|
-
|
|
1290
|
-
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, RampWorkflow, ReceiveModal, ReceiveModalTemplate, type ReceiveModalTemplateProps, RecoveryModal, RecoveryModalTemplate, type RecoveryModalTemplateProps, type RecoveryView, RegistryCheckModal, 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 };
|
|
1329
|
+
export { type AuthModalProps, CardModal, ChainSelect, type ChainSelectProps, CosignModal, CosignModalTemplate, type CosignModalTemplateProps, CustodyMigrationModal, CustodyMigrationModalTemplate, type CustodyMigrationModalTemplateProps, type CustomTrustlineModalTemplateProps, DistributionRulesModal, DistributionRulesModalTemplate, EarnModal, EnabledAssetsModal, EnabledAssetsModalTemplate, type EnabledAssetsModalTemplateProps, KycModal, KycModalTemplate, KycStatus, type KycStep, type LoginButtonProps, LoginModalTemplate, type ModalChrome, type ModalStyleOverrides, type ModalVariant, type PollarConfig, PollarProvider, type PollarStyles, ProviderRegistrationModal, type RampStep, RampWidget, RampWidgetTemplate, ReceiveModal, ReceiveModalTemplate, type ReceiveModalTemplateProps, RecoveryModal, RecoveryModalTemplate, type RecoveryModalTemplateProps, type RecoveryView, RegistryCheckModal, RejectedRouteDisplay, RequirementFormModal, RouteDisplay, type SendMemoType, SendModal, SendModalTemplate, type SendModalTemplateProps, SessionsModal, SessionsModalTemplate, type SessionsModalTemplateProps, type SwapAssetOption, SwapModal, SwapModalTemplate, type SwapModalTemplateProps, TransactionModalTemplate, type TransactionModalTemplateProps, TxHistoryModalTemplate, TxStatusView, type TxStatusViewProps, type UseChainsResult, type UseCosignResult, WalletBalanceModal, WalletBalanceModalTemplate, type WalletBalanceModalTemplateProps, WalletButton, WalletButtonTemplate, type WalletButtonTemplateProps, addressForChain, browserPasskeyCeremony, browserPasskeySigner, browserRecoveryPasskey, buildModalCssVars, chainsOf, createPollarAdapterHook, modalChrome, readableTextOn, resolveChain, useChains, useCosign, usePollar, walletNotReadyReason };
|