@privy-io/react-auth 2.17.3 → 2.18.1

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.
Files changed (48) hide show
  1. package/dist/cjs/abstract-smart-wallets.js +1 -1
  2. package/dist/cjs/extended-chains.js +1 -1
  3. package/dist/cjs/farcaster.js +1 -1
  4. package/dist/cjs/index.js +1 -1
  5. package/dist/cjs/internal-context-Uge-4WDr.js +1 -0
  6. package/dist/cjs/privy-provider-CURvvz5W.js +29 -0
  7. package/dist/cjs/{smart-wallets-C5OETWB3.js → smart-wallets-ieCGvkYu.js} +1 -1
  8. package/dist/cjs/smart-wallets.js +1 -1
  9. package/dist/cjs/solana.js +1 -1
  10. package/dist/cjs/ui.js +1 -1
  11. package/dist/cjs/{use-sign-with-user-signer-CpEHKe74.js → use-sign-with-user-signer-BrJ6QN6E.js} +1 -1
  12. package/dist/cjs/{useActiveWallet-C_wN_Vtk.js → useActiveWallet-B8dTfhVh.js} +1 -1
  13. package/dist/cjs/{useFundWallet-D7jsZQgJ.js → useFundWallet-Bl1vf9MU.js} +1 -1
  14. package/dist/dts/extended-chains.d.mts +1 -1
  15. package/dist/dts/extended-chains.d.ts +1 -1
  16. package/dist/dts/farcaster.d.mts +1 -1
  17. package/dist/dts/farcaster.d.ts +1 -1
  18. package/dist/dts/index.d.mts +68 -7
  19. package/dist/dts/index.d.ts +68 -7
  20. package/dist/dts/smart-wallets.d.mts +1 -1
  21. package/dist/dts/smart-wallets.d.ts +1 -1
  22. package/dist/dts/solana.d.mts +4 -4
  23. package/dist/dts/solana.d.ts +4 -4
  24. package/dist/dts/{types-C750flIl.d.mts → types-cSndhqyV.d.mts} +6 -2
  25. package/dist/dts/{types-C750flIl.d.ts → types-cSndhqyV.d.ts} +6 -2
  26. package/dist/dts/ui.d.mts +1 -1
  27. package/dist/dts/ui.d.ts +1 -1
  28. package/dist/dts/{useSolanaWallets-BMH597gE.d.mts → useSolanaWallets-BGaZqngA.d.mts} +1 -1
  29. package/dist/dts/{useSolanaWallets-BMH597gE.d.ts → useSolanaWallets-BGaZqngA.d.ts} +1 -1
  30. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  31. package/dist/esm/extended-chains.mjs +1 -1
  32. package/dist/esm/farcaster.mjs +1 -1
  33. package/dist/esm/index.mjs +1 -1
  34. package/dist/esm/internal-context-BzsB315R.mjs +1 -0
  35. package/dist/esm/privy-provider-ElOeMJBm.mjs +29 -0
  36. package/dist/esm/{smart-wallets-DJW4A6lN.mjs → smart-wallets-CyBOoqqt.mjs} +1 -1
  37. package/dist/esm/smart-wallets.mjs +1 -1
  38. package/dist/esm/solana.mjs +1 -1
  39. package/dist/esm/ui.mjs +2 -2
  40. package/dist/esm/{use-sign-with-user-signer-C3vxQSbq.mjs → use-sign-with-user-signer-C21K9CRz.mjs} +1 -1
  41. package/dist/esm/useActiveWallet-Cp73WmB3.mjs +1 -0
  42. package/dist/esm/{useFundWallet-Biyv49Yj.mjs → useFundWallet-DywFOko6.mjs} +1 -1
  43. package/package.json +4 -4
  44. package/dist/cjs/internal-context-vhWXhsPy.js +0 -1
  45. package/dist/cjs/privy-provider-DJSBO1cS.js +0 -28
  46. package/dist/esm/internal-context-De1jxnac.mjs +0 -1
  47. package/dist/esm/privy-provider-C8x4T-HJ.mjs +0 -28
  48. package/dist/esm/useActiveWallet-DTVla7H-.mjs +0 -1
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { MouseEvent } from 'react';
3
- import { m as WalletClientType, d as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as PrivyClientConfig, u as EIP1193Provider, v as EntropyIdVerifier$1, H as HDWalletWithMetadata, w as RequestArguments, x as WalletTimeoutError, y as WalletConnector, B as BaseConnectedEthereumWallet, z as ConnectedWalletMetadata, A as ConnectorType, D as WalletListEntry, G as AppConfig, I as BaseConnectedWallet, l as SolanaWalletConnector, U as User, J as ConnectWalletModalOptions, K as LoginModalOptions, g as CreateWalletOptions, W as Wallet, N as SetWalletRecoveryOptions, i as SignMessageModalUIOptions, Q as SignTypedDataParams, M as MfaMethod, T as UnsignedTransactionRequest, h as SendTransactionModalUIOptions, V as FundWalletConfig, X as ConnectedWallet, O as OAuthTokens, Y as CrossAppProviderDetails, Z as OAuthProviderType, _ as MoonpaySignRequest, $ as MoonpaySignResponse, a0 as SmartWalletConfig, a as LoginMethod, a1 as SiweWalletMetadata, a2 as TelegramAuthResult, a3 as TelegramWebAppData, a4 as OAuthUserInfo, a5 as SiwsMessageType, a6 as OAuthFlowState, a7 as LoginWithCode, a8 as OtpFlowState, a9 as PasskeyFlowState, aa as SiweFlowState, ab as UnsignedTransactionRequestWithChainId, ac as BaseConnectedWalletType, C as ConnectedSolanaWallet, ad as SessionSignerInput, ae as TelegramAuthFlowState } from './types-C750flIl.js';
4
- export { ax as Apple, aK as AppleOAuthWithMetadata, aS as ContractUIOptions, aB as CrossAppAccount, aN as CrossAppAccountWithMetadata, au as Discord, aF as DiscordOAuthWithMetadata, aP as Email, ap as EmailWithMetadata, aW as Farcaster, aL as FarcasterWithMetadata, av as Github, aG as GithubOAuthWithMetadata, as as Google, aD as GoogleOAuthWithMetadata, az as Line, aI as LineOAuthWithMetadata, aC as LinkedAccountType, b as LinkedAccountWithMetadata, aw as LinkedIn, aJ as LinkedInOAuthWithMetadata, aY as LoginMethodOrderOption, ag as MessageTypes, ai as MoonpayConfig, aj as MoonpayCurrencyCode, aU as MoonpayFundingConfig, ak as MoonpayPaymentMethod, aT as NativeFundingConfig, ao as NonEmptyArray, aX as Passkey, aO as PasskeyWithMetadata, aQ as Phone, aq as PhoneWithMetadata, aV as PriceDisplayOptions, P as PrivyErrorCode, al as Quantity, ah as SmartWallet, f as SolanaCluster, k as SolanaFundingConfig, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, aA as Telegram, aM as TelegramWithMetadata, ay as Tiktok, aH as TiktokOAuthWithMetadata, am as TransactionLog, an as TransactionReceipt, aR as TransactionUIOptions, at as Twitter, aE as TwitterOAuthWithMetadata, af as TypedMessage, ar as WalletWithMetadata } from './types-C750flIl.js';
3
+ import { m as WalletClientType, d as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as PrivyClientConfig, u as EIP1193Provider, v as EntropyIdVerifier$1, H as HDWalletWithMetadata, w as RequestArguments, x as WalletTimeoutError, y as WalletConnector, B as BaseConnectedEthereumWallet, z as ConnectedWalletMetadata, A as ConnectorType, D as WalletListEntry, G as AppConfig, I as BaseConnectedWallet, l as SolanaWalletConnector, U as User, J as ConnectWalletModalOptions, K as LoginModalOptions, g as CreateWalletOptions, W as Wallet, N as SetWalletRecoveryOptions, i as SignMessageModalUIOptions, Q as SignTypedDataParams, M as MfaMethod, T as UnsignedTransactionRequest, h as SendTransactionModalUIOptions, V as FundWalletConfig, X as ConnectedWallet, O as OAuthTokens, Y as CrossAppProviderDetails, Z as OAuthProviderType, _ as MoonpaySignRequest, $ as MoonpaySignResponse, a0 as SmartWalletConfig, a as LoginMethod, a1 as SiweWalletMetadata, a2 as TelegramAuthResult, a3 as TelegramWebAppData, a4 as OAuthUserInfo, a5 as SiwsMessageType, a6 as OAuthFlowState, a7 as LoginWithCode, a8 as OtpFlowState, a9 as PasskeyFlowState, aa as SiweFlowState, ab as UnsignedTransactionRequestWithChainId, ac as BaseConnectedWalletType, C as ConnectedSolanaWallet, ad as SessionSignerInput, ae as TelegramAuthFlowState } from './types-cSndhqyV.js';
4
+ export { ax as Apple, aK as AppleOAuthWithMetadata, aS as ContractUIOptions, aB as CrossAppAccount, aN as CrossAppAccountWithMetadata, au as Discord, aF as DiscordOAuthWithMetadata, aP as Email, ap as EmailWithMetadata, aW as Farcaster, aL as FarcasterWithMetadata, av as Github, aG as GithubOAuthWithMetadata, as as Google, aD as GoogleOAuthWithMetadata, az as Line, aI as LineOAuthWithMetadata, aC as LinkedAccountType, b as LinkedAccountWithMetadata, aw as LinkedIn, aJ as LinkedInOAuthWithMetadata, aY as LoginMethodOrderOption, ag as MessageTypes, ai as MoonpayConfig, aj as MoonpayCurrencyCode, aU as MoonpayFundingConfig, ak as MoonpayPaymentMethod, aT as NativeFundingConfig, ao as NonEmptyArray, aX as Passkey, aO as PasskeyWithMetadata, aQ as Phone, aq as PhoneWithMetadata, aV as PriceDisplayOptions, P as PrivyErrorCode, al as Quantity, ah as SmartWallet, f as SolanaCluster, k as SolanaFundingConfig, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, aA as Telegram, aM as TelegramWithMetadata, ay as Tiktok, aH as TiktokOAuthWithMetadata, am as TransactionLog, an as TransactionReceipt, aR as TransactionUIOptions, at as Twitter, aE as TwitterOAuthWithMetadata, af as TypedMessage, ar as WalletWithMetadata } from './types-cSndhqyV.js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { TurnstileProps } from '@marsidev/react-turnstile';
7
7
  import { AppKit } from '@reown/appkit';
