@privy-io/react-auth 2.19.0 → 2.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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/{frame-B38H7ILa.js → frame-8JZCzmCf.js} +1 -1
  5. package/dist/cjs/index.js +1 -1
  6. package/dist/cjs/{internal-context-BChQoYJ7.js → internal-context-B_aIJuQh.js} +1 -1
  7. package/dist/cjs/{paths-CdRs2pll.js → paths-B00ZrFQm.js} +1 -1
  8. package/dist/cjs/{privy-provider-CENM9vOZ.js → privy-provider-DSwXDdcX.js} +25 -25
  9. package/dist/cjs/{smart-wallets-B8cmx9jP.js → smart-wallets-IHcyZonv.js} +1 -1
  10. package/dist/cjs/smart-wallets.js +1 -1
  11. package/dist/cjs/solana.js +1 -1
  12. package/dist/cjs/ui.js +1 -1
  13. package/dist/cjs/{use-sign-with-user-signer-YijW4Qvj.js → use-sign-with-user-signer-BQ_24mRh.js} +1 -1
  14. package/dist/cjs/{useActiveWallet-ChBjCxdS.js → useActiveWallet-Dv_ZghMS.js} +1 -1
  15. package/dist/cjs/{useFundWallet-ChzgQztK.js → useFundWallet-B6An-q7Z.js} +1 -1
  16. package/dist/dts/extended-chains.d.mts +2 -2
  17. package/dist/dts/extended-chains.d.ts +2 -2
  18. package/dist/dts/farcaster.d.mts +2 -2
  19. package/dist/dts/farcaster.d.ts +2 -2
  20. package/dist/dts/index.d.mts +89 -99
  21. package/dist/dts/index.d.ts +89 -99
  22. package/dist/dts/smart-wallets.d.mts +2 -2
  23. package/dist/dts/smart-wallets.d.ts +2 -2
  24. package/dist/dts/solana.d.mts +5 -5
  25. package/dist/dts/solana.d.ts +5 -5
  26. package/dist/dts/{types-C5FjymFC.d.mts → types-ZqHmGCwO.d.mts} +40 -6
  27. package/dist/dts/{types-C5FjymFC.d.ts → types-ZqHmGCwO.d.ts} +40 -6
  28. package/dist/dts/ui.d.mts +2 -2
  29. package/dist/dts/ui.d.ts +2 -2
  30. package/dist/dts/{useSolanaWallets-C_wdD6lb.d.mts → useSolanaWallets-idhSZbQC.d.mts} +1 -1
  31. package/dist/dts/{useSolanaWallets-C_wdD6lb.d.ts → useSolanaWallets-idhSZbQC.d.ts} +1 -1
  32. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  33. package/dist/esm/extended-chains.mjs +1 -1
  34. package/dist/esm/farcaster.mjs +1 -1
  35. package/dist/esm/{frame-FpttHlk8.mjs → frame-DMd4vZ0H.mjs} +1 -1
  36. package/dist/esm/index.mjs +1 -1
  37. package/dist/esm/{internal-context-DelFGnzS.mjs → internal-context-qdNgTV5f.mjs} +1 -1
  38. package/dist/esm/{paths-CYLUXo_U.mjs → paths-DCwuPDUk.mjs} +1 -1
  39. package/dist/esm/privy-provider-B0E_t4-_.mjs +29 -0
  40. package/dist/esm/{smart-wallets-Cp5Kl2CX.mjs → smart-wallets-BuX2Ltru.mjs} +1 -1
  41. package/dist/esm/smart-wallets.mjs +1 -1
  42. package/dist/esm/solana.mjs +1 -1
  43. package/dist/esm/ui.mjs +1 -1
  44. package/dist/esm/{use-sign-with-user-signer-DCN1LHu1.mjs → use-sign-with-user-signer-DnNPDfxp.mjs} +1 -1
  45. package/dist/esm/{useActiveWallet-Bu4Myhqk.mjs → useActiveWallet-Cqbk2Bwf.mjs} +1 -1
  46. package/dist/esm/{useFundWallet-DpRl0Fim.mjs → useFundWallet-BjGzb-ri.mjs} +1 -1
  47. package/package.json +4 -4
  48. package/dist/esm/privy-provider-BrsjzEmo.mjs +0 -29
