import { createCoinbaseWalletSDK } from '@coinbase/wallet-sdk'; import { PublicKeyCredentialCreationOptionsJSON } from '@simplewebauthn/browser'; import { Rpc, SolanaRpcApi, RpcSubscriptions, SolanaRpcSubscriptionsApi } from '@solana/kit'; import { ReactElement, ReactNode } from 'react'; import { Hex } from 'viem'; import { OAuthProviderID, WalletChainType, SmartWalletType, CustomOAuthProviderID, User as User$1, AppResponse, PasskeyAuthenticateRequestBody } from '@privy-io/api-types'; import { CountryCode, Chain, ConnectedStandardSolanaWallet, RpcConfig, ChainLikeWithId } from '@privy-io/js-sdk-core'; import { createBaseAccountSDK } from '@base-org/account'; import { WalletWithFeatures, Wallet as Wallet$1 } from '@wallet-standard/base'; import { SolanaSignMessageFeature, SolanaSignTransactionFeature, SolanaSignAndSendTransactionFeature, SolanaSignInFeature } from '@solana/wallet-standard-features'; import { StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature } from '@wallet-standard/features'; import EventEmitter from 'eventemitter3'; /** * Internationalization strings for Privy UI components. * * Keys follow the pattern: `component.semanticDescription` */ type PrivyI18nStrings = { 'connectionStatus.successfullyConnected': string; 'connectionStatus.errorTitle': string; 'connectionStatus.connecting': string; 'connectionStatus.connectOneWallet': string; 'connectionStatus.checkOtherWindows': string; 'connectionStatus.stillHere': string; 'connectionStatus.tryConnectingAgain': string; 'connectionStatus.or': string; 'connectionStatus.useDifferentLink': string; 'connectWallet.connectYourWallet': string; 'connectWallet.waitingForWallet': string; 'connectWallet.connectToAccount': string; 'connectWallet.installAndConnect': string; 'connectWallet.tryConnectingAgain': string; 'connectWallet.openInApp': string; 'connectWallet.copyLink': string; 'connectWallet.retry': string; 'connectWallet.searchPlaceholder': string; 'connectWallet.noWalletsFound': string; 'connectWallet.lastUsed': string; 'connectWallet.selectYourWallet': string; 'connectWallet.selectNetwork': string; 'connectWallet.goToWallet': string; 'connectWallet.scanToConnect': string; 'connectWallet.openOrInstall': string; }; interface ConnectorEvents { walletsUpdated(): void; initialized(): void; } /** * @hidden * * A WalletConnector is identified by a connectorType and walletClientType. A * connectorType includes injected, wallet_connect, etc. A walletClientType * includes metamask, trustwallet, etc. * * Each WalletConnector manages a list of wallets, identified by an address * and chainId. Each wallet has a connected property indicating its current * connection status, which is determined based on events emitted by the * underlying provider. * * The WalletConnector also emits two events: walletsUpdated and initialized. * The walletsUpdated event is triggered when the list of wallets changes, * while the initialized event is triggered when the WalletConnector is * ready and has successfully executed the syncAccounts() function for * the first time. */ declare abstract class WalletConnector extends EventEmitter { connected: boolean; initialized: boolean; walletClientType: WalletClientType; abstract wallets: (BaseConnectedEthereumWallet | BaseConnectedSolanaWallet)[]; abstract chainType: 'ethereum' | 'solana'; abstract connectorType: ConnectorType; constructor(walletClientType: WalletClientType); abstract isConnected(): Promise; abstract subscribeListeners(): void; abstract unsubscribeListeners(): void; abstract get walletBranding(): WalletBranding; abstract initialize(): Promise; abstract connect(options: { showPrompt?: boolean; chainId?: number; }): Promise; abstract disconnect(): void; abstract promptConnection(walletClientType: WalletClientType): void; } /** * We support a subset of the provider methods found here: * * https://ethereum.org/en/developers/docs/apis/json-rpc/#json-rpc-methods * * For now, we're focused on signing-related methods because the iframe (this code) * is the only place that has access to the private key and thus is the only one * who can create signatures. All other methods do not need the private key and * can therefore be implemented by clients of the iframe. */ declare const SUPPORTED_ETHEREUM_RPC_METHODS: readonly ["eth_sign", "eth_populateTransactionRequest", "eth_signTransaction", "personal_sign", "eth_signTypedData_v4", "csw_signUserOperation", "secp256k1_sign"]; type EthereumRpcMethodType = (typeof SUPPORTED_ETHEREUM_RPC_METHODS)[number]; declare const SUPPORTED_SOLANA_RPC_METHODS: string[]; type SolanaRpcMethodType = (typeof SUPPORTED_SOLANA_RPC_METHODS)[number]; type Quantity = string | number | bigint; type UnsignedTransactionRequest = { from?: string; to?: string; nonce?: Quantity; gasLimit?: Quantity; gasPrice?: Quantity; data?: ArrayLike | string; value?: Quantity; chainId?: number; type?: number; accessList?: Array<{ address: string; storageKeys: Array; }> | Array<[string, Array]> | Record>; maxPriorityFeePerGas?: Quantity; maxFeePerGas?: Quantity; }; type TransactionLog = { blockNumber: number; blockHash: string; transactionIndex: number; removed: boolean; address: string; data: string; topics: Array; transactionHash: string; logIndex: number; }; type TransactionReceipt = { to: string; from: string; contractAddress: string; transactionIndex: number; root?: string; logs: Array; logsBloom: string; blockHash: string; transactionHash: string; blockNumber: number; confirmations: number; byzantium: boolean; type: number; status?: number; gasUsed: string; cumulativeGasUsed: string; effectiveGasPrice?: string; }; interface BaseEthereumRpcRequestType { method: EthereumRpcMethodType; } interface BaseSolanaRpcRequestType { method: SolanaRpcMethodType; } interface eth_populateTransactionRequest extends BaseEthereumRpcRequestType { method: 'eth_populateTransactionRequest'; params: [UnsignedTransactionRequest]; } interface eth_populateTransactionRequestResponse { method: 'eth_populateTransactionRequest'; data: UnsignedTransactionRequest; } interface eth_signTransaction extends BaseEthereumRpcRequestType { method: 'eth_signTransaction'; params: [UnsignedTransactionRequest]; } interface eth_sign extends BaseEthereumRpcRequestType { method: 'eth_sign'; params: [address: string, message: string]; } interface eth_signResponse { method: 'eth_sign'; data: string; } interface personal_sign extends BaseEthereumRpcRequestType { method: 'personal_sign'; params: [string, string]; } interface personal_signResponse { method: 'personal_sign'; data: string; } interface eth_signTransactionResponse { method: 'eth_signTransaction'; data: string; } interface eth_signTypedData_v4 extends BaseEthereumRpcRequestType { method: 'eth_signTypedData_v4'; params: [string, TypedMessage | string]; } interface eth_signTypedData_v4Response { method: 'eth_signTypedData_v4'; data: string; } interface secp256k1_sign extends BaseEthereumRpcRequestType { method: 'secp256k1_sign'; params: [`0x${string}`]; } interface secp256k1_signResponse { method: 'secp256k1_sign'; data: `0x${string}`; } interface solana_signMessage extends BaseSolanaRpcRequestType { method: 'signMessage'; params: { message: string; }; } interface solana_signMessageResponse { method: 'signMessage'; data: { signature: string; }; } type EthereumRpcRequestType = eth_signTransaction | eth_populateTransactionRequest | eth_sign | personal_sign | eth_signTypedData_v4 | secp256k1_sign; type EthereumRpcResponseType = eth_signTransactionResponse | eth_populateTransactionRequestResponse | eth_signResponse | personal_signResponse | eth_signTypedData_v4Response | secp256k1_signResponse; type SolanaRpcRequestType = solana_signMessage; type SolanaRpcResponseType = solana_signMessageResponse; declare abstract class PrivyError extends Error { /** * Privy error type. */ abstract type: string; /** * Original Error object, it the error originated client-side. */ cause?: Error; /** * An optional error code, often included in Privy API responses. */ privyErrorCode?: PrivyErrorCode; /** * @param type Privy error type. * @param message Human-readable message. * @param cause Source of this error. */ protected constructor(message: string, cause?: unknown, privyErrorCode?: PrivyErrorCode); toString(): string; } /** * The PrivyConnector instance threw an exception. */ declare class PrivyConnectorError extends PrivyError { type: string; constructor(message: string, cause?: unknown, privyErrorCode?: PrivyErrorCode); } declare enum PrivyErrorCode { OAUTH_ACCOUNT_SUSPENDED = "oauth_account_suspended", MISSING_OR_INVALID_PRIVY_APP_ID = "missing_or_invalid_privy_app_id", MISSING_OR_INVALID_PRIVY_ACCOUNT_ID = "missing_or_invalid_privy_account_id", MISSING_OR_INVALID_TOKEN = "missing_or_invalid_token", INVALID_DATA = "invalid_data", INVALID_CAPTCHA = "invalid_captcha", LINKED_TO_ANOTHER_USER = "linked_to_another_user", CANNOT_LINK_MORE_OF_TYPE = "cannot_link_more_of_type", FAILED_TO_LINK_ACCOUNT = "failed_to_link_account", FAILED_TO_UPDATE_ACCOUNT = "failed_to_update_account", USER_EXITED_UPDATE_FLOW = "exited_update_flow", ALLOWLIST_REJECTED = "allowlist_rejected", OAUTH_USER_DENIED = "oauth_user_denied", OAUTH_UNEXPECTED = "oauth_unexpected", UNKNOWN_AUTH_ERROR = "unknown_auth_error", USER_EXITED_AUTH_FLOW = "exited_auth_flow", USER_EXITED_LINK_FLOW = "exited_link_flow", USER_EXITED_SET_PASSWORD_FLOW = "user_exited_set_password_flow", MUST_BE_AUTHENTICATED = "must_be_authenticated", UNKNOWN_CONNECT_WALLET_ERROR = "unknown_connect_wallet_error", GENERIC_CONNECT_WALLET_ERROR = "generic_connect_wallet_error", CLIENT_REQUEST_TIMEOUT = "client_request_timeout", INVALID_CREDENTIALS = "invalid_credentials", MISSING_MFA_CREDENTIALS = "missing_or_invalid_mfa", UNKNOWN_MFA_ERROR = "unknown_mfa_error", EMBEDDED_WALLET_ALREADY_EXISTS = "embedded_wallet_already_exists", EMBEDDED_WALLET_NOT_FOUND = "embedded_wallet_not_found", EMBEDDED_WALLET_CREATE_ERROR = "embedded_wallet_create_error", UNKNOWN_EMBEDDED_WALLET_ERROR = "unknown_embedded_wallet_error", EMBEDDED_WALLET_PASSWORD_UNCONFIRMED = "embedded_wallet_password_unconfirmed", EMBEDDED_WALLET_PASSWORD_ALREADY_EXISTS = "embedded_wallet_password_already_exists", EMBEDDED_WALLET_RECOVERY_ALREADY_EXISTS = "embedded_wallet_recovery_already_exists", TRANSACTION_FAILURE = "transaction_failure", UNSUPPORTED_CHAIN_ID = "unsupported_chain_id", NOT_SUPPORTED = "not_supported", CAPTCHA_TIMEOUT = "captcha_timeout", INVALID_MESSAGE = "invalid_message", UNABLE_TO_SIGN = "unable_to_sign", CAPTCHA_FAILURE = "captcha_failure", CAPTCHA_DISABLED = "captcha_disabled", SESSION_STORAGE_UNAVAILABLE = "session_storage_unavailable", TOO_MANY_REQUESTS = "too_many_requests", USER_LIMIT_REACHED = "max_accounts_reached", DISALLOWED_LOGIN_METHOD = "disallowed_login_method", DISALLOWED_PLUS_EMAIL = "disallowed_plus_email", PASSKEY_NOT_ALLOWED = "passkey_not_allowed", USER_DOES_NOT_EXIST = "user_does_not_exist", INSUFFICIENT_BALANCE = "insufficient_balance", ACCOUNT_TRANSFER_REQUIRED = "account_transfer_required", BUFFER_NOT_DEFINED = "buffer_not_defined", UNSUPPORTED_WALLET_TYPE = "unsupported_wallet_type", NO_SOLANA_ACCOUNTS = "no_solana_accounts", UNKNOWN_FUNDING_ERROR = "unknown_funding_error" } declare class WalletTimeoutError extends PrivyConnectorError { type: string; constructor(); } /** * A ProviderRpcError combines the necessary bits of the {PrivyError} with the * EIP-compliant ProviderRpcError. This is meant to be a type around errors raised * by the ethereum provider. */ declare class ProviderRpcError extends PrivyError { type: string; readonly code: number; readonly data?: unknown; constructor(message: string, code: number, data?: unknown); } type ProviderConnectInfo = { chainId: string; }; type OnConnectEventHandler = (connectInfo: ProviderConnectInfo) => void; type OnDisconnectEventHandler = (error: ProviderRpcError) => void; type OnChainChangedEventHandler = (chainId: string | number) => void; type OnAccountsChangedEventHandler = (accounts: string[]) => void; type ProviderMessage = { type: string; data: unknown; }; type OnMessageEventHandler = (message: ProviderMessage) => void; type EIP1193OnEventHandler = OnConnectEventHandler | OnDisconnectEventHandler | OnChainChangedEventHandler | OnAccountsChangedEventHandler | OnMessageEventHandler; interface EIP1193Provider { rpcTimeoutDuration?: number; request: (request: { method: string; params?: Array | undefined; }) => Promise; on: (eventName: string, listener: EIP1193OnEventHandler) => any; removeListener: (eventName: string | symbol, listener: (...args: any[]) => void) => any; } interface RequestArguments { readonly method: string; readonly params?: readonly unknown[] | object | any; } declare global { interface Window { ethereum?: any; } } /** * @hidden * * The PrivyProxyProvider adds a middleware layer on top of the underlying wallet provider. * */ declare class PrivyProxyProvider implements EIP1193Provider { rpcTimeoutDuration: number; walletProvider?: EIP1193Provider; private _subscriptions; constructor(walletProvider?: EIP1193Provider, rpcTimeoutDuration?: number); on(eventName: string, listener: (...args: any[]) => void): any; request(request: { method: string; params?: any[] | undefined; }): Promise; removeListener: (eventName: string | symbol, listener: (...args: any[]) => void) => any; walletTimeout: (error?: WalletTimeoutError, timeoutMs?: number) => Promise; setWalletProvider: (provider: EIP1193Provider) => void; } type BaseAccountSdkCreateParams = Parameters[0]; type BaseAccountSdkType = ReturnType; type SetBaseAccountSdkType = (sdk: BaseAccountSdkType | undefined) => void; /** * Type of all Solana chains supported by Privy. */ type SolanaChain = (typeof SOLANA_CHAINS)[number]; /** * Helper type for defining a Standard Wallet with a union of Solana features. */ type SolanaStandardWallet = WalletWithFeatures<{ 'standard:connect'?: StandardConnectFeature['standard:connect']; 'standard:disconnect'?: StandardDisconnectFeature['standard:disconnect']; 'standard:events'?: StandardEventsFeature['standard:events']; 'solana:signMessage'?: SolanaSignMessageFeature['solana:signMessage']; 'solana:signTransaction'?: SolanaSignTransactionFeature['solana:signTransaction']; 'solana:signAndSendTransaction'?: SolanaSignAndSendTransactionFeature['solana:signAndSendTransaction']; 'solana:signIn'?: SolanaSignInFeature['solana:signIn']; }>; /** * Represents a connection with a single Solana wallet provider. Manages wallet state * including ongoing connection status, and exposes methods for connecting and disconnecting. */ declare class SolanaWalletConnector extends WalletConnector { chainType: "solana"; connectorType: string; wallets: BaseConnectedSolanaWallet[]; private _wallet; private autoConnectEnabled; private _unsubscribeListeners; constructor(wallet: Wallet$1, autoConnectEnabled: boolean); get isInstalled(): boolean; get wallet(): SolanaStandardWallet; /** * Builds a connected wallet object to be exposed to the developer. This object * contains the address and a few helper methods. * * Provider methods share the PrivyProxyProvider instance. This means that multiple * wallets may share the same provider if one wallet was disconnected and another * wallet was connected. * * A wallet is considered connected if it is present in the wallets array and is * in a connected state. * * @hidden */ buildConnectedWallet(): BaseConnectedSolanaWallet[]; /** * @hidden */ syncAccounts(): Promise; /** * @hidden */ get walletBranding(): WalletBranding; /** * @hidden */ initialize(): Promise; /** * @hidden */ connect(options: { showPrompt: boolean; }): Promise; /** * @hidden */ disconnect: () => Promise; /** * @hidden */ promptConnection: () => Promise; protected onChange: () => void; /** * Get the most recently connected wallet. * * @hidden */ getConnectedWallet(): Promise; /** * We depend on the adapter to manage the connection state. We consider a wallet * connected if the adapter is connected and its readyState is 'Installed'. * * @hidden */ isConnected(): Promise; /** * @hidden */ subscribeListeners(): void; /** * @hidden */ unsubscribeListeners(): void; private shouldAttemptAutoConnect; } interface SolanaWalletConnectorsOptions { shouldAutoConnect?: boolean; } /** * Plugin object to add solana support to the Privy SDK */ type SolanaWalletConnectorsConfig = { /** * Creates listeners for when solana wallets are registered or unregistered */ onMount: () => void; /** * Remove listener registered by `onMount` */ onUnmount: () => void; /** * Get all Wallets that have been registered, converted to `SolanaWalletConnectors`. */ get: () => SolanaWalletConnector[]; }; /** * Wraps the wallet detection logic found in `@solana/wallet-standard-wallet-adapter-base` * and `@wallet-standard-app`. Returns a `SolanaWalletConnectors` object to be used with the `PrivyProvider`. * * @param {SolanaWalletConnectorsOptions} args Configuration object * @param {boolean} args.shouldAutoConnect Whether to automatically connect to the wallet. * Defaults to `true` and should not prompt the user loudly for connection. However, some legacy * adapters may still auto-connect loudly, so this flag can be used to disable that behavior. */ declare const toSolanaWalletConnectors: (args?: SolanaWalletConnectorsOptions) => SolanaWalletConnectorsConfig; /** * Accepted payment methods for the MoonPay fiat on-ramp. */ type MoonpayPaymentMethod = 'ach_bank_transfer' | 'credit_debit_card' | 'gbp_bank_transfer' | 'gbp_open_banking_payment' | 'mobile_wallet' | 'sepa_bank_transfer' | 'sepa_open_banking_payment' | 'pix_instant_payment' | 'yellow_card_bank_transfer'; type MoonpayUiConfig = { accentColor?: string; theme?: 'light' | 'dark'; }; /** * Cryptocurrency codes for the MoonPay fiat on-ramp. These codes * follow the format {TOKEN_NAME}_{NETWORK_NAME}. */ type MoonpayCurrencyCode = 'AVAX_CCHAIN' | 'CELO_CELO' | 'CUSD_CELO' | 'DAI_ETHEREUM' | 'ETH_ETHEREUM' | 'ETH_ARBITRUM' | 'ETH_POLYGON' | 'ETH_BASE' | 'FIL_FVM' | 'MATIC_ETHEREUM' | 'MATIC_POLYGON' | 'POL_POLYGON' | 'POL_ETHEREUM' | 'USDC_ETHEREUM' | 'USDC_ARBITRUM' | 'USDC_OPTIMISM' | 'USDC_POLYGON' | 'USDC_BASE' | 'USDC_CCHAIN' | 'USDT_ETHEREUM' | 'USDT_POLYGON' | 'WETH_POLYGON' | 'WBTC_ETHEREUM' | 'BNB_BNB' | 'BNB_BSC' | 'MON_MON' | 'SOL' | 'USDC_SOL'; /** * Configuration parameter for the MoonPay fiat on-ramp. */ type MoonpayConfig = { currencyCode?: MoonpayCurrencyCode; quoteCurrencyAmount?: number; paymentMethod?: MoonpayPaymentMethod; uiConfig?: MoonpayUiConfig; }; type MoonpaySignRequest = { address: string; config: MoonpayConfig; useSandbox: boolean; }; type MoonpaySignResponse = { signedUrl: string; externalTransactionId: string; }; declare const DEFAULT_BICONOMY_PAYMASTER_CONTEXT: { mode: string; calculateGasLimits: boolean; expiryDuration: number; sponsorshipInfo: { webhookData: {}; smartAccountInfo: { name: string; version: string; }; }; }; type BiconomyPaymasterContext = typeof DEFAULT_BICONOMY_PAYMASTER_CONTEXT; type AlchemyPaymasterContextClient = { policyId: string; }; /** * Plugin that keeps user state in sync across browser tabs using BroadcastChannel. * * @experimental This plugin is experimental and may change or be removed in future versions. */ type CrossTabUserSyncPlugin = { readonly id: typeof CROSS_TAB_USER_SYNC_PLUGIN_ID; }; /** * Creates a cross-tab user sync plugin. * * @experimental This plugin is experimental and may change or be removed in future versions. * * @param options.channelId - A unique channel ID for your app. * * @example * ```tsx * createCrossTabUserSyncPlugin({ * channelId: process.env.NEXT_PUBLIC_PRIVY_SYNC_CHANNEL_ID * }) * ``` */ declare function createCrossTabUserSyncPlugin(options: { channelId: string; }): CrossTabUserSyncPlugin; /** * Plugin that adds data suffix support to the SDK. */ type DataSuffixPlugin = { readonly id: typeof DATA_SUFFIX_PLUGIN_ID; /** * Appends a data suffix to transaction data. * * @param opts.data - The current transaction data (if any) * @returns The transaction data with the suffix appended */ appendDataSuffix: (opts: { data: Hex; }) => Hex; }; /** * Creates a data suffix plugin instance with the configured suffix. * * @param suffix - The hex suffix to append to transaction data (with or without '0x' prefix). * Must be valid hex data. * @returns A plugin instance that transforms transaction data. * @throws {Error} If the suffix is not valid hex. */ declare function createDataSuffixPlugin(suffix: string): DataSuffixPlugin; /** * Plugin that overrides automatic embedded wallet creation (createOnLogin config). * * When present, the plugin's `shouldCreateWallet` predicate fully overrides the app's * createOnLogin setting: `true` = create wallet(s), `false` = do not create. * When the plugin is not registered, the default createOnLogin logic is used. * * @experimental This plugin is experimental and may change or be removed in future versions. */ type WalletCreationFilterPlugin = { readonly id: typeof WALLET_CREATION_ON_LOGIN_PLUGIN_ID; /** * Override for whether to create embedded wallet(s) for this user. * When the plugin is active, this replaces the createOnLogin config. */ shouldCreateWallet: ({ user }: { user: User; }) => boolean; }; /** * Creates a plugin that overrides automatic embedded wallet creation based on a * user-defined predicate. * * When the plugin is registered, it overrides the app's createOnLogin config: * - `shouldCreateWallet({ user }) === true` → create embedded wallet(s) for this user * - `shouldCreateWallet({ user }) === false` → do not create * * @experimental This plugin is experimental and may change or be removed in future versions. * * @param options.shouldCreateWallet Predicate receiving `{ user }`; true = create, false = do not create (overrides createOnLogin). * * @example * ```tsx * const walletCreationPlugin = createWalletCreationOnLoginPlugin({ * shouldCreateWallet: ({ user }) => * user.customMetadata?.['alchemy_org_id'] === undefined, * }); * * ``` */ declare function createWalletCreationOnLoginPlugin(options: { shouldCreateWallet: ({ user }: { user: User; }) => boolean; }): WalletCreationFilterPlugin; type CustomMetadataType = User$1['custom_metadata']; declare const SUPPORTED_RECOVERY_PROVIDERS: readonly ["google-drive", "icloud"]; declare const SUPPORTED_MFA_METHODS: readonly ["sms", "totp", "passkey"]; type MfaMethod = (typeof SUPPORTED_MFA_METHODS)[number]; type MfaSubmitArgs = { mfaMethod: MfaMethod; mfaCode: string | PasskeyAuthenticateRequestBody['authenticator_response']; relyingParty: string; }; type EntropyIdVerifier = 'ethereum-address-verifier' | 'solana-address-verifier'; /** * Supported OAuth providers for the recovery flow. Can be `'google-drive'` */ type RecoveryProviderType = (typeof SUPPORTED_RECOVERY_PROVIDERS)[number]; type LoginMethod = 'email' | 'sms' | 'siwe' | 'siws' | 'farcaster' | OAuthProviderID | 'passkey' | 'telegram' | 'custom' | 'guest'; type LoginWithCode = { /** * One-time password _([OTP](https://en.wikipedia.org/wiki/One-time_password))_ that was sent to user during first login step */ code: string; }; declare const EMBEDDED_WALLET_CLIENT_TYPES: readonly ["privy"]; type EmbeddedWalletClientType = (typeof EMBEDDED_WALLET_CLIENT_TYPES)[number]; declare const INJECTED_WALLET_CLIENT_TYPES: readonly ["metamask", "phantom", "brave_wallet", "rainbow", "uniswap_wallet_extension", "uniswap_extension", "rabby_wallet", "bybit_wallet", "ronin_wallet", "haha_wallet", "crypto.com_wallet_extension", "crypto.com_onchain", "binance", "bitget_wallet"]; type InjectedWalletClientType = (typeof INJECTED_WALLET_CLIENT_TYPES)[number]; declare const COINBASE_WALLET_CLIENT_TYPES: readonly ["coinbase_wallet", "coinbase_smart_wallet", "base_account"]; type CoinbaseWalletClientType = (typeof COINBASE_WALLET_CLIENT_TYPES)[number]; type WalletConnectWalletClientType = (typeof WALLET_CONNECT_WALLET_CLIENT_TYPES)[number]; declare const UNKNOWN_WALLET_CLIENT_TYPES: readonly ["unknown"]; type UnknownWalletClientType = (typeof UNKNOWN_WALLET_CLIENT_TYPES)[number]; declare const SOLANA_WALLET_CLIENT_TYPES: readonly ["phantom", "solflare", "glow", "backpack", "jupiter", "mobile_wallet_adapter"]; type SolanaWalletClientType = (typeof SOLANA_WALLET_CLIENT_TYPES)[number]; type WalletClientType = InjectedWalletClientType | CoinbaseWalletClientType | WalletConnectWalletClientType | EmbeddedWalletClientType | UnknownWalletClientType | SolanaWalletClientType; declare const SUPPORTED_CONNECTOR_TYPES: string[]; type ConnectorType = (typeof SUPPORTED_CONNECTOR_TYPES)[number]; /** * Wallet metadata currently for internal use only */ type WalletBranding = { name: string; id: string; icon?: string | EmbeddedSVG; }; type LinkedAccountType = 'wallet' | 'smart_wallet' | 'email' | 'phone' | 'google_oauth' | 'twitter_oauth' | 'discord_oauth' | 'github_oauth' | 'spotify_oauth' | 'instagram_oauth' | 'tiktok_oauth' | 'line_oauth' | 'twitch_oauth' | 'linkedin_oauth' | 'apple_oauth' | 'custom_auth' | 'farcaster' | 'passkey' | 'telegram' | 'cross_app' | 'authorization_key' | CustomOAuthProviderID | 'guest'; /** @ignore */ interface LinkMetadata { /** Account type, most commonly useful when filtering through linkedAccounts */ type: LinkedAccountType; /** Datetime when this account was linked to the user. */ firstVerifiedAt: Date | null; /** Datetime when this account was most recently used as a login/link method by the user. */ latestVerifiedAt: Date | null; } /** * Config for preferred credit card provider. We will default to using this method first if available. */ type PreferredCardProvider = 'coinbase' | 'moonpay'; /** * Configuration for the funding flow UIs. */ type FundingUiConfig = { receiveFundsTitle?: string; receiveFundsSubtitle?: string; landing?: { title?: string; }; }; /** * Configuration for Solana funding */ type SolanaFundingConfig = { /** The chain used for connections */ chain?: SolanaChain; /** The default amount in SOL */ amount?: string; /** The default funding method */ defaultFundingMethod?: DefaultFundingMethod; card?: { /** The preferred card provider for funding */ preferredProvider?: PreferredCardProvider; }; /** Customization for the funding UIs */ uiConfig?: FundingUiConfig; /** The asset to fund with */ asset?: 'native-currency' | 'USDC'; }; /** * Configuration for native funding amount. */ type NativeFundingConfig = { chain?: ChainLikeWithId; amount?: string; defaultFundingMethod?: DefaultFundingMethod; card?: { /** The preferred card onramp for funding */ preferredProvider?: PreferredCardProvider; }; /** Customization for the funding UIs */ uiConfig?: FundingUiConfig; } | { chain?: ChainLikeWithId; amount: string; asset: { erc20: Hex; } | 'USDC' | 'native-currency'; defaultFundingMethod?: DefaultFundingMethod; card?: { /** The preferred card onramp for funding */ preferredProvider?: PreferredCardProvider; }; /** Customization for the funding UIs */ uiConfig?: FundingUiConfig; }; /** * Optional configuration parameter for the fiat on-ramp. */ type FundWalletConfig = NativeFundingConfig; /** * Status of a funding transaction */ type FundingStatus = 'completed' | 'cancelled'; /** * Result returned when fundWallet() promise resolves */ interface FundingResult { /** * Status of the funding transaction */ status: FundingStatus; /** * Wallet address that was funded */ address: string; /** * Method used to fund the wallet */ fundingMethod: FundingMethod | undefined; /** * Transaction hash (if available from on-chain transfer or fiat provider) */ transactionHash?: string; /** * Amount transferred */ amount?: string; /** * Asset type transferred (e.g., 'Ether', 'USDC') */ assetType?: string; /** * Additional provider-specific metadata */ metadata?: { /** Type of wallet used (e.g., 'metamask', 'rainbow', 'phantom') */ walletClientType?: string; }; } /** * Possible methods of user-driven recovery. * This is set, per app, on the server. */ type UserRecoveryMethod = 'user-passcode' | RecoveryProviderType; /** * Object representation of a user's wallet. */ interface Wallet { /** The server wallet ID of the wallet. Null if the wallet is not delegated. Only applies to embedded wallets (`walletClientType === 'privy'` or `walletClientType === 'privy-v2'`). */ id?: string | null; /** The wallet address. */ address: string; /** * Chain type of the wallet address. */ chainType: WalletChainType; /** * The wallet client used for this wallet during the most recent verification. * * If the value is `privy`, then this is a privy embedded wallet. * * Other values include but are not limited to `metamask`, `rainbow`, `coinbase_wallet`, etc. */ walletClientType?: string; /** * The connector type used for this wallet during the most recent verification. * * This includes but is not limited to `injected`, `wallet_connect`, `coinbase_wallet`, `embedded`. */ connectorType?: string; /** * If this is a 'privy' embedded wallet, stores the recovery method: * * 1. 'privy': privy escrow of the recovery material * 2. 'user-passcode': recovery protected by user-input passcode */ recoveryMethod?: RecoveryMethod; /** Whether the wallet is imported. Only applies to embedded wallets (`walletClientType === 'privy'` or `walletClientType === 'privy-v2'`). */ imported: boolean; /** Whether the wallet is delegated. Only applies to embedded wallets (`walletClientType === 'privy'` or `walletClientType === 'privy-v2'`). */ delegated: boolean; /** HD index for the wallet. Only applies to embedded wallets (`walletClientType === 'privy'` or `walletClientType === 'privy-v2'`). */ walletIndex: number | null; /** Public key for the wallet. Only applies to tier 2 chains */ publicKey?: string; } /** * * Object representation of a base connected wallet from a wallet connector. */ interface BaseConnectedSolanaWallet extends BaseConnectedWallet { type: 'solana'; provider: ConnectedStandardSolanaWallet; } /** * Union type of all possible base connected wallets. */ type BaseConnectedWalletType = BaseConnectedEthereumWallet | BaseConnectedSolanaWallet; /** * Object representation of metadata reported by a connected wallet from a wallet connector */ interface ConnectedWalletMetadata { /** The wallet name (e.g. MetaMask). */ name: string; /** The wallet RDNS, falls back to the wallet name if none is available. */ id: string; /** The wallet logo */ icon?: string; } /** * Object representation of a base connected wallet from a wallet connector. */ interface BaseConnectedWallet { type: 'ethereum' | 'solana'; /** The wallet address. */ address: string; /** The first time this wallet was connected without break. */ connectedAt: number; /** * The wallet client where this key-pair is stored. * e.g. metamask, rainbow, coinbase_wallet, etc. */ walletClientType: WalletClientType; /** * The connector used to initiate the connection with the wallet client. * e.g. injected, wallet_connect, coinbase_wallet, etc. */ connectorType: ConnectorType; /** Whether the wallet is imported. */ imported: boolean; /** * Metadata for the wallet. */ meta: ConnectedWalletMetadata; /** Returns true if the wallet is connected, false otherwise */ isConnected: () => Promise; /** * @experimental **Experimental**: This property is subject to change at any time. * * Not all wallet clients support programmatic disconnects (e.g. MetaMask, Phantom). * In kind, if the wallet's client does not support programmatic disconnects, * this method will no-op. */ disconnect: () => void; } /** * Object representation of a base connected Ethereum wallet from a wallet connector. */ interface BaseConnectedEthereumWallet extends BaseConnectedWallet { type: 'ethereum'; /** The current chain ID with CAIP-2 formatting. */ chainId: string; /** * Switch the network chain to a specified ID. * Note: The chainId must be a supported network: https://docs.privy.io/guide/frontend/embedded/networks * Note: This will not update any existing provider instances, re-request `wallet.getEthereumProvider` (e.g.) * to get a provider with the updated chainId. * * @param targetChainId The specified chain ID to switch to, as a number or 0x prefixed string. * @returns void */ switchChain: (targetChainId: `0x${string}` | number) => Promise; /** Helper methods to build providers for interfacing with this wallet. */ getEthereumProvider: () => Promise; /** * Perform personal_sign with the user's wallet. * * @param {string} message The message to sign. * @returns {string} The resulting signature. */ sign: (message: string) => Promise; } interface PrivyConnectedWallet { /** True if this wallet is linked to the authenticated user. False if it is not yet linked or * the user has not yet authenticated. */ linked: boolean; /** Login with this wallet or link this wallet to the authenticated user. * * Throws a PrivyClientError if the wallet is not connected. */ loginOrLink: () => Promise; /** Unlink this wallet to the authenticated user. Throws a PrivyClientError if the user is not * authenticated. */ unlink: () => Promise; /** The HD wallet index */ walletIndex?: number; } /** * Object representation of a connected wallet, with additional Privy flows */ interface ConnectedWallet extends BaseConnectedEthereumWallet, PrivyConnectedWallet { /** * Prompt the user to go through the funding flow and for the connected wallet. * * This will open the modal with a prompt for the user to select a funding method (if multiple are enabled). * * Once the user continues to the funding flow, Privy will display the funding status screen, and wait * for the transaction to complete. * * Note: Even after a successful funding, funds can take a few minutes to arrive in the user's wallet. * * Privy currently supports funding via external wallets and Moonpay. * * @param {FundWalletConfig} fundWalletConfig Funding configuration to specify chain and funding amount (if enabled) * **/ fund: (fundWalletConfig?: FundWalletConfig) => Promise; } /** * Object representation of a smart wallet. */ interface SmartWallet { /** The wallet address. */ address: string; /** The provider of the smart wallet. */ smartWalletType: SmartWalletType; /** The version of the smart wallet. */ smartWalletVersion?: string; } /** Object representation of a user's email. */ interface Email { /** The email address. */ address: string; } /** Object representation of a user's phone number. */ interface Phone { /** The phone number. */ number: string; } /** Object representation of a user's Google account. */ interface Google { /** The `sub` claim from the Google-issued JWT for this account. */ subject: string; /** The email associated with the Google account. */ email: string; /** The name associated with the Google account. */ name: string | null; } /** Object representation of a user's Twitter account. */ interface Twitter { /** The `sub` claim from the Twitter-issued JWT for this account. */ subject: string; /** The username associated with the Twitter account. */ username: string | null; /** The name associated with the Twitter account. */ name: string | null; /** The profile picture URL associated with the Twitter account. * Note that the Twitter image URL returned is appended with `_normal` * to return a 48x48px image. In order to retrieve the original-sized image, * remove the `_normal` from the URL as specified in the Twitter API docs: * https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/user-profile-images-and-banners */ profilePictureUrl: string | null; } /** Object representation of a user's Discord account. */ interface Discord { /** The `sub` claim from the Discord-issued JWT for this account. */ subject: string; /** The username associated with the Discord account. */ username: string | null; /** The email associated with the Discord account. */ email: string | null; } /** Object representation of a user's Github account. */ interface Github { /** The `sub` claim from the Github-issued JWT for this account. */ subject: string; /** The username associated with the Github account. */ username: string | null; /** The name associated with the Github account. */ name: string | null; /** The email associated with the Github account. */ email: string | null; } /** Object representation of a user's Spotify account. */ interface Spotify { /** The user id associated with the Spotify account. */ subject: string; /** The email associated with the Spotify account. */ email: string | null; /** The display name associated with the Spotify account. */ name: string | null; } /** Object representation of a user's Instagram account. */ interface Instagram { /** The user id associated with the Instagram account. */ subject: string; /** The username associated with the Instagram account. */ username: string | null; } /** Object representation of a user's Tiktok account. */ interface Tiktok { /** The `sub` claim from the Tiktok-issued JWT for this account. */ subject: string; /** The username associated with the Tiktok account. */ username: string | null; /** The display name associated with the Tiktok account. */ name: string | null; } /** Object representation of a user's Line account. */ interface Line { /** The `sub` claim from the Line-issued JWT for this account. */ subject: string; /** The name associated with the Line account. */ name: string | null; /** The email associated with the Line account. */ email: string | null; /** The profile image URL associated with the Line account. */ profilePictureUrl: string | null; } /** Object representation of a user's Twitch account. */ interface Twitch { /** The unique identifier for the Twitch account. */ subject: string; /** The username associated with the Twitch account. */ username: string | null; } /** Object representation of a user's LinkedIn account. */ interface LinkedIn { /** The `sub` claim from the LinkedIn-issued JWT for this account. */ subject: string; /** The name associated with the LinkedIn account. */ name: string | null; /** The email associated with the LinkedIn account. */ email: string | null; /** The vanityName/profile URL associated with the LinkedIn account. */ vanityName: string | null; } /** Object representation of a user's Apple account. */ interface Apple { /** The `sub` claim from the Apple-issued JWT for this account. */ subject: string; /** The email associated with the Apple account. */ email: string; } /** Object representation of a user's Custom OAuth Account. */ interface CustomOAuth { /** The `sub` claim from the Custom OAuth-issued JWT for this account. */ subject: string; /** The name associated with the Custom OAuth account. */ name: string | null; /** The username associated with the Custom OAuth account. */ username: string | null; /** The email associated with the Custom OAuth account. */ email: string | null; /** The profile picture URL associated with the Custom OAuth account. */ profilePictureUrl: string | null; } interface CustomJwtAccount { /** The user ID given by the custom auth provider */ customUserId: string; } interface Farcaster { /** The Farcaster on-chain FID */ fid: number | null; /** The Farcaster ethereum address that owns the FID */ ownerAddress: string; /** The Farcaster protocol username */ username: string | null; /** The Farcaster protocol display name */ displayName: string | null; /** The Farcaster protocol bio */ bio: string | null; /** The Farcaster protocol profile picture */ pfp: string | null; /** The Farcaster protocol profile url */ url: string | null; /** The public key of the signer, if set. This is not guaranteed to be valid, as the user can revoke the key at any time */ signerPublicKey: string | null; } interface Telegram { /** The user ID that owns this Telegram account. */ telegramUserId: string; /** The first name of the user . */ firstName: string | null; /** The last name of the user . */ lastName: string | null; /** The username associated with the Telegram account. */ username: string | null; /** The url of the user's profile picture. */ photoUrl: string | null; } interface Passkey { /** The passkey credential ID */ credentialId: string; /** The passkey public key (base64 encoded) */ publicKey?: string; /** Whether or not this passkey can be used for MFA */ enrolledInMfa: boolean; /** The type of authenticator holding the passkey */ authenticatorName?: string; /** Metadata about the device that registered the passkey */ createdWithDevice?: string; /** Metadata about the OS that registered the passkey */ createdWithOs?: string; /** Metadata about the browser that registered the passkey */ createdWithBrowser?: string; } /** Metadata about the provider app for a cross-app account */ interface ProviderAppMetadata { /** Privy app ID for the provider app. */ id: string; /** Name for the provider app. */ name?: string; /** Logo URL for the provider app. */ logoUrl?: string; } interface CrossAppAccount { /** The user's embedded wallet address(es) from the provider app */ embeddedWallets: { address: string; }[]; smartWallets: { address: string; }[]; providerApp: ProviderAppMetadata; subject: string; } /** Object representation of a user's email, with additional metadata for advanced use cases. */ interface EmailWithMetadata extends LinkMetadata, Email { /** Denotes that this is an email account. */ type: 'email'; } /** Object representation of a user's phone number, with additional metadata for advanced use cases. */ interface PhoneWithMetadata extends LinkMetadata, Phone { /** Denotes that this is a phone account. */ type: 'phone'; } /** Object representation of a user's wallet, with additional metadata for advanced use cases. */ interface WalletWithMetadata extends LinkMetadata, Wallet { /** Denotes that this is a wallet account. */ type: 'wallet'; } interface SmartWalletWithMetadata extends LinkMetadata, SmartWallet { /** Denotes that this is a smart wallet account. */ type: 'smart_wallet'; } /** Object representation of an HD embedded wallet with a defined `walletIndex` */ type HDWalletWithMetadata = WalletWithMetadata & { walletIndex: number; }; /** Object representation of a user's Google Account, with additional metadata for advanced use cases. */ interface GoogleOAuthWithMetadata extends LinkMetadata, Google { /** Denotes that this is a Google account. */ type: 'google_oauth'; } /** Object representation of a user's Twitter Account, with additional metadata for advanced use cases. */ interface TwitterOAuthWithMetadata extends LinkMetadata, Twitter { /** Denotes that this is a Twitter account. */ type: 'twitter_oauth'; } /** Object representation of a user's Discord Account, with additional metadata for advanced use cases. */ interface DiscordOAuthWithMetadata extends LinkMetadata, Discord { /** Denotes that this is a Discord account. */ type: 'discord_oauth'; } /** Object representation of a user's Github Account, with additional metadata for advanced use cases. */ interface GithubOAuthWithMetadata extends LinkMetadata, Github { /** Denotes that this is a Github account. */ type: 'github_oauth'; } /** Object representation of a user's Spotify Account, with additional metadata for advanced use cases. */ interface SpotifyOAuthWithMetadata extends LinkMetadata, Spotify { /** Denotes that this is a Spotify account. */ type: 'spotify_oauth'; } /** Object representation of a user's Instagram Account, with additional metadata for advanced use cases. */ interface InstagramOAuthWithMetadata extends LinkMetadata, Instagram { /** Denotes that this is a Instagram account. */ type: 'instagram_oauth'; } /** Object representation of a user's Tiktok Account, with additional metadata for advanced use cases. */ interface TiktokOAuthWithMetadata extends LinkMetadata, Tiktok { /** Denotes that this is a Tiktok account. */ type: 'tiktok_oauth'; } /** Object representation of a user's Line Account, with additional metadata for advanced use cases. */ interface LineOAuthWithMetadata extends LinkMetadata, Line { /** Denotes that this is a Line account. */ type: 'line_oauth'; } /** Object representation of a user's Twitch Account, with additional metadata for advanced use cases. */ interface TwitchOAuthWithMetadata extends LinkMetadata, Twitch { /** Denotes that this is a Twitch account. */ type: 'twitch_oauth'; } /** Object representation of a user's LinkedIn Account, with additional metadata for advanced use cases. */ interface LinkedInOAuthWithMetadata extends LinkMetadata, LinkedIn { /** Denotes that this is a LinkedIn account. */ type: 'linkedin_oauth'; } /** Object representation of a user's Apple Account, with additional metadata for advanced use cases. */ interface AppleOAuthWithMetadata extends LinkMetadata, Apple { /** Denotes that this is a Apple account. */ type: 'apple_oauth'; } /** Object representation of a user's Custom OAuth Account, with additional metadata for advanced use cases. */ interface CustomOAuthWithMetadata extends LinkMetadata, CustomOAuth { /** Denotes that this is a Custom OAuth account. */ type: CustomOAuthProviderID; } /** Object representation of a user's Custom JWT Account, with additional metadata for advanced use cases. */ interface CustomJwtAccountWithMetadata extends LinkMetadata, CustomJwtAccount { /** Denotes that this is an custom account. */ type: 'custom_auth'; } /** Object representation of a user's Farcaster Account, with additional metadata for advanced use cases. */ interface FarcasterWithMetadata extends LinkMetadata, Farcaster { /** Denotes that this is a Farcaster account. */ type: 'farcaster'; } /** Object representation of a user's Passkey Account, with additional metadata for advanced use cases. */ interface PasskeyWithMetadata extends LinkMetadata, Passkey { /** Denotes that this is a Passkey account. */ type: 'passkey'; } /** Object representation of a user's Telegram Account, with additional metadata for advanced use cases. */ interface TelegramWithMetadata extends LinkMetadata, Telegram { /** Denotes that this is a Telegram account. */ type: 'telegram'; } /** Object representation of a user's cross-app account, with additional metadata for advanced use cases. */ interface CrossAppAccountWithMetadata extends LinkMetadata, CrossAppAccount { /** Denotes that this is a cross-app account */ type: 'cross_app'; } /** * Object representation of a user's linked accounts */ type LinkedAccountWithMetadata = WalletWithMetadata | SmartWalletWithMetadata | EmailWithMetadata | PhoneWithMetadata | GoogleOAuthWithMetadata | TwitterOAuthWithMetadata | DiscordOAuthWithMetadata | GithubOAuthWithMetadata | SpotifyOAuthWithMetadata | InstagramOAuthWithMetadata | TiktokOAuthWithMetadata | LineOAuthWithMetadata | TwitchOAuthWithMetadata | LinkedInOAuthWithMetadata | AppleOAuthWithMetadata | CustomOAuthWithMetadata | CustomJwtAccountWithMetadata | FarcasterWithMetadata | PasskeyWithMetadata | TelegramWithMetadata | CrossAppAccountWithMetadata; interface User { /** The Privy-issued DID for the user. If you need to store additional information * about a user, you can use this DID to reference them. */ id: string; /** The datetime of when the user was created. */ createdAt: Date; /** The user's email address, if they have linked one. It cannot be linked to another user. */ email?: Email; /** The user's phone number, if they have linked one. It cannot be linked to another user. */ phone?: Phone; /** The user's first verified wallet, if they have linked at least one wallet. * It cannot be linked to another user. **/ wallet?: Wallet; /** * The user's smart wallet, if they have set up through the Privy Smart Wallet SDK. */ smartWallet?: SmartWallet; /** The user's Google account, if they have linked one. It cannot be linked to another user. */ google?: Google; /** The user's Twitter account, if they have linked one. It cannot be linked to another user. */ twitter?: Twitter; /** The user's Discord account, if they have linked one. It cannot be linked to another user. */ discord?: Discord; /** The user's Github account, if they have linked one. It cannot be linked to another user. */ github?: Github; /** The user's Spotify account, if they have linked one. It cannot be linked to another user. */ spotify?: Spotify; /** The user's Instagram account, if they have linked one. It cannot be linked to another user. */ instagram?: Instagram; /** The user's Tiktok account, if they have linked one. It cannot be linked to another user. */ tiktok?: Tiktok; /** The user's Line account, if they have linked one. It cannot be linked to another user. */ line?: Line; /** The user's Twitch account, if they have linked one. It cannot be linked to another user. */ twitch?: Twitch; /** The user's LinkedIn account, if they have linked one. It cannot be linked to another user. */ linkedin?: LinkedIn; /** The user's Apple account, if they have linked one. It cannot be linked to another user. */ apple?: Apple; /** The user's Farcaster account, if they have linked one. It cannot be linked to another user. */ farcaster?: Farcaster; /** The user's Telegram account, if they have linked one. It cannot be linked to another user. */ telegram?: Telegram; /** The list of accounts associated with this user. Each account contains additional metadata * that may be helpful for advanced use cases. */ linkedAccounts: Array; /** The list of MFA Methods associated with this user. */ mfaMethods: Array; /** * Whether or not the user has explicitly accepted the Terms and Conditions * and/or Privacy Policy */ hasAcceptedTerms: boolean; /** Whether or not the user is a guest */ isGuest: boolean; /** Custom metadata field for a given user account */ customMetadata?: CustomMetadataType; } type OAuthTokens = { /** The OAuth provider. */ provider: OAuthProviderID; /** The OAuth access token. */ accessToken: string; /** The number of seconds until the OAuth access token expires. */ accessTokenExpiresInSeconds?: number; /** The OAuth refresh token. */ refreshToken?: string; /** The number of seconds until the OAuth refresh token expires. * if the refresh token is present and this field is undefined, it is assumed * that the refresh token does not have an expiration date */ refreshTokenExpiresInSeconds?: number; /** The list of OAuth scopes the access token is approved for. */ scopes?: string[]; }; type FundingMethod = 'moonpay' | 'coinbase-onramp' | 'external'; /** The default funding method to immediately trigger when funding is requested */ type DefaultFundingMethod = 'card' | 'exchange' | 'wallet' | 'manual'; type HexColor = `#${string}`; /** * Options to customize the display of transaction prices in the embedded wallet's transaction prompt. */ type PriceDisplayOptions = { primary: 'fiat-currency'; secondary: 'native-token'; } | { primary: 'native-token'; secondary: null; }; type WalletListEntry = 'metamask' | 'coinbase_wallet' | 'base_account' | 'rainbow' | 'phantom' | 'zerion' | 'cryptocom' | 'uniswap' | 'okx_wallet' | 'universal_profile' /** @deprecated Use `detected_ethereum_wallets` or `detected_solana_wallets` instead */ | 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'wallet_connect_qr' | 'wallet_connect_qr_solana' /** @deprecated rabby_wallet is no longer supported */ | 'rabby_wallet' | 'bybit_wallet' | 'ronin_wallet' | 'haha_wallet' | 'safe' | 'solflare' | 'backpack' | 'jupiter' | 'binance' | 'binanceus' | 'bitget_wallet' | 'kraken_wallet'; type NonEmptyArray = [T, ...T[]]; type LoginMethodOrderOption = 'email' | 'sms' | WalletListEntry | OAuthProviderID | `privy:${string}` | 'farcaster' | 'telegram'; type ExternalWalletsConfig = { /** * Options to configure connections to the Coinbase Wallet (browser extension wallet, mobile wallet, and * passkey-based smart wallet). * * @experimental This is an experimental config designed to give Privy developers a way to test the Coinbase Smart Wallet * ahead of its mainnet launch. The smart wallet currently only supports the Base Sepolia testnet. In kind, DO NOT use this * configuration in production as it will prevent users from using the Coinbase Wallet on networks other than Base Sepolia. */ coinbaseWallet?: { /** * Allows you to override the default configuration options for initializing the Coinbase Wallet * connector. This includes overriding the connection options (via config.preference.options) * or adding additional configuration (i.e. enabling subAccounts) */ config?: Parameters[0]; }; /** * Options to configure connections to the Base Account (passkey-based smart wallet). */ baseAccount?: { /** * Allows you to override the default configuration options for initializing the Base Account * connector. This includes overriding the connection options (via config.preference.options) * or adding additional configuration (i.e. enabling subAccounts) */ config?: BaseAccountSdkCreateParams; }; /** * Mapping between `walletClientType`s to the length of time after which signature and RPC requests will timeout for that * `walletClientType`. * * By default, all signature or RPC requests through Privy will timeout after 2 mins (120000 ms). Use this object to * override the signature or RPC timeout in ms for specific` walletClientType`s, e.g. 'safe', in order to extend or * shorten the timeout duration. */ signatureRequestTimeouts?: { [key in string]?: number; }; /** * Options to configure WalletConnect behavior. * * @experimental This may change in future releases */ walletConnect?: { /** * If disabled, stops WalletConnect from being initialized by the Privy SDK. * * WARNING: If you allow WalletConnect or WalletConnect-powered wallets, this will cause issues. * * Note that even if disabled, WalletConnect code may still be loaded in the browser. Defaults to true. * * @experimental This feature is very experimental and may break your wallet connector experience if you use external wallets. */ enabled: boolean; }; solana?: { connectors?: SolanaWalletConnectorsConfig; }; /** * If true, disables all connections to external wallets. * * @experimental This feature is experimental */ disableAllExternalWallets?: boolean; }; interface PrivyClientConfig { /** All UI and theme related configuration */ appearance?: { /** Primary theme for the privy UI. This dictates the foreground and background colors within the UI. * * 'light' (default): The privy default light UI. * 'dark': The privy default dark UI. * custom hex code (i.e. '#13152F'): A custom background. This will generate the remainder of the foreground and * background colors for the UI by modulating the luminance of the passed color. This value should be _either_ dark * or light (<20% or >80% luminance), for accessibility. */ theme?: 'light' | 'dark' | HexColor; /** Accent color for the privy UI. * Used for buttons, active borders, etc. This will generate light and dark variants. * This overrides the server setting `accent_color`. */ accentColor?: HexColor; /** Logo for the main privy modal screen. * This can be a string (url) or an img / svg react element. * If passing an element, Privy will overwrite the `style` props, to ensure proper rendering. * This overrides the server setting `logo_url` */ logo?: string | ReactElement; /** * Header text for the landing screen of the Privy login modal. We strongly recommend using a string * of length 35 or less. Strings longer than the width of the login modal will be ellipsified. * * Defaults to 'Log in or sign up'. */ landingHeader?: string; /** * Subtitle text for the landing screen of the Privy login modal. * * This text will renders below the logo and will be capped at 100 characters. * * Defaults to undefined. */ loginMessage?: string; /** Determines the order of the login options in the privy modal. If true, the wallet login will render above * social and email / sms login options. * This overrides the server setting `show_wallet_login_first` */ showWalletLoginFirst?: boolean; /** * An array of {@link WalletListEntry wallet names} to configure the wallet buttons shown within * the `login`, `connectWallet`, and `linkWallet` modals. Privy will show buttons for each option * present in the list, in the order in which they are configured. * * On 'detected_wallets': * - This option serves as a fallback to include all wallets that detected by Privy, that might not be * individually configured in the `walletList`. Browser extension wallets that are not explicitly configured * in the `walletList` will fall into this category. * - If Privy detects a wallet, _and_ that wallet is configured within the `walletList` (e.g. 'metamask'), * the order of the wallet's explicit name (e.g. 'metamask') in the `walletList` will take priority * over the order of 'detected_wallets'. * * Defaults to ['detected_wallets', 'metamask', 'coinbase_wallet', 'rainbow', 'wallet_connect'] * * @default ['detected_wallets', 'metamask', 'coinbase_wallet', 'rainbow', 'wallet_connect'] */ walletList?: WalletListEntry[]; /** * Determines which external wallet types to show in the modal. By default, only Ethereum external wallets * are shown. If you want to show Solana wallets, set this to 'solana-only' or 'ethereum-and-solana'. * * When 'ethereum-and-solana' is set, Solana wallets will have a badge indicating that they are Solana wallets. * * @defaults 'ethereum-only' */ walletChainType?: 'ethereum-only' | 'solana-only' | 'ethereum-and-solana'; }; /** * Login methods for the privy modal. * * This parameter enables you to display a subset of the login methods specified in the developer dashboard. `loginMethods` cannot be an empty array if specified. The order of this array does not dictate order of the login methods in the UI. * * Note that any login method included in this parameter must also be enabled as a login method in the developer dashboard. * * If both `loginMethodsAndOrder` and `loginMethods` are defined, `loginMethodsAndOrder` will take precedence. */ loginMethods?: Array<'wallet' | 'email' | 'sms' | 'google' | 'twitter' | 'discord' | 'github' | 'linkedin' | 'spotify' | 'instagram' | 'tiktok' | 'line' | 'twitch' | 'apple' | 'farcaster' | 'telegram' | 'passkey' | `privy:${string}`>; /** * @deprecated Use `loginMethods` instead. * * Login methods for the Privy modal. _This will override carefully designed defaults and should be used with caution._ * * This parameter enables you to display a subset of the login methods specified in the developer dashboard. Login methods will be rendered in the order they appear in the array. The first 4 options specified in the `primary` list will render on the default screen of the login experience. Options in the `overflow` list will appear on the following screen. * * Note that any login method included in this parameter must also be enabled as a login method in the developer dashboard. * * If both `loginMethodsAndOrder` and `loginMethods` are defined, `loginMethodsAndOrder` will take precedence. */ loginMethodsAndOrder?: { primary: NonEmptyArray; overflow?: Array; }; /** Options for internationalization of the privy modal */ intl?: { /** * This property is used to configure formatting and validation for the phone number input * used when `phone` is enabled as a login method. Must be a valid * [two-leter ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) (e.g. 'US'). * Defaults to 'US'. * * @default 'US' */ defaultCountry: CountryCode; /** * Custom localization strings for Privy UI components. * * Pass a partial object with only the strings you want to override. * All other strings will fall back to default English values. * * Supports simple template interpolation with {variableName} syntax. * * @experimental This feature is experimental and may change in future releases. * * @example * ```typescript * * {children} * * ``` */ textLocalization?: Partial; }; /** * This property is only required for apps that use a third-party authentication provider. * @deprecated Use the `useSyncJwtBasedAuthState` hook instead. */ customAuth?: { /** * If true, enable custom authentication integration. * This enables a JWT from a custom auth provider to be used to authenticate Privy embedded wallets. * Defaults to true. * * @default true * @deprecated Use the `useSyncJwtBasedAuthState` hook instead. */ enabled?: boolean; /** * A callback that returns the user's custom auth provider's access token as a string. * Can be left blank if using cookies to store and send access tokens * * @deprecated Use the `useSyncJwtBasedAuthState` hook instead. * * @example * const {getAccessTokenSilently} = useAuth(); * * */ getCustomAccessToken: () => Promise; /** * Custom auth providers loading state * * @deprecated Use the `useSyncJwtBasedAuthState` hook instead. * * @example * const {isLoading} = useAuth(); * * */ isLoading: boolean; }; /** All legal configuration */ legal?: { /** URL to the terms and conditions page for your application. * Rendered as a link in the privy modal footer. * This overrides the server setting `terms_and_conditions_url` */ termsAndConditionsUrl?: string | null; /** URL to the privacy policy page for your application. * Rendered as a link in the privy modal footer. * This overrides the server setting `privacy_policy_url` */ privacyPolicyUrl?: string | null; }; walletConnectCloudProjectId?: string; /** * Plugins to register with the SDK. Plugins extend SDK functionality * and are automatically registered when the PrivyProvider mounts. * * @example * ```tsx * import {dataSuffix} from '@privy-io/react-auth'; * * * ``` */ plugins?: Array; /** * Custom redirect URL for OAuth flows, useful for mobile applications. * If not provided, defaults to window.location.href. * * For Capacitor/mobile apps, use a custom URL scheme like: * 'com.yourapp.oauth://callback' or 'yourapp://oauth' * * Make sure to register this URL scheme in your app configuration * and add it to your app's allowed URL schemes in the Privy dashboard. */ customOAuthRedirectUrl?: string; /** * If true, allows OAuth login in React Native WebViews and other embedded browsers. * By default, OAuth (particularly Google) is blocked in these environments because * OAuth providers typically reject authentication requests from embedded webviews. * * Only enable this if you have a specific use case and have confirmed OAuth works * in your WebView environment. * * @default false * @experimental This is an experimental config that is subject to breaking changes without a major version bump of the SDK. */ allowOAuthInEmbeddedBrowsers?: boolean; /** * A list of supported chains, used to specify which chains should be used throughout the application. * * Calling `sendTransaction` or `switchChain` on an unsupported network will throw an error. * * For external wallets, if the wallet's current chain post-connection (during connect-only or siwe flows) * is not within the supported chains list, the user will be prompted to switch to the `defaultChain` (if set) or first supplied. If the chain * switching process does not fully succeed, the user will **not** be blocked from the application (and the wallet's current `chainId` can always * be observed and acted upon accordingly). * * For embedded wallets, the wallet will automatically default to the `defaultChain` (if set) or first supplied `supportedChain`. */ supportedChains?: Chain[]; /** * When supplied, the `defaultChain` will be the default chain used throughout the application. * * For external wallets, it will be used if the user's wallet it not within the `supportedChains` (or default chains) list. * * For embedded wallets, it will be used upon initialization, when the user hasn't switched to another supported chain. */ defaultChain?: Chain; captchaEnabled?: boolean; /** * Options for connecting to external wallets like Coinbase Wallet, MetaMask, etc. * * @experimental This is an experimental config that is subject to breaking changes without a major version bump of the SDK. */ externalWallets?: ExternalWalletsConfig; /** All embedded wallets configuration */ embeddedWallets?: { ethereum?: { /** * Whether an Ethereum embedded wallet should be created for the user on login. * * For `all-users`, the user will be prompted to create a Privy wallet after successfully * logging in. If they cancel or are visiting after this flag was put in place, they will be * prompted to create a wallet on their next login. * * For `users-without-wallets`, the user will be prompted to create a Privy wallet after * successfully logging in, only if they do not currently have any wallet associated with their * user object - for example if they have linked an external wallet. * * For `off`, an embedded wallet is not created during login. You can always prompt the user to * create one manually with your app. * * Defaults to 'off'. */ createOnLogin?: EmbeddedWalletCreateOnLoginConfig; }; solana?: { /** * Whether a Solana embedded wallet should be created for the user on login. * * For `all-users`, the user will be prompted to create a Privy wallet after successfully * logging in. If they cancel or are visiting after this flag was put in place, they will be * prompted to create a wallet on their next login. * * For `users-without-wallets`, the user will be prompted to create a Privy wallet after * successfully logging in, only if they do not currently have any wallet associated with their * user object - for example if they have linked an external wallet. * * For `off`, an embedded wallet is not created during login. You can always prompt the user to * create one manually with your app. * * Defaults to 'off'. */ createOnLogin?: EmbeddedWalletCreateOnLoginConfig; }; /** * Set to `true` to disable automatic migration, if you are migrating * manually via the `useMigrateWallets` hook. * * @default false */ disableAutomaticMigration?: boolean; /** * Override any settings for the embedded wallet's UI to show or hide the wallet UIs. * * If true, wallet UIs will always be shown. * If false, wallet UIs will always be hidden. * * If not set, the default behavior will match the server configuration. */ showWalletUIs?: boolean; /** * Options to customize the display of transaction prices in the embedded wallet's transaction * prompt. You may configure a primary currency to emphasize, and a secondary currency to show * as subtext. Defaults to emphasizing the price in fiat currency, and showing the price in the native * token as subtext. * * You may either set: * - `{primary: 'fiat-currency', secondary: 'native-token'}` to emphasize fiat currency prices, showing native token * prices as subtext. This is the default. * - `{secondary: 'native-token', secondary: null}` to show native token prices only, with no subtext. * * Privy does not currently support: * - emphasizing native token prices over fiat currency prices * - showing prices only in fiat currency, without native token prices * */ priceDisplay?: PriceDisplayOptions; /** * If true, Privy will attempt to additional decoding calldata for 721 and 1155 approval, transfer, and mint sendTransaction calls, * in addition to the default ERC20 `transfer` and `approve` decoding. * If false, Privy will only decode `transfer` and `approve` calldata for ERC20 tokens. * * @default false * @experimental This is an experimental config that is subject to breaking changes without a major version bump of the SDK. */ extendedCalldataDecoding?: boolean; }; /** * All multi-factor authentication configuration */ mfa?: { /** * If true, Privy will not prompt or instantiate any UI for MFA Verification. The developer * must handle MFA verification themselves. * If false, any action that requires MFA will raise a modal and require user to verify MFA * before proceeding. * * Defaults to false. */ noPromptOnMfaRequired?: boolean; }; passkeys?: { /** * - If `true`, unenrolling a passkey from MFA will also remove it as a login method. * - If `false`, it will keep it as a login method as long as it has not been manually unlinked. * * @default true */ shouldUnlinkOnUnenrollMfa?: boolean; /** * - If `true`, unlinking a passkey as a login method will also unenroll it from MFA. * - If `false`, it will keep it as an mfa method as long as it has not been manually unenrolled. * * @default true */ shouldUnenrollMfaOnUnlink?: boolean; /** * Allows overriding the default options returned for passkey registration */ registration?: Pick; }; /** * Settings associated with funding methods */ fundingMethodConfig?: { moonpay: { /** * Determines whether to use the Moonpay sandbox flow. * * Defaults to false. */ useSandbox?: boolean; /** * Determines the payment method for each Moonpay transaction. * * Defaults to Moonpay's default. */ paymentMethod?: MoonpayPaymentMethod; /** * Determines the UI settings for each Moonpay transaction. * * Defaults to Moonpay's default. */ uiConfig?: MoonpayUiConfig; }; }; /** * Configuration for Solana */ solana?: { /** * @solana/kit RPC configuration objects for each solana chain. This applies for solana standard wallet hooks like `useStandardSignMessage`, * `useStandardSignTransaction`, `useStandardSignAndSendTransaction`. * * @example * ```typescript * import {createSolanaRpc, createSolanaRpcSubscriptions} from '@solana/kit'; * * const rpcs = { * 'solana:mainnet': { * rpc: createSolanaRpc('https://api.mainnet-beta.solana.com'), * rpcSubscriptions: createSolanaRpcSubscriptions('wss://api.mainnet-beta.solana.com'), * blockExplorerUrl: 'https://explorer.solana.com', * }, * } */ rpcs?: Partial; rpcSubscriptions: RpcSubscriptions; blockExplorerUrl?: string; }>>; }; } /** * The data received from Telegram when the user is authenticated. * * @see https://core.telegram.org/widgets/login#receiving-authorization-data */ interface TelegramAuthResult { id: number; first_name: string; auth_date: number; hash: string; last_name?: string; photo_url?: string; username?: string; } /** * Data received from Telegram when the user is authenticated via the Telegram Web App. * * @see https://core.telegram.org/widgets/login#receiving-authorization-data */ interface TelegramWebAppData { query_id?: string; auth_date: number; hash: string; user: string; chat_instance?: string; chat_type?: string; start_param?: string; signature?: string; } /** * Data received from an OAuth user endpoint -- only used in account transfer flows */ interface OAuthUserInfo { subject: string; username?: string; name?: string; email?: string; profilePictureUrl?: string; vanityName?: string; meta?: { providerAppId?: string; }; embeddedWalletAddresses?: string[]; smartWalletAddresses?: string[]; } /** * Object representation of metadata reported by a connected wallet during the SIWE flow */ interface ExternalWalletMetadata { walletClientType: WalletClientType; chainId?: string; connectorType: string; } /** * Configuration for the Privy Smart Wallet SDK. * This configuration is used to enable the Smart Wallet SDK and configure the networks that the Smart Wallet will be used on. * This is internal so changes to this do not count as breaking API changes. */ type SmartWalletConfig = { enabled: false; } | { enabled: true; smartWalletType: SmartWalletType; smartWalletVersion?: string; configuredNetworks: SmartWalletNetworkConfig[]; }; type SmartWalletNetworkConfig = { chainId: string; bundlerUrl: string; paymasterUrl?: string; paymasterContext?: AlchemyPaymasterContextClient | BiconomyPaymasterContext; }; /** * There are two options For how to prioritize/highlight the user's login method options: * - `web3-first`: highlight the web3 login method options (wallets) * - `web2-first`: highlight the web2 login method options (email, sms, social) */ type LoginGroupPriority = 'web2-first' | 'web3-first'; /** Privy configuration object used throughout the application * This is a composition of the server config and client config, and contains data used throughout the app. * This is just used internally - changes to this don't count as breaking API changes. */ type AppConfig = { id: AppResponse['id']; appClientId: string | undefined; name: AppResponse['name']; allowlistConfig: { errorTitle: string | null; errorDetail: string | null; errorCtaText: string | null; errorCtaLink: string | null; }; legacyWalletUiConfig: AppResponse['legacy_wallet_ui_config']; appearance: { logo?: NonNullable['logo']; landingHeader: NonNullable['landingHeader']; loginMessage: NonNullable['loginMessage']; footerLogo: NonNullable['footerLogo']; palette: PrivyPalette; loginGroupPriority: LoginGroupPriority; hideDirectWeb2Inputs?: boolean; walletList: NonNullable['walletList']>; walletChainType: NonNullable['walletChainType']>; }; loginMethods: { wallet?: boolean; email?: boolean; sms?: boolean; google?: boolean; twitter?: boolean; discord?: boolean; github?: boolean; spotify?: boolean; instagram?: boolean; tiktok?: boolean; line?: boolean; twitch?: boolean; linkedin?: boolean; apple?: boolean; farcaster?: boolean; passkey?: boolean; telegram?: boolean; }; disablePlusEmails: AppResponse['disable_plus_emails']; globalDisablePasskeys: NonNullable; loginMethodsAndOrder?: PrivyClientConfig['loginMethodsAndOrder']; legal: { termsAndConditionsUrl: AppResponse['terms_and_conditions_url']; privacyPolicyUrl: AppResponse['privacy_policy_url']; requireUsersAcceptTerms: NonNullable; }; walletConnectCloudProjectId: NonNullable; rpcConfig: RpcConfig; chains: Chain[]; defaultChain: Chain; intl: { defaultCountry: CountryCode; textLocalization?: Partial; }; customOAuthProviders: AppResponse['custom_oauth_providers']; /** * Cross-app providers specified in the loginMethods array (format: privy:${appId}) */ crossAppProviders: string[]; /** * Whether the `defaultChain` in the internal config should be enforced on connection requests. This * gets set to true if the app has explicitly set a `defaultChain`, and false otherwise. * * If true, Privy will prompt wallets to switch to the `defaultChain` on connection, and will include * the default chain in the required chains namespace for WalletConnect. */ shouldEnforceDefaultChainOnConnect: boolean; captcha: { /** * Null if captcha is disabled, otherwise the enabled captcha provider. */ enabledProvider: AppResponse['enabled_captcha_provider']; siteKey: NonNullable; }; externalWallets: { coinbaseWallet: { config: NonNullable['coinbaseWallet']>['config']>; }; baseAccount: { config: NonNullable['baseAccount']>['config']>; }; walletConnect: { enabled: boolean; }; solana: { connectors: NonNullable['solana']>['connectors']; }; disableAllExternalWallets: boolean; }; embeddedWallets: { ethereum: { createOnLogin: NonNullable['ethereum']['create_on_login']; }; solana: { createOnLogin: NonNullable['solana']['create_on_login']; }; disableAutomaticMigration: NonNullable['disableAutomaticMigration']>; requireUserOwnedRecoveryOnCreate: NonNullable['require_user_owned_recovery_on_create']; userOwnedRecoveryOptions: NonNullable['user_owned_recovery_options']; mode: 'legacy-embedded-wallets-only' | 'user-controlled-server-wallets-only'; priceDisplay: NonNullable['priceDisplay']>; showWalletUIs: NonNullable['showWalletUIs']>; extendedCalldataDecoding: NonNullable['extendedCalldataDecoding']>; transactionScanning: { enabled: boolean; domain: NonNullable['transactionScanning']>['domain']>; }; }; mfa: { methods: NonNullable; noPromptOnMfaRequired?: NonNullable['noPromptOnMfaRequired']; }; passkeys: { shouldUnlinkOnUnenrollMfa: NonNullable['shouldUnlinkOnUnenrollMfa']; shouldUnenrollMfaOnUnlink: NonNullable['shouldUnenrollMfaOnUnlink']; registration: NonNullable['registration']; }; customAuth?: { enabled?: boolean; getCustomAccessToken: NonNullable['getCustomAccessToken']; isLoading: NonNullable['isLoading']; }; render: { standalone: NonNullable['standalone']; }; loginConfig: { telegramAuthConfiguration?: { botId: string; botName: string; linkEnabled: boolean; seamlessAuthEnabled: boolean; }; passkeysForSignupEnabled: AppResponse['passkeys_for_signup_enabled']; }; headless: boolean; fundingConfig?: { methods: NonNullable['methods']; options: NonNullable['options']; defaultRecommendedAmount: string; defaultRecommendedCurrency: NonNullable['default_recommended_currency']; promptFundingOnWalletCreation: boolean; crossChainBridgingEnabled: boolean; }; fundingMethodConfig: NonNullable; whatsAppEnabled: boolean; customOAuthRedirectUrl?: string; allowOAuthInEmbeddedBrowsers: boolean; solanaRpcs: Record; rpcSubscriptions: RpcSubscriptions; blockExplorerUrl?: string; } | null>; smartWallets?: SmartWalletConfig; /** Enable debug logging for wallet connectors */ connectorsDebugLogs: boolean; }; /** Privy's generated color palette. * This will be generated, given a passed theme and accent color (from configuration), * and then passed along to css variables. Generated attributes can be overridden by the user. * at the css level. */ type PrivyPalette = { colorScheme: 'light' | 'dark'; background: string; background2: string; background3: string; foreground: string; foreground2: string; foreground3: string; foreground4: string; foregroundAccent: string; accent: string; accentLight: string; accentHover: string; accentDark: string; accentDarkest: string; success: string; warn: string; warnLight: string; successDark: string; successLight: string; error: string; errorLight: string; borderDefault: string; borderHover: string; borderFocus: string; borderError: string; borderSuccess: string; borderWarning: string; borderInfo: string; borderInteractive: string; borderInteractiveHover: string; backgroundHover: string; backgroundClicked: string; backgroundDisabled: string; backgroundInteractive: string; backgroundInteractiveHover: string; backgroundInteractiveClicked: string; backgroundInteractiveDisabled: string; foregroundHover: string; foregroundClicked: string; foregroundDisabled: string; foregroundInteractive: string; foregroundInteractiveHover: string; warningDark: string; errorDark: string; successBg: string; errorBg: string; errorBgHover: string; warnBg: string; infoBg: string; infoBgHover: string; accentHasGoodContrast: string; linkNavigationColor: string; linkNavigationDecoration: string; iconDefault: string; iconMuted: string; iconSubtle: string; iconInverse: string; iconSuccess: string; iconWarning: string; iconError: string; iconInteractive: string; iconDefaultHover: string; iconMutedHover: string; iconSubtleHover: string; iconDefaultClicked: string; iconMutedClicked: string; iconSubtleClicked: string; iconDefaultDisabled: string; iconMutedDisabled: string; iconSubtleDisabled: string; iconErrorHover: string; iconInteractiveHover: string; iconErrorClicked: string; iconInteractiveClicked: string; iconMutedDisabledAlt: string; iconSubtleDisabledAlt: string; }; type EmbeddedWalletCreateOnLoginConfig = 'users-without-wallets' | 'all-users' | 'off'; type OtpFlowState = { status: 'initial'; } | { status: 'error'; error: Error | null; } | { status: 'sending-code'; } | { status: 'awaiting-code-input'; } | { status: 'submitting-code'; } | { status: 'done'; }; type PasskeyFlowState = { status: 'initial'; } | { status: 'error'; error: Error | null; } | { status: 'generating-challenge'; } | { status: 'awaiting-passkey'; } | { status: 'submitting-response'; } | { status: 'done'; }; type SiweFlowState = { status: 'initial'; } | { status: 'error'; error: Error | null; } | { status: 'generating-message'; } | { status: 'awaiting-signature'; } | { status: 'submitting-signature'; } | { status: 'done'; }; type SiwsFlowState = { status: 'initial'; } | { status: 'error'; error: Error | null; } | { status: 'generating-message'; } | { status: 'awaiting-signature'; } | { status: 'submitting-signature'; } | { status: 'done'; }; type OAuthFlowState = { status: 'initial'; } | { status: 'loading'; } | { status: 'done'; } | { status: 'error'; error: Error | null; }; type TelegramAuthFlowState = { status: 'initial'; } | { status: 'loading'; } | { status: 'done'; } | { status: 'error'; error: Error | null; }; /** * UI configuration object for the embedded wallet's Sign Message screen */ type SignMessageModalUIOptions = { /** * Whether or not to show wallet UIs for this action. Defaults to the wallet UI setting enabled * for your app in the Privy Dashboard, or `showWalletUIs` in the `embeddedWallets` config. */ showWalletUIs?: boolean; /** * Title for the Sign Message screen. Defaults to 'Sign'. */ title?: string; /** * Description text for the Sign Message screen. Defaults to * 'Sign to continue'. */ description?: string; /** * Text for the CTA button on the Sign Message screen. Defaults to * 'Sign and Continue' */ buttonText?: string; /** * An icon to display on the Sign Message screen. Defaults to no icon. */ iconUrl?: string; /** * Whether or not to display a cancel button on the transaction confirmation screen */ isCancellable?: boolean; }; type MessageTypeProperty = { name: string; type: string; }; type MessageTypes = { [additionalProperties: string]: MessageTypeProperty[]; }; /** * JSON Object that conforms to the EIP-712 [`TypedData JSON schema.`](https://eips.ethereum.org/EIPS/eip-712#specification-of-the-eth_signtypeddata-json-rpc) * */ type TypedMessage = { types: T; primaryType: keyof T; domain: { name?: string; version?: string; chainId?: number; verifyingContract?: string; salt?: ArrayBuffer; }; message: Record; }; /** * JSON Object that conforms to the EIP-712 [`TypedData JSON schema.`](https://eips.ethereum.org/EIPS/eip-712#specification-of-the-eth_signtypeddata-json-rpc) * See [`TypedMessage`](TypedMessage) for specs on the specific params of typedData. */ type SignTypedDataParams = TypedMessage; /** * UI customization object for additional transaction details. Will be shown * in an expandable accordion in the Send Transaction screen. */ type TransactionUIOptions = { /** * Title for the transaction details accordion within the * Send Transaction screen. Defaults to 'Details'. */ title?: string; /** * Action that the user is taking when sending this transaction. This * should be short (<4 words, e.g. 'Buy NFT'). Will be shown inside * the transaction details accordion in Send Transaction screen. */ action?: string; /** * If the transaction to be sent is a call to a smart contract, you may * use this object to fill in additional details about the contract being called. */ contractInfo?: ContractUIOptions; }; /** * If the transaction to be sent is a call to a smart contract, you may use this * object to fill in additional details about the contract being called. */ type ContractUIOptions = { /** * URL with more information about the smart contract. */ url?: string; /** * Name of smart contract being called. */ name?: string; /** * URL for an image to show in the Send Transaction screen. */ imgUrl?: string; /** * Alt text for the image in the Send Transaction screen, if a * valid `imgUrl` is set. */ imgAltText?: string; /** * Size for the image in the Send Transaction screen, if a valid * `imgUrl` is set. */ imgSize?: 'sm' | 'lg'; }; /** * UI customization object for the embedded wallet's Send Transaction screen */ type SendTransactionModalUIOptions = { /** * Whether or not to show wallet UIs for this action. Defaults to the wallet UI setting enabled * for your app in the Privy Dashboard, or `showWalletUIs` in the `embeddedWallets` config. */ showWalletUIs?: boolean; /** * Description of the transaction being sent. */ description?: string; /** * Text to show on CTA button for Send Transaction screen. Defaults to * 'Submit'. For fund transactions, defaults to 'Approve'. */ buttonText?: string; /** * Details about the transaction that the user will send. Will be shown * in an accordion in the Send Transaction screen. */ transactionInfo?: TransactionUIOptions; /** * Text to display at top of Send Transaction Success screen. Defaults to * 'Transaction complete!' if transaction is successful. */ successHeader?: string; /** * Description of the transaction Success screen. Defaults to 'You're all set.' */ successDescription?: string; /** * Whether or not to display a cancel button on the transaction confirmation screen */ isCancellable?: boolean; }; /** * Our external-facing `UnsignedTransactionRequest` type makes the `chainId` field optional, * matching ethers, wagmi, and other libraries. However, our modal needs to be "aware" * of the transaction's `chainId` to ensure it does price conversion, quote labeling, etc. importantly. * * Thus, in the modal, we enforce a stricter type `UnsignedTransactionRequestWithChainId` which wraps * `UnsignedTransactionRequest` to make `chainId` required. * * If the developer does not set a `chainId` in their `UnsignedTransactionRequest`, we default to the embedded * provider's current `chainId` in `privy-provider.tsx` > `sendTransaction` */ type UnsignedTransactionRequestWithChainId = UnsignedTransactionRequest & { chainId: number; }; type LoginModalOptions = RuntimeLoginOverridableOptions & { isSigningInWithLedgerSolana?: boolean; }; type ConnectWalletModalOptions = ExternalConnectWalletModalOptions; type PrivyFarcasterSignerInitResponse = { public_key: string; status: 'pending_approval'; signer_approval_url: string; } | { public_key: string; status: 'approved'; fid: bigint; } | { public_key: string; status: 'revoked'; }; type PrefillLoginOptions = { type: 'email' | 'phone'; value: string; }; /** Options for Privy's `login` method. */ type RuntimeLoginOverridableOptions = { /** An array of login methods to display in the login modal. */ loginMethods?: PrivyClientConfig['loginMethods']; /** Details to prefill a user's email or phone number for email or SMS login. */ prefill?: PrefillLoginOptions; /** * Whether or not to block sign ups (only allow existing users to log in). */ disableSignup?: boolean; /** * Filter the login wallet options to only show wallets that support the specified chain type. */ walletChainType?: NonNullable['walletChainType']; }; /** Options for Privy's `connectWallet` method */ type ExternalConnectWalletModalOptions = { /** * @deprecated Use `description` instead to provide custom text for the connect wallet modal. * An address to suggest the user to connect in Privy's UIs. This is only a suggestion for the * user and the method will not error if they connect a different address. */ suggestedAddress?: string; /** * An array of wallet options to present the user in the connect wallet modal. */ walletList?: WalletListEntry[]; /** * Filter the login wallet options to only show wallets that support the specified chain type. */ walletChainType?: NonNullable['walletChainType']; /** * Custom description text to display in the connect wallet modal. If not provided, * a default description will be shown based on the context (e.g., "Connect a wallet to your [app] account"). * To hide completely, set to an empty string. */ description?: ReactNode; /** * When set, the connect view will skip the wallets list and go straight to the wallet connection. */ preSelectedWalletId?: string; /** * Whether to hide the modal header content (wallet icon, title, and description). * The close button and padding will still be shown. Defaults to false (header is visible). */ hideHeader?: boolean; }; /** Options for Privy's `createWallet` method */ type CreateWalletOptions = { /** * Whether or not to create an additional Ethereum embedded wallet for a user that already has * an Ethereum embedded wallet. If this is set to `true` and the user does not already have an Ethereum * embedded wallet, `createWallet` will throw an error. * * Defaults to `false`. */ createAdditional?: boolean; /** * Session signers to associate with the wallet at creation time. * Only supported for TEE execution mode (`user-controlled-server-wallets-only`). */ signers?: SessionSignerInput; } | { /** * Specify the hierarchical deterministic (HD) index of the embedded wallet to create. * **A wallet with HD index 0 must be created before creating a wallet at greater HD indices.** * If a value < 0 is passed in, `createWallet` will throw an error. * If a value > 1 is passed in, and the user does not have a primary wallet (HD index == 0), * `createWallet` will throw an error. * */ walletIndex: number; /** * Session signers to associate with the wallet at creation time. * Only supported for TEE execution mode (`user-controlled-server-wallets-only`). */ signers?: SessionSignerInput; }; type SetWalletRecoveryOptions = {}; type CrossAppProviderDetails = { name: string; icon_url: string | null; }; type LoginToMiniApp = { /** * The message the Farcaster wallet signed */ message: string; /** * The SIWF signature */ signature: string; }; /** * For SIWS flows, indicates whether or not the SIWS message is plaintext, or wrapped in a memo transaction */ type SiwsMessageType = 'plain' | 'transaction'; type SessionSignerInput = { signerId: string; policyIds?: string[]; }[]; type SignerInput = SessionSignerInput; export { type ExternalWalletMetadata as $, type WalletListEntry as A, type BaseConnectedEthereumWallet as B, type CreateWalletOptions as C, type AppConfig as D, type EthereumRpcRequestType as E, type FundingMethod as F, type BaseConnectedWallet as G, type HDWalletWithMetadata as H, type ConnectWalletModalOptions as I, type LoginModalOptions as J, type SetWalletRecoveryOptions as K, type LoginMethod as L, type MfaMethod as M, type SignTypedDataParams as N, type OAuthTokens as O, PrivyErrorCode as P, type UnsignedTransactionRequest as Q, type RuntimeLoginOverridableOptions as R, type SolanaChain as S, type FundWalletConfig as T, type User as U, type ConnectedWallet as V, type Wallet as W, type CrossAppProviderDetails as X, type MoonpaySignRequest as Y, type MoonpaySignResponse as Z, type SiwsMessageType as _, type LinkedAccountWithMetadata as a, createDataSuffixPlugin as a$, type TelegramAuthResult as a0, type TelegramWebAppData as a1, type OAuthUserInfo as a2, type OAuthFlowState as a3, type LoginWithCode as a4, type OtpFlowState as a5, type PasskeyFlowState as a6, type SiweFlowState as a7, type FundingResult as a8, type BaseAccountSdkType as a9, type Telegram as aA, type CrossAppAccount as aB, type LinkedAccountType as aC, type GoogleOAuthWithMetadata as aD, type TwitterOAuthWithMetadata as aE, type DiscordOAuthWithMetadata as aF, type GithubOAuthWithMetadata as aG, type TiktokOAuthWithMetadata as aH, type LineOAuthWithMetadata as aI, type LinkedInOAuthWithMetadata as aJ, type AppleOAuthWithMetadata as aK, type FarcasterWithMetadata as aL, type TelegramWithMetadata as aM, type CrossAppAccountWithMetadata as aN, type PasskeyWithMetadata as aO, type Email as aP, type Phone as aQ, type TransactionUIOptions as aR, type ContractUIOptions as aS, type FundingStatus as aT, type NativeFundingConfig as aU, type PriceDisplayOptions as aV, type Farcaster as aW, type Passkey as aX, type LoginMethodOrderOption as aY, type SiwsFlowState as aZ, type PrivyI18nStrings as a_, type UnsignedTransactionRequestWithChainId as aa, type BaseConnectedWalletType as ab, type SignerInput as ac, type TelegramAuthFlowState as ad, createCrossTabUserSyncPlugin as ae, createWalletCreationOnLoginPlugin as af, type TypedMessage as ag, type MessageTypes as ah, type SmartWallet as ai, type MoonpayCurrencyCode as aj, type MoonpayPaymentMethod as ak, type Quantity as al, type TransactionLog as am, type TransactionReceipt as an, type NonEmptyArray as ao, type EmailWithMetadata as ap, type PhoneWithMetadata as aq, type WalletWithMetadata as ar, type Google as as, type Twitter as at, type Discord as au, type Github as av, type LinkedIn as aw, type Apple as ax, type Tiktok as ay, type Line as az, type BaseConnectedSolanaWallet as b, type UserRecoveryMethod as c, type LoginToMiniApp as d, type SendTransactionModalUIOptions as e, type SignMessageModalUIOptions as f, type SessionSignerInput as g, type SolanaStandardWallet as h, type SolanaFundingConfig as i, SolanaWalletConnector as j, type MfaSubmitArgs as k, type SolanaRpcRequestType as l, type EthereumRpcResponseType as m, type SolanaRpcResponseType as n, type PrivyFarcasterSignerInitResponse as o, type EIP1193Provider as p, type EntropyIdVerifier as q, type RequestArguments as r, WalletConnector as s, toSolanaWalletConnectors as t, PrivyProxyProvider as u, type WalletClientType as v, type ConnectedWalletMetadata as w, type PrivyClientConfig as x, type ConnectorType as y, type SetBaseAccountSdkType as z };