@@ -11,13 +11,14 @@ import Privy, { Chain, RpcConfig, GenerateAuthorizationSignatureInput, GenerateA
11
11
  export { DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS, addPrivyRpcToChain, addRpcUrlOverrideToChain } from '@privy-io/js-sdk-core';
12
12
  import { PasskeyAuthenticateInputType, CustomMetadataType, SmartWalletType, PrivyCoinbaseOnRampInitInput, PrivyCoinbaseOnRampInitResponse, PrivyCoinbaseOnRampStatusResponse, PrivyTransactionScanningInputType, PrivyTransactionScanningResponseType } from '@privy-io/public-api';
13
13
  import * as viem from 'viem';
14
- import { Address, HttpTransport } from 'viem';
14
+ import { Address, HttpTransport, Hex } from 'viem';
15
15
  import * as _simplewebauthn_types from '@simplewebauthn/types';
16
16
  import { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types';
17
17
  import { Cluster } from '@solana/web3.js';
18
18
  import { FetchOptions } from 'ofetch';
19
- import { P as PrivyEvents } from './useSolanaWallets-BMH597gE.js';
20
- export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-BMH597gE.js';
19
+ import { P as PrivyEvents } from './useSolanaWallets-BGaZqngA.js';
20
+ export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-BGaZqngA.js';
21
+ import * as viem_accounts from 'viem/accounts';
21
22
  import '@coinbase/wallet-sdk';
22
23
  import '@solana/wallet-adapter-base';
23
24
  import '@solana/wallet-standard-features';
@@ -3397,13 +3398,46 @@ interface UseConnectCoinbaseSmartWalletInterface {
3397
3398
  declare const useConnectCoinbaseSmartWallet: () => UseConnectCoinbaseSmartWalletInterface;
3398
3399
 
3399
3400
  type UseAuthMfa = {
3400
- verify: () => Promise<void>;
3401
+ /**
3402
+ * Trigger the verification flow for auth MFA.
3403
+ *
3404
+ * @param o options for the verification flow
3405
+ * @returns a promise that resolves to void on success, rejects otherwise
3406
+ */
3407
+ verify: (o?: {
3408
+ /**
3409
+ * If set to false, `verify` can be used within other Privy flows e.g. enrollment.
3410
+ *
3411
+ * @default true
3412
+ */
3413
+ standalone?: boolean;
3414
+ }) => Promise<void>;
3401
3415
  };
3402
3416
  /**
3403
3417
  * @experimental
3418
+ *
3419
+ * Hook to trigger MFA verification for Privy authentication
3404
3420
  */
3405
3421
  declare const useAuthMfa: () => UseAuthMfa;
3406
3422
 
3423
+ type UseAuthMfaEnrollment = {
3424
+ /**
3425
+ * Trigger the enrollment/un-enrollment flow for auth MFA.
3426
+ *
3427
+ * @param o options for the verification flow
3428
+ * @returns a promise that resolves to an object with the updated user
3429
+ */
3430
+ enroll: (o?: Record<string, never>) => Promise<{
3431
+ user: User;
3432
+ }>;
3433
+ };
3434
+ /**
3435
+ * @experimental
3436
+ *
3437
+ * Hook to trigger MFA enrollment for Privy authentication
3438
+ */
3439
+ declare const useAuthMfaEnrollment: () => UseAuthMfaEnrollment;
3440
+
3407
3441
  interface UseImportWalletInterface {
3408
3442
  /**
3409
3443
  * Imports a private key to be used as an embedded wallet for the user
@@ -4150,4 +4184,31 @@ declare const LoginModal: ({ open }: {
4150
4184
  open: boolean;
4151
4185
  }) => react_jsx_runtime.JSX.Element;
4152
4186
 
4153
- export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, type CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, type JwtAuthFlowState, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseAuthorizationSignatureInterface, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkJwtAccount, type UseLinkWithPasskey, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseRecoverEmbeddedWalletInterface, type UseSessionSignersInterface, type UseSignupWithPasskey, type UseSubscribeToJwtAuthWithFlagInput, type UseSyncJwtBasedAuthStateInput, type UseSyncJwtBasedAuthStateInterface, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, useActiveWallet, useAuthMfa, useAuthorizationSignature, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkJwtAccount, useLinkWithPasskey, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSiwe, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSessionSigners, useSetWalletPassword, useSetWalletRecovery, useSign7702Authorization, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useSubscribeToJwtAuthWithFlag, useSyncJwtBasedAuthState, useToken, useUpdateAccount, useUpdateEmail, useUser, useWallets };
4187
+ /**
4188
+ * Helper function to create a viem Account instance given a connected Ethereum wallet.
4189
+ *
4190
+ * @param wallet {ConnectedWallet} the connected Ethereum wallet to create an Account for
4191
+ * @returns the corresponding viem account for the wallet
4192
+ */
4193
+ declare const toViemAccount: ({ wallet }: {
4194
+ wallet: ConnectedWallet;
4195
+ }) => Promise<{
4196
+ address: viem.Address;
4197
+ nonceManager?: viem.NonceManager | undefined;
4198
+ sign?: ((parameters: {
4199
+ hash: viem.Hash;
4200
+ }) => Promise<Hex>) | undefined;
4201
+ signAuthorization?: ((parameters: viem.AuthorizationRequest) => Promise<viem_accounts.SignAuthorizationReturnType>) | undefined;
4202
+ signMessage: ({ message }: {
4203
+ message: viem.SignableMessage;
4204
+ }) => Promise<Hex>;
4205
+ signTransaction: <serializer extends viem.SerializeTransactionFn<viem.TransactionSerializable> = viem.SerializeTransactionFn<viem.TransactionSerializable>, transaction extends Parameters<serializer>[0] = Parameters<serializer>[0]>(transaction: transaction, options?: {
4206
+ serializer?: serializer | undefined;
4207
+ } | undefined) => Promise<viem.IsNarrowable<viem.TransactionSerialized<viem.GetTransactionType<transaction>>, Hex> extends true ? viem.TransactionSerialized<viem.GetTransactionType<transaction>> : Hex>;
4208
+ signTypedData: <const typedData extends viem.TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(parameters: viem.TypedDataDefinition<typedData, primaryType>) => Promise<Hex>;
4209
+ publicKey: Hex;
4210
+ source: string;
4211
+ type: "local";
4212
+ }>;
4213
+
4214
+ export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, type CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, type JwtAuthFlowState, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseAuthorizationSignatureInterface, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkJwtAccount, type UseLinkWithPasskey, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseRecoverEmbeddedWalletInterface, type UseSessionSignersInterface, type UseSignupWithPasskey, type UseSubscribeToJwtAuthWithFlagInput, type UseSyncJwtBasedAuthStateInput, type UseSyncJwtBasedAuthStateInterface, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, toViemAccount, useActiveWallet, useAuthMfa, useAuthMfaEnrollment, useAuthorizationSignature, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkJwtAccount, useLinkWithPasskey, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSiwe, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSessionSigners, useSetWalletPassword, useSetWalletRecovery, useSign7702Authorization, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useSubscribeToJwtAuthWithFlag, useSyncJwtBasedAuthState, useToken, useUpdateAccount, useUpdateEmail, useUser, useWallets };
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { MouseEvent } from 'react';
3
- import { m as WalletClientType, d as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as PrivyClientConfig, u as EIP1193Provider, v as EntropyIdVerifier$1, H as HDWalletWithMetadata, w as RequestArguments, x as WalletTimeoutError, y as WalletConnector, B as BaseConnectedEthereumWallet, z as ConnectedWalletMetadata, A as ConnectorType, D as WalletListEntry, G as AppConfig, I as BaseConnectedWallet, l as SolanaWalletConnector, U as User, J as ConnectWalletModalOptions, K as LoginModalOptions, g as CreateWalletOptions, W as Wallet, N as SetWalletRecoveryOptions, i as SignMessageModalUIOptions, Q as SignTypedDataParams, M as MfaMethod, T as UnsignedTransactionRequest, h as SendTransactionModalUIOptions, V as FundWalletConfig, X as ConnectedWallet, O as OAuthTokens, Y as CrossAppProviderDetails, Z as OAuthProviderType, _ as MoonpaySignRequest, $ as MoonpaySignResponse, a0 as SmartWalletConfig, a as LoginMethod, a1 as SiweWalletMetadata, a2 as TelegramAuthResult, a3 as TelegramWebAppData, a4 as OAuthUserInfo, a5 as SiwsMessageType, a6 as OAuthFlowState, a7 as LoginWithCode, a8 as OtpFlowState, a9 as PasskeyFlowState, aa as SiweFlowState, ab as UnsignedTransactionRequestWithChainId, ac as BaseConnectedWalletType, C as ConnectedSolanaWallet, ad as SessionSignerInput, ae as TelegramAuthFlowState } from './types-C750flIl.js';
4
- export { ax as Apple, aK as AppleOAuthWithMetadata, aS as ContractUIOptions, aB as CrossAppAccount, aN as CrossAppAccountWithMetadata, au as Discord, aF as DiscordOAuthWithMetadata, aP as Email, ap as EmailWithMetadata, aW as Farcaster, aL as FarcasterWithMetadata, av as Github, aG as GithubOAuthWithMetadata, as as Google, aD as GoogleOAuthWithMetadata, az as Line, aI as LineOAuthWithMetadata, aC as LinkedAccountType, b as LinkedAccountWithMetadata, aw as LinkedIn, aJ as LinkedInOAuthWithMetadata, aY as LoginMethodOrderOption, ag as MessageTypes, ai as MoonpayConfig, aj as MoonpayCurrencyCode, aU as MoonpayFundingConfig, ak as MoonpayPaymentMethod, aT as NativeFundingConfig, ao as NonEmptyArray, aX as Passkey, aO as PasskeyWithMetadata, aQ as Phone, aq as PhoneWithMetadata, aV as PriceDisplayOptions, P as PrivyErrorCode, al as Quantity, ah as SmartWallet, f as SolanaCluster, k as SolanaFundingConfig, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, aA as Telegram, aM as TelegramWithMetadata, ay as Tiktok, aH as TiktokOAuthWithMetadata, am as TransactionLog, an as TransactionReceipt, aR as TransactionUIOptions, at as Twitter, aE as TwitterOAuthWithMetadata, af as TypedMessage, ar as WalletWithMetadata } from './types-C750flIl.js';
3
+ import { m as WalletClientType, d as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as PrivyClientConfig, u as EIP1193Provider, v as EntropyIdVerifier$1, H as HDWalletWithMetadata, w as RequestArguments, x as WalletTimeoutError, y as WalletConnector, B as BaseConnectedEthereumWallet, z as ConnectedWalletMetadata, A as ConnectorType, D as WalletListEntry, G as AppConfig, I as BaseConnectedWallet, l as SolanaWalletConnector, U as User, J as ConnectWalletModalOptions, K as LoginModalOptions, g as CreateWalletOptions, W as Wallet, N as SetWalletRecoveryOptions, i as SignMessageModalUIOptions, Q as SignTypedDataParams, M as MfaMethod, T as UnsignedTransactionRequest, h as SendTransactionModalUIOptions, V as FundWalletConfig, X as ConnectedWallet, O as OAuthTokens, Y as CrossAppProviderDetails, Z as OAuthProviderType, _ as MoonpaySignRequest, $ as MoonpaySignResponse, a0 as SmartWalletConfig, a as LoginMethod, a1 as SiweWalletMetadata, a2 as TelegramAuthResult, a3 as TelegramWebAppData, a4 as OAuthUserInfo, a5 as SiwsMessageType, a6 as OAuthFlowState, a7 as LoginWithCode, a8 as OtpFlowState, a9 as PasskeyFlowState, aa as SiweFlowState, ab as UnsignedTransactionRequestWithChainId, ac as BaseConnectedWalletType, C as ConnectedSolanaWallet, ad as SessionSignerInput, ae as TelegramAuthFlowState } from './types-cSndhqyV.js';
4
+ export { ax as Apple, aK as AppleOAuthWithMetadata, aS as ContractUIOptions, aB as CrossAppAccount, aN as CrossAppAccountWithMetadata, au as Discord, aF as DiscordOAuthWithMetadata, aP as Email, ap as EmailWithMetadata, aW as Farcaster, aL as FarcasterWithMetadata, av as Github, aG as GithubOAuthWithMetadata, as as Google, aD as GoogleOAuthWithMetadata, az as Line, aI as LineOAuthWithMetadata, aC as LinkedAccountType, b as LinkedAccountWithMetadata, aw as LinkedIn, aJ as LinkedInOAuthWithMetadata, aY as LoginMethodOrderOption, ag as MessageTypes, ai as MoonpayConfig, aj as MoonpayCurrencyCode, aU as MoonpayFundingConfig, ak as MoonpayPaymentMethod, aT as NativeFundingConfig, ao as NonEmptyArray, aX as Passkey, aO as PasskeyWithMetadata, aQ as Phone, aq as PhoneWithMetadata, aV as PriceDisplayOptions, P as PrivyErrorCode, al as Quantity, ah as SmartWallet, f as SolanaCluster, k as SolanaFundingConfig, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, aA as Telegram, aM as TelegramWithMetadata, ay as Tiktok, aH as TiktokOAuthWithMetadata, am as TransactionLog, an as TransactionReceipt, aR as TransactionUIOptions, at as Twitter, aE as TwitterOAuthWithMetadata, af as TypedMessage, ar as WalletWithMetadata } from './types-cSndhqyV.js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { TurnstileProps } from '@marsidev/react-turnstile';
7
7
  import { AppKit } from '@reown/appkit';
@@ -11,13 +11,14 @@ import Privy, { Chain, RpcConfig, GenerateAuthorizationSignatureInput, GenerateA
11
11
  export { DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS, addPrivyRpcToChain, addRpcUrlOverrideToChain } from '@privy-io/js-sdk-core';
12
12
  import { PasskeyAuthenticateInputType, CustomMetadataType, SmartWalletType, PrivyCoinbaseOnRampInitInput, PrivyCoinbaseOnRampInitResponse, PrivyCoinbaseOnRampStatusResponse, PrivyTransactionScanningInputType, PrivyTransactionScanningResponseType } from '@privy-io/public-api';
13
13
  import * as viem from 'viem';
14
- import { Address, HttpTransport } from 'viem';
14
+ import { Address, HttpTransport, Hex } from 'viem';
15
15
  import * as _simplewebauthn_types from '@simplewebauthn/types';
16
16
  import { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types';
17
17
  import { Cluster } from '@solana/web3.js';
18
18
  import { FetchOptions } from 'ofetch';
19
- import { P as PrivyEvents } from './useSolanaWallets-BMH597gE.js';
20
- export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-BMH597gE.js';
19
+ import { P as PrivyEvents } from './useSolanaWallets-BGaZqngA.js';
20
+ export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-BGaZqngA.js';
21
+ import * as viem_accounts from 'viem/accounts';
21
22
  import '@coinbase/wallet-sdk';
22
23
  import '@solana/wallet-adapter-base';
23
24
  import '@solana/wallet-standard-features';
@@ -3397,13 +3398,46 @@ interface UseConnectCoinbaseSmartWalletInterface {
3397
3398
  declare const useConnectCoinbaseSmartWallet: () => UseConnectCoinbaseSmartWalletInterface;
3398
3399
 
3399
3400
  type UseAuthMfa = {
3400
- verify: () => Promise<void>;
3401
+ /**
3402
+ * Trigger the verification flow for auth MFA.
3403
+ *
3404
+ * @param o options for the verification flow
3405
+ * @returns a promise that resolves to void on success, rejects otherwise
3406
+ */
3407
+ verify: (o?: {
3408
+ /**
3409
+ * If set to false, `verify` can be used within other Privy flows e.g. enrollment.
3410
+ *
3411
+ * @default true
3412
+ */
3413
+ standalone?: boolean;
3414
+ }) => Promise<void>;
3401
3415
  };
3402
3416
  /**
3403
3417
  * @experimental
3418
+ *
3419
+ * Hook to trigger MFA verification for Privy authentication
3404
3420
  */
3405
3421
  declare const useAuthMfa: () => UseAuthMfa;
3406
3422
 
3423
+ type UseAuthMfaEnrollment = {
3424
+ /**
3425
+ * Trigger the enrollment/un-enrollment flow for auth MFA.
3426
+ *
3427
+ * @param o options for the verification flow
3428
+ * @returns a promise that resolves to an object with the updated user
3429
+ */
3430
+ enroll: (o?: Record<string, never>) => Promise<{
3431
+ user: User;
3432
+ }>;
3433
+ };
3434
+ /**
3435
+ * @experimental
3436
+ *
3437
+ * Hook to trigger MFA enrollment for Privy authentication
3438
+ */
3439
+ declare const useAuthMfaEnrollment: () => UseAuthMfaEnrollment;
3440
+
3407
3441
  interface UseImportWalletInterface {
3408
3442
  /**
3409
3443
  * Imports a private key to be used as an embedded wallet for the user
@@ -4150,4 +4184,31 @@ declare const LoginModal: ({ open }: {
4150
4184
  open: boolean;
4151
4185
  }) => react_jsx_runtime.JSX.Element;
4152
4186
 
4153
- export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, type CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, type JwtAuthFlowState, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseAuthorizationSignatureInterface, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkJwtAccount, type UseLinkWithPasskey, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseRecoverEmbeddedWalletInterface, type UseSessionSignersInterface, type UseSignupWithPasskey, type UseSubscribeToJwtAuthWithFlagInput, type UseSyncJwtBasedAuthStateInput, type UseSyncJwtBasedAuthStateInterface, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, useActiveWallet, useAuthMfa, useAuthorizationSignature, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkJwtAccount, useLinkWithPasskey, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSiwe, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSessionSigners, useSetWalletPassword, useSetWalletRecovery, useSign7702Authorization, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useSubscribeToJwtAuthWithFlag, useSyncJwtBasedAuthState, useToken, useUpdateAccount, useUpdateEmail, useUser, useWallets };
4187
+ /**
4188
+ * Helper function to create a viem Account instance given a connected Ethereum wallet.
4189
+ *
4190
+ * @param wallet {ConnectedWallet} the connected Ethereum wallet to create an Account for
4191
+ * @returns the corresponding viem account for the wallet
4192
+ */
4193
+ declare const toViemAccount: ({ wallet }: {
4194
+ wallet: ConnectedWallet;
4195
+ }) => Promise<{
4196
+ address: viem.Address;
4197
+ nonceManager?: viem.NonceManager | undefined;
4198
+ sign?: ((parameters: {
4199
+ hash: viem.Hash;
4200
+ }) => Promise<Hex>) | undefined;
4201
+ signAuthorization?: ((parameters: viem.AuthorizationRequest) => Promise<viem_accounts.SignAuthorizationReturnType>) | undefined;
4202
+ signMessage: ({ message }: {
4203
+ message: viem.SignableMessage;
4204
+ }) => Promise<Hex>;
4205
+ signTransaction: <serializer extends viem.SerializeTransactionFn<viem.TransactionSerializable> = viem.SerializeTransactionFn<viem.TransactionSerializable>, transaction extends Parameters<serializer>[0] = Parameters<serializer>[0]>(transaction: transaction, options?: {
4206
+ serializer?: serializer | undefined;
4207
+ } | undefined) => Promise<viem.IsNarrowable<viem.TransactionSerialized<viem.GetTransactionType<transaction>>, Hex> extends true ? viem.TransactionSerialized<viem.GetTransactionType<transaction>> : Hex>;
4208
+ signTypedData: <const typedData extends viem.TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(parameters: viem.TypedDataDefinition<typedData, primaryType>) => Promise<Hex>;
4209
+ publicKey: Hex;
4210
+ source: string;
4211
+ type: "local";
4212
+ }>;
4213
+
4214
+ export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, type CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, type JwtAuthFlowState, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseAuthorizationSignatureInterface, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkJwtAccount, type UseLinkWithPasskey, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseRecoverEmbeddedWalletInterface, type UseSessionSignersInterface, type UseSignupWithPasskey, type UseSubscribeToJwtAuthWithFlagInput, type UseSyncJwtBasedAuthStateInput, type UseSyncJwtBasedAuthStateInterface, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, toViemAccount, useActiveWallet, useAuthMfa, useAuthMfaEnrollment, useAuthorizationSignature, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkJwtAccount, useLinkWithPasskey, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSiwe, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSessionSigners, useSetWalletPassword, useSetWalletRecovery, useSign7702Authorization, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useSubscribeToJwtAuthWithFlag, useSyncJwtBasedAuthState, useToken, useUpdateAccount, useUpdateEmail, useUser, useWallets };
@@ -4,7 +4,7 @@ import { SmartAccountClient } from 'permissionless';
4
4
  import { SendTransactionParameters, Chain, Hash, SignableMessage, Hex, TypedData, SignTypedDataParameters, EIP1193Provider, PublicClient, HttpTransport, WalletClient, PaymasterRpcSchema } from 'viem';
5
5
  import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstraction';
6
6
  import { SmartWalletType } from '@privy-io/js-sdk-core';
7
- import { h as SendTransactionModalUIOptions, i as SignMessageModalUIOptions } from './types-C750flIl.js';
7
+ import { h as SendTransactionModalUIOptions, i as SignMessageModalUIOptions } from './types-cSndhqyV.js';
8
8
  import '@coinbase/wallet-sdk';
9
9
  import '@reown/appkit';
10
10
  import '@solana/wallet-adapter-base';
@@ -4,7 +4,7 @@ import { SmartAccountClient } from 'permissionless';
4
4
  import { SendTransactionParameters, Chain, Hash, SignableMessage, Hex, TypedData, SignTypedDataParameters, EIP1193Provider, PublicClient, HttpTransport, WalletClient, PaymasterRpcSchema } from 'viem';
5
5
  import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstraction';
6
6
  import { SmartWalletType } from '@privy-io/js-sdk-core';
7
- import { h as SendTransactionModalUIOptions, i as SignMessageModalUIOptions } from './types-C750flIl.js';
7
+ import { h as SendTransactionModalUIOptions, i as SignMessageModalUIOptions } from './types-cSndhqyV.js';
8
8
  import '@coinbase/wallet-sdk';
9
9
  import '@reown/appkit';
10
10
  import '@solana/wallet-adapter-base';
@@ -1,7 +1,7 @@
1
- import { W as Wallet, j as SolanaStandardWallet, k as SolanaFundingConfig, e as SupportedSolanaTransaction, h as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, i as SignMessageModalUIOptions } from './types-C750flIl.js';
2
- export { C as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-C750flIl.js';
3
- import { P as PrivyEvents } from './useSolanaWallets-BMH597gE.js';
4
- export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-BMH597gE.js';
1
+ import { W as Wallet, j as SolanaStandardWallet, k as SolanaFundingConfig, e as SupportedSolanaTransaction, h as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, i as SignMessageModalUIOptions } from './types-cSndhqyV.js';
2
+ export { C as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-cSndhqyV.js';
3
+ import { P as PrivyEvents } from './useSolanaWallets-BGaZqngA.js';
4
+ export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-BGaZqngA.js';
5
5
  import { SolanaSignAndSendTransactionFeature, SolanaSignTransactionFeature, SolanaSignMessageFeature } from '@solana/wallet-standard-features';
6
6
  import { WalletAccount, WalletIcon, WalletVersion } from '@wallet-standard/base';
7
7
  import { StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature } from '@wallet-standard/features';
@@ -1,7 +1,7 @@
1
- import { W as Wallet, j as SolanaStandardWallet, k as SolanaFundingConfig, e as SupportedSolanaTransaction, h as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, i as SignMessageModalUIOptions } from './types-C750flIl.js';
2
- export { C as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-C750flIl.js';
3
- import { P as PrivyEvents } from './useSolanaWallets-BMH597gE.js';
4
- export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-BMH597gE.js';
1
+ import { W as Wallet, j as SolanaStandardWallet, k as SolanaFundingConfig, e as SupportedSolanaTransaction, h as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, i as SignMessageModalUIOptions } from './types-cSndhqyV.js';
2
+ export { C as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-cSndhqyV.js';
3
+ import { P as PrivyEvents } from './useSolanaWallets-BGaZqngA.js';
4
+ export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-BGaZqngA.js';
5
5
  import { SolanaSignAndSendTransactionFeature, SolanaSignTransactionFeature, SolanaSignMessageFeature } from '@solana/wallet-standard-features';
6
6
  import { WalletAccount, WalletIcon, WalletVersion } from '@wallet-standard/base';
7
7
  import { StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature } from '@wallet-standard/features';
@@ -1,7 +1,7 @@
1
1
  import { createCoinbaseWalletSDK } from '@coinbase/wallet-sdk';
2
2
  import { AppKit } from '@reown/appkit';
3
3
  import { StandardWalletAdapter, Adapter, WalletError, MessageSignerWalletAdapterProps, WalletAdapterProps, SignerWalletAdapterProps } from '@solana/wallet-adapter-base';
4
- import { ReactElement } from 'react';
4
+ import { ReactElement, ReactNode } from 'react';
5
5
  import { Hex } from 'viem';
6
6
  import { Cluster as Cluster$1, ChainLikeWithId, CountryCode, Chain, RpcConfig } from '@privy-io/js-sdk-core';
7
7
  import { ChainType, SmartWalletType, CustomMetadataType, PrivyAppResponse, PasskeyAuthenticateInputType } from '@privy-io/public-api';
@@ -2196,7 +2196,11 @@ type ExternalConnectWalletModalOptions = {
2196
2196
  * a default description will be shown based on the context (e.g., "Connect a wallet to your [app] account").
2197
2197
  * To hide completely, set to an empty string.
2198
2198
  */
2199
- description?: string;
2199
+ description?: ReactNode;
2200
+ /**
2201
+ * When set, the connect view will skip the wallets list and go straight to the wallet connection.
2202
+ */
2203
+ preSelectedWalletId?: string;
2200
2204
  };
2201
2205
  /** Options for Privy's `createWallet` method */
2202
2206
  type CreateWalletOptions = {
@@ -1,7 +1,7 @@
1
1
  import { createCoinbaseWalletSDK } from '@coinbase/wallet-sdk';
2
2
  import { AppKit } from '@reown/appkit';
3
3
  import { StandardWalletAdapter, Adapter, WalletError, MessageSignerWalletAdapterProps, WalletAdapterProps, SignerWalletAdapterProps } from '@solana/wallet-adapter-base';
4
- import { ReactElement } from 'react';
4
+ import { ReactElement, ReactNode } from 'react';
5
5
  import { Hex } from 'viem';
6
6
  import { Cluster as Cluster$1, ChainLikeWithId, CountryCode, Chain, RpcConfig } from '@privy-io/js-sdk-core';
7
7
  import { ChainType, SmartWalletType, CustomMetadataType, PrivyAppResponse, PasskeyAuthenticateInputType } from '@privy-io/public-api';
@@ -2196,7 +2196,11 @@ type ExternalConnectWalletModalOptions = {
2196
2196
  * a default description will be shown based on the context (e.g., "Connect a wallet to your [app] account").
2197
2197
  * To hide completely, set to an empty string.
2198
2198
  */
2199
- description?: string;
2199
+ description?: ReactNode;
2200
+ /**
2201
+ * When set, the connect view will skip the wallets list and go straight to the wallet connection.
2202
+ */
2203
+ preSelectedWalletId?: string;
2200
2204
  };
2201
2205
  /** Options for Privy's `createWallet` method */
2202
2206
  type CreateWalletOptions = {
package/dist/dts/ui.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { R as RuntimeLoginOverridableOptions } from './types-C750flIl.js';
2
+ import { R as RuntimeLoginOverridableOptions } from './types-cSndhqyV.js';
3
3
  import { Hex } from 'viem';
4
4
  import { Chain, Cluster } from '@privy-io/js-sdk-core';
5
5
  import '@coinbase/wallet-sdk';
package/dist/dts/ui.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { R as RuntimeLoginOverridableOptions } from './types-C750flIl.js';
2
+ import { R as RuntimeLoginOverridableOptions } from './types-cSndhqyV.js';
3
3
  import { Hex } from 'viem';
4
4
  import { Chain, Cluster } from '@privy-io/js-sdk-core';
5
5
  import '@coinbase/wallet-sdk';
@@ -1,5 +1,5 @@
1
1
  import { Chain } from '@privy-io/js-sdk-core';
2
- import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, f as SolanaCluster, C as ConnectedSolanaWallet, g as CreateWalletOptions } from './types-C750flIl.js';
2
+ import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, f as SolanaCluster, C as ConnectedSolanaWallet, g as CreateWalletOptions } from './types-cSndhqyV.js';
3
3
  import { MouseEvent } from 'react';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { Chain } from '@privy-io/js-sdk-core';
2
- import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, f as SolanaCluster, C as ConnectedSolanaWallet, g as CreateWalletOptions } from './types-C750flIl.js';
2
+ import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, f as SolanaCluster, C as ConnectedSolanaWallet, g as CreateWalletOptions } from './types-cSndhqyV.js';
3
3
  import { MouseEvent } from 'react';
4
4
 
5
5
  /**
@@ -1 +1 @@
1
- import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{getBatchTransactionObject as o}from"@abstract-foundation/agw-client/actions";import{hexToNumber as r,createWalletClient as t,custom as n,http as i}from"viem";import{toAccount as a}from"viem/accounts";import{abstractTestnet as c}from"viem/chains";import{u as s,g as l,c as d}from"./use-sign-with-user-signer-C3vxQSbq.mjs";import{k as p,p as m,e as u,a as h,aP as I,aQ as g,aR as y,q as f}from"./privy-provider-C8x4T-HJ.mjs";import{u as v}from"./internal-context-De1jxnac.mjs";import{g as w}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import{c as C}from"./smart-wallets-DJW4A6lN.mjs";import"react";import"react/jsx-runtime";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/js-sdk-core";import"./paths-j39vuJt8.mjs";import"ofetch";import"uuid";import"jose";import"eventemitter3";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"@marsidev/react-turnstile";import"styled-components";import"tinycolor2";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/ChevronDownIcon";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"zustand";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/UserCircleIcon";import"@heroicons/react/24/outline/EnvelopeIcon";import"@heroicons/react/20/solid/CheckIcon";import"@heroicons/react/24/outline/WalletIcon";import"@heroicons/react/24/outline/CheckIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import"@heroicons/react/24/solid/DocumentCheckIcon";import"@heroicons/react/24/solid/XCircleIcon";import"@heroicons/react/24/solid/CheckCircleIcon";import"qrcode";import"@heroicons/react/24/solid/ArrowsRightLeftIcon";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/LockClosedIcon";import"@heroicons/react/24/outline/PencilSquareIcon";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"@heroicons/react/24/outline/KeyIcon";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/LockClosedIcon";import"@heroicons/react/24/outline/CheckCircleIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"@heroicons/react/24/outline/CreditCardIcon";import"@heroicons/react/24/outline/QrCodeIcon";import"@heroicons/react/24/outline/GlobeAltIcon";import"@heroicons/react/24/outline";import"@heroicons/react/24/outline/ClipboardDocumentIcon";import"@tanstack/react-virtual";import"@heroicons/react/24/outline/CloudArrowUpIcon";import"@heroicons/react/24/outline/NoSymbolIcon";import"@heroicons/react/24/outline/ClockIcon";import"@heroicons/react/24/outline/TrashIcon";import"@heroicons/react/24/solid/CheckBadgeIcon";import"@heroicons/react/24/solid/IdentificationIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/solid/ShieldCheckIcon";import"js-cookie";import"permissionless";import"permissionless/accounts";import"permissionless/clients/pimlico";import"viem/account-abstraction";function T(){let{user:T}=s(),{hideWalletUIs:P,openPrivyModal:S,chains:b,appId:A,rpcConfig:W,client:k}=v(),M=p(),{wallets:F}=m(),{setModalData:q}=u(),R=l(T),x=!!R&&d(R),D=async(o=c.id)=>{let s=w(F);if(!s)throw Error("No connected wallet found");let l="string"==typeof o?r(o):o;if(![c.id,2741].includes(l))throw Error("Error, only Abstract chains are supported");let d=b.find((e=>e.id===l));if(!d)throw Error("Chain not configured");await s.switchChain(d.id);let p=await s.getEthereumProvider(),m=t({account:s.address,transport:n(p)}),u=a({address:s.address,signMessage:m.signMessage,signTransaction:m.signTransaction,signTypedData:m.signTypedData});return await e({chain:d,transport:i(f(d,W,A)),publicTransport:i(f(d,W,A)),signer:u})};return{signMessage:async({message:e},o)=>{let r=await D(o);return new Promise((async(o,t)=>{let{entropyId:n,entropyIdVerifier:i}=h(T);P.current=!0,q({connectWallet:{recoveryMethod:R.recoveryMethod,connectingWalletAddress:R.address,isUnifiedWallet:x,entropyId:n,entropyIdVerifier:i,onCompleteNavigateTo:I,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>r.signMessage({message:e}),onSuccess:e=>o(e),onFailure:t,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))},signTypedData:async(e,o)=>{let r=await D(o);return new Promise((async(o,t)=>{P.current=!0;let{entropyId:n,entropyIdVerifier:i}=h(T);q({connectWallet:{recoveryMethod:R.recoveryMethod,connectingWalletAddress:R.address,isUnifiedWallet:x,entropyId:n,entropyIdVerifier:i,onCompleteNavigateTo:I,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>r.signTypedData(e),onSuccess:e=>o(e),onFailure:t,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))},sendTransaction:async e=>{let r=await D(e.chainId),t=[],n="calls"in e&&void 0!==e.calls;return t=n?[...e.calls]:[e],new Promise((async(i,a)=>{P.current=!0;let{entropyId:c,entropyIdVerifier:s}=h(T);q({connectWallet:{recoveryMethod:R.recoveryMethod,connectingWalletAddress:R.address,isUnifiedWallet:x,entropyId:c,entropyIdVerifier:s,onCompleteNavigateTo:y,onFailure:()=>{}},sendTransaction:{transactionRequests:C({calls:t,chain:r.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:c,entropyIdVerifier:s,transactingWalletAddress:r.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let t=n?o(r.account.address,e):e;return await r.prepareAbstractTransactionRequest(t)},scanTransaction:async()=>{if(!k)throw Error("Privy client not found");let t=n?o(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest(t);return await k.scanTransaction({metadata:{domain:M.embeddedWallets.transactionScanning.domain},chain_id:e.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:i.from,to:i.to,value:i.value?.toString(),gas:i.gas?.toString(),gasPrice:i.gasPrice?.toString(),nonce:i.nonce?.toString(),data:i.data,eip_712_meta:{paymaster_params:{paymaster:i.paymaster,paymaster_input:i.paymasterInput}}}]}})},signOnly:!1,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:()=>n?r.sendTransactionBatch(e):r.sendTransaction(e),onSuccess:e=>i(e.hash),onFailure:a,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))},signTransaction:async e=>{let r=await D(e.chainId),t=[],n="calls"in e&&void 0!==e.calls;return t=n?[...e.calls]:[e],new Promise((async(i,a)=>{P.current=!0;let{entropyId:c,entropyIdVerifier:s}=h(T);q({connectWallet:{recoveryMethod:R.recoveryMethod,connectingWalletAddress:R.address,isUnifiedWallet:x,entropyId:c,entropyIdVerifier:s,onCompleteNavigateTo:y,onFailure:()=>{}},sendTransaction:{transactionRequests:C({calls:t,chain:r.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:c,entropyIdVerifier:s,transactingWalletAddress:r.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let t=n?o(r.account.address,e):e;return await r.prepareAbstractTransactionRequest(t)},scanTransaction:async()=>{if(!k)throw Error("Privy client not found");let t=n?o(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest(t);return await k.scanTransaction({metadata:{domain:M.embeddedWallets.transactionScanning.domain},chain_id:e.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:i.from,to:i.to,value:i.value?.toString(),gas:i.gas?.toString(),gasPrice:i.gasPrice?.toString(),nonce:i.nonce?.toString(),data:i.data}]}})},signOnly:!0,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:async()=>{let t=n?o(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest(t);return r.signTransaction(i)},onSuccess:e=>i(e.hash),onFailure:a,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))}}}export{T as useAbstractSmartWallets};
1
+ import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{getBatchTransactionObject as o}from"@abstract-foundation/agw-client/actions";import{hexToNumber as r,createWalletClient as t,custom as n,http as i}from"viem";import{toAccount as a}from"viem/accounts";import{abstractTestnet as c}from"viem/chains";import{u as s,g as l,c as d}from"./use-sign-with-user-signer-C21K9CRz.mjs";import{o as p,w as m,e as u,a as h,a$ as I,b0 as g,b1 as y,x as f}from"./privy-provider-ElOeMJBm.mjs";import{u as v}from"./internal-context-BzsB315R.mjs";import{g as w}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import{c as C}from"./smart-wallets-CyBOoqqt.mjs";import"react";import"react/jsx-runtime";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/js-sdk-core";import"./paths-j39vuJt8.mjs";import"ofetch";import"uuid";import"jose";import"eventemitter3";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"@marsidev/react-turnstile";import"styled-components";import"tinycolor2";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/ChevronDownIcon";import"zustand";import"@headlessui/react";import"@heroicons/react/24/outline/CheckIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"@walletconnect/ethereum-provider";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/UserCircleIcon";import"@heroicons/react/24/outline/EnvelopeIcon";import"@heroicons/react/20/solid/CheckIcon";import"@heroicons/react/24/outline/WalletIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import"@heroicons/react/24/solid/DocumentCheckIcon";import"@heroicons/react/24/solid/XCircleIcon";import"@heroicons/react/24/solid/CheckCircleIcon";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"qrcode";import"@heroicons/react/24/solid/ArrowsRightLeftIcon";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/LockClosedIcon";import"@heroicons/react/24/outline/PencilSquareIcon";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"@heroicons/react/24/outline/KeyIcon";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/LockClosedIcon";import"@heroicons/react/24/outline/CheckCircleIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"@heroicons/react/24/outline/CreditCardIcon";import"@heroicons/react/24/outline/QrCodeIcon";import"@heroicons/react/24/outline/GlobeAltIcon";import"@heroicons/react/24/outline/ClipboardDocumentIcon";import"@heroicons/react/24/outline/CloudArrowUpIcon";import"@heroicons/react/24/outline/NoSymbolIcon";import"@heroicons/react/24/outline/ClockIcon";import"@heroicons/react/24/outline/TrashIcon";import"@heroicons/react/24/solid/CheckBadgeIcon";import"@heroicons/react/24/solid/IdentificationIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/solid/ShieldCheckIcon";import"js-cookie";import"permissionless";import"permissionless/accounts";import"permissionless/clients/pimlico";import"viem/account-abstraction";function T(){let{user:T}=s(),{hideWalletUIs:P,openPrivyModal:S,chains:b,appId:A,rpcConfig:W,client:M}=v(),k=p(),{wallets:F}=m(),{setModalData:x}=u(),q=l(T),R=!!q&&d(q),D=async(o=c.id)=>{let s=w(F);if(!s)throw Error("No connected wallet found");let l="string"==typeof o?r(o):o;if(![c.id,2741].includes(l))throw Error("Error, only Abstract chains are supported");let d=b.find((e=>e.id===l));if(!d)throw Error("Chain not configured");await s.switchChain(d.id);let p=await s.getEthereumProvider(),m=t({account:s.address,transport:n(p)}),u=a({address:s.address,signMessage:m.signMessage,signTransaction:m.signTransaction,signTypedData:m.signTypedData});return await e({chain:d,transport:i(f(d,W,A)),publicTransport:i(f(d,W,A)),signer:u})};return{signMessage:async({message:e},o)=>{let r=await D(o);return new Promise((async(o,t)=>{let{entropyId:n,entropyIdVerifier:i}=h(T);P.current=!0,x({connectWallet:{recoveryMethod:q.recoveryMethod,connectingWalletAddress:q.address,isUnifiedWallet:R,entropyId:n,entropyIdVerifier:i,onCompleteNavigateTo:I,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>r.signMessage({message:e}),onSuccess:e=>o(e),onFailure:t,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))},signTypedData:async(e,o)=>{let r=await D(o);return new Promise((async(o,t)=>{P.current=!0;let{entropyId:n,entropyIdVerifier:i}=h(T);x({connectWallet:{recoveryMethod:q.recoveryMethod,connectingWalletAddress:q.address,isUnifiedWallet:R,entropyId:n,entropyIdVerifier:i,onCompleteNavigateTo:I,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>r.signTypedData(e),onSuccess:e=>o(e),onFailure:t,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))},sendTransaction:async e=>{let r=await D(e.chainId),t=[],n="calls"in e&&void 0!==e.calls;return t=n?[...e.calls]:[e],new Promise((async(i,a)=>{P.current=!0;let{entropyId:c,entropyIdVerifier:s}=h(T);x({connectWallet:{recoveryMethod:q.recoveryMethod,connectingWalletAddress:q.address,isUnifiedWallet:R,entropyId:c,entropyIdVerifier:s,onCompleteNavigateTo:y,onFailure:()=>{}},sendTransaction:{transactionRequests:C({calls:t,chain:r.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:c,entropyIdVerifier:s,transactingWalletAddress:r.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let t=n?o(r.account.address,e):e;return await r.prepareAbstractTransactionRequest(t)},scanTransaction:async()=>{if(!M)throw Error("Privy client not found");let t=n?o(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest(t);return await M.scanTransaction({metadata:{domain:k.embeddedWallets.transactionScanning.domain},chain_id:e.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:i.from,to:i.to,value:i.value?.toString(),gas:i.gas?.toString(),gasPrice:i.gasPrice?.toString(),nonce:i.nonce?.toString(),data:i.data,eip_712_meta:{paymaster_params:{paymaster:i.paymaster,paymaster_input:i.paymasterInput}}}]}})},signOnly:!1,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:()=>n?r.sendTransactionBatch(e):r.sendTransaction(e),onSuccess:e=>i(e.hash),onFailure:a,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))},signTransaction:async e=>{let r=await D(e.chainId),t=[],n="calls"in e&&void 0!==e.calls;return t=n?[...e.calls]:[e],new Promise((async(i,a)=>{P.current=!0;let{entropyId:c,entropyIdVerifier:s}=h(T);x({connectWallet:{recoveryMethod:q.recoveryMethod,connectingWalletAddress:q.address,isUnifiedWallet:R,entropyId:c,entropyIdVerifier:s,onCompleteNavigateTo:y,onFailure:()=>{}},sendTransaction:{transactionRequests:C({calls:t,chain:r.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:c,entropyIdVerifier:s,transactingWalletAddress:r.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let t=n?o(r.account.address,e):e;return await r.prepareAbstractTransactionRequest(t)},scanTransaction:async()=>{if(!M)throw Error("Privy client not found");let t=n?o(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest(t);return await M.scanTransaction({metadata:{domain:k.embeddedWallets.transactionScanning.domain},chain_id:e.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:i.from,to:i.to,value:i.value?.toString(),gas:i.gas?.toString(),gasPrice:i.gasPrice?.toString(),nonce:i.nonce?.toString(),data:i.data}]}})},signOnly:!0,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:async()=>{let t=n?o(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest(t);return r.signTransaction(i)},onSuccess:e=>i(e.hash),onFailure:a,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))}}}export{T as useAbstractSmartWallets};
@@ -1 +1 @@
1
- import{useMemo as r}from"react";import{create as e,rawSign as t}from"@privy-io/js-sdk-core";import{u as a}from"./internal-context-De1jxnac.mjs";import{u as i,a as s,f as n,c as o}from"./use-sign-with-user-signer-C3vxQSbq.mjs";import"viem";const u=()=>{let{refreshSessionAndUser:t,privy:i}=a();return r((()=>({async createWallet(r){let a=await e(i,{request:{chain_type:r.chainType}}),s=await t();if(!s)throw Error("User must be authenticated before creating a Privy wallet");return{user:s,wallet:a}}})),[t,i])},d=()=>{let{user:e}=i(),{privy:u}=a(),{signWithUserSigner:d}=s();return r((()=>({async signRawHash({address:r,chainType:a,hash:i}){if(!e)throw Error("User must be authenticated before signing");let s=n(e,a).filter((r=>o(r))).find((e=>e.address===r));if(!s)throw Error("Wallet not found");let h=await t(u,d,{wallet_id:s.id,params:{hash:i}});if(h.data&&"signature"in h.data&&"hex"===h.data.encoding)return{signature:h.data.signature};throw Error("Failed to sign")}})),[u])};export{u as useCreateWallet,d as useSignRawHash};
1
+ import{useMemo as r}from"react";import{create as e,rawSign as t}from"@privy-io/js-sdk-core";import{u as a}from"./internal-context-BzsB315R.mjs";import{u as i,a as s,f as n,c as o}from"./use-sign-with-user-signer-C21K9CRz.mjs";import"viem";const u=()=>{let{refreshSessionAndUser:t,privy:i}=a();return r((()=>({async createWallet(r){let a=await e(i,{request:{chain_type:r.chainType}}),s=await t();if(!s)throw Error("User must be authenticated before creating a Privy wallet");return{user:s,wallet:a}}})),[t,i])},d=()=>{let{user:e}=i(),{privy:u}=a(),{signWithUserSigner:d}=s();return r((()=>({async signRawHash({address:r,chainType:a,hash:i}){if(!e)throw Error("User must be authenticated before signing");let s=n(e,a).filter((r=>o(r))).find((e=>e.address===r));if(!s)throw Error("Wallet not found");let h=await t(u,d,{wallet_id:s.id,params:{hash:i}});if(h.data&&"signature"in h.data&&"hex"===h.data.encoding)return{signature:h.data.signature};throw Error("Failed to sign")}})),[u])};export{u as useCreateWallet,d as useSignRawHash};
@@ -1 +1 @@
1
- import{useCallback as t}from"react";import{F as e}from"./frame-UsDF_L76.mjs";import{P as r}from"./paths-j39vuJt8.mjs";import{u as i}from"./internal-context-De1jxnac.mjs";import"ofetch";const a=()=>{let{client:a,setAuthenticated:s,setUser:n}=i();return{initLoginToFrame:t((async()=>{let t=new e;if(!a)throw new r("Must initialize Privy client first.");return a.startAuthFlow(t),await t.init()}),[a]),loginToFrame:t((async({message:t,signature:i})=>{if(!a)throw new r("Must initialize Privy client first.");if(!(a.authFlow instanceof e))throw new r("Must initialize Farcaster frame flow first.");let o=(t=>{let e=t.match(/farcaster:\/\/fid\/(\d+)/);return e&&e[1]?parseInt(e[1],10):null})(t);if(!o)throw new r("Invalid message format; could not parse Farcaster ID.");a.authFlow.setAuthData({message:t,signature:i,fid:o});let{user:l}=await a.authenticate();return l&&(n(l),s(!0)),l}),[a,n,s])}};export{a as useLoginToFrame};
1
+ import{useCallback as t}from"react";import{F as e}from"./frame-UsDF_L76.mjs";import{P as r}from"./paths-j39vuJt8.mjs";import{u as i}from"./internal-context-BzsB315R.mjs";import"ofetch";const a=()=>{let{client:a,setAuthenticated:s,setUser:n}=i();return{initLoginToFrame:t((async()=>{let t=new e;if(!a)throw new r("Must initialize Privy client first.");return a.startAuthFlow(t),await t.init()}),[a]),loginToFrame:t((async({message:t,signature:i})=>{if(!a)throw new r("Must initialize Privy client first.");if(!(a.authFlow instanceof e))throw new r("Must initialize Farcaster frame flow first.");let o=(t=>{let e=t.match(/farcaster:\/\/fid\/(\d+)/);return e&&e[1]?parseInt(e[1],10):null})(t);if(!o)throw new r("Invalid message format; could not parse Farcaster ID.");a.authFlow.setAuthData({message:t,signature:i,fid:o});let{user:l}=await a.authenticate();return l&&(n(l),s(!0)),l}),[a,n,s])}};export{a as useLoginToFrame};