@pollar/react 0.11.4 → 0.11.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 +8 -1
- package/dist/index.css +198 -32
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +103 -5
- package/dist/index.d.ts +103 -5
- package/dist/index.js +594 -56
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +593 -58
- 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, PollarLoginOptions, SessionsState, TransactionState, TxBuildBody, BuildOutcome, SubmitOutcome, SignOutcome, SendPaymentParams, StellarNetwork, WalletBalanceState, EnabledAssetsState, TrustlineOutcome, TxHistoryState, SwapVenue, SwapToken, SwapQuoteParams, SwapQuote, EarnProviderId, EarnOpportunity, EarnPositionParams, EarnPosition, EarnTxParams, PollarAdapter, PasskeyCeremony, PasskeySigner, WalletChain, KycStatus as KycStatus$1, RampQuote, WalletId, AuthState, KycProvider, KycStartResponse, RampDirection, RampCountry, RampQuoteRequirement, RampTxStatus, RampDepositInstructions, EnabledAssetRecord, WalletBalanceRecord, SwapProvider, DistributionRulesState, DistributionRule } from '@pollar/core';
|
|
2
|
+
import { pollarPaths, PollarClient, PollarClientConfig, PollarAdapters, OnStorageDegrade, WalletInfo, PollarLoginOptions, SessionsState, CosignState, PendingConfirmation, TransactionState, TxBuildBody, BuildOutcome, SubmitOutcome, SignOutcome, SendPaymentParams, StellarNetwork, WalletBalanceState, EnabledAssetsState, TrustlineOutcome, TxHistoryState, SwapVenue, SwapToken, SwapQuoteParams, SwapQuote, EarnProviderId, EarnOpportunity, EarnPositionParams, EarnPosition, EarnTxParams, PollarAdapter, PasskeyCeremony, PasskeySigner, WalletChain, CosignRequest, CosignVerification, CosignQuorumReport, CosignDevicesContent, KycStatus as KycStatus$1, RampQuote, WalletId, AuthState, KycProvider, KycStartResponse, RampDirection, RampCountry, RampQuoteRequirement, RampTxStatus, RampDepositInstructions, EnabledAssetRecord, WalletBalanceRecord, SwapProvider, DistributionRulesState, DistributionRule } from '@pollar/core';
|
|
3
3
|
export { AuthProviderContext, PollarAuthProvider, SessionsState } from '@pollar/core';
|
|
4
4
|
import { ReactNode, CSSProperties } from 'react';
|
|
5
5
|
|
|
@@ -56,6 +56,12 @@ interface PollarContextValue {
|
|
|
56
56
|
sessions: SessionsState;
|
|
57
57
|
/** Open the active-sessions modal. */
|
|
58
58
|
openSessionsModal: () => void;
|
|
59
|
+
/** Requests waiting for this device's vote. */
|
|
60
|
+
cosign: CosignState;
|
|
61
|
+
/** Open the approval prompt of a co-signed wallet. Opens by itself when a request arrives. */
|
|
62
|
+
openCosignModal: () => void;
|
|
63
|
+
/** Signing calls waiting for the user under `confirmation: 'prompt'`; the provider shows the first one. */
|
|
64
|
+
confirmations: PendingConfirmation[];
|
|
59
65
|
appConfig: PollarConfig;
|
|
60
66
|
styles: PollarStyles;
|
|
61
67
|
/** Remote app-config load state. 'loading' while the initial fetch is in
|
|
@@ -397,6 +403,37 @@ interface UseChainsResult {
|
|
|
397
403
|
}
|
|
398
404
|
declare function useChains(): UseChainsResult;
|
|
399
405
|
|
|
406
|
+
interface UseCosignResult {
|
|
407
|
+
/** Requests waiting for this device's vote, oldest first. */
|
|
408
|
+
pending: CosignRequest[];
|
|
409
|
+
/** The last request that reached a final state. */
|
|
410
|
+
lastResolved?: CosignRequest;
|
|
411
|
+
/** Whether the client's co-sign store has been read at least once. */
|
|
412
|
+
loaded: boolean;
|
|
413
|
+
/** Re-read the pending requests from the API. */
|
|
414
|
+
refresh: () => Promise<void>;
|
|
415
|
+
/** Verify the request against Turnkey and, when it checks out, vote yes. */
|
|
416
|
+
approve: (request: CosignRequest) => Promise<CosignRequest>;
|
|
417
|
+
/** Vote no. Final. */
|
|
418
|
+
reject: (request: CosignRequest) => Promise<CosignRequest>;
|
|
419
|
+
/** The verification a UI can show before the user decides. */
|
|
420
|
+
verify: (request: CosignRequest) => Promise<CosignVerification>;
|
|
421
|
+
/** Read the sub-organization from Turnkey with the device key and record whether it is the promised 2-of-2. */
|
|
422
|
+
inspectQuorum: () => Promise<CosignQuorumReport>;
|
|
423
|
+
/** The user's enrolled devices and the quorum state as sdk-api records it. */
|
|
424
|
+
devices: () => Promise<CosignDevicesContent>;
|
|
425
|
+
/** Revoke another enrolled device; `force` to revoke this one. */
|
|
426
|
+
revokeDevice: (deviceId: string, options?: {
|
|
427
|
+
force?: boolean;
|
|
428
|
+
}) => Promise<CosignDevicesContent>;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* The user's side of a Turnkey co-signed wallet, for an app that renders its
|
|
432
|
+
* own confirmation UI instead of the provider's modal. Subscribes to the
|
|
433
|
+
* client's co-sign store and loads the pending requests once on mount.
|
|
434
|
+
*/
|
|
435
|
+
declare function useCosign(): UseCosignResult;
|
|
436
|
+
|
|
400
437
|
interface KycModalProps {
|
|
401
438
|
corridorId?: string;
|
|
402
439
|
/** A card provider's steps, in place of a route's. */
|
|
@@ -527,6 +564,16 @@ interface SessionsModalProps {
|
|
|
527
564
|
}
|
|
528
565
|
declare function SessionsModal({ onClose }: SessionsModalProps): react_jsx_runtime.JSX.Element;
|
|
529
566
|
|
|
567
|
+
interface CosignModalProps {
|
|
568
|
+
onClose: () => void;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* The approval prompt of a Turnkey co-signed wallet. Verifies each request
|
|
572
|
+
* against Turnkey before enabling Approve, so the user only ever confirms a
|
|
573
|
+
* transaction the device checked itself.
|
|
574
|
+
*/
|
|
575
|
+
declare function CosignModal({ onClose }: CosignModalProps): react_jsx_runtime.JSX.Element;
|
|
576
|
+
|
|
530
577
|
interface DistributionRulesModalProps {
|
|
531
578
|
onClose: () => void;
|
|
532
579
|
}
|
|
@@ -719,9 +766,23 @@ interface RampWidgetTemplateProps {
|
|
|
719
766
|
onboardingStatus?: 'kyc' | 'endorsement' | 'awaiting_provider' | null;
|
|
720
767
|
/** The gate has since cleared - the user needs a fresh quote to continue. */
|
|
721
768
|
kycJustApproved: boolean;
|
|
769
|
+
/** Superseded by `txHash`, which carries the settlement on any chain; read when `txHash` is absent. */
|
|
722
770
|
stellarTxHash: string | null;
|
|
723
|
-
/**
|
|
771
|
+
/** The on-chain transaction that settled the ramp, on `txChain`. */
|
|
772
|
+
txHash?: string | null;
|
|
773
|
+
/** Chain of `txHash`; Stellar when omitted. */
|
|
774
|
+
txChain?: 'STELLAR' | 'POLYGON' | 'SOLANA' | null;
|
|
775
|
+
/** Explorer URL for the transaction (chain- and network-aware); null when unknown. */
|
|
724
776
|
explorerUrl: string | null;
|
|
777
|
+
/**
|
|
778
|
+
* The user's money is in one of their wallets between two steps of the route.
|
|
779
|
+
* Optional for integrators rendering their own chrome; omitted, the state is
|
|
780
|
+
* not shown.
|
|
781
|
+
*/
|
|
782
|
+
fundsInTransit?: boolean;
|
|
783
|
+
/** A retry of the pending step is in flight. */
|
|
784
|
+
retrying?: boolean;
|
|
785
|
+
onRetryTransit?: () => void;
|
|
725
786
|
depositInstructions: RampDepositInstructions | null;
|
|
726
787
|
canComplete: boolean;
|
|
727
788
|
completing: boolean;
|
|
@@ -746,7 +807,7 @@ interface RampWidgetTemplateProps {
|
|
|
746
807
|
onRefresh: () => void;
|
|
747
808
|
onClose: () => void;
|
|
748
809
|
}
|
|
749
|
-
declare function RampWidgetTemplate({ theme, accentColor, styleOverrides, step, flowSteps, flowStepIndex, startingQuoteId, direction, amount, currency, country, requiredFields, fieldValues, countries, countriesLoading, refreshing, quotes, kycRequired, isLoading, provider, txStatus, kycUrl, tosUrl, kycBlocking, onboardingStatus, kycJustApproved, stellarTxHash, explorerUrl, depositInstructions, canComplete, completing, errorMsg, noticeMsg, onDirectionChange, onAmountChange, onFieldChange, onCountryChange, onFindRoute, onSelectQuote, onVerifyRoute, onContactContinue, onOpenKyc, onOpenTos, onCompleteWithdraw, onBack, onRetry, onRefresh, onClose, }: RampWidgetTemplateProps): react_jsx_runtime.JSX.Element;
|
|
810
|
+
declare function RampWidgetTemplate({ theme, accentColor, styleOverrides, step, flowSteps, flowStepIndex, startingQuoteId, direction, amount, currency, country, requiredFields, fieldValues, countries, countriesLoading, refreshing, quotes, kycRequired, isLoading, provider, txStatus, kycUrl, tosUrl, kycBlocking, onboardingStatus, kycJustApproved, stellarTxHash, txHash, txChain, explorerUrl, fundsInTransit, retrying, onRetryTransit, depositInstructions, canComplete, completing, errorMsg, noticeMsg, onDirectionChange, onAmountChange, onFieldChange, onCountryChange, onFindRoute, onSelectQuote, onVerifyRoute, onContactContinue, onOpenKyc, onOpenTos, onCompleteWithdraw, onBack, onRetry, onRefresh, onClose, }: RampWidgetTemplateProps): react_jsx_runtime.JSX.Element;
|
|
750
811
|
|
|
751
812
|
interface TransactionModalTemplateProps {
|
|
752
813
|
theme: string;
|
|
@@ -861,6 +922,8 @@ interface CustomTrustlineModalTemplateProps {
|
|
|
861
922
|
}) => void;
|
|
862
923
|
}
|
|
863
924
|
|
|
925
|
+
/** The memo types the backend accepts on a Stellar payment. */
|
|
926
|
+
type SendMemoType = 'text' | 'id';
|
|
864
927
|
interface SendModalTemplateProps {
|
|
865
928
|
theme: string;
|
|
866
929
|
accentColor: string;
|
|
@@ -911,6 +974,15 @@ interface SendModalTemplateProps {
|
|
|
911
974
|
onMax: () => void;
|
|
912
975
|
onPaste: () => void;
|
|
913
976
|
onDestinationChange: (value: string) => void;
|
|
977
|
+
/**
|
|
978
|
+
* Optional Stellar memo. The field renders only on Stellar and only when
|
|
979
|
+
* {@link onMemoChange} is passed, so a custom template written before it
|
|
980
|
+
* existed keeps compiling.
|
|
981
|
+
*/
|
|
982
|
+
memo?: string;
|
|
983
|
+
memoType?: SendMemoType;
|
|
984
|
+
onMemoChange?: (value: string) => void;
|
|
985
|
+
onMemoTypeChange?: (type: SendMemoType) => void;
|
|
914
986
|
onSubmit: () => void;
|
|
915
987
|
onSignAndSend: () => void;
|
|
916
988
|
onToggleXdr: () => void;
|
|
@@ -918,7 +990,7 @@ interface SendModalTemplateProps {
|
|
|
918
990
|
onRetry: () => void;
|
|
919
991
|
onDone: () => void;
|
|
920
992
|
}
|
|
921
|
-
declare function SendModalTemplate({ theme, accentColor, styleOverrides, step, txTitle, assets, selectedAsset, selectedChain, canSendOnChain, notReadyReason, chains, onSelectChain, amount, destination, formError, isLoadingBalance, transaction, showXdr, copied, explorerUrl, walletType, showBack, isInProgress, onClose, onBack, onRefresh, onSelectAsset, onAmountChange, onMax, onPaste, onDestinationChange, onSubmit, onSignAndSend, onToggleXdr, onCopyHash, onRetry, onDone, }: SendModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
993
|
+
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;
|
|
922
994
|
|
|
923
995
|
interface SwapAssetOption {
|
|
924
996
|
ref: SwapQuoteParams['sellAsset'];
|
|
@@ -1019,6 +1091,32 @@ interface SessionsModalTemplateProps {
|
|
|
1019
1091
|
}
|
|
1020
1092
|
declare function SessionsModalTemplate({ theme, accentColor, styleOverrides, state, revokingFamilyId, signingOutEverywhere, revokeError, onRefresh, onRevoke, onLogoutEverywhere, onClose, }: SessionsModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1021
1093
|
|
|
1094
|
+
interface CosignModalTemplateProps {
|
|
1095
|
+
theme: string;
|
|
1096
|
+
accentColor: string;
|
|
1097
|
+
/** Per-app modal chrome overrides (background, card + button radius). */
|
|
1098
|
+
styleOverrides?: ModalStyleOverrides;
|
|
1099
|
+
/** Requests waiting for this device's vote, oldest first. */
|
|
1100
|
+
pending: CosignRequest[];
|
|
1101
|
+
/** The request shown in detail; the first pending one when not chosen. */
|
|
1102
|
+
current: CosignRequest | null;
|
|
1103
|
+
/** Verification of `current`, or null while it runs. */
|
|
1104
|
+
verification: CosignVerification | null;
|
|
1105
|
+
busy: 'approving' | 'rejecting' | null;
|
|
1106
|
+
error: string | null;
|
|
1107
|
+
/** Approve stays off for a request whose approval just failed. */
|
|
1108
|
+
approveBlocked?: boolean;
|
|
1109
|
+
/** The last request that reached a final state, shown once the list is empty. */
|
|
1110
|
+
lastResolved?: CosignRequest;
|
|
1111
|
+
/** Explorer page of {@link lastResolved}'s transaction, when it was sent. */
|
|
1112
|
+
explorerUrl?: string | null;
|
|
1113
|
+
onSelect: (request: CosignRequest) => void;
|
|
1114
|
+
onApprove: (request: CosignRequest) => void;
|
|
1115
|
+
onReject: (request: CosignRequest) => void;
|
|
1116
|
+
onClose: () => void;
|
|
1117
|
+
}
|
|
1118
|
+
declare function CosignModalTemplate({ theme, accentColor, styleOverrides, pending, current, verification, busy, error, approveBlocked, lastResolved, explorerUrl, onSelect, onApprove, onReject, onClose, }: CosignModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1119
|
+
|
|
1022
1120
|
interface DistributionRulesModalTemplateProps {
|
|
1023
1121
|
theme: string;
|
|
1024
1122
|
accentColor: string;
|
|
@@ -1034,4 +1132,4 @@ interface DistributionRulesModalTemplateProps {
|
|
|
1034
1132
|
}
|
|
1035
1133
|
declare function DistributionRulesModalTemplate({ theme, accentColor, styleOverrides, state, claimingId, claimErrors, claimedIds, onRefresh, onClaim, onClose, }: DistributionRulesModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1036
1134
|
|
|
1037
|
-
export { type AuthModalProps, CardModal, ChainSelect, type ChainSelectProps, type CustomTrustlineModalTemplateProps, DistributionRulesModal, DistributionRulesModalTemplate, EarnModal, EnabledAssetsModal, EnabledAssetsModalTemplate, type EnabledAssetsModalTemplateProps, KycModal, KycModalTemplate, KycStatus, type KycStep, type LoginButtonProps, LoginModalTemplate, type ModalChrome, type ModalStyleOverrides, type ModalVariant, type PollarConfig, PollarProvider, type PollarStyles, ProviderRegistrationModal, type RampStep, RampWidget, RampWidgetTemplate, ReceiveModal, ReceiveModalTemplate, type ReceiveModalTemplateProps, RegistryCheckModal, RequirementFormModal, RouteDisplay, SendModal, SendModalTemplate, type SendModalTemplateProps, SessionsModal, SessionsModalTemplate, type SessionsModalTemplateProps, type SwapAssetOption, SwapModal, SwapModalTemplate, type SwapModalTemplateProps, TransactionModalTemplate, type TransactionModalTemplateProps, TxHistoryModalTemplate, TxStatusView, type TxStatusViewProps, type UseChainsResult, WalletBalanceModal, WalletBalanceModalTemplate, type WalletBalanceModalTemplateProps, WalletButton, WalletButtonTemplate, type WalletButtonTemplateProps, addressForChain, browserPasskeyCeremony, browserPasskeySigner, buildModalCssVars, chainsOf, createPollarAdapterHook, modalChrome, readableTextOn, resolveChain, useChains, usePollar, walletNotReadyReason };
|
|
1135
|
+
export { type AuthModalProps, CardModal, ChainSelect, type ChainSelectProps, CosignModal, CosignModalTemplate, type CosignModalTemplateProps, type CustomTrustlineModalTemplateProps, DistributionRulesModal, DistributionRulesModalTemplate, EarnModal, EnabledAssetsModal, EnabledAssetsModalTemplate, type EnabledAssetsModalTemplateProps, KycModal, KycModalTemplate, KycStatus, type KycStep, type LoginButtonProps, LoginModalTemplate, type ModalChrome, type ModalStyleOverrides, type ModalVariant, type PollarConfig, PollarProvider, type PollarStyles, ProviderRegistrationModal, type RampStep, RampWidget, RampWidgetTemplate, ReceiveModal, ReceiveModalTemplate, type ReceiveModalTemplateProps, RegistryCheckModal, RequirementFormModal, RouteDisplay, 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, buildModalCssVars, chainsOf, createPollarAdapterHook, modalChrome, readableTextOn, resolveChain, useChains, useCosign, usePollar, walletNotReadyReason };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { pollarPaths, PollarClient, PollarClientConfig, PollarAdapters, OnStorageDegrade, WalletInfo, PollarLoginOptions, SessionsState, TransactionState, TxBuildBody, BuildOutcome, SubmitOutcome, SignOutcome, SendPaymentParams, StellarNetwork, WalletBalanceState, EnabledAssetsState, TrustlineOutcome, TxHistoryState, SwapVenue, SwapToken, SwapQuoteParams, SwapQuote, EarnProviderId, EarnOpportunity, EarnPositionParams, EarnPosition, EarnTxParams, PollarAdapter, PasskeyCeremony, PasskeySigner, WalletChain, KycStatus as KycStatus$1, RampQuote, WalletId, AuthState, KycProvider, KycStartResponse, RampDirection, RampCountry, RampQuoteRequirement, RampTxStatus, RampDepositInstructions, EnabledAssetRecord, WalletBalanceRecord, SwapProvider, DistributionRulesState, DistributionRule } from '@pollar/core';
|
|
2
|
+
import { pollarPaths, PollarClient, PollarClientConfig, PollarAdapters, OnStorageDegrade, WalletInfo, PollarLoginOptions, SessionsState, CosignState, PendingConfirmation, TransactionState, TxBuildBody, BuildOutcome, SubmitOutcome, SignOutcome, SendPaymentParams, StellarNetwork, WalletBalanceState, EnabledAssetsState, TrustlineOutcome, TxHistoryState, SwapVenue, SwapToken, SwapQuoteParams, SwapQuote, EarnProviderId, EarnOpportunity, EarnPositionParams, EarnPosition, EarnTxParams, PollarAdapter, PasskeyCeremony, PasskeySigner, WalletChain, CosignRequest, CosignVerification, CosignQuorumReport, CosignDevicesContent, KycStatus as KycStatus$1, RampQuote, WalletId, AuthState, KycProvider, KycStartResponse, RampDirection, RampCountry, RampQuoteRequirement, RampTxStatus, RampDepositInstructions, EnabledAssetRecord, WalletBalanceRecord, SwapProvider, DistributionRulesState, DistributionRule } from '@pollar/core';
|
|
3
3
|
export { AuthProviderContext, PollarAuthProvider, SessionsState } from '@pollar/core';
|
|
4
4
|
import { ReactNode, CSSProperties } from 'react';
|
|
5
5
|
|
|
@@ -56,6 +56,12 @@ interface PollarContextValue {
|
|
|
56
56
|
sessions: SessionsState;
|
|
57
57
|
/** Open the active-sessions modal. */
|
|
58
58
|
openSessionsModal: () => void;
|
|
59
|
+
/** Requests waiting for this device's vote. */
|
|
60
|
+
cosign: CosignState;
|
|
61
|
+
/** Open the approval prompt of a co-signed wallet. Opens by itself when a request arrives. */
|
|
62
|
+
openCosignModal: () => void;
|
|
63
|
+
/** Signing calls waiting for the user under `confirmation: 'prompt'`; the provider shows the first one. */
|
|
64
|
+
confirmations: PendingConfirmation[];
|
|
59
65
|
appConfig: PollarConfig;
|
|
60
66
|
styles: PollarStyles;
|
|
61
67
|
/** Remote app-config load state. 'loading' while the initial fetch is in
|
|
@@ -397,6 +403,37 @@ interface UseChainsResult {
|
|
|
397
403
|
}
|
|
398
404
|
declare function useChains(): UseChainsResult;
|
|
399
405
|
|
|
406
|
+
interface UseCosignResult {
|
|
407
|
+
/** Requests waiting for this device's vote, oldest first. */
|
|
408
|
+
pending: CosignRequest[];
|
|
409
|
+
/** The last request that reached a final state. */
|
|
410
|
+
lastResolved?: CosignRequest;
|
|
411
|
+
/** Whether the client's co-sign store has been read at least once. */
|
|
412
|
+
loaded: boolean;
|
|
413
|
+
/** Re-read the pending requests from the API. */
|
|
414
|
+
refresh: () => Promise<void>;
|
|
415
|
+
/** Verify the request against Turnkey and, when it checks out, vote yes. */
|
|
416
|
+
approve: (request: CosignRequest) => Promise<CosignRequest>;
|
|
417
|
+
/** Vote no. Final. */
|
|
418
|
+
reject: (request: CosignRequest) => Promise<CosignRequest>;
|
|
419
|
+
/** The verification a UI can show before the user decides. */
|
|
420
|
+
verify: (request: CosignRequest) => Promise<CosignVerification>;
|
|
421
|
+
/** Read the sub-organization from Turnkey with the device key and record whether it is the promised 2-of-2. */
|
|
422
|
+
inspectQuorum: () => Promise<CosignQuorumReport>;
|
|
423
|
+
/** The user's enrolled devices and the quorum state as sdk-api records it. */
|
|
424
|
+
devices: () => Promise<CosignDevicesContent>;
|
|
425
|
+
/** Revoke another enrolled device; `force` to revoke this one. */
|
|
426
|
+
revokeDevice: (deviceId: string, options?: {
|
|
427
|
+
force?: boolean;
|
|
428
|
+
}) => Promise<CosignDevicesContent>;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* The user's side of a Turnkey co-signed wallet, for an app that renders its
|
|
432
|
+
* own confirmation UI instead of the provider's modal. Subscribes to the
|
|
433
|
+
* client's co-sign store and loads the pending requests once on mount.
|
|
434
|
+
*/
|
|
435
|
+
declare function useCosign(): UseCosignResult;
|
|
436
|
+
|
|
400
437
|
interface KycModalProps {
|
|
401
438
|
corridorId?: string;
|
|
402
439
|
/** A card provider's steps, in place of a route's. */
|
|
@@ -527,6 +564,16 @@ interface SessionsModalProps {
|
|
|
527
564
|
}
|
|
528
565
|
declare function SessionsModal({ onClose }: SessionsModalProps): react_jsx_runtime.JSX.Element;
|
|
529
566
|
|
|
567
|
+
interface CosignModalProps {
|
|
568
|
+
onClose: () => void;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* The approval prompt of a Turnkey co-signed wallet. Verifies each request
|
|
572
|
+
* against Turnkey before enabling Approve, so the user only ever confirms a
|
|
573
|
+
* transaction the device checked itself.
|
|
574
|
+
*/
|
|
575
|
+
declare function CosignModal({ onClose }: CosignModalProps): react_jsx_runtime.JSX.Element;
|
|
576
|
+
|
|
530
577
|
interface DistributionRulesModalProps {
|
|
531
578
|
onClose: () => void;
|
|
532
579
|
}
|
|
@@ -719,9 +766,23 @@ interface RampWidgetTemplateProps {
|
|
|
719
766
|
onboardingStatus?: 'kyc' | 'endorsement' | 'awaiting_provider' | null;
|
|
720
767
|
/** The gate has since cleared - the user needs a fresh quote to continue. */
|
|
721
768
|
kycJustApproved: boolean;
|
|
769
|
+
/** Superseded by `txHash`, which carries the settlement on any chain; read when `txHash` is absent. */
|
|
722
770
|
stellarTxHash: string | null;
|
|
723
|
-
/**
|
|
771
|
+
/** The on-chain transaction that settled the ramp, on `txChain`. */
|
|
772
|
+
txHash?: string | null;
|
|
773
|
+
/** Chain of `txHash`; Stellar when omitted. */
|
|
774
|
+
txChain?: 'STELLAR' | 'POLYGON' | 'SOLANA' | null;
|
|
775
|
+
/** Explorer URL for the transaction (chain- and network-aware); null when unknown. */
|
|
724
776
|
explorerUrl: string | null;
|
|
777
|
+
/**
|
|
778
|
+
* The user's money is in one of their wallets between two steps of the route.
|
|
779
|
+
* Optional for integrators rendering their own chrome; omitted, the state is
|
|
780
|
+
* not shown.
|
|
781
|
+
*/
|
|
782
|
+
fundsInTransit?: boolean;
|
|
783
|
+
/** A retry of the pending step is in flight. */
|
|
784
|
+
retrying?: boolean;
|
|
785
|
+
onRetryTransit?: () => void;
|
|
725
786
|
depositInstructions: RampDepositInstructions | null;
|
|
726
787
|
canComplete: boolean;
|
|
727
788
|
completing: boolean;
|
|
@@ -746,7 +807,7 @@ interface RampWidgetTemplateProps {
|
|
|
746
807
|
onRefresh: () => void;
|
|
747
808
|
onClose: () => void;
|
|
748
809
|
}
|
|
749
|
-
declare function RampWidgetTemplate({ theme, accentColor, styleOverrides, step, flowSteps, flowStepIndex, startingQuoteId, direction, amount, currency, country, requiredFields, fieldValues, countries, countriesLoading, refreshing, quotes, kycRequired, isLoading, provider, txStatus, kycUrl, tosUrl, kycBlocking, onboardingStatus, kycJustApproved, stellarTxHash, explorerUrl, depositInstructions, canComplete, completing, errorMsg, noticeMsg, onDirectionChange, onAmountChange, onFieldChange, onCountryChange, onFindRoute, onSelectQuote, onVerifyRoute, onContactContinue, onOpenKyc, onOpenTos, onCompleteWithdraw, onBack, onRetry, onRefresh, onClose, }: RampWidgetTemplateProps): react_jsx_runtime.JSX.Element;
|
|
810
|
+
declare function RampWidgetTemplate({ theme, accentColor, styleOverrides, step, flowSteps, flowStepIndex, startingQuoteId, direction, amount, currency, country, requiredFields, fieldValues, countries, countriesLoading, refreshing, quotes, kycRequired, isLoading, provider, txStatus, kycUrl, tosUrl, kycBlocking, onboardingStatus, kycJustApproved, stellarTxHash, txHash, txChain, explorerUrl, fundsInTransit, retrying, onRetryTransit, depositInstructions, canComplete, completing, errorMsg, noticeMsg, onDirectionChange, onAmountChange, onFieldChange, onCountryChange, onFindRoute, onSelectQuote, onVerifyRoute, onContactContinue, onOpenKyc, onOpenTos, onCompleteWithdraw, onBack, onRetry, onRefresh, onClose, }: RampWidgetTemplateProps): react_jsx_runtime.JSX.Element;
|
|
750
811
|
|
|
751
812
|
interface TransactionModalTemplateProps {
|
|
752
813
|
theme: string;
|
|
@@ -861,6 +922,8 @@ interface CustomTrustlineModalTemplateProps {
|
|
|
861
922
|
}) => void;
|
|
862
923
|
}
|
|
863
924
|
|
|
925
|
+
/** The memo types the backend accepts on a Stellar payment. */
|
|
926
|
+
type SendMemoType = 'text' | 'id';
|
|
864
927
|
interface SendModalTemplateProps {
|
|
865
928
|
theme: string;
|
|
866
929
|
accentColor: string;
|
|
@@ -911,6 +974,15 @@ interface SendModalTemplateProps {
|
|
|
911
974
|
onMax: () => void;
|
|
912
975
|
onPaste: () => void;
|
|
913
976
|
onDestinationChange: (value: string) => void;
|
|
977
|
+
/**
|
|
978
|
+
* Optional Stellar memo. The field renders only on Stellar and only when
|
|
979
|
+
* {@link onMemoChange} is passed, so a custom template written before it
|
|
980
|
+
* existed keeps compiling.
|
|
981
|
+
*/
|
|
982
|
+
memo?: string;
|
|
983
|
+
memoType?: SendMemoType;
|
|
984
|
+
onMemoChange?: (value: string) => void;
|
|
985
|
+
onMemoTypeChange?: (type: SendMemoType) => void;
|
|
914
986
|
onSubmit: () => void;
|
|
915
987
|
onSignAndSend: () => void;
|
|
916
988
|
onToggleXdr: () => void;
|
|
@@ -918,7 +990,7 @@ interface SendModalTemplateProps {
|
|
|
918
990
|
onRetry: () => void;
|
|
919
991
|
onDone: () => void;
|
|
920
992
|
}
|
|
921
|
-
declare function SendModalTemplate({ theme, accentColor, styleOverrides, step, txTitle, assets, selectedAsset, selectedChain, canSendOnChain, notReadyReason, chains, onSelectChain, amount, destination, formError, isLoadingBalance, transaction, showXdr, copied, explorerUrl, walletType, showBack, isInProgress, onClose, onBack, onRefresh, onSelectAsset, onAmountChange, onMax, onPaste, onDestinationChange, onSubmit, onSignAndSend, onToggleXdr, onCopyHash, onRetry, onDone, }: SendModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
993
|
+
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;
|
|
922
994
|
|
|
923
995
|
interface SwapAssetOption {
|
|
924
996
|
ref: SwapQuoteParams['sellAsset'];
|
|
@@ -1019,6 +1091,32 @@ interface SessionsModalTemplateProps {
|
|
|
1019
1091
|
}
|
|
1020
1092
|
declare function SessionsModalTemplate({ theme, accentColor, styleOverrides, state, revokingFamilyId, signingOutEverywhere, revokeError, onRefresh, onRevoke, onLogoutEverywhere, onClose, }: SessionsModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1021
1093
|
|
|
1094
|
+
interface CosignModalTemplateProps {
|
|
1095
|
+
theme: string;
|
|
1096
|
+
accentColor: string;
|
|
1097
|
+
/** Per-app modal chrome overrides (background, card + button radius). */
|
|
1098
|
+
styleOverrides?: ModalStyleOverrides;
|
|
1099
|
+
/** Requests waiting for this device's vote, oldest first. */
|
|
1100
|
+
pending: CosignRequest[];
|
|
1101
|
+
/** The request shown in detail; the first pending one when not chosen. */
|
|
1102
|
+
current: CosignRequest | null;
|
|
1103
|
+
/** Verification of `current`, or null while it runs. */
|
|
1104
|
+
verification: CosignVerification | null;
|
|
1105
|
+
busy: 'approving' | 'rejecting' | null;
|
|
1106
|
+
error: string | null;
|
|
1107
|
+
/** Approve stays off for a request whose approval just failed. */
|
|
1108
|
+
approveBlocked?: boolean;
|
|
1109
|
+
/** The last request that reached a final state, shown once the list is empty. */
|
|
1110
|
+
lastResolved?: CosignRequest;
|
|
1111
|
+
/** Explorer page of {@link lastResolved}'s transaction, when it was sent. */
|
|
1112
|
+
explorerUrl?: string | null;
|
|
1113
|
+
onSelect: (request: CosignRequest) => void;
|
|
1114
|
+
onApprove: (request: CosignRequest) => void;
|
|
1115
|
+
onReject: (request: CosignRequest) => void;
|
|
1116
|
+
onClose: () => void;
|
|
1117
|
+
}
|
|
1118
|
+
declare function CosignModalTemplate({ theme, accentColor, styleOverrides, pending, current, verification, busy, error, approveBlocked, lastResolved, explorerUrl, onSelect, onApprove, onReject, onClose, }: CosignModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1119
|
+
|
|
1022
1120
|
interface DistributionRulesModalTemplateProps {
|
|
1023
1121
|
theme: string;
|
|
1024
1122
|
accentColor: string;
|
|
@@ -1034,4 +1132,4 @@ interface DistributionRulesModalTemplateProps {
|
|
|
1034
1132
|
}
|
|
1035
1133
|
declare function DistributionRulesModalTemplate({ theme, accentColor, styleOverrides, state, claimingId, claimErrors, claimedIds, onRefresh, onClaim, onClose, }: DistributionRulesModalTemplateProps): react_jsx_runtime.JSX.Element;
|
|
1036
1134
|
|
|
1037
|
-
export { type AuthModalProps, CardModal, ChainSelect, type ChainSelectProps, type CustomTrustlineModalTemplateProps, DistributionRulesModal, DistributionRulesModalTemplate, EarnModal, EnabledAssetsModal, EnabledAssetsModalTemplate, type EnabledAssetsModalTemplateProps, KycModal, KycModalTemplate, KycStatus, type KycStep, type LoginButtonProps, LoginModalTemplate, type ModalChrome, type ModalStyleOverrides, type ModalVariant, type PollarConfig, PollarProvider, type PollarStyles, ProviderRegistrationModal, type RampStep, RampWidget, RampWidgetTemplate, ReceiveModal, ReceiveModalTemplate, type ReceiveModalTemplateProps, RegistryCheckModal, RequirementFormModal, RouteDisplay, SendModal, SendModalTemplate, type SendModalTemplateProps, SessionsModal, SessionsModalTemplate, type SessionsModalTemplateProps, type SwapAssetOption, SwapModal, SwapModalTemplate, type SwapModalTemplateProps, TransactionModalTemplate, type TransactionModalTemplateProps, TxHistoryModalTemplate, TxStatusView, type TxStatusViewProps, type UseChainsResult, WalletBalanceModal, WalletBalanceModalTemplate, type WalletBalanceModalTemplateProps, WalletButton, WalletButtonTemplate, type WalletButtonTemplateProps, addressForChain, browserPasskeyCeremony, browserPasskeySigner, buildModalCssVars, chainsOf, createPollarAdapterHook, modalChrome, readableTextOn, resolveChain, useChains, usePollar, walletNotReadyReason };
|
|
1135
|
+
export { type AuthModalProps, CardModal, ChainSelect, type ChainSelectProps, CosignModal, CosignModalTemplate, type CosignModalTemplateProps, type CustomTrustlineModalTemplateProps, DistributionRulesModal, DistributionRulesModalTemplate, EarnModal, EnabledAssetsModal, EnabledAssetsModalTemplate, type EnabledAssetsModalTemplateProps, KycModal, KycModalTemplate, KycStatus, type KycStep, type LoginButtonProps, LoginModalTemplate, type ModalChrome, type ModalStyleOverrides, type ModalVariant, type PollarConfig, PollarProvider, type PollarStyles, ProviderRegistrationModal, type RampStep, RampWidget, RampWidgetTemplate, ReceiveModal, ReceiveModalTemplate, type ReceiveModalTemplateProps, RegistryCheckModal, RequirementFormModal, RouteDisplay, 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, buildModalCssVars, chainsOf, createPollarAdapterHook, modalChrome, readableTextOn, resolveChain, useChains, useCosign, usePollar, walletNotReadyReason };
|