@@ -1,20 +1,20 @@
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-C5FjymFC.js';
2
- export { C as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-C5FjymFC.js';
3
- import { P as PrivyEvents } from './useSolanaWallets-C_wdD6lb.js';
4
- export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-C_wdD6lb.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-ZqHmGCwO.js';
2
+ export { C as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-ZqHmGCwO.js';
3
+ import { P as PrivyEvents } from './useSolanaWallets-idhSZbQC.js';
4
+ export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-idhSZbQC.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';
8
8
  import { Transaction, VersionedTransaction, Cluster, SendOptions, TransactionSignature, Connection } from '@solana/web3.js';
9
9
  import EventEmitter from 'eventemitter3';
10
10
  import { SendTransactionOptions } from '@solana/wallet-adapter-base';
11
- import '@base-org/account';
12
11
  import '@coinbase/wallet-sdk';
13
12
  import '@reown/appkit';
14
13
  import 'react';
15
14
  import 'viem';
16
15
  import '@privy-io/js-sdk-core';
17
16
  import '@privy-io/public-api';
17
+ import '@base-org/account';
18
18
  import '@metamask/eth-sig-util';
19
19
 
20
20
  interface UseImportWalletInterface {
@@ -1,20 +1,20 @@
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-C5FjymFC.js';
2
- export { C as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-C5FjymFC.js';
3
- import { P as PrivyEvents } from './useSolanaWallets-C_wdD6lb.js';
4
- export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-C_wdD6lb.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-ZqHmGCwO.js';
2
+ export { C as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-ZqHmGCwO.js';
3
+ import { P as PrivyEvents } from './useSolanaWallets-idhSZbQC.js';
4
+ export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-idhSZbQC.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';
8
8
  import { Transaction, VersionedTransaction, Cluster, SendOptions, TransactionSignature, Connection } from '@solana/web3.js';
9
9
  import EventEmitter from 'eventemitter3';
10
10
  import { SendTransactionOptions } from '@solana/wallet-adapter-base';
11
- import '@base-org/account';
12
11
  import '@coinbase/wallet-sdk';
13
12
  import '@reown/appkit';
14
13
  import 'react';
15
14
  import 'viem';
16
15
  import '@privy-io/js-sdk-core';
17
16
  import '@privy-io/public-api';
17
+ import '@base-org/account';
18
18
  import '@metamask/eth-sig-util';
19
19
 
20
20
  interface UseImportWalletInterface {
@@ -1,4 +1,3 @@
1
- import { createBaseAccountSDK } from '@base-org/account';
2
1
  import { createCoinbaseWalletSDK } from '@coinbase/wallet-sdk';
3
2
  import { AppKit } from '@reown/appkit';
4
3
  import { StandardWalletAdapter, Adapter, WalletError, MessageSignerWalletAdapterProps, WalletAdapterProps, SignerWalletAdapterProps } from '@solana/wallet-adapter-base';
@@ -6,6 +5,7 @@ import { ReactElement, ReactNode } from 'react';
6
5
  import { Hex } from 'viem';
7
6
  import { Cluster as Cluster$1, ChainLikeWithId, CountryCode, Chain, RpcConfig } from '@privy-io/js-sdk-core';
8
7
  import { ChainType, SmartWalletType, CustomMetadataType, PrivyAppResponse, PasskeyAuthenticateInputType } from '@privy-io/public-api';
8
+ import { createBaseAccountSDK } from '@base-org/account';
9
9
  import { SolanaSignMessageFeature, SolanaSignTransactionFeature, SolanaSignAndSendTransactionFeature, SolanaSignInFeature } from '@solana/wallet-standard-features';
10
10
  import { WalletWithFeatures } from '@wallet-standard/base';
11
11
  import { StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature } from '@wallet-standard/features';
@@ -315,6 +315,35 @@ interface RequestArguments {
315
315
  readonly params?: readonly unknown[] | object | any;
316
316
  }
317
317
 
318
+ declare global {
319
+ interface Window {
320
+ ethereum?: any;
321
+ }
322
+ }
323
+ /**
324
+ * @hidden
325
+ *
326
+ * The PrivyProxyProvider adds a middleware layer on top of the underlying wallet provider.
327
+ * */
328
+ declare class PrivyProxyProvider implements EIP1193Provider {
329
+ rpcTimeoutDuration: number;
330
+ walletProvider?: EIP1193Provider;
331
+ private _subscriptions;
332
+ constructor(walletProvider?: EIP1193Provider, rpcTimeoutDuration?: number);
333
+ on(eventName: string, listener: (...args: any[]) => void): any;
334
+ request(request: {
335
+ method: string;
336
+ params?: any[] | undefined;
337
+ }): Promise<any>;
338
+ removeListener: (eventName: string | symbol, listener: (...args: any[]) => void) => any;
339
+ walletTimeout: (error?: WalletTimeoutError, timeoutMs?: number) => Promise<string[]>;
340
+ setWalletProvider: (provider: EIP1193Provider) => void;
341
+ }
342
+
343
+ type BaseAccountSdkCreateParams = Parameters<typeof createBaseAccountSDK>[0];
344
+ type BaseAccountSdkType = ReturnType<typeof createBaseAccountSDK>;
345
+ type SetBaseAccountSdkType = (sdk: BaseAccountSdkType | undefined) => void;
346
+
318
347
  /**
319
348
  * Helper type for defining a Standard Wallet with a union of Solana features.
320
349
  */
@@ -1274,7 +1303,7 @@ type ExternalWalletsConfig = {
1274
1303
  * connector. This includes overriding the connection options (via config.preference.options)
1275
1304
  * or adding additional configuration (i.e. enabling subAccounts)
1276
1305
  */
1277
- config?: Parameters<typeof createBaseAccountSDK>[0];
1306
+ config?: BaseAccountSdkCreateParams;
1278
1307
  };
1279
1308
  /**
1280
1309
  * Mapping between `walletClientType`s to the length of time after which signature and RPC requests will timeout for that
@@ -1721,7 +1750,7 @@ interface TelegramWebAppData {
1721
1750
  signature?: string;
1722
1751
  }
1723
1752
  /**
1724
- * Data received from an OAuth user endpoint
1753
+ * Data received from an OAuth user endpoint -- only used in account transfer flows
1725
1754
  */
1726
1755
  interface OAuthUserInfo {
1727
1756
  subject: string;
@@ -1730,13 +1759,18 @@ interface OAuthUserInfo {
1730
1759
  email?: string;
1731
1760
  profilePictureUrl?: string;
1732
1761
  vanityName?: string;
1762
+ meta?: {
1763
+ providerAppId?: string;
1764
+ };
1765
+ embeddedWalletAddresses?: string[];
1766
+ smartWalletAddresses?: string[];
1733
1767
  }
1734
1768
  /**
1735
1769
  * Object representation of metadata reported by a connected wallet during the SIWE flow
1736
1770
  */
1737
- interface SiweWalletMetadata {
1771
+ interface ExternalWalletMetadata {
1738
1772
  walletClientType: WalletClientType;
1739
- chainId: string;
1773
+ chainId?: string;
1740
1774
  connectorType: string;
1741
1775
  }
1742
1776
  /**
@@ -2262,4 +2296,4 @@ type SessionSignerInput = {
2262
2296
  policyIds?: string[];
2263
2297
  }[];
2264
2298
 
2265
- export { type MoonpaySignResponse as $, type ConnectorType as A, type BaseConnectedEthereumWallet as B, type ConnectedSolanaWallet as C, type WalletListEntry as D, type EthereumRpcRequestType as E, type FundingMethod as F, type AppConfig as G, type HDWalletWithMetadata as H, type BaseConnectedWallet as I, type ConnectWalletModalOptions as J, type LoginModalOptions as K, type LoginToFrame as L, type MfaMethod as M, type SetWalletRecoveryOptions as N, type OAuthTokens as O, PrivyErrorCode as P, type SignTypedDataParams as Q, type RuntimeLoginOverridableOptions as R, type SolanaTransactionReceipt as S, type UnsignedTransactionRequest as T, type User as U, type FundWalletConfig as V, type Wallet as W, type ConnectedWallet as X, type CrossAppProviderDetails as Y, type OAuthProviderType as Z, type MoonpaySignRequest as _, type LoginMethod as a, type SmartWalletConfig as a0, type SiweWalletMetadata as a1, type TelegramAuthResult as a2, type TelegramWebAppData as a3, type OAuthUserInfo as a4, type SiwsMessageType as a5, type OAuthFlowState as a6, type LoginWithCode as a7, type OtpFlowState as a8, type PasskeyFlowState 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 NativeFundingConfig as aT, type MoonpayFundingConfig as aU, type PriceDisplayOptions as aV, type Farcaster as aW, type Passkey as aX, type LoginMethodOrderOption as aY, type SiweFlowState as aa, type UnsignedTransactionRequestWithChainId as ab, type BaseConnectedWalletType as ac, type SessionSignerInput as ad, type TelegramAuthFlowState as ae, type TypedMessage as af, type MessageTypes as ag, type SmartWallet as ah, type MoonpayConfig 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 LinkedAccountWithMetadata as b, type BaseConnectedSolanaWallet as c, type UserRecoveryMethod as d, type SupportedSolanaTransaction as e, type SolanaCluster as f, type CreateWalletOptions as g, type SendTransactionModalUIOptions as h, type SignMessageModalUIOptions as i, type SolanaStandardWallet as j, type SolanaFundingConfig as k, SolanaWalletConnector as l, type WalletClientType as m, type PrivyFarcasterSignerInitResponse as n, type MfaSubmitArgs as o, type SolanaRpcRequestType as p, type EthereumRpcResponseType as q, type SolanaRpcResponseType as r, type PrivyClientConfig as s, toSolanaWalletConnectors as t, type EIP1193Provider as u, type EntropyIdVerifier as v, type RequestArguments as w, WalletTimeoutError as x, WalletConnector as y, type ConnectedWalletMetadata as z };
2299
+ export { type MoonpaySignRequest as $, type ConnectorType as A, type BaseConnectedEthereumWallet as B, type ConnectedSolanaWallet as C, type SetBaseAccountSdkType as D, type EthereumRpcRequestType as E, type FundingMethod as F, type WalletListEntry as G, type HDWalletWithMetadata as H, type AppConfig as I, type BaseConnectedWallet as J, type ConnectWalletModalOptions as K, type LoginToFrame as L, type MfaMethod as M, type LoginModalOptions as N, type OAuthTokens as O, PrivyErrorCode as P, type SetWalletRecoveryOptions as Q, type RuntimeLoginOverridableOptions as R, type SolanaTransactionReceipt as S, type SignTypedDataParams as T, type User as U, type UnsignedTransactionRequest as V, type Wallet as W, type FundWalletConfig as X, type ConnectedWallet as Y, type CrossAppProviderDetails as Z, type OAuthProviderType as _, type LoginMethod as a, type MoonpaySignResponse as a0, type SmartWalletConfig as a1, type ExternalWalletMetadata as a2, type TelegramAuthResult as a3, type TelegramWebAppData as a4, type OAuthUserInfo as a5, type SiwsMessageType as a6, type OAuthFlowState as a7, type LoginWithCode as a8, type OtpFlowState as a9, type Tiktok as aA, type Line as aB, type Telegram as aC, type CrossAppAccount as aD, type LinkedAccountType as aE, type GoogleOAuthWithMetadata as aF, type TwitterOAuthWithMetadata as aG, type DiscordOAuthWithMetadata as aH, type GithubOAuthWithMetadata as aI, type TiktokOAuthWithMetadata as aJ, type LineOAuthWithMetadata as aK, type LinkedInOAuthWithMetadata as aL, type AppleOAuthWithMetadata as aM, type FarcasterWithMetadata as aN, type TelegramWithMetadata as aO, type CrossAppAccountWithMetadata as aP, type PasskeyWithMetadata as aQ, type Email as aR, type Phone as aS, type TransactionUIOptions as aT, type ContractUIOptions as aU, type NativeFundingConfig as aV, type MoonpayFundingConfig as aW, type PriceDisplayOptions as aX, type Farcaster as aY, type Passkey as aZ, type LoginMethodOrderOption as a_, type PasskeyFlowState as aa, type SiweFlowState as ab, type BaseAccountSdkType as ac, type UnsignedTransactionRequestWithChainId as ad, type BaseConnectedWalletType as ae, type SessionSignerInput as af, type TelegramAuthFlowState as ag, type TypedMessage as ah, type MessageTypes as ai, type SmartWallet as aj, type MoonpayConfig as ak, type MoonpayCurrencyCode as al, type MoonpayPaymentMethod as am, type Quantity as an, type TransactionLog as ao, type TransactionReceipt as ap, type NonEmptyArray as aq, type EmailWithMetadata as ar, type PhoneWithMetadata as as, type WalletWithMetadata as at, type Google as au, type Twitter as av, type Discord as aw, type Github as ax, type LinkedIn as ay, type Apple as az, type LinkedAccountWithMetadata as b, type BaseConnectedSolanaWallet as c, type UserRecoveryMethod as d, type SupportedSolanaTransaction as e, type SolanaCluster as f, type CreateWalletOptions as g, type SendTransactionModalUIOptions as h, type SignMessageModalUIOptions as i, type SolanaStandardWallet as j, type SolanaFundingConfig as k, SolanaWalletConnector as l, type PrivyFarcasterSignerInitResponse as m, type MfaSubmitArgs as n, type SolanaRpcRequestType as o, type EthereumRpcResponseType as p, type SolanaRpcResponseType as q, type EIP1193Provider as r, type EntropyIdVerifier as s, toSolanaWalletConnectors as t, type RequestArguments as u, WalletConnector as v, PrivyProxyProvider as w, type WalletClientType as x, type ConnectedWalletMetadata as y, type PrivyClientConfig as z };
@@ -1,4 +1,3 @@
1
- import { createBaseAccountSDK } from '@base-org/account';
2
1
  import { createCoinbaseWalletSDK } from '@coinbase/wallet-sdk';
3
2
  import { AppKit } from '@reown/appkit';
4
3
  import { StandardWalletAdapter, Adapter, WalletError, MessageSignerWalletAdapterProps, WalletAdapterProps, SignerWalletAdapterProps } from '@solana/wallet-adapter-base';
@@ -6,6 +5,7 @@ import { ReactElement, ReactNode } from 'react';
6
5
  import { Hex } from 'viem';
7
6
  import { Cluster as Cluster$1, ChainLikeWithId, CountryCode, Chain, RpcConfig } from '@privy-io/js-sdk-core';
8
7
  import { ChainType, SmartWalletType, CustomMetadataType, PrivyAppResponse, PasskeyAuthenticateInputType } from '@privy-io/public-api';
8
+ import { createBaseAccountSDK } from '@base-org/account';
9
9
  import { SolanaSignMessageFeature, SolanaSignTransactionFeature, SolanaSignAndSendTransactionFeature, SolanaSignInFeature } from '@solana/wallet-standard-features';
10
10
  import { WalletWithFeatures } from '@wallet-standard/base';
11
11
  import { StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature } from '@wallet-standard/features';
@@ -315,6 +315,35 @@ interface RequestArguments {
315
315
  readonly params?: readonly unknown[] | object | any;
316
316
  }
317
317
 
318
+ declare global {
319
+ interface Window {
320
+ ethereum?: any;
321
+ }
322
+ }
323
+ /**
324
+ * @hidden
325
+ *
326
+ * The PrivyProxyProvider adds a middleware layer on top of the underlying wallet provider.
327
+ * */
328
+ declare class PrivyProxyProvider implements EIP1193Provider {
329
+ rpcTimeoutDuration: number;
330
+ walletProvider?: EIP1193Provider;
331
+ private _subscriptions;
332
+ constructor(walletProvider?: EIP1193Provider, rpcTimeoutDuration?: number);
333
+ on(eventName: string, listener: (...args: any[]) => void): any;
334
+ request(request: {
335
+ method: string;
336
+ params?: any[] | undefined;
337
+ }): Promise<any>;
338
+ removeListener: (eventName: string | symbol, listener: (...args: any[]) => void) => any;
339
+ walletTimeout: (error?: WalletTimeoutError, timeoutMs?: number) => Promise<string[]>;
340
+ setWalletProvider: (provider: EIP1193Provider) => void;
341
+ }
342
+
343
+ type BaseAccountSdkCreateParams = Parameters<typeof createBaseAccountSDK>[0];
344
+ type BaseAccountSdkType = ReturnType<typeof createBaseAccountSDK>;
345
+ type SetBaseAccountSdkType = (sdk: BaseAccountSdkType | undefined) => void;
346
+
318
347
  /**
319
348
  * Helper type for defining a Standard Wallet with a union of Solana features.
320
349
  */
@@ -1274,7 +1303,7 @@ type ExternalWalletsConfig = {
1274
1303
  * connector. This includes overriding the connection options (via config.preference.options)
1275
1304
  * or adding additional configuration (i.e. enabling subAccounts)
1276
1305
  */
1277
- config?: Parameters<typeof createBaseAccountSDK>[0];
1306
+ config?: BaseAccountSdkCreateParams;
1278
1307
  };
1279
1308
  /**
1280
1309
  * Mapping between `walletClientType`s to the length of time after which signature and RPC requests will timeout for that
@@ -1721,7 +1750,7 @@ interface TelegramWebAppData {
1721
1750
  signature?: string;
1722
1751
  }
1723
1752
  /**
1724
- * Data received from an OAuth user endpoint
1753
+ * Data received from an OAuth user endpoint -- only used in account transfer flows
1725
1754
  */
1726
1755
  interface OAuthUserInfo {
1727
1756
  subject: string;
@@ -1730,13 +1759,18 @@ interface OAuthUserInfo {
1730
1759
  email?: string;
1731
1760
  profilePictureUrl?: string;
1732
1761
  vanityName?: string;
1762
+ meta?: {
1763
+ providerAppId?: string;
1764
+ };
1765
+ embeddedWalletAddresses?: string[];
1766
+ smartWalletAddresses?: string[];
1733
1767
  }
1734
1768
  /**
1735
1769
  * Object representation of metadata reported by a connected wallet during the SIWE flow
1736
1770
  */
1737
- interface SiweWalletMetadata {
1771
+ interface ExternalWalletMetadata {
1738
1772
  walletClientType: WalletClientType;
1739
- chainId: string;
1773
+ chainId?: string;
1740
1774
  connectorType: string;
1741
1775
  }
1742
1776
  /**
@@ -2262,4 +2296,4 @@ type SessionSignerInput = {
2262
2296
  policyIds?: string[];
2263
2297
  }[];
2264
2298
 
2265
- export { type MoonpaySignResponse as $, type ConnectorType as A, type BaseConnectedEthereumWallet as B, type ConnectedSolanaWallet as C, type WalletListEntry as D, type EthereumRpcRequestType as E, type FundingMethod as F, type AppConfig as G, type HDWalletWithMetadata as H, type BaseConnectedWallet as I, type ConnectWalletModalOptions as J, type LoginModalOptions as K, type LoginToFrame as L, type MfaMethod as M, type SetWalletRecoveryOptions as N, type OAuthTokens as O, PrivyErrorCode as P, type SignTypedDataParams as Q, type RuntimeLoginOverridableOptions as R, type SolanaTransactionReceipt as S, type UnsignedTransactionRequest as T, type User as U, type FundWalletConfig as V, type Wallet as W, type ConnectedWallet as X, type CrossAppProviderDetails as Y, type OAuthProviderType as Z, type MoonpaySignRequest as _, type LoginMethod as a, type SmartWalletConfig as a0, type SiweWalletMetadata as a1, type TelegramAuthResult as a2, type TelegramWebAppData as a3, type OAuthUserInfo as a4, type SiwsMessageType as a5, type OAuthFlowState as a6, type LoginWithCode as a7, type OtpFlowState as a8, type PasskeyFlowState 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 NativeFundingConfig as aT, type MoonpayFundingConfig as aU, type PriceDisplayOptions as aV, type Farcaster as aW, type Passkey as aX, type LoginMethodOrderOption as aY, type SiweFlowState as aa, type UnsignedTransactionRequestWithChainId as ab, type BaseConnectedWalletType as ac, type SessionSignerInput as ad, type TelegramAuthFlowState as ae, type TypedMessage as af, type MessageTypes as ag, type SmartWallet as ah, type MoonpayConfig 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 LinkedAccountWithMetadata as b, type BaseConnectedSolanaWallet as c, type UserRecoveryMethod as d, type SupportedSolanaTransaction as e, type SolanaCluster as f, type CreateWalletOptions as g, type SendTransactionModalUIOptions as h, type SignMessageModalUIOptions as i, type SolanaStandardWallet as j, type SolanaFundingConfig as k, SolanaWalletConnector as l, type WalletClientType as m, type PrivyFarcasterSignerInitResponse as n, type MfaSubmitArgs as o, type SolanaRpcRequestType as p, type EthereumRpcResponseType as q, type SolanaRpcResponseType as r, type PrivyClientConfig as s, toSolanaWalletConnectors as t, type EIP1193Provider as u, type EntropyIdVerifier as v, type RequestArguments as w, WalletTimeoutError as x, WalletConnector as y, type ConnectedWalletMetadata as z };
2299
+ export { type MoonpaySignRequest as $, type ConnectorType as A, type BaseConnectedEthereumWallet as B, type ConnectedSolanaWallet as C, type SetBaseAccountSdkType as D, type EthereumRpcRequestType as E, type FundingMethod as F, type WalletListEntry as G, type HDWalletWithMetadata as H, type AppConfig as I, type BaseConnectedWallet as J, type ConnectWalletModalOptions as K, type LoginToFrame as L, type MfaMethod as M, type LoginModalOptions as N, type OAuthTokens as O, PrivyErrorCode as P, type SetWalletRecoveryOptions as Q, type RuntimeLoginOverridableOptions as R, type SolanaTransactionReceipt as S, type SignTypedDataParams as T, type User as U, type UnsignedTransactionRequest as V, type Wallet as W, type FundWalletConfig as X, type ConnectedWallet as Y, type CrossAppProviderDetails as Z, type OAuthProviderType as _, type LoginMethod as a, type MoonpaySignResponse as a0, type SmartWalletConfig as a1, type ExternalWalletMetadata as a2, type TelegramAuthResult as a3, type TelegramWebAppData as a4, type OAuthUserInfo as a5, type SiwsMessageType as a6, type OAuthFlowState as a7, type LoginWithCode as a8, type OtpFlowState as a9, type Tiktok as aA, type Line as aB, type Telegram as aC, type CrossAppAccount as aD, type LinkedAccountType as aE, type GoogleOAuthWithMetadata as aF, type TwitterOAuthWithMetadata as aG, type DiscordOAuthWithMetadata as aH, type GithubOAuthWithMetadata as aI, type TiktokOAuthWithMetadata as aJ, type LineOAuthWithMetadata as aK, type LinkedInOAuthWithMetadata as aL, type AppleOAuthWithMetadata as aM, type FarcasterWithMetadata as aN, type TelegramWithMetadata as aO, type CrossAppAccountWithMetadata as aP, type PasskeyWithMetadata as aQ, type Email as aR, type Phone as aS, type TransactionUIOptions as aT, type ContractUIOptions as aU, type NativeFundingConfig as aV, type MoonpayFundingConfig as aW, type PriceDisplayOptions as aX, type Farcaster as aY, type Passkey as aZ, type LoginMethodOrderOption as a_, type PasskeyFlowState as aa, type SiweFlowState as ab, type BaseAccountSdkType as ac, type UnsignedTransactionRequestWithChainId as ad, type BaseConnectedWalletType as ae, type SessionSignerInput as af, type TelegramAuthFlowState as ag, type TypedMessage as ah, type MessageTypes as ai, type SmartWallet as aj, type MoonpayConfig as ak, type MoonpayCurrencyCode as al, type MoonpayPaymentMethod as am, type Quantity as an, type TransactionLog as ao, type TransactionReceipt as ap, type NonEmptyArray as aq, type EmailWithMetadata as ar, type PhoneWithMetadata as as, type WalletWithMetadata as at, type Google as au, type Twitter as av, type Discord as aw, type Github as ax, type LinkedIn as ay, type Apple as az, type LinkedAccountWithMetadata as b, type BaseConnectedSolanaWallet as c, type UserRecoveryMethod as d, type SupportedSolanaTransaction as e, type SolanaCluster as f, type CreateWalletOptions as g, type SendTransactionModalUIOptions as h, type SignMessageModalUIOptions as i, type SolanaStandardWallet as j, type SolanaFundingConfig as k, SolanaWalletConnector as l, type PrivyFarcasterSignerInitResponse as m, type MfaSubmitArgs as n, type SolanaRpcRequestType as o, type EthereumRpcResponseType as p, type SolanaRpcResponseType as q, type EIP1193Provider as r, type EntropyIdVerifier as s, toSolanaWalletConnectors as t, type RequestArguments as u, WalletConnector as v, PrivyProxyProvider as w, type WalletClientType as x, type ConnectedWalletMetadata as y, type PrivyClientConfig as z };
package/dist/dts/ui.d.mts CHANGED
@@ -1,13 +1,13 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { R as RuntimeLoginOverridableOptions } from './types-C5FjymFC.js';
2
+ import { R as RuntimeLoginOverridableOptions } from './types-ZqHmGCwO.js';
3
3
  import { Hex } from 'viem';
4
4
  import { Chain, Cluster } from '@privy-io/js-sdk-core';
5
- import '@base-org/account';
6
5
  import '@coinbase/wallet-sdk';
7
6
  import '@reown/appkit';
8
7
  import '@solana/wallet-adapter-base';
9
8
  import 'react';
10
9
  import '@privy-io/public-api';
10
+ import '@base-org/account';
11
11
  import '@solana/wallet-standard-features';
12
12
  import '@wallet-standard/base';
13
13
  import '@wallet-standard/features';
package/dist/dts/ui.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { R as RuntimeLoginOverridableOptions } from './types-C5FjymFC.js';
2
+ import { R as RuntimeLoginOverridableOptions } from './types-ZqHmGCwO.js';
3
3
  import { Hex } from 'viem';
4
4
  import { Chain, Cluster } from '@privy-io/js-sdk-core';
5
- import '@base-org/account';
6
5
  import '@coinbase/wallet-sdk';
7
6
  import '@reown/appkit';
8
7
  import '@solana/wallet-adapter-base';
9
8
  import 'react';
10
9
  import '@privy-io/public-api';
10
+ import '@base-org/account';
11
11
  import '@solana/wallet-standard-features';
12
12
  import '@wallet-standard/base';
13
13
  import '@wallet-standard/features';
@@ -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-C5FjymFC.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-ZqHmGCwO.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-C5FjymFC.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-ZqHmGCwO.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-DCN1LHu1.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-BrsjzEmo.mjs";import{u as v}from"./internal-context-DelFGnzS.mjs";import{g as w}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import{c as C}from"./smart-wallets-Cp5Kl2CX.mjs";import"react";import"react/jsx-runtime";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/js-sdk-core";import"./paths-CYLUXo_U.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
+ 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-DnNPDfxp.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-B0E_t4-_.mjs";import{u as v}from"./internal-context-qdNgTV5f.mjs";import{g as w}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import{c as C}from"./smart-wallets-BuX2Ltru.mjs";import"react";import"react/jsx-runtime";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/js-sdk-core";import"./paths-DCwuPDUk.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-DelFGnzS.mjs";import{u as i,a as s,f as n,c as o}from"./use-sign-with-user-signer-DCN1LHu1.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-qdNgTV5f.mjs";import{u as i,a as s,f as n,c as o}from"./use-sign-with-user-signer-DnNPDfxp.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-FpttHlk8.mjs";import{P as r}from"./paths-CYLUXo_U.mjs";import{u as i}from"./internal-context-DelFGnzS.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-DMd4vZ0H.mjs";import{P as r}from"./paths-DCwuPDUk.mjs";import{u as i}from"./internal-context-qdNgTV5f.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 +1 @@
1
- import{P as t,aj as s,ak as i,f as a}from"./paths-CYLUXo_U.mjs";class e{async init(){if(!this.api)throw new t("Auth flow has no API instance");let{nonce:i,expires_at:a}=await this.api.post(s,{});return{nonce:i,expiresAt:a}}async authenticate(){if(!this.message||!this.signature||!this.fid)throw new t("Auth flow has no message, signature, or fid");if(!this.api)throw new t("Auth flow has no API instance");try{let s=await this.api.post(i,{message:this.message,signature:this.signature,fid:this.fid});if(!s)throw new t("No response from authentication");return s}catch(t){throw a(t)}}async link(){throw Error("Not implemented")}setAuthData({message:t,signature:s,fid:i}){this.message=t,this.signature=s,this.fid=i}constructor(){this.meta={}}}export{e as F};
1
+ import{P as t,ak as s,al as i,f as a}from"./paths-DCwuPDUk.mjs";class e{async init(){if(!this.api)throw new t("Auth flow has no API instance");let{nonce:i,expires_at:a}=await this.api.post(s,{});return{nonce:i,expiresAt:a}}async authenticate(){if(!this.message||!this.signature||!this.fid)throw new t("Auth flow has no message, signature, or fid");if(!this.api)throw new t("Auth flow has no API instance");try{let s=await this.api.post(i,{message:this.message,signature:this.signature,fid:this.fid});if(!s)throw new t("No response from authentication");return s}catch(t){throw a(t)}}async link(){throw Error("Not implemented")}setAuthData({message:t,signature:s,fid:i}){this.message=t,this.signature=s,this.fid=i}constructor(){this.meta={}}}export{e as F};
@@ -1 +1 @@
1
- import{g as e,a as t,u as r,b as o,c as n,C as i,d as s,s as l,U as d,e as h,f as w,t as p,h as m,M as y,i as f,A,j as k,k as v,L as C,l as E,I as S,T,S as U,B as I,P as W,E as P,m as M,n as F,o as L,p as D,q as H,G as x,W as q,r as z,v as j,w as B,x as G,y as J,z as ee,D as te,F as re,H as ae,J as oe}from"./privy-provider-BrsjzEmo.mjs";export{O as Captcha,Q as ConnectorManager,V as EthereumWalletConnector,a9 as LoginModal,a2 as PrivyClient,K as PrivyProvider,a1 as VERSION,R as WalletConnector,$ as errorIndicatesMaxMfaRetries,a0 as errorIndicatesMfaTimeout,_ as errorIndicatesMfaVerificationFailed,N as getAccessToken,a6 as useCreateWallet,a3 as useIdentityToken,a8 as useImportWallet,a4 as useLogout,Y as useMfa,Z as useMfaEnrollment,X as usePrivy,a5 as useRegisterMfaListener,a7 as useSolanaWallets}from"./privy-provider-BrsjzEmo.mjs";import{useCallback as ne,useMemo as ie,useEffect as se,useContext as le,useState as ce,useRef as ue}from"react";import{P as de,a as he}from"./paths-CYLUXo_U.mjs";import{u as we,I as pe}from"./internal-context-DelFGnzS.mjs";import{u as me,P as ye,g as ge,a as fe,b as Ae,c as ke}from"./use-sign-with-user-signer-DCN1LHu1.mjs";export{c as useActiveWallet,a as useConnectWallet,b as useFundWallet,u as useLogin}from"./useActiveWallet-Bu4Myhqk.mjs";import{F as ve}from"./frame-FpttHlk8.mjs";import{MfaAuthTotpVerify as Ce,MfaAuthPasskeyInit as Ee,MfaAuthPasskeyVerify as Se,MfaAuthTotpInit as Te,MfaAuthTotpEnroll as Ue,MfaAuthTotpUnenroll as Ie,MfaAuthPasskeyEnrollment as We}from"@privy-io/public-api";import{jsxs as Re,Fragment as Pe,jsx as be}from"react/jsx-runtime";import Me from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import Ne from"@heroicons/react/24/outline/ShieldCheckIcon";import{zeroAddress as Oe,getAddress as _e,createWalletClient as Fe,http as Le,parseSignature as De}from"viem";import{hashAuthorization as He}from"viem/utils";import{getWallet as xe,updateWallet as Ke,generateAuthorizationSignature as qe,PrivyClientError as ze}from"@privy-io/js-sdk-core";export{DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS,addPrivyRpcToChain,addRpcUrlOverrideToChain}from"@privy-io/js-sdk-core";export{g as getEmbeddedConnectedWallet}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import{toAccount as je}from"viem/accounts";import"mipd";import"react-device-detect";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/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";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"ofetch";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";const Ve=()=>{let{user:r}=me(),{walletProxy:a}=we();return{recover:ne((async o=>{if(!a)throw Error("Wallet proxy is not ready");let n=await e();if(!r||!n)throw new de("User must be logged in before attempting to modify the recovery method.");let{entropyId:i,entropyIdVerifier:s}=t(r);try{await a.recover({entropyId:i,entropyIdVerifier:s,accessToken:n,...o})}catch{throw new de("Unable to recover wallets")}}),[a,r])}},Be=()=>{let{client:e,setAuthenticated:t,setUser:r}=we();return ie((()=>({init:async()=>{if(!e)throw new de("Must initialize Privy client first.");let t=new ve;return e.startAuthFlow(t),await t.init()},login:async({fid:a,message:o,signature:n})=>{if(!e)throw new de("Must initialize Privy client first.");if(!(e.authFlow instanceof ve))throw new de("Must initialize Farcaster frame flow first.");e.authFlow.setAuthData({message:o,signature:n,fid:a});let{user:i}=await e.authenticate();if(!i)throw new de("Failed to login with Farcaster V2");return r(i),t(!0),{user:i}}})),[e,r,t])},Ge=e=>{r("login",e);let t=o(),a=n(),{ready:c,user:u}=me(),{initLoginWithHeadlessOAuth:d,loginWithHeadlessOAuth:h,oAuthState:w,setOAuthState:p,isHeadlessOAuthLoading:m}=we(),y=ne((async e=>{try{if(t.enabled&&"success"!==t.status)throw new i(t.error,null,he.CAPTCHA_FAILURE);return await d(e.provider,t.token,e.disableSignup)}catch(e){throw p({status:"error",error:e}),e}}),[d,t]),g=ne((async()=>{let e=s();try{if(u)return console.warn("Cannot login with OAuth when already logged in"),u;if(!e.inProgress)throw Error("Cannot login with OAuth because no OAuth flow is in progress");if(e.popupFlow)return}catch(e){throw p({status:"error",error:e}),e}try{return await h(e)}catch(e){throw p({status:"error",error:e}),e}finally{l()}}),[h]);return se((()=>{let e=s();c&&a&&e.inProgress&&!e.withPrivyUi&&!e.popupFlow&&g().catch((()=>{}))}),[c,a]),{initOAuth:y,loading:m,state:w}},$e=e=>{let t=o(),{emailOtpState:r,setEmailOtpState:a,initLoginWithEmail:n,loginWithCode:s}=we();return{sendCode:ne((async({email:r,disableSignup:o})=>{try{let e;if(!r)throw Error("Email required to send OTP code");if(t.enabled&&"error"===t.status)throw new i(t.error,null,he.CAPTCHA_FAILURE);return t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),await n({email:r,captchaToken:e,disableSignup:o,withPrivyUi:!1})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[n]),loginWithCode:ne((async({code:r})=>{try{if(t.enabled&&"error"===t.status)throw new i(t.error,null,he.CAPTCHA_FAILURE);let{user:a,isNewUser:o,wasAlreadyAuthenticated:n,linkedAccount:l}=await s(r);e?.onComplete?.({user:a,isNewUser:o,wasAlreadyAuthenticated:n,loginMethod:"email",loginAccount:l})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[s,t.status]),state:r}},Qe=e=>{let t=o(),{initSignupWithPasskey:r,signupWithPasskey:a,passkeyAuthState:n,setPasskeyAuthState:s}=we();return{signupWithPasskey:ne((async()=>{try{let o;if(t.enabled&&"error"===t.status)throw new i(t.error,null,he.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),o=await t.waitForResult()),await r({captchaToken:o,withPrivyUi:!1});let{user:n,isNewUser:s,wasAlreadyAuthenticated:l,loginAccount:c}=await a();e?.onComplete?.({user:n,isNewUser:s,wasAlreadyAuthenticated:l,loginMethod:"passkey",loginAccount:c})}catch(t){throw s({status:"error",error:t}),e?.onError?.(t.privyErrorCode||he.UNKNOWN_AUTH_ERROR),t}}),[a,t.status]),state:n}},Xe=e=>{let t=o(),{initLoginWithPasskey:r,loginWithPasskey:a,passkeyAuthState:n,setPasskeyAuthState:s}=we();return{loginWithPasskey:ne((async o=>{try{let n;if(t.enabled&&"error"===t.status)throw new i(t.error,null,he.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),n=await t.waitForResult()),await r({captchaToken:n,withPrivyUi:!1});let{user:s,isNewUser:l,wasAlreadyAuthenticated:c,loginAccount:u}=await a(o);e?.onComplete?.({user:s,isNewUser:l,wasAlreadyAuthenticated:c,loginMethod:"passkey",loginAccount:u})}catch(o){throw s({status:"error",error:o}),e?.onError?.(o.privyErrorCode||he.UNKNOWN_AUTH_ERROR),o}}),[a,t.status]),state:n}},Je=e=>{let{initLinkWithPasskey:t,linkWithPasskey:r,passkeyAuthState:a,setPasskeyAuthState:o}=we();return{linkWithPasskey:ne((async()=>{try{await t();let a=await r();if(!a)throw Error("Error, user not found");let o=a.linkedAccounts.filter((e=>"passkey"===e.type)).sort(((e,t)=>t.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime()))[0];e?.onSuccess?.({user:a,linkMethod:"passkey",linkedAccount:o})}catch(t){throw o({status:"error",error:t}),e?.onError?.(t.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"passkey"}),t}}),[r]),state:a}},Ye=e=>{let t=o(),{smsOtpState:r,setSmsOtpState:a,initLoginWithSms:n,loginWithCode:s}=we();return{sendCode:ne((async({phoneNumber:r,disableSignup:o})=>{try{let e;if(!r)throw Error("SMS required to send OTP code");if(t.enabled&&"error"===t.status)throw new i(t.error,null,he.CAPTCHA_FAILURE);return t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),await n({phoneNumber:r,captchaToken:e,disableSignup:o,withPrivyUi:!1})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[n]),loginWithCode:ne((async({code:r})=>{try{if(t.enabled&&"success"!==t.status)throw new i(t.error,null,he.CAPTCHA_FAILURE);let{user:a,isNewUser:o,wasAlreadyAuthenticated:n,linkedAccount:l}=await s(r);e?.onComplete?.({user:a,isNewUser:o,wasAlreadyAuthenticated:n,loginMethod:"sms",loginAccount:l})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[s,t.status]),state:r}},Ze=e=>{let{connectOrCreateWallet:t}=me();return r("connectOrCreateWallet",e),{connectOrCreateWallet:t}},et=e=>{let t=o(),{siweState:r,setSiweState:a,linkWithSiwe:n,generateSiweMessage:s}=we();return{generateSiweMessage:ne((async({address:t,chainId:r})=>{try{if(!t||!r)throw Error("wallet address and chainId required to generate nonce");return await s({address:t,chainId:r}).then((e=>e))}catch(t){throw a({status:"error",error:t}),e?.onError?.(t.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"siwe"}),t}}),[s]),linkWithSiwe:ne((async({signature:r,message:o,chainId:s,walletClientType:l,connectorType:c})=>{try{if(t.enabled&&"success"!==t.status)throw new i(t.error,null,he.CAPTCHA_FAILURE);let{user:a,linkedAccount:u}=await n({message:o,signature:r,chainId:s,walletClientType:l,connectorType:c});u&&e?.onSuccess?.({user:a,linkMethod:"siwe",linkedAccount:u})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"siwe"}),r}}),[n,t.status]),state:r}},tt=e=>{let t=o(),{siweState:r,setSiweState:a,client:n,generateSiweMessage:s,loginWithSiwe:l}=we();return{generateSiweNonce:ne((async r=>{try{let e;if(t.enabled&&"error"===t.status)throw new i(t.error,null,he.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),a({status:"generating-message"});let o=await n.generateSiweNonce({address:r?.address,captchaToken:e});return a({status:"awaiting-signature"}),o}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[n,t]),generateSiweMessage:ne((async({address:t,chainId:r})=>{try{return await s({address:t,chainId:r})}catch(t){throw a({status:"error",error:t}),e?.onError?.(t.privyErrorCode||he.UNKNOWN_AUTH_ERROR),t}}),[s]),loginWithSiwe:ne((async({message:r,signature:o,disableSignup:n})=>{try{let a;if(t.enabled&&"error"===t.status)throw new i(t.error,null,he.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),a=await t.waitForResult());let s=await l({message:r,signature:o,captchaToken:a,disableSignup:n});return e?.onComplete?.({user:s,isNewUser:!1,wasAlreadyAuthenticated:!1,loginMethod:"siwe",loginAccount:null}),s}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[l,t.status]),state:r}};function rt(){let{signTransaction:e}=le(ye);return{signTransaction:e}}function at(e){let{linkEmail:t,linkPhone:a,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:s,linkDiscord:l,linkGithub:c,linkLinkedIn:u,linkTiktok:d,linkLine:h,linkSpotify:w,linkInstagram:p,linkTelegram:m,linkFarcaster:y,linkPasskey:g}=le(ye);return r("linkAccount",e),{linkEmail:t,linkPhone:a,linkWallet:o,linkGoogle:n,linkApple:i,linkTwitter:s,linkDiscord:l,linkGithub:c,linkLinkedIn:u,linkTiktok:d,linkLine:h,linkSpotify:w,linkInstagram:p,linkFarcaster:y,linkTelegram:m,linkPasskey:g}}function ot(e){let{updateEmail:t,updatePhone:a}=le(ye);return r("update",e),{updateEmail:t,updatePhone:a}}const nt=e=>{let{user:t}=me(),{loginWithCode:r,emailOtpState:a,setEmailOtpState:o,client:n,inProgressAuthFlowRef:i,inProgressLoginOrLinkMethodRef:s}=we();return{state:a,sendCode:ne((async({newEmailAddress:r})=>{try{if(!t?.email)throw Error("User is required to have an email address to update it.");let e=new d(t.email.address,r);n.startAuthFlow(e),await e.sendCodeEmail({withPrivyUi:!1})}catch(r){o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"email"})}}),[t?.email]),verifyCode:ne((async({code:a})=>{try{if(!t?.email)throw Error("User is required to have an email address to update it.");i.current="update",s.current="email";let{user:o,linkedAccount:n}=await r(a);return e?.onSuccess?.({user:o,updateMethod:"email",updatedAccount:n}),{user:o}}catch(a){o({status:"error",error:a}),e?.onError?.(a.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"email"})}}),[t?.email])}},it=()=>{let{connectCoinbaseSmartWallet:e}=we();return{connectCoinbaseSmartWallet:e}},st=()=>{let{connectBaseAccount:e}=we();return{connectBaseAccount:e}},lt=()=>{let{setModalData:e}=h(),{openModal:t,privy:r,closePrivyModal:a}=we(),{user:o}=me();return ie((()=>({verify:async({standalone:n=!0}={standalone:!0})=>new Promise(((i,s)=>o?0===o.mfaMethods.length?i():(e((e=>({...e,mfaVerify:{onSuccess:async()=>{n?await a({shouldCallAuthOnSuccess:!1,isSuccess:!0}):w.setState({inProgressMfaFlow:void 0}),i()},onFailure:async e=>{n?await a({shouldCallAuthOnSuccess:!1,isSuccess:!1}):w.setState({inProgressMfaFlow:void 0}),s(e)},sendSmsCode:async()=>{throw Error("Not enabled")},verifySmsCode:async()=>{throw Error("Not enabled")},verifyTotpCode:async e=>{await r.fetchPrivyRoute(Ce,{body:{code:e}})},generateOptions:async()=>p((await r.fetchPrivyRoute(Ee,{body:{}})).options),verifyPasskey:async e=>{let t=await import("@simplewebauthn/browser"),a=await t.startAuthentication(e);await r.fetchPrivyRoute(Se,{body:{authenticator_response:m(a)}})}}}))),void(n?t(y):w.setState({inProgressMfaFlow:"auth"}))):s(Error("Must be logged in to verify MFA"))))})),[r,e,t,a])},ct={component:()=>{let{user:e,ready:t}=me(),{app:r,data:a,onUserCloseViaDialogOrKeybindRef:o}=h(),[n,i]=ce(null),[s,l]=ce(null),[c,u]=ce(null),[d,w]=ce(!1),[p,m]=ce(!1),[y,g]=ce(),R=async()=>{y?b(y):e?await N({user:e}):b(Error("Must be logged in to manage MFA")),setTimeout((()=>{i(null),l(null)}),500)};if(o.current=R,!a?.mfaEnroll)throw Error("Missing modal data for MFA enrollment screen.");let{onFailure:b,onSuccess:N,mfaMethods:O,verify:_,generateTotpSecret:L,enrollTotp:D,unenrollTotp:H,enrollPasskey:x}=a.mfaEnroll,K=e?.mfaMethods.includes("sms"),q=e?.mfaMethods.includes("totp"),z=e?.mfaMethods.includes("passkey"),j=!!e?.phone,V=e?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function B(){i(null),l(null),g(void 0)}async function G(e=V){try{g(void 0),m(!0);let t=await x(e);return await N({user:t})}catch(e){g(e)}finally{m(!1),w(!1)}}if(!t||!e||!r)/*#__PURE__*/return Re(Pe,{children:[/*#__PURE__*/be(f,{onClose:R},"header"),/*#__PURE__*/be(A,{children:/*#__PURE__*/be(k,{})}),/*#__PURE__*/be(v,{children:/*#__PURE__*/be(C,{})}),/*#__PURE__*/be(E,{})]});if("sms"===n)return null;if("totp"===n)/*#__PURE__*/return Re(Pe,{children:[/*#__PURE__*/be(f,{backFn:B,onClose:R},"header"),/*#__PURE__*/be(S,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/be(Me,{})}),/*#__PURE__*/be(T,{children:"Remove authenticator app verification?"}),/*#__PURE__*/Re(U,{children:["MFA adds an extra layer of security to your ",r?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/be(I,{children:/*#__PURE__*/be(W,{$warn:!0,onClick:async function(){try{g(void 0),m(!0);let e=await H();return await N({user:e})}catch(e){g(e)}finally{m(!1),i(null)}},loading:p,children:"Remove"})}),/*#__PURE__*/be(E,{})]});if("passkey"===n){let e=a.mfaEnroll.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return Re(Pe,{children:[/*#__PURE__*/be(f,{backFn:B,onClose:R},"header"),/*#__PURE__*/be(S,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/be(Me,{})}),/*#__PURE__*/be(T,{children:"Are you sure you want to remove this passkey?"}),/*#__PURE__*/be(U,{children:e?"Removing your passkey will remove as both a verification method and a login method.":"Removing your passkey will remove as a verification method."}),/*#__PURE__*/be(I,{children:/*#__PURE__*/be(W,{$warn:!0,onClick:async function(){try{g(void 0),m(!0);let e=await x([]);return await N({user:e})}catch(e){g(e)}finally{m(!1),i(null)}},loading:p,children:"Remove"})}),/*#__PURE__*/be(E,{})]})}return 0!==O.length||K||q||z?"sms"===s?null:"totp"===s&&c?/*#__PURE__*/be(P,{onClose:R,onReset:B,submitEnrollmentWithTotp:e=>async function(e){try{g(void 0),m(!0);let t=await D(e);return await N({user:t})}catch(e){g(e)}finally{m(!1),i(null)}}(e.mfaCode),error:y,totpInfo:{...c,appName:r?.name||"Privy"}}):"passkey"===s?/*#__PURE__*/be(M,{onReset:B,onClose:R,submitEnrollmentWithPasskey:G}):/*#__PURE__*/be(F,{showIntro:!1,userMfaMethods:e.mfaMethods,appMfaMethods:r.mfa.methods,userHasAuthSms:j,onBackToIntro:()=>{},handleSelectMethod:async function(e){g(void 0);try{await _()}catch(e){return void g(e)}return"totp"===e?(l(e),u(null),void L().then((({totpSecret:e,totpAuthUrl:t})=>{u({authUrl:t,secret:e})})).catch((()=>{u(null),B()}))):"passkey"===e&&1===V.length?await G():void l(e)},isTotpLoading:"totp"===s&&!c,isPasskeyLoading:d,error:y,onClose:R,setRemovingMfaMethod:async function(e){g(void 0);try{await _()}catch(e){return void g(e)}i(e)}}):/*#__PURE__*/Re(Pe,{children:[/*#__PURE__*/be(f,{onClose:R},"header"),/*#__PURE__*/be(S,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/be(Ne,{})}),/*#__PURE__*/be(T,{children:"Add more security"}),/*#__PURE__*/Re(U,{children:[r?.name," does not have any verification methods enabled."]}),/*#__PURE__*/be(I,{children:/*#__PURE__*/be(W,{onClick:R,children:"Close"})}),/*#__PURE__*/be(E,{})]})}},ut=()=>{let e=L(),{setModalData:t}=h(),{verify:r}=lt(),{openModal:a,privy:o,closePrivyModal:n,refreshSessionAndUser:i,setUser:s}=we();return ie((()=>({enroll:async()=>new Promise(((l,c)=>{t({mfaEnroll:{onSuccess:async e=>{await n({shouldCallAuthOnSuccess:!1,isSuccess:!0}),l(e)},onFailure:async e=>{await n({shouldCallAuthOnSuccess:!1,isSuccess:!1}),c(e)},verify:()=>r({standalone:!1}),shouldUnlinkOnUnenrollMfa:!0,mfaMethods:e.mfa.methods,sendSmsCode:async()=>{throw Error("Not enabled")},enrollSms:async()=>{throw Error("Not enabled")},unenrollSms:async()=>{throw Error("Not enabled")},generateTotpSecret:async()=>await o.fetchPrivyRoute(Te,{body:{}}),enrollTotp:async e=>{await o.fetchPrivyRoute(Ue,{body:{code:e}});let t=await i();return s(t),t},unenrollTotp:async()=>{await o.fetchPrivyRoute(Ie,{body:{}});let e=await i();return s(e),e},enrollPasskey:async e=>{await o.fetchPrivyRoute(We,{body:{credential_ids:e,remove_for_login:!0}});let t=await i();return s(t),t}}}),a(ct)}))})),[o,t,a,n])},dt=()=>{let{startCrossAppAuthFlow:e,unlinkCrossAppAccount:t,signMessageWithCrossAppWallet:r,signTypedDataWithCrossAppWallet:a,sendTransactionWithCrossAppWallet:o}=me();return{loginWithCrossAppAccount:({appId:t})=>e({appId:t,action:"login"}),linkCrossAppAccount:({appId:t})=>e({appId:t,action:"link"}),unlinkCrossAppAccount:t,signMessage:r,signTypedData:a,sendTransaction:o}};function ht(e){let{sendTransaction:t}=le(ye);return r("sendTransaction",e),{sendTransaction:t}}function wt(e){let{setWalletPassword:t}=le(ye);return r("setWalletPassword",e),{setWalletPassword:t}}function pt(){let e=L(),{getAccessToken:t}=me(),r=D(),{client:a,setUser:o,setAuthenticated:n,setIsNewUser:i,initializeWalletProxy:s}=we(),{create:l}=H();return{createGuestAccount:async()=>{if(!e.id||!a)throw Error("SDK not yet ready");a.startAuthFlow(new x(e.id));try{let c=await a.authenticate(),u=c.user,d=c.isNewUser??!1;if(!u)throw new de("Unable to authenticate guest account");let h=await t(),w=await s(q);if(h&&w)try{let t=z(u,e.embeddedWallets.ethereum.createOnLogin),r=j(u,e.embeddedWallets.solana.createOnLogin);t&&r?(u=(await l({chainType:"ethereum",latestUser:u})).user,u=(await l({chainType:"solana",latestUser:u})).user):r?u=(await l({chainType:"solana",latestUser:u})).user:t?u=(await l({chainType:"ethereum",latestUser:u})).user:o(u)}catch(e){o(u),console.warn("Unable to create embedded wallet for guest account")}return i(d),n(!0),r("login","onComplete",{user:u,isNewUser:d,wasAlreadyAuthenticated:!1,loginMethod:"guest",loginAccount:null}),u}catch(e){throw r("login","onError",e.privyErrorCode||he.UNKNOWN_AUTH_ERROR),e}}}}function mt(e){let{setWalletRecovery:t}=le(ye);return r("setWalletRecovery",e),{setWalletRecovery:t}}function yt(e){let{signMessage:t}=le(ye);return r("signMessage",e),{signMessage:t}}const gt=()=>{let{ready:e,wallets:t}=B(),{user:r}=me(),{rpcConfig:a,chains:o,appId:n}=we();return{signAuthorization:ne((async(i,s)=>{let l;if(!r)throw Error("User must be authenticated before signing with a Privy wallet");if(!e)throw Error("Wallets are not ready");let c=s?.address??ge(r)?.address??Oe,u=t.find((e=>_e(e.address)===_e(c)));if(!u)throw Error("Signing wallet not found.");let d=i.chainId??Number(u.chainId.split(":")[1]);if(0===d)l={chainId:0,address:i.contractAddress,nonce:i.nonce??0};else{let e=o.find((e=>e.id===d));if(!e)throw Error("Error, chain not configured in PrivyProvider config");let t=Fe({account:c,chain:e,transport:Le(G(e,a,n))});l=await t.prepareAuthorization({...i})}let h=await u.getEthereumProvider(),w=await h.request({method:"secp256k1_sign",params:[He(l)]});return{...l,...De(w)}}),[e,t,r,o])}},ft=gt;function At(e){let{signTypedData:t}=le(ye);return r("signTypedData",e),{signTypedData:t}}const kt=()=>{let{isModalOpen:e}=le(ye);return{isOpen:e}};function vt(e){let{getAccessToken:t}=le(ye);return r("accessToken",e),{getAccessToken:t}}function Ct(e){let{authenticated:t,user:a}=me(),{initLoginWithOAuth:o}=we(),n=D();return r("oAuthAuthorization",e),{reauthorize:e=>Et(t,a,o,n,e.provider)}}let Et=async(e,t,r,a,o)=>{if(!e)throw a("linkAccount","onError",he.MUST_BE_AUTHENTICATED,{linkMethod:o}),new de("User must be authenticated before linking an account.");if(!t?.linkedAccounts.some((e=>e.type.includes(o))))throw new de(`OAuth account of type ${o} not linked to the account.`);await r(o)};function St(e){let{client:t}=we(),[r,a]=ce({status:"initial"});return{linkWithCustomJwt:ne((async r=>{try{a({status:"initial"}),t.startAuthFlow(new J(r)),a({status:"loading"});let{user:o}=await t.link();if(!o)throw Error("Error, user not found");let n=o.linkedAccounts.filter((e=>"custom_auth"===e.type)).sort(((e,t)=>t.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime())).at(0);return a({status:"done"}),e?.onSuccess?.({user:o,linkMethod:"custom",linkedAccount:n}),{user:o}}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"custom"}),r}}),[t.startAuthFlow,t.link]),state:r}}const Tt=e=>{let t=ee();return r("customAuth",e),{status:t}};function Ut({isAuthenticated:e,isLoading:t,...r}){let a=ue();se((()=>{t||a.current?.()}),[e,t]);let o=ne((e=>(a.current=e,()=>{a.current=void 0})),[]);return te({...r,subscribe:o})}function It(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=me();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}const Wt=()=>{let{revokeDelegatedWallets:e,delegateWallet:t}=we();return{delegateWallet:async({address:e,chainType:r})=>await t({address:e,chainType:r,showDelegationUIs:!0}),revokeWallets:async()=>await e({showDelegationUIs:!0})}},Rt=()=>{let{addSessionSignersInternal:e,removeSessionSignersInternal:t}=(()=>{let{getAccessToken:e,user:t}=me(),r=we(),{signWithUserSigner:a}=fe(),o=async({wallet:o,additional_signers:n})=>{let i=await e();if(!t||!i)throw new de("User must be authenticated and have an embedded wallet to delegate actions.");if(!o.id)throw new de("Wallet to add signers to must have ID on server");if(!r.walletProxy)throw new de("Wallet proxy not initialized.");await Ke(r.privy,{wallet_id:o.id},a,{additional_signers:n})};return{addSessionSignersInternal:async({address:a,signers:n})=>{let i=await e();if(!t||!i)throw new de("User must be authenticated and have an embedded wallet to add a session signer.");let s=r.walletProxy??await r.initializeWalletProxy(15e3);if(!s)throw new de("Wallet proxy not initialized.");let l=Ae(t,a);if(!l)throw new de("Address to add signers too is not associated with current user.");if(ke(l)){if(0===n.length)throw new de("Must specify at least one signer to add.");let e=[...(await xe(r.privy,{wallet_id:l.id})).additional_signers,...re(n)];await o({wallet:l,additional_signers:e})}else{if(l.delegated)return{user:t};if(n.length>0)throw new de("Specifying signers in addSessionSigners is only supported for TEE execution and this app uses On-device execution. Pass an empty array for signers instead. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide");let e=ae({address:a,user:t}),o=oe({address:a,user:t});await r.recoverEmbeddedWallet({address:a}),await s.createDelegatedAction({accessToken:i,rootWallet:o,delegatedWallets:[e]})}let c=await r.refreshSessionAndUser();if(!c)throw Error("Could not refresh user");return{user:c}},removeSessionSignersInternal:async({address:a})=>{let n=await e();if(!t||!n)throw new de("User must be authenticated and have an embedded wallet to delegate actions.");if(!(r.walletProxy??await r.initializeWalletProxy(15e3)))throw new de("Wallet proxy not initialized.");let i=Ae(t,a);if(!i)throw new de("Address to remove signers from is not associated with current user.");ke(i)?await o({wallet:i,additional_signers:[]}):await r.client.revokeDelegatedWallet();let s=await r.refreshSessionAndUser();if(!s)throw Error("Could not refresh user");return{user:s}}}})();return{addSessionSigners:async({address:t,signers:r})=>e({address:t,signers:r}),removeSessionSigners:async({address:e})=>t({address:e})}},Pt=()=>{let{signWithUserSigner:e}=fe();return ie((()=>({async generateAuthorizationSignature(t){let{signature:r}=await qe(e,t);return{signature:r}}})),[e])},bt=()=>{let{setUser:e,client:t}=le(pe),{user:r}=le(ye);return{user:r,refreshUser:ne((async()=>{let r=await(t?.updateUserAndIdToken());return e(r??null),r}),[t,e])}},Mt=e=>{let t=o(),{initLoginWithTelegram:r,loginWithTelegram:a,telegramAuthState:n,setTelegramAuthState:s}=we();return{login:ne((async o=>{try{if(t.enabled&&"success"!==t.status)throw new i(t.error,null,he.CAPTCHA_FAILURE);await r(t.token,o?.disableSignup);let{user:n,isNewUser:s,loginAccount:l,wasAlreadyAuthenticated:c}=await a({intent:"login"});e?.onComplete?.({user:n,isNewUser:s,wasAlreadyAuthenticated:c,loginMethod:"telegram",loginAccount:l})}catch(o){throw s({status:"error",error:o}),e?.onError?.(o.privyErrorCode||he.UNKNOWN_AUTH_ERROR),o}}),[r,a,t]),state:n}},Nt=()=>{let{revokeDelegatedWallets:e,delegateWallet:t}=we();return{delegateWallet:async({address:e,chainType:r})=>await t({address:e,chainType:r,showDelegationUIs:!1}),revokeWallets:async()=>await e({showDelegationUIs:!1})}},Ot=async({wallet:e})=>{let t=await e.getEthereumProvider();return je({address:e.address,sign:async({hash:r})=>{if("privy"!==e.walletClientType)throw new ze({error:"Unprefixed signing is not supported by external wallets.",code:"unsupported_wallet_type"});return await t.request({method:"secp256k1_sign",params:[r]})},signMessage:async({message:r})=>await t.request({method:"personal_sign",params:[r,e.address]}),signTypedData:async r=>await t.request({method:"eth_signTypedData_v4",params:[e.address,r]}),signTransaction:async e=>await t.request({method:"eth_signTransaction",params:[e]})})};export{Ot as toViemAccount,lt as useAuthMfa,ut as useAuthMfaEnrollment,Pt as useAuthorizationSignature,st as useConnectBaseAccount,it as useConnectCoinbaseSmartWallet,Ze as useConnectOrCreateWallet,dt as useCrossAppAccounts,Tt as useCustomAuth,Wt as useDelegatedActions,It as useFarcasterSigner,pt as useGuestAccounts,Nt as useHeadlessDelegatedActions,at as useLinkAccount,St as useLinkJwtAccount,Je as useLinkWithPasskey,et as useLinkWithSiwe,$e as useLoginWithEmail,Be as useLoginWithFarcasterV2,Ge as useLoginWithOAuth,Xe as useLoginWithPasskey,tt as useLoginWithSiwe,Ye as useLoginWithSms,Mt as useLoginWithTelegram,kt as useModalStatus,Ct as useOAuthTokens,Ve as useRecoverEmbeddedWallet,ht as useSendTransaction,Rt as useSessionSigners,wt as useSetWalletPassword,mt as useSetWalletRecovery,gt as useSign7702Authorization,ft as useSignAuthorization,yt as useSignMessage,rt as useSignTransaction,At as useSignTypedData,Qe as useSignupWithPasskey,Ut as useSubscribeToJwtAuthWithFlag,te as useSyncJwtBasedAuthState,vt as useToken,ot as useUpdateAccount,nt as useUpdateEmail,bt as useUser,B as useWallets};
1
+ import{g as e,a as t,u as r,b as o,c as n,C as s,d as i,s as l,U as d,e as h,f as w,t as p,h as m,M as y,i as f,A,j as k,k as C,L as v,l as E,I as S,T,S as U,B as I,P as W,E as P,m as M,n as F,o as L,p as H,q as D,G as x,W as q,r as z,v as j,w as B,x as G,y as J,z as ee,D as te,F as re,H as ae,J as oe}from"./privy-provider-B0E_t4-_.mjs";export{O as Captcha,Q as ConnectorManager,V as EthereumWalletConnector,a9 as LoginModal,a2 as PrivyClient,K as PrivyProvider,a1 as VERSION,R as WalletConnector,$ as errorIndicatesMaxMfaRetries,a0 as errorIndicatesMfaTimeout,_ as errorIndicatesMfaVerificationFailed,N as getAccessToken,a6 as useCreateWallet,a3 as useIdentityToken,a8 as useImportWallet,a4 as useLogout,Y as useMfa,Z as useMfaEnrollment,X as usePrivy,a5 as useRegisterMfaListener,a7 as useSolanaWallets}from"./privy-provider-B0E_t4-_.mjs";import{useCallback as ne,useMemo as se,useEffect as ie,useContext as le,useState as ce,useRef as ue}from"react";import{P as de,a as he}from"./paths-DCwuPDUk.mjs";import{u as we,I as pe}from"./internal-context-qdNgTV5f.mjs";import{u as me,P as ye,g as ge,a as fe,b as Ae,c as ke}from"./use-sign-with-user-signer-DnNPDfxp.mjs";export{c as useActiveWallet,a as useConnectWallet,b as useFundWallet,u as useLogin}from"./useActiveWallet-Cqbk2Bwf.mjs";import{F as Ce}from"./frame-DMd4vZ0H.mjs";import{MfaAuthTotpVerify as ve,MfaAuthPasskeyInit as Ee,MfaAuthPasskeyVerify as Se,MfaAuthTotpInit as Te,MfaAuthTotpEnroll as Ue,MfaAuthTotpUnenroll as Ie,MfaAuthPasskeyEnrollment as Re}from"@privy-io/public-api";import{jsxs as We,Fragment as Pe,jsx as be}from"react/jsx-runtime";import Me from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import Ne from"@heroicons/react/24/outline/ShieldCheckIcon";import{zeroAddress as Oe,getAddress as _e,createWalletClient as Fe,http as Le,parseSignature as He}from"viem";import{hashAuthorization as De}from"viem/utils";import{getWallet as xe,updateWallet as Ke,generateAuthorizationSignature as qe,PrivyClientError as ze}from"@privy-io/js-sdk-core";export{DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS,addPrivyRpcToChain,addRpcUrlOverrideToChain}from"@privy-io/js-sdk-core";export{g as getEmbeddedConnectedWallet}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import{toAccount as je}from"viem/accounts";import"mipd";import"react-device-detect";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/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";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"ofetch";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";const Ve=()=>{let{user:r}=me(),{walletProxy:a}=we();return{recover:ne((async o=>{if(!a)throw Error("Wallet proxy is not ready");let n=await e();if(!r||!n)throw new de("User must be logged in before attempting to modify the recovery method.");let{entropyId:s,entropyIdVerifier:i}=t(r);try{await a.recover({entropyId:s,entropyIdVerifier:i,accessToken:n,...o})}catch{throw new de("Unable to recover wallets")}}),[a,r])}},Be=()=>{let{client:e,setAuthenticated:t,setUser:r}=we();return se((()=>({init:async()=>{if(!e)throw new de("Must initialize Privy client first.");let t=new Ce;return e.startAuthFlow(t),await t.init()},login:async({fid:a,message:o,signature:n})=>{if(!e)throw new de("Must initialize Privy client first.");if(!(e.authFlow instanceof Ce))throw new de("Must initialize Farcaster frame flow first.");e.authFlow.setAuthData({message:o,signature:n,fid:a});let{user:s}=await e.authenticate();if(!s)throw new de("Failed to login with Farcaster V2");return r(s),t(!0),{user:s}}})),[e,r,t])},Ge=e=>{r("login",e);let t=o(),a=n(),{ready:c,user:u}=me(),{initLoginWithHeadlessOAuth:d,loginWithHeadlessOAuth:h,oAuthState:w,setOAuthState:p,isHeadlessOAuthLoading:m}=we(),y=ne((async e=>{try{if(t.enabled&&"success"!==t.status)throw new s(t.error,null,he.CAPTCHA_FAILURE);return await d(e.provider,t.token,e.disableSignup)}catch(e){throw p({status:"error",error:e}),e}}),[d,t]),g=ne((async()=>{let e=i();try{if(u)return console.warn("Cannot login with OAuth when already logged in"),u;if(!e.inProgress)throw Error("Cannot login with OAuth because no OAuth flow is in progress");if(e.popupFlow)return}catch(e){throw p({status:"error",error:e}),e}try{return await h(e)}catch(e){throw p({status:"error",error:e}),e}finally{l()}}),[h]);return ie((()=>{let e=i();c&&a&&e.inProgress&&!e.withPrivyUi&&!e.popupFlow&&g().catch((()=>{}))}),[c,a]),{initOAuth:y,loading:m,state:w}},$e=e=>{let t=o(),{emailOtpState:r,setEmailOtpState:a,initLoginWithEmail:n,loginWithCode:i}=we();return{sendCode:ne((async({email:r,disableSignup:o})=>{try{let e;if(!r)throw Error("Email required to send OTP code");if(t.enabled&&"error"===t.status)throw new s(t.error,null,he.CAPTCHA_FAILURE);return t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),await n({email:r,captchaToken:e,disableSignup:o,withPrivyUi:!1})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[n]),loginWithCode:ne((async({code:r})=>{try{if(t.enabled&&"error"===t.status)throw new s(t.error,null,he.CAPTCHA_FAILURE);let{user:a,isNewUser:o,wasAlreadyAuthenticated:n,linkedAccount:l}=await i(r);e?.onComplete?.({user:a,isNewUser:o,wasAlreadyAuthenticated:n,loginMethod:"email",loginAccount:l})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[i,t.status]),state:r}},Qe=e=>{let t=o(),{initSignupWithPasskey:r,signupWithPasskey:a,passkeyAuthState:n,setPasskeyAuthState:i}=we();return{signupWithPasskey:ne((async()=>{try{let o;if(t.enabled&&"error"===t.status)throw new s(t.error,null,he.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),o=await t.waitForResult()),await r({captchaToken:o,withPrivyUi:!1});let{user:n,isNewUser:i,wasAlreadyAuthenticated:l,loginAccount:c}=await a();e?.onComplete?.({user:n,isNewUser:i,wasAlreadyAuthenticated:l,loginMethod:"passkey",loginAccount:c})}catch(t){throw i({status:"error",error:t}),e?.onError?.(t.privyErrorCode||he.UNKNOWN_AUTH_ERROR),t}}),[a,t.status]),state:n}},Xe=e=>{let t=o(),{initLoginWithPasskey:r,loginWithPasskey:a,passkeyAuthState:n,setPasskeyAuthState:i}=we();return{loginWithPasskey:ne((async o=>{try{let n;if(t.enabled&&"error"===t.status)throw new s(t.error,null,he.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),n=await t.waitForResult()),await r({captchaToken:n,withPrivyUi:!1});let{user:i,isNewUser:l,wasAlreadyAuthenticated:c,loginAccount:u}=await a(o);e?.onComplete?.({user:i,isNewUser:l,wasAlreadyAuthenticated:c,loginMethod:"passkey",loginAccount:u})}catch(o){throw i({status:"error",error:o}),e?.onError?.(o.privyErrorCode||he.UNKNOWN_AUTH_ERROR),o}}),[a,t.status]),state:n}},Je=e=>{let{initLinkWithPasskey:t,linkWithPasskey:r,passkeyAuthState:a,setPasskeyAuthState:o}=we();return{linkWithPasskey:ne((async()=>{try{await t();let a=await r();if(!a)throw Error("Error, user not found");let o=a.linkedAccounts.filter((e=>"passkey"===e.type)).sort(((e,t)=>t.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime()))[0];e?.onSuccess?.({user:a,linkMethod:"passkey",linkedAccount:o})}catch(t){throw o({status:"error",error:t}),e?.onError?.(t.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"passkey"}),t}}),[r]),state:a}},Ye=e=>{let t=o(),{smsOtpState:r,setSmsOtpState:a,initLoginWithSms:n,loginWithCode:i}=we();return{sendCode:ne((async({phoneNumber:r,disableSignup:o})=>{try{let e;if(!r)throw Error("SMS required to send OTP code");if(t.enabled&&"error"===t.status)throw new s(t.error,null,he.CAPTCHA_FAILURE);return t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),await n({phoneNumber:r,captchaToken:e,disableSignup:o,withPrivyUi:!1})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[n]),loginWithCode:ne((async({code:r})=>{try{if(t.enabled&&"error"===t.status)throw new s(t.error,null,he.CAPTCHA_FAILURE);let{user:a,isNewUser:o,wasAlreadyAuthenticated:n,linkedAccount:l}=await i(r);e?.onComplete?.({user:a,isNewUser:o,wasAlreadyAuthenticated:n,loginMethod:"sms",loginAccount:l})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[i,t.status]),state:r}},Ze=e=>{let{connectOrCreateWallet:t}=me();return r("connectOrCreateWallet",e),{connectOrCreateWallet:t}},et=e=>{let t=o(),{siweState:r,setSiweState:a,linkWithSiwe:n,generateSiweMessage:i}=we();return{generateSiweMessage:ne((async({address:t,chainId:r})=>{try{if(!t||!r)throw Error("wallet address and chainId required to generate nonce");return await i({address:t,chainId:r}).then((e=>e))}catch(t){throw a({status:"error",error:t}),e?.onError?.(t.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"siwe"}),t}}),[i]),linkWithSiwe:ne((async({signature:r,message:o,chainId:i,walletClientType:l,connectorType:c})=>{try{if(t.enabled&&"success"!==t.status)throw new s(t.error,null,he.CAPTCHA_FAILURE);let{user:a,linkedAccount:u}=await n({message:o,signature:r,chainId:i,walletClientType:l,connectorType:c});u&&e?.onSuccess?.({user:a,linkMethod:"siwe",linkedAccount:u})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"siwe"}),r}}),[n,t.status]),state:r}},tt=e=>{let t=o(),{siweState:r,setSiweState:a,client:n,generateSiweMessage:i,loginWithSiwe:l}=we();return{generateSiweNonce:ne((async r=>{try{let e;if(t.enabled&&"error"===t.status)throw new s(t.error,null,he.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),a({status:"generating-message"});let o=await n.generateSiweNonce({address:r?.address,captchaToken:e});return a({status:"awaiting-signature"}),o}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[n,t]),generateSiweMessage:ne((async({address:r,chainId:o})=>{try{let e;if(t.enabled&&"error"===t.status)throw new s(t.error,null,he.CAPTCHA_FAILURE);return t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),await i({address:r,chainId:o,captchaToken:e})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[i,t]),loginWithSiwe:ne((async({message:r,signature:o,disableSignup:n})=>{try{let a;if(t.enabled&&"error"===t.status)throw new s(t.error,null,he.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),a=await t.waitForResult());let i=await l({message:r,signature:o,captchaToken:a,disableSignup:n});return e?.onComplete?.({user:i,isNewUser:!1,wasAlreadyAuthenticated:!1,loginMethod:"siwe",loginAccount:null}),i}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[l,t.status]),state:r}};function rt(){let{signTransaction:e}=le(ye);return{signTransaction:e}}function at(e){let{linkEmail:t,linkPhone:a,linkWallet:o,linkGoogle:n,linkApple:s,linkTwitter:i,linkDiscord:l,linkGithub:c,linkLinkedIn:u,linkTiktok:d,linkLine:h,linkSpotify:w,linkInstagram:p,linkTelegram:m,linkFarcaster:y,linkPasskey:g}=le(ye);return r("linkAccount",e),{linkEmail:t,linkPhone:a,linkWallet:o,linkGoogle:n,linkApple:s,linkTwitter:i,linkDiscord:l,linkGithub:c,linkLinkedIn:u,linkTiktok:d,linkLine:h,linkSpotify:w,linkInstagram:p,linkFarcaster:y,linkTelegram:m,linkPasskey:g}}function ot(e){let{updateEmail:t,updatePhone:a}=le(ye);return r("update",e),{updateEmail:t,updatePhone:a}}const nt=e=>{let{user:t}=me(),{loginWithCode:r,emailOtpState:a,setEmailOtpState:o,client:n,inProgressAuthFlowRef:s,inProgressLoginOrLinkMethodRef:i}=we();return{state:a,sendCode:ne((async({newEmailAddress:r})=>{try{if(!t?.email)throw Error("User is required to have an email address to update it.");let e=new d(t.email.address,r);n.startAuthFlow(e),await e.sendCodeEmail({withPrivyUi:!1})}catch(r){o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"email"})}}),[t?.email]),verifyCode:ne((async({code:a})=>{try{if(!t?.email)throw Error("User is required to have an email address to update it.");s.current="update",i.current="email";let{user:o,linkedAccount:n}=await r(a);return e?.onSuccess?.({user:o,updateMethod:"email",updatedAccount:n}),{user:o}}catch(a){o({status:"error",error:a}),e?.onError?.(a.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"email"})}}),[t?.email])}},st=()=>{let{connectCoinbaseSmartWallet:e}=we();return{connectCoinbaseSmartWallet:e}},it=()=>{let{connectBaseAccount:e}=we();return{connectBaseAccount:e}},lt=()=>{let{baseAccountSdk:e}=we();return{baseAccountSdk:e}},ct=()=>{let{setModalData:e}=h(),{openModal:t,privy:r,closePrivyModal:a}=we(),{user:o}=me();return se((()=>({verify:async({standalone:n=!0}={standalone:!0})=>new Promise(((s,i)=>o?0===o.mfaMethods.length?s():(e((e=>({...e,mfaVerify:{onSuccess:async()=>{n?await a({shouldCallAuthOnSuccess:!1,isSuccess:!0}):w.setState({inProgressMfaFlow:void 0}),s()},onFailure:async e=>{n?await a({shouldCallAuthOnSuccess:!1,isSuccess:!1}):w.setState({inProgressMfaFlow:void 0}),i(e)},sendSmsCode:async()=>{throw Error("Not enabled")},verifySmsCode:async()=>{throw Error("Not enabled")},verifyTotpCode:async e=>{await r.fetchPrivyRoute(ve,{body:{code:e}})},generateOptions:async()=>p((await r.fetchPrivyRoute(Ee,{body:{}})).options),verifyPasskey:async e=>{let t=await import("@simplewebauthn/browser"),a=await t.startAuthentication(e);await r.fetchPrivyRoute(Se,{body:{authenticator_response:m(a)}})}}}))),void(n?t(y):w.setState({inProgressMfaFlow:"auth"}))):i(Error("Must be logged in to verify MFA"))))})),[r,e,t,a])},ut={component:()=>{let{user:e,ready:t}=me(),{app:r,data:a,onUserCloseViaDialogOrKeybindRef:o}=h(),[n,s]=ce(null),[i,l]=ce(null),[c,u]=ce(null),[d,w]=ce(!1),[p,m]=ce(!1),[y,g]=ce(),R=async()=>{y?b(y):e?await N({user:e}):b(Error("Must be logged in to manage MFA")),setTimeout((()=>{s(null),l(null)}),500)};if(o.current=R,!a?.mfaEnroll)throw Error("Missing modal data for MFA enrollment screen.");let{onFailure:b,onSuccess:N,mfaMethods:O,verify:_,generateTotpSecret:L,enrollTotp:H,unenrollTotp:D,enrollPasskey:x}=a.mfaEnroll,K=e?.mfaMethods.includes("sms"),q=e?.mfaMethods.includes("totp"),z=e?.mfaMethods.includes("passkey"),j=!!e?.phone,V=e?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function B(){s(null),l(null),g(void 0)}async function G(e=V){try{g(void 0),m(!0);let t=await x(e);return await N({user:t})}catch(e){g(e)}finally{m(!1),w(!1)}}if(!t||!e||!r)/*#__PURE__*/return We(Pe,{children:[/*#__PURE__*/be(f,{onClose:R},"header"),/*#__PURE__*/be(A,{children:/*#__PURE__*/be(k,{})}),/*#__PURE__*/be(C,{children:/*#__PURE__*/be(v,{})}),/*#__PURE__*/be(E,{})]});if("sms"===n)return null;if("totp"===n)/*#__PURE__*/return We(Pe,{children:[/*#__PURE__*/be(f,{backFn:B,onClose:R},"header"),/*#__PURE__*/be(S,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/be(Me,{})}),/*#__PURE__*/be(T,{children:"Remove authenticator app verification?"}),/*#__PURE__*/We(U,{children:["MFA adds an extra layer of security to your ",r?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/be(I,{children:/*#__PURE__*/be(W,{$warn:!0,onClick:async function(){try{g(void 0),m(!0);let e=await D();return await N({user:e})}catch(e){g(e)}finally{m(!1),s(null)}},loading:p,children:"Remove"})}),/*#__PURE__*/be(E,{})]});if("passkey"===n){let e=a.mfaEnroll.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return We(Pe,{children:[/*#__PURE__*/be(f,{backFn:B,onClose:R},"header"),/*#__PURE__*/be(S,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/be(Me,{})}),/*#__PURE__*/be(T,{children:"Are you sure you want to remove this passkey?"}),/*#__PURE__*/be(U,{children:e?"Removing your passkey will remove as both a verification method and a login method.":"Removing your passkey will remove as a verification method."}),/*#__PURE__*/be(I,{children:/*#__PURE__*/be(W,{$warn:!0,onClick:async function(){try{g(void 0),m(!0);let e=await x([]);return await N({user:e})}catch(e){g(e)}finally{m(!1),s(null)}},loading:p,children:"Remove"})}),/*#__PURE__*/be(E,{})]})}return 0!==O.length||K||q||z?"sms"===i?null:"totp"===i&&c?/*#__PURE__*/be(P,{onClose:R,onReset:B,submitEnrollmentWithTotp:e=>async function(e){try{g(void 0),m(!0);let t=await H(e);return await N({user:t})}catch(e){g(e)}finally{m(!1),s(null)}}(e.mfaCode),error:y,totpInfo:{...c,appName:r?.name||"Privy"}}):"passkey"===i?/*#__PURE__*/be(M,{onReset:B,onClose:R,submitEnrollmentWithPasskey:G}):/*#__PURE__*/be(F,{showIntro:!1,userMfaMethods:e.mfaMethods,appMfaMethods:r.mfa.methods,userHasAuthSms:j,onBackToIntro:()=>{},handleSelectMethod:async function(e){g(void 0);try{await _()}catch(e){return void g(e)}return"totp"===e?(l(e),u(null),void L().then((({totpSecret:e,totpAuthUrl:t})=>{u({authUrl:t,secret:e})})).catch((()=>{u(null),B()}))):"passkey"===e&&1===V.length?await G():void l(e)},isTotpLoading:"totp"===i&&!c,isPasskeyLoading:d,error:y,onClose:R,setRemovingMfaMethod:async function(e){g(void 0);try{await _()}catch(e){return void g(e)}s(e)}}):/*#__PURE__*/We(Pe,{children:[/*#__PURE__*/be(f,{onClose:R},"header"),/*#__PURE__*/be(S,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/be(Ne,{})}),/*#__PURE__*/be(T,{children:"Add more security"}),/*#__PURE__*/We(U,{children:[r?.name," does not have any verification methods enabled."]}),/*#__PURE__*/be(I,{children:/*#__PURE__*/be(W,{onClick:R,children:"Close"})}),/*#__PURE__*/be(E,{})]})}},dt=()=>{let e=L(),{setModalData:t}=h(),{verify:r}=ct(),{openModal:a,privy:o,closePrivyModal:n,refreshSessionAndUser:s,setUser:i}=we();return se((()=>({enroll:async()=>new Promise(((l,c)=>{t({mfaEnroll:{onSuccess:async e=>{await n({shouldCallAuthOnSuccess:!1,isSuccess:!0}),l(e)},onFailure:async e=>{await n({shouldCallAuthOnSuccess:!1,isSuccess:!1}),c(e)},verify:()=>r({standalone:!1}),shouldUnlinkOnUnenrollMfa:!0,mfaMethods:e.mfa.methods,sendSmsCode:async()=>{throw Error("Not enabled")},enrollSms:async()=>{throw Error("Not enabled")},unenrollSms:async()=>{throw Error("Not enabled")},generateTotpSecret:async()=>await o.fetchPrivyRoute(Te,{body:{}}),enrollTotp:async e=>{await o.fetchPrivyRoute(Ue,{body:{code:e}});let t=await s();return i(t),t},unenrollTotp:async()=>{await o.fetchPrivyRoute(Ie,{body:{}});let e=await s();return i(e),e},enrollPasskey:async e=>{await o.fetchPrivyRoute(Re,{body:{credential_ids:e,remove_for_login:!0}});let t=await s();return i(t),t}}}),a(ut)}))})),[o,t,a,n])},ht=()=>{let{startCrossAppAuthFlow:e,unlinkCrossAppAccount:t,signMessageWithCrossAppWallet:r,signTypedDataWithCrossAppWallet:a,sendTransactionWithCrossAppWallet:o}=me();return{loginWithCrossAppAccount:({appId:t})=>e({appId:t,action:"login"}),linkCrossAppAccount:({appId:t})=>e({appId:t,action:"link"}),unlinkCrossAppAccount:t,signMessage:r,signTypedData:a,sendTransaction:o}};function wt(e){let{sendTransaction:t}=le(ye);return r("sendTransaction",e),{sendTransaction:t}}function pt(e){let{setWalletPassword:t}=le(ye);return r("setWalletPassword",e),{setWalletPassword:t}}function mt(){let e=L(),{getAccessToken:t}=me(),r=H(),{client:a,setUser:o,setAuthenticated:n,setIsNewUser:s,initializeWalletProxy:i}=we(),{create:l}=D();return{createGuestAccount:async()=>{if(!e.id||!a)throw Error("SDK not yet ready");a.startAuthFlow(new x(e.id));try{let c=await a.authenticate(),u=c.user,d=c.isNewUser??!1;if(!u)throw new de("Unable to authenticate guest account");let h=await t(),w=await i(q);if(h&&w)try{let t=z(u,e.embeddedWallets.ethereum.createOnLogin),r=j(u,e.embeddedWallets.solana.createOnLogin);t&&r?(u=(await l({chainType:"ethereum",latestUser:u})).user,u=(await l({chainType:"solana",latestUser:u})).user):r?u=(await l({chainType:"solana",latestUser:u})).user:t?u=(await l({chainType:"ethereum",latestUser:u})).user:o(u)}catch(e){o(u),console.warn("Unable to create embedded wallet for guest account")}return s(d),n(!0),r("login","onComplete",{user:u,isNewUser:d,wasAlreadyAuthenticated:!1,loginMethod:"guest",loginAccount:null}),u}catch(e){throw r("login","onError",e.privyErrorCode||he.UNKNOWN_AUTH_ERROR),e}}}}function yt(e){let{setWalletRecovery:t}=le(ye);return r("setWalletRecovery",e),{setWalletRecovery:t}}function gt(e){let{signMessage:t}=le(ye);return r("signMessage",e),{signMessage:t}}const ft=()=>{let{ready:e,wallets:t}=B(),{user:r}=me(),{rpcConfig:a,chains:o,appId:n}=we();return{signAuthorization:ne((async(s,i)=>{let l;if(!r)throw Error("User must be authenticated before signing with a Privy wallet");if(!e)throw Error("Wallets are not ready");let c=i?.address??ge(r)?.address??Oe,u=t.find((e=>_e(e.address)===_e(c)));if(!u)throw Error("Signing wallet not found.");let d=s.chainId??Number(u.chainId.split(":")[1]);if(0===d)l={chainId:0,address:s.contractAddress,nonce:s.nonce??0};else{let e=o.find((e=>e.id===d));if(!e)throw Error("Error, chain not configured in PrivyProvider config");let t=Fe({account:c,chain:e,transport:Le(G(e,a,n))});l=await t.prepareAuthorization({...s})}let h=await u.getEthereumProvider(),w=await h.request({method:"secp256k1_sign",params:[De(l)]});return{...l,...He(w)}}),[e,t,r,o])}},At=ft;function kt(e){let{signTypedData:t}=le(ye);return r("signTypedData",e),{signTypedData:t}}const Ct=()=>{let{isModalOpen:e}=le(ye);return{isOpen:e}};function vt(e){let{getAccessToken:t}=le(ye);return r("accessToken",e),{getAccessToken:t}}function Et(e){let{authenticated:t,user:a}=me(),{initLoginWithOAuth:o}=we(),n=H();return r("oAuthAuthorization",e),{reauthorize:e=>St(t,a,o,n,e.provider)}}let St=async(e,t,r,a,o)=>{if(!e)throw a("linkAccount","onError",he.MUST_BE_AUTHENTICATED,{linkMethod:o}),new de("User must be authenticated before linking an account.");if(!t?.linkedAccounts.some((e=>e.type.includes(o))))throw new de(`OAuth account of type ${o} not linked to the account.`);await r(o)};function Tt(e){let{client:t}=we(),[r,a]=ce({status:"initial"});return{linkWithCustomJwt:ne((async r=>{try{a({status:"initial"}),t.startAuthFlow(new J(r)),a({status:"loading"});let{user:o}=await t.link();if(!o)throw Error("Error, user not found");let n=o.linkedAccounts.filter((e=>"custom_auth"===e.type)).sort(((e,t)=>t.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime())).at(0);return a({status:"done"}),e?.onSuccess?.({user:o,linkMethod:"custom",linkedAccount:n}),{user:o}}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"custom"}),r}}),[t.startAuthFlow,t.link]),state:r}}const Ut=e=>{let t=ee();return r("customAuth",e),{status:t}};function It({isAuthenticated:e,isLoading:t,...r}){let a=ue();ie((()=>{t||a.current?.()}),[e,t]);let o=ne((e=>(a.current=e,()=>{a.current=void 0})),[]);return te({...r,subscribe:o})}function Rt(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=me();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}const Wt=()=>{let{revokeDelegatedWallets:e,delegateWallet:t}=we();return{delegateWallet:async({address:e,chainType:r})=>await t({address:e,chainType:r,showDelegationUIs:!0}),revokeWallets:async()=>await e({showDelegationUIs:!0})}},Pt=()=>{let{addSessionSignersInternal:e,removeSessionSignersInternal:t}=(()=>{let{getAccessToken:e,user:t}=me(),r=we(),{signWithUserSigner:a}=fe(),o=async({wallet:o,additional_signers:n})=>{let s=await e();if(!t||!s)throw new de("User must be authenticated and have an embedded wallet to delegate actions.");if(!o.id)throw new de("Wallet to add signers to must have ID on server");if(!r.walletProxy)throw new de("Wallet proxy not initialized.");await Ke(r.privy,{wallet_id:o.id},a,{additional_signers:n})};return{addSessionSignersInternal:async({address:a,signers:n})=>{let s=await e();if(!t||!s)throw new de("User must be authenticated and have an embedded wallet to add a session signer.");let i=r.walletProxy??await r.initializeWalletProxy(15e3);if(!i)throw new de("Wallet proxy not initialized.");let l=Ae(t,a);if(!l)throw new de("Address to add signers too is not associated with current user.");if(ke(l)){if(0===n.length)throw new de("Must specify at least one signer to add.");let e=[...(await xe(r.privy,{wallet_id:l.id})).additional_signers,...re(n)];await o({wallet:l,additional_signers:e})}else{if(l.delegated)return{user:t};if(n.length>0)throw new de("Specifying signers in addSessionSigners is only supported for TEE execution and this app uses On-device execution. Pass an empty array for signers instead. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide");let e=ae({address:a,user:t}),o=oe({address:a,user:t});await r.recoverEmbeddedWallet({address:a}),await i.createDelegatedAction({accessToken:s,rootWallet:o,delegatedWallets:[e]})}let c=await r.refreshSessionAndUser();if(!c)throw Error("Could not refresh user");return{user:c}},removeSessionSignersInternal:async({address:a})=>{let n=await e();if(!t||!n)throw new de("User must be authenticated and have an embedded wallet to delegate actions.");if(!(r.walletProxy??await r.initializeWalletProxy(15e3)))throw new de("Wallet proxy not initialized.");let s=Ae(t,a);if(!s)throw new de("Address to remove signers from is not associated with current user.");ke(s)?await o({wallet:s,additional_signers:[]}):await r.client.revokeDelegatedWallet();let i=await r.refreshSessionAndUser();if(!i)throw Error("Could not refresh user");return{user:i}}}})();return{addSessionSigners:async({address:t,signers:r})=>e({address:t,signers:r}),removeSessionSigners:async({address:e})=>t({address:e})}},bt=()=>{let{signWithUserSigner:e}=fe();return se((()=>({async generateAuthorizationSignature(t){let{signature:r}=await qe(e,t);return{signature:r}}})),[e])},Mt=()=>{let{setUser:e,client:t}=le(pe),{user:r}=le(ye);return{user:r,refreshUser:ne((async()=>{let r=await(t?.updateUserAndIdToken());return e(r??null),r}),[t,e])}},Nt=e=>{let t=o(),{initLoginWithTelegram:r,loginWithTelegram:a,telegramAuthState:n,setTelegramAuthState:i}=we();return{login:ne((async o=>{try{if(t.enabled&&"success"!==t.status)throw new s(t.error,null,he.CAPTCHA_FAILURE);await r(t.token,o?.disableSignup);let{user:n,isNewUser:i,loginAccount:l,wasAlreadyAuthenticated:c}=await a({intent:"login"});e?.onComplete?.({user:n,isNewUser:i,wasAlreadyAuthenticated:c,loginMethod:"telegram",loginAccount:l})}catch(o){throw i({status:"error",error:o}),e?.onError?.(o.privyErrorCode||he.UNKNOWN_AUTH_ERROR),o}}),[r,a,t]),state:n}},Ot=()=>{let{revokeDelegatedWallets:e,delegateWallet:t}=we();return{delegateWallet:async({address:e,chainType:r})=>await t({address:e,chainType:r,showDelegationUIs:!1}),revokeWallets:async()=>await e({showDelegationUIs:!1})}},_t=async({wallet:e})=>{let t=await e.getEthereumProvider();return je({address:e.address,sign:async({hash:r})=>{if("privy"!==e.walletClientType)throw new ze({error:"Unprefixed signing is not supported by external wallets.",code:"unsupported_wallet_type"});return await t.request({method:"secp256k1_sign",params:[r]})},signMessage:async({message:r})=>await t.request({method:"personal_sign",params:[r,e.address]}),signTypedData:async r=>await t.request({method:"eth_signTypedData_v4",params:[e.address,r]}),signTransaction:async e=>await t.request({method:"eth_signTransaction",params:[e]})})};export{_t as toViemAccount,ct as useAuthMfa,dt as useAuthMfaEnrollment,bt as useAuthorizationSignature,lt as useBaseAccountSdk,it as useConnectBaseAccount,st as useConnectCoinbaseSmartWallet,Ze as useConnectOrCreateWallet,ht as useCrossAppAccounts,Ut as useCustomAuth,Wt as useDelegatedActions,Rt as useFarcasterSigner,mt as useGuestAccounts,Ot as useHeadlessDelegatedActions,at as useLinkAccount,Tt as useLinkJwtAccount,Je as useLinkWithPasskey,et as useLinkWithSiwe,$e as useLoginWithEmail,Be as useLoginWithFarcasterV2,Ge as useLoginWithOAuth,Xe as useLoginWithPasskey,tt as useLoginWithSiwe,Ye as useLoginWithSms,Nt as useLoginWithTelegram,Ct as useModalStatus,Et as useOAuthTokens,Ve as useRecoverEmbeddedWallet,wt as useSendTransaction,Pt as useSessionSigners,pt as useSetWalletPassword,yt as useSetWalletRecovery,ft as useSign7702Authorization,At as useSignAuthorization,gt as useSignMessage,rt as useSignTransaction,kt as useSignTypedData,Qe as useSignupWithPasskey,It as useSubscribeToJwtAuthWithFlag,te as useSyncJwtBasedAuthState,vt as useToken,ot as useUpdateAccount,nt as useUpdateEmail,Mt as useUser,B as useWallets};
@@ -1 +1 @@
1
- import{createContext as t,useContext as e}from"react";const i=()=>{throw Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")},a=t=>()=>{throw Error(t.trim())},n=/*#__PURE__*/t({setAuthenticated:i,setUser:i,setIsNewUser:i,isNewUserThisSession:!1,walletConnectionStatus:null,setWalletConnectionStatus:i,connectors:[],solanaWallets:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,client:null,privy:null,appId:"notAdded",onCustomAuthAuthenticated:i,hideWalletUIs:{current:!1},nativeTokenSymbolForChainId:i,initializeWalletProxy:i,getAuthMeta:i,getAuthFlow:i,closePrivyModal:i,openPrivyModal:i,connectWallet:i,initLoginWithWallet:i,loginWithWallet:i,initLoginWithFarcaster:i,loginWithFarcaster:i,loginWithCode:i,initLoginWithEmail:i,initLoginWithSms:i,initUpdateEmail:i,initUpdatePhone:i,resendEmailCode:i,resendSmsCode:i,initLoginWithHeadlessOAuth:i,loginWithHeadlessOAuth:i,crossAppAuthFlow:i,initLoginWithOAuth:i,loginWithOAuth:i,passkeyAuthState:{status:"initial"},setPasskeyAuthState:i,initSignupWithPasskey:i,signupWithPasskey:i,initLoginWithPasskey:i,loginWithPasskey:i,initLinkWithPasskey:i,linkWithPasskey:i,refreshSessionAndUser:i,walletProxy:null,createAnalyticsEvent:i,acceptTerms:i,getUsdTokenPrice:i,getUsdPriceForSol:i,getSplTokenMetadata:i,recoverEmbeddedWallet:i,updateWallets:i,fundWallet:i,openModal:i,setReadyToTrue:i,requestFarcasterSignerStatus:i,initLoginWithTelegram:i,loginWithTelegram:i,generateSiweMessage:i,generateSiweMessageForSmartWallet:i,loginWithSiwe:i,linkWithSiwe:i,linkSmartWallet:i,delegateWallet:i,revokeDelegatedWallets:i,exportSolanaWallet:i,connectCoinbaseSmartWallet:i,connectBaseAccount:i,initiateAccountTransfer:i,emailOtpState:{status:"initial"},setEmailOtpState:i,smsOtpState:{status:"initial"},setSmsOtpState:i,siweState:{status:"initial"},setSiweState:i,oAuthState:{status:"initial"},setOAuthState:i,telegramAuthState:{status:"initial"},setTelegramAuthState:i,isHeadlessOAuthLoading:!1,isHeadlessSigning:i,inProgressAuthFlowRef:{current:null},inProgressLoginOrLinkMethodRef:{current:null}}),s=()=>e(n);export{n as I,i as a,a as n,s as u};
1
+ import{createContext as t,useContext as e}from"react";const i=()=>{throw Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")},a=t=>()=>{throw Error(t.trim())},n=/*#__PURE__*/t({setAuthenticated:i,setUser:i,setIsNewUser:i,isNewUserThisSession:!1,walletConnectionStatus:null,setWalletConnectionStatus:i,connectors:[],solanaWallets:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,client:null,privy:null,appId:"notAdded",onCustomAuthAuthenticated:i,hideWalletUIs:{current:!1},nativeTokenSymbolForChainId:i,initializeWalletProxy:i,getAuthMeta:i,getAuthFlow:i,closePrivyModal:i,openPrivyModal:i,connectWallet:i,initLoginWithWallet:i,loginWithWallet:i,initLoginWithFarcaster:i,loginWithFarcaster:i,loginWithCode:i,initLoginWithEmail:i,initLoginWithSms:i,initUpdateEmail:i,initUpdatePhone:i,resendEmailCode:i,resendSmsCode:i,initLoginWithHeadlessOAuth:i,loginWithHeadlessOAuth:i,crossAppAuthFlow:i,initLoginWithOAuth:i,loginWithOAuth:i,passkeyAuthState:{status:"initial"},setPasskeyAuthState:i,initSignupWithPasskey:i,signupWithPasskey:i,initLoginWithPasskey:i,loginWithPasskey:i,initLinkWithPasskey:i,linkWithPasskey:i,refreshSessionAndUser:i,walletProxy:null,createAnalyticsEvent:i,acceptTerms:i,getUsdTokenPrice:i,getUsdPriceForSol:i,getSplTokenMetadata:i,recoverEmbeddedWallet:i,updateWallets:i,fundWallet:i,openModal:i,setReadyToTrue:i,requestFarcasterSignerStatus:i,initLoginWithTelegram:i,loginWithTelegram:i,generateSiweMessage:i,generateSiweMessageForSmartWallet:i,loginWithSiwe:i,linkWithSiwe:i,linkSmartWallet:i,delegateWallet:i,revokeDelegatedWallets:i,exportSolanaWallet:i,connectCoinbaseSmartWallet:i,connectBaseAccount:i,initiateAccountTransfer:i,emailOtpState:{status:"initial"},setEmailOtpState:i,smsOtpState:{status:"initial"},setSmsOtpState:i,siweState:{status:"initial"},setSiweState:i,oAuthState:{status:"initial"},setOAuthState:i,telegramAuthState:{status:"initial"},setTelegramAuthState:i,isHeadlessOAuthLoading:!1,isHeadlessSigning:i,inProgressAuthFlowRef:{current:null},inProgressLoginOrLinkMethodRef:{current:null},baseAccountSdk:void 0,setBaseAccountSdk:i}),s=()=>e(n);export{n as I,i as a,a as n,s as u};