@privy-io/react-auth 2.6.2 → 2.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/farcaster.js +1 -1
- package/dist/cjs/getEmbeddedConnectedWallet-DTU4T9TJ.js +1 -0
- package/dist/cjs/index.js +1 -5
- package/dist/cjs/internal-context-HesndSYh.js +1 -0
- package/dist/cjs/privy-provider-CWADob3g.js +27 -0
- package/dist/cjs/smart-wallets-Dsq1trqs.js +1 -0
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/ui.js +2 -2
- package/dist/cjs/useActiveWallet-D5FyaqZJ.js +1 -0
- package/dist/cjs/useFundWallet-BsBuslJV.js +1 -0
- package/dist/dts/farcaster.d.mts +1 -1
- package/dist/dts/farcaster.d.ts +1 -1
- package/dist/dts/index.d.mts +12 -8
- package/dist/dts/index.d.ts +12 -8
- package/dist/dts/smart-wallets.d.mts +1 -1
- package/dist/dts/smart-wallets.d.ts +1 -1
- package/dist/dts/solana.d.mts +6 -6
- package/dist/dts/solana.d.ts +6 -6
- package/dist/dts/{types-CcosPsy6.d.mts → types-CsAGoXth.d.mts} +9 -9
- package/dist/dts/{types-CcosPsy6.d.ts → types-CsAGoXth.d.ts} +9 -9
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/dts/{useSolanaWallets-BHduxJmW.d.mts → useSolanaWallets-CFgYdjDv.d.mts} +18 -1
- package/dist/dts/{useSolanaWallets-BHduxJmW.d.ts → useSolanaWallets-CFgYdjDv.d.ts} +18 -1
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/farcaster.mjs +1 -1
- package/dist/esm/getEmbeddedConnectedWallet-CSSBWE2p.mjs +1 -0
- package/dist/esm/index.mjs +1 -5
- package/dist/esm/{internal-context-CL_EG4e1.mjs → internal-context-O3TPYUku.mjs} +1 -1
- package/dist/esm/privy-provider-u_cmfixS.mjs +27 -0
- package/dist/esm/smart-wallets-vK26EMrU.mjs +1 -0
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/ui.mjs +2 -2
- package/dist/esm/useActiveWallet-Cwj5v4eK.mjs +1 -0
- package/dist/esm/useFundWallet-BPk4tVPS.mjs +1 -0
- package/package.json +4 -4
- package/dist/cjs/AwaitingEvmToSolBridgingScreen-pmGmvR1q.js +0 -22
- package/dist/cjs/getEmbeddedConnectedWallet-CGj_I0cc.js +0 -2
- package/dist/cjs/importWallet-Du1BO6qb.js +0 -1
- package/dist/cjs/internal-context-D5TgeQk8.js +0 -1
- package/dist/cjs/prepareFundingModalData-C2_ED32S.js +0 -1
- package/dist/cjs/smart-wallets-CoYci1bf.js +0 -1
- package/dist/cjs/useActiveWallet-CaLK0Ao4.js +0 -1
- package/dist/cjs/useFundWallet-92y-LJjK.js +0 -1
- package/dist/esm/AwaitingEvmToSolBridgingScreen-DnBONxHo.mjs +0 -22
- package/dist/esm/getEmbeddedConnectedWallet-Cyt02rK3.mjs +0 -2
- package/dist/esm/importWallet-Bqr-aqzk.mjs +0 -1
- package/dist/esm/prepareFundingModalData-Bkg2jc5P.mjs +0 -1
- package/dist/esm/smart-wallets-KrlR2oLu.mjs +0 -1
- package/dist/esm/useActiveWallet-SKrFBYMY.mjs +0 -1
- package/dist/esm/useFundWallet-BvMwnH48.mjs +0 -1
package/dist/dts/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import react__default, { MouseEvent } from 'react';
|
|
3
|
-
import { C as Chain, m as WalletClientType, d as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as PrivyClientConfig, u as RpcConfig, v as EIP1193Provider, w as EntropyIdVerifier$1, x as RequestArguments, y as WalletTimeoutError, z as WalletConnector, B as BaseConnectedEthereumWallet, A as ConnectedWalletMetadata, D as ConnectorType, G as WalletListEntry, H as ExternalWalletsConfig, I as BaseConnectedWallet, l as SolanaWalletConnector, U as User, J as ConnectWalletModalOptions, K as LoginModalOptions, h as CreateWalletOptions, W as Wallet, N as SetWalletRecoveryOptions, j as SignMessageModalUIOptions, Q as SignTypedDataParams, M as MfaMethod, T as UnsignedTransactionRequest, i as SendTransactionModalUIOptions, V as FundWalletConfig, X as ConnectedWallet, O as OAuthTokens, Y as CrossAppProviderDetails, Z as OAuthProviderType, _ as MoonpaySignRequest, $ as MoonpaySignResponse, a0 as SmartWalletConfig, a1 as PrivyServerConfig, a as LoginMethod, a2 as SiweWalletMetadata, a3 as TelegramAuthResult, a4 as TelegramWebAppData, a5 as OAuthUserInfo, a6 as OAuthFlowState, a7 as LoginWithCode, a8 as OtpFlowState, a9 as PasskeyFlowState, aa as SiweFlowState, ab as UnsignedTransactionRequestWithChainId, ac as BaseConnectedWalletType, g as ConnectedSolanaWallet, ad as CustomAuthFlowState, ae as TelegramAuthFlowState } from './types-
|
|
4
|
-
export { ax as Apple, aI as AppleOAuthWithMetadata, aQ as ContractUIOptions, aA as CrossAppAccount, aL as CrossAppAccountWithMetadata, au as Discord, aE as DiscordOAuthWithMetadata, aN as Email, ap as EmailWithMetadata, aU as Farcaster, aJ as FarcasterWithMetadata, av as Github, aF as GithubOAuthWithMetadata, as as Google, aC as GoogleOAuthWithMetadata, aB as LinkedAccountType, b as LinkedAccountWithMetadata, aw as LinkedIn, aH as LinkedInOAuthWithMetadata, aW as LoginMethodOrderOption, ag as MessageTypes, ai as MoonpayConfig, aj as MoonpayCurrencyCode, aS as MoonpayFundingConfig, ak as MoonpayPaymentMethod, aR as NativeFundingConfig, ao as NonEmptyArray, aV as Passkey, aM as PasskeyWithMetadata, aO as Phone, aq as PhoneWithMetadata, aT as PriceDisplayOptions, P as PrivyErrorCode, al as Quantity, ah as SmartWallet, f as SolanaCluster, k as SolanaFundingConfig, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, az as Telegram, aK as TelegramWithMetadata, ay as Tiktok, aG as TiktokOAuthWithMetadata, am as TransactionLog, an as TransactionReceipt, aP as TransactionUIOptions, at as Twitter, aD as TwitterOAuthWithMetadata, af as TypedMessage, ar as WalletWithMetadata } from './types-
|
|
3
|
+
import { C as Chain, m as WalletClientType, d as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as PrivyClientConfig, u as RpcConfig, v as EIP1193Provider, w as EntropyIdVerifier$1, x as RequestArguments, y as WalletTimeoutError, z as WalletConnector, B as BaseConnectedEthereumWallet, A as ConnectedWalletMetadata, D as ConnectorType, G as WalletListEntry, H as ExternalWalletsConfig, I as BaseConnectedWallet, l as SolanaWalletConnector, U as User, J as ConnectWalletModalOptions, K as LoginModalOptions, h as CreateWalletOptions, W as Wallet, N as SetWalletRecoveryOptions, j as SignMessageModalUIOptions, Q as SignTypedDataParams, M as MfaMethod, T as UnsignedTransactionRequest, i as SendTransactionModalUIOptions, V as FundWalletConfig, X as ConnectedWallet, O as OAuthTokens, Y as CrossAppProviderDetails, Z as OAuthProviderType, _ as MoonpaySignRequest, $ as MoonpaySignResponse, a0 as SmartWalletConfig, a1 as PrivyServerConfig, a as LoginMethod, a2 as SiweWalletMetadata, a3 as TelegramAuthResult, a4 as TelegramWebAppData, a5 as OAuthUserInfo, a6 as OAuthFlowState, a7 as LoginWithCode, a8 as OtpFlowState, a9 as PasskeyFlowState, aa as SiweFlowState, ab as UnsignedTransactionRequestWithChainId, ac as BaseConnectedWalletType, g as ConnectedSolanaWallet, ad as CustomAuthFlowState, ae as TelegramAuthFlowState } from './types-CsAGoXth.js';
|
|
4
|
+
export { ax as Apple, aI as AppleOAuthWithMetadata, aQ as ContractUIOptions, aA as CrossAppAccount, aL as CrossAppAccountWithMetadata, au as Discord, aE as DiscordOAuthWithMetadata, aN as Email, ap as EmailWithMetadata, aU as Farcaster, aJ as FarcasterWithMetadata, av as Github, aF as GithubOAuthWithMetadata, as as Google, aC as GoogleOAuthWithMetadata, aB as LinkedAccountType, b as LinkedAccountWithMetadata, aw as LinkedIn, aH as LinkedInOAuthWithMetadata, aW as LoginMethodOrderOption, ag as MessageTypes, ai as MoonpayConfig, aj as MoonpayCurrencyCode, aS as MoonpayFundingConfig, ak as MoonpayPaymentMethod, aR as NativeFundingConfig, ao as NonEmptyArray, aV as Passkey, aM as PasskeyWithMetadata, aO as Phone, aq as PhoneWithMetadata, aT as PriceDisplayOptions, P as PrivyErrorCode, al as Quantity, ah as SmartWallet, f as SolanaCluster, k as SolanaFundingConfig, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, az as Telegram, aK as TelegramWithMetadata, ay as Tiktok, aG as TiktokOAuthWithMetadata, am as TransactionLog, an as TransactionReceipt, aP as TransactionUIOptions, at as Twitter, aD as TwitterOAuthWithMetadata, af as TypedMessage, ar as WalletWithMetadata } from './types-CsAGoXth.js';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import { TurnstileProps } from '@marsidev/react-turnstile';
|
|
7
7
|
import EventEmitter from 'eventemitter3';
|
|
@@ -17,8 +17,8 @@ import * as _simplewebauthn_types from '@simplewebauthn/types';
|
|
|
17
17
|
import { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types';
|
|
18
18
|
import { Cluster } from '@solana/web3.js';
|
|
19
19
|
import { FetchOptions } from 'ofetch';
|
|
20
|
-
import { P as PrivyEvents } from './useSolanaWallets-
|
|
21
|
-
export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-
|
|
20
|
+
import { P as PrivyEvents } from './useSolanaWallets-CFgYdjDv.js';
|
|
21
|
+
export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-CFgYdjDv.js';
|
|
22
22
|
import '@solana/wallet-adapter-base';
|
|
23
23
|
import '@privy-io/js-sdk-core';
|
|
24
24
|
import '@metamask/eth-sig-util';
|
|
@@ -2395,14 +2395,14 @@ interface ResponseCrossAppAccount {
|
|
|
2395
2395
|
first_verified_at: number | null;
|
|
2396
2396
|
latest_verified_at: number | null;
|
|
2397
2397
|
}
|
|
2398
|
-
interface
|
|
2399
|
-
type: '
|
|
2398
|
+
interface ResponseAuthorizationKeyAccount {
|
|
2399
|
+
type: 'authorization_key';
|
|
2400
2400
|
public_key: string;
|
|
2401
2401
|
verified_at: number;
|
|
2402
2402
|
first_verified_at: number | null;
|
|
2403
2403
|
latest_verified_at: number | null;
|
|
2404
2404
|
}
|
|
2405
|
-
type LinkedAccountsResponseType = Array<ResponseEmailAccount | ResponsePhoneAccount | ResponseEthereumAccount | ResponseSmartWalletAccount | ResponseSolanaAccount | ResponseOAuthGoogle | ResponseOAuthTwitter | ResponseOAuthDiscord | ResponseOAuthGithub | ResponseOAuthSpotify | ResponseOAuthInstagram | ResponseOAuthTiktok | ResponseOAuthLinkedIn | ResponseOAuthApple | ResponseCustomJwtAccount | ResponseFarcasterAccount | ResponsePasskeyAccount | ResponseTelegramAccount | ResponseCrossAppAccount |
|
|
2405
|
+
type LinkedAccountsResponseType = Array<ResponseEmailAccount | ResponsePhoneAccount | ResponseEthereumAccount | ResponseSmartWalletAccount | ResponseSolanaAccount | ResponseOAuthGoogle | ResponseOAuthTwitter | ResponseOAuthDiscord | ResponseOAuthGithub | ResponseOAuthSpotify | ResponseOAuthInstagram | ResponseOAuthTiktok | ResponseOAuthLinkedIn | ResponseOAuthApple | ResponseCustomJwtAccount | ResponseFarcasterAccount | ResponsePasskeyAccount | ResponseTelegramAccount | ResponseCrossAppAccount | ResponseAuthorizationKeyAccount>;
|
|
2406
2406
|
interface ResponseSmsMfaMethod {
|
|
2407
2407
|
type: 'sms';
|
|
2408
2408
|
verified_at: number;
|
|
@@ -2981,6 +2981,10 @@ type UseLoginWithSms = {
|
|
|
2981
2981
|
*/
|
|
2982
2982
|
declare const useLoginWithSms: (callbacks?: PrivyEvents["login"]) => UseLoginWithSms;
|
|
2983
2983
|
|
|
2984
|
+
declare const useConnectOrCreateWallet: (callbacks?: PrivyEvents["connectOrCreateWallet"]) => {
|
|
2985
|
+
connectOrCreateWallet: () => void;
|
|
2986
|
+
};
|
|
2987
|
+
|
|
2984
2988
|
type UseLinkWithSiwe = {
|
|
2985
2989
|
/**
|
|
2986
2990
|
* Given an external wallet address and chain ID, creates a EIP-4361 message for signing.
|
|
@@ -3797,4 +3801,4 @@ declare const LoginModal: ({ open }: {
|
|
|
3797
3801
|
open: boolean;
|
|
3798
3802
|
}) => react_jsx_runtime.JSX.Element;
|
|
3799
3803
|
|
|
3800
|
-
export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkWithPasskey, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseSignupWithPasskey, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, addPrivyRpcToChain, addRpcUrlOverrideToChain, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, useActiveWallet, useConnectCoinbaseSmartWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkWithPasskey, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useModalStatus, useOAuthTokens, usePrivy, useRegisterMfaListener, useSendTransaction, useSetWalletPassword, useSetWalletRecovery, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useToken, useUpdateAccount, useUser, useWallets };
|
|
3804
|
+
export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkWithPasskey, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseSignupWithPasskey, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, addPrivyRpcToChain, addRpcUrlOverrideToChain, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, useActiveWallet, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkWithPasskey, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useModalStatus, useOAuthTokens, usePrivy, useRegisterMfaListener, useSendTransaction, useSetWalletPassword, useSetWalletRecovery, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useToken, useUpdateAccount, useUser, useWallets };
|
package/dist/dts/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import react__default, { MouseEvent } from 'react';
|
|
3
|
-
import { C as Chain, m as WalletClientType, d as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as PrivyClientConfig, u as RpcConfig, v as EIP1193Provider, w as EntropyIdVerifier$1, x as RequestArguments, y as WalletTimeoutError, z as WalletConnector, B as BaseConnectedEthereumWallet, A as ConnectedWalletMetadata, D as ConnectorType, G as WalletListEntry, H as ExternalWalletsConfig, I as BaseConnectedWallet, l as SolanaWalletConnector, U as User, J as ConnectWalletModalOptions, K as LoginModalOptions, h as CreateWalletOptions, W as Wallet, N as SetWalletRecoveryOptions, j as SignMessageModalUIOptions, Q as SignTypedDataParams, M as MfaMethod, T as UnsignedTransactionRequest, i as SendTransactionModalUIOptions, V as FundWalletConfig, X as ConnectedWallet, O as OAuthTokens, Y as CrossAppProviderDetails, Z as OAuthProviderType, _ as MoonpaySignRequest, $ as MoonpaySignResponse, a0 as SmartWalletConfig, a1 as PrivyServerConfig, a as LoginMethod, a2 as SiweWalletMetadata, a3 as TelegramAuthResult, a4 as TelegramWebAppData, a5 as OAuthUserInfo, a6 as OAuthFlowState, a7 as LoginWithCode, a8 as OtpFlowState, a9 as PasskeyFlowState, aa as SiweFlowState, ab as UnsignedTransactionRequestWithChainId, ac as BaseConnectedWalletType, g as ConnectedSolanaWallet, ad as CustomAuthFlowState, ae as TelegramAuthFlowState } from './types-
|
|
4
|
-
export { ax as Apple, aI as AppleOAuthWithMetadata, aQ as ContractUIOptions, aA as CrossAppAccount, aL as CrossAppAccountWithMetadata, au as Discord, aE as DiscordOAuthWithMetadata, aN as Email, ap as EmailWithMetadata, aU as Farcaster, aJ as FarcasterWithMetadata, av as Github, aF as GithubOAuthWithMetadata, as as Google, aC as GoogleOAuthWithMetadata, aB as LinkedAccountType, b as LinkedAccountWithMetadata, aw as LinkedIn, aH as LinkedInOAuthWithMetadata, aW as LoginMethodOrderOption, ag as MessageTypes, ai as MoonpayConfig, aj as MoonpayCurrencyCode, aS as MoonpayFundingConfig, ak as MoonpayPaymentMethod, aR as NativeFundingConfig, ao as NonEmptyArray, aV as Passkey, aM as PasskeyWithMetadata, aO as Phone, aq as PhoneWithMetadata, aT as PriceDisplayOptions, P as PrivyErrorCode, al as Quantity, ah as SmartWallet, f as SolanaCluster, k as SolanaFundingConfig, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, az as Telegram, aK as TelegramWithMetadata, ay as Tiktok, aG as TiktokOAuthWithMetadata, am as TransactionLog, an as TransactionReceipt, aP as TransactionUIOptions, at as Twitter, aD as TwitterOAuthWithMetadata, af as TypedMessage, ar as WalletWithMetadata } from './types-
|
|
3
|
+
import { C as Chain, m as WalletClientType, d as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as PrivyClientConfig, u as RpcConfig, v as EIP1193Provider, w as EntropyIdVerifier$1, x as RequestArguments, y as WalletTimeoutError, z as WalletConnector, B as BaseConnectedEthereumWallet, A as ConnectedWalletMetadata, D as ConnectorType, G as WalletListEntry, H as ExternalWalletsConfig, I as BaseConnectedWallet, l as SolanaWalletConnector, U as User, J as ConnectWalletModalOptions, K as LoginModalOptions, h as CreateWalletOptions, W as Wallet, N as SetWalletRecoveryOptions, j as SignMessageModalUIOptions, Q as SignTypedDataParams, M as MfaMethod, T as UnsignedTransactionRequest, i as SendTransactionModalUIOptions, V as FundWalletConfig, X as ConnectedWallet, O as OAuthTokens, Y as CrossAppProviderDetails, Z as OAuthProviderType, _ as MoonpaySignRequest, $ as MoonpaySignResponse, a0 as SmartWalletConfig, a1 as PrivyServerConfig, a as LoginMethod, a2 as SiweWalletMetadata, a3 as TelegramAuthResult, a4 as TelegramWebAppData, a5 as OAuthUserInfo, a6 as OAuthFlowState, a7 as LoginWithCode, a8 as OtpFlowState, a9 as PasskeyFlowState, aa as SiweFlowState, ab as UnsignedTransactionRequestWithChainId, ac as BaseConnectedWalletType, g as ConnectedSolanaWallet, ad as CustomAuthFlowState, ae as TelegramAuthFlowState } from './types-CsAGoXth.js';
|
|
4
|
+
export { ax as Apple, aI as AppleOAuthWithMetadata, aQ as ContractUIOptions, aA as CrossAppAccount, aL as CrossAppAccountWithMetadata, au as Discord, aE as DiscordOAuthWithMetadata, aN as Email, ap as EmailWithMetadata, aU as Farcaster, aJ as FarcasterWithMetadata, av as Github, aF as GithubOAuthWithMetadata, as as Google, aC as GoogleOAuthWithMetadata, aB as LinkedAccountType, b as LinkedAccountWithMetadata, aw as LinkedIn, aH as LinkedInOAuthWithMetadata, aW as LoginMethodOrderOption, ag as MessageTypes, ai as MoonpayConfig, aj as MoonpayCurrencyCode, aS as MoonpayFundingConfig, ak as MoonpayPaymentMethod, aR as NativeFundingConfig, ao as NonEmptyArray, aV as Passkey, aM as PasskeyWithMetadata, aO as Phone, aq as PhoneWithMetadata, aT as PriceDisplayOptions, P as PrivyErrorCode, al as Quantity, ah as SmartWallet, f as SolanaCluster, k as SolanaFundingConfig, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, az as Telegram, aK as TelegramWithMetadata, ay as Tiktok, aG as TiktokOAuthWithMetadata, am as TransactionLog, an as TransactionReceipt, aP as TransactionUIOptions, at as Twitter, aD as TwitterOAuthWithMetadata, af as TypedMessage, ar as WalletWithMetadata } from './types-CsAGoXth.js';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import { TurnstileProps } from '@marsidev/react-turnstile';
|
|
7
7
|
import EventEmitter from 'eventemitter3';
|
|
@@ -17,8 +17,8 @@ import * as _simplewebauthn_types from '@simplewebauthn/types';
|
|
|
17
17
|
import { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types';
|
|
18
18
|
import { Cluster } from '@solana/web3.js';
|
|
19
19
|
import { FetchOptions } from 'ofetch';
|
|
20
|
-
import { P as PrivyEvents } from './useSolanaWallets-
|
|
21
|
-
export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-
|
|
20
|
+
import { P as PrivyEvents } from './useSolanaWallets-CFgYdjDv.js';
|
|
21
|
+
export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-CFgYdjDv.js';
|
|
22
22
|
import '@solana/wallet-adapter-base';
|
|
23
23
|
import '@privy-io/js-sdk-core';
|
|
24
24
|
import '@metamask/eth-sig-util';
|
|
@@ -2395,14 +2395,14 @@ interface ResponseCrossAppAccount {
|
|
|
2395
2395
|
first_verified_at: number | null;
|
|
2396
2396
|
latest_verified_at: number | null;
|
|
2397
2397
|
}
|
|
2398
|
-
interface
|
|
2399
|
-
type: '
|
|
2398
|
+
interface ResponseAuthorizationKeyAccount {
|
|
2399
|
+
type: 'authorization_key';
|
|
2400
2400
|
public_key: string;
|
|
2401
2401
|
verified_at: number;
|
|
2402
2402
|
first_verified_at: number | null;
|
|
2403
2403
|
latest_verified_at: number | null;
|
|
2404
2404
|
}
|
|
2405
|
-
type LinkedAccountsResponseType = Array<ResponseEmailAccount | ResponsePhoneAccount | ResponseEthereumAccount | ResponseSmartWalletAccount | ResponseSolanaAccount | ResponseOAuthGoogle | ResponseOAuthTwitter | ResponseOAuthDiscord | ResponseOAuthGithub | ResponseOAuthSpotify | ResponseOAuthInstagram | ResponseOAuthTiktok | ResponseOAuthLinkedIn | ResponseOAuthApple | ResponseCustomJwtAccount | ResponseFarcasterAccount | ResponsePasskeyAccount | ResponseTelegramAccount | ResponseCrossAppAccount |
|
|
2405
|
+
type LinkedAccountsResponseType = Array<ResponseEmailAccount | ResponsePhoneAccount | ResponseEthereumAccount | ResponseSmartWalletAccount | ResponseSolanaAccount | ResponseOAuthGoogle | ResponseOAuthTwitter | ResponseOAuthDiscord | ResponseOAuthGithub | ResponseOAuthSpotify | ResponseOAuthInstagram | ResponseOAuthTiktok | ResponseOAuthLinkedIn | ResponseOAuthApple | ResponseCustomJwtAccount | ResponseFarcasterAccount | ResponsePasskeyAccount | ResponseTelegramAccount | ResponseCrossAppAccount | ResponseAuthorizationKeyAccount>;
|
|
2406
2406
|
interface ResponseSmsMfaMethod {
|
|
2407
2407
|
type: 'sms';
|
|
2408
2408
|
verified_at: number;
|
|
@@ -2981,6 +2981,10 @@ type UseLoginWithSms = {
|
|
|
2981
2981
|
*/
|
|
2982
2982
|
declare const useLoginWithSms: (callbacks?: PrivyEvents["login"]) => UseLoginWithSms;
|
|
2983
2983
|
|
|
2984
|
+
declare const useConnectOrCreateWallet: (callbacks?: PrivyEvents["connectOrCreateWallet"]) => {
|
|
2985
|
+
connectOrCreateWallet: () => void;
|
|
2986
|
+
};
|
|
2987
|
+
|
|
2984
2988
|
type UseLinkWithSiwe = {
|
|
2985
2989
|
/**
|
|
2986
2990
|
* Given an external wallet address and chain ID, creates a EIP-4361 message for signing.
|
|
@@ -3797,4 +3801,4 @@ declare const LoginModal: ({ open }: {
|
|
|
3797
3801
|
open: boolean;
|
|
3798
3802
|
}) => react_jsx_runtime.JSX.Element;
|
|
3799
3803
|
|
|
3800
|
-
export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkWithPasskey, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseSignupWithPasskey, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, addPrivyRpcToChain, addRpcUrlOverrideToChain, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, useActiveWallet, useConnectCoinbaseSmartWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkWithPasskey, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useModalStatus, useOAuthTokens, usePrivy, useRegisterMfaListener, useSendTransaction, useSetWalletPassword, useSetWalletRecovery, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useToken, useUpdateAccount, useUser, useWallets };
|
|
3804
|
+
export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkWithPasskey, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseSignupWithPasskey, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, addPrivyRpcToChain, addRpcUrlOverrideToChain, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, useActiveWallet, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkWithPasskey, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useModalStatus, useOAuthTokens, usePrivy, useRegisterMfaListener, useSendTransaction, useSetWalletPassword, useSetWalletRecovery, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useToken, useUpdateAccount, useUser, useWallets };
|
|
@@ -7,7 +7,7 @@ import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstract
|
|
|
7
7
|
import * as viem from 'viem';
|
|
8
8
|
import { SendTransactionParameters, Chain, Hash, SignableMessage, Hex, TypedData, SignTypedDataParameters, EIP1193Provider, PublicClient, Client } from 'viem';
|
|
9
9
|
import { SmartWalletType } from '@privy-io/js-sdk-core';
|
|
10
|
-
import { i as SendTransactionModalUIOptions, j as SignMessageModalUIOptions } from './types-
|
|
10
|
+
import { i as SendTransactionModalUIOptions, j as SignMessageModalUIOptions } from './types-CsAGoXth.js';
|
|
11
11
|
import '@solana/wallet-adapter-base';
|
|
12
12
|
import '@privy-io/public-api';
|
|
13
13
|
import 'eventemitter3';
|
|
@@ -7,7 +7,7 @@ import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstract
|
|
|
7
7
|
import * as viem from 'viem';
|
|
8
8
|
import { SendTransactionParameters, Chain, Hash, SignableMessage, Hex, TypedData, SignTypedDataParameters, EIP1193Provider, PublicClient, Client } from 'viem';
|
|
9
9
|
import { SmartWalletType } from '@privy-io/js-sdk-core';
|
|
10
|
-
import { i as SendTransactionModalUIOptions, j as SignMessageModalUIOptions } from './types-
|
|
10
|
+
import { i as SendTransactionModalUIOptions, j as SignMessageModalUIOptions } from './types-CsAGoXth.js';
|
|
11
11
|
import '@solana/wallet-adapter-base';
|
|
12
12
|
import '@privy-io/public-api';
|
|
13
13
|
import 'eventemitter3';
|
package/dist/dts/solana.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { W as Wallet, k as SolanaFundingConfig, e as SupportedSolanaTransaction, i as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, j as SignMessageModalUIOptions } from './types-
|
|
2
|
-
export { g as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-
|
|
3
|
-
import { P as PrivyEvents } from './useSolanaWallets-
|
|
4
|
-
export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-
|
|
1
|
+
import { W as Wallet, k as SolanaFundingConfig, e as SupportedSolanaTransaction, i as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, j as SignMessageModalUIOptions } from './types-CsAGoXth.js';
|
|
2
|
+
export { g as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-CsAGoXth.js';
|
|
3
|
+
import { P as PrivyEvents } from './useSolanaWallets-CFgYdjDv.js';
|
|
4
|
+
export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-CFgYdjDv.js';
|
|
5
5
|
import { SendTransactionOptions } from '@solana/wallet-adapter-base';
|
|
6
6
|
import { Connection } from '@solana/web3.js';
|
|
7
7
|
import 'react';
|
|
@@ -180,11 +180,11 @@ interface UseSignMessageInterface {
|
|
|
180
180
|
* @returns signMessage - prompts the user to sign a message using their embedded wallet
|
|
181
181
|
*/
|
|
182
182
|
declare function useSignMessage(callbacks?: PrivyEvents['signSolanaMessage']): {
|
|
183
|
-
signMessage: (
|
|
183
|
+
signMessage: ({ message: _message, options, }: {
|
|
184
184
|
message: Uint8Array;
|
|
185
185
|
options?: {
|
|
186
|
-
uiOptions?: SignMessageModalUIOptions;
|
|
187
186
|
address?: string;
|
|
187
|
+
uiOptions?: SignMessageModalUIOptions;
|
|
188
188
|
};
|
|
189
189
|
}) => Promise<Uint8Array>;
|
|
190
190
|
};
|
package/dist/dts/solana.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { W as Wallet, k as SolanaFundingConfig, e as SupportedSolanaTransaction, i as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, j as SignMessageModalUIOptions } from './types-
|
|
2
|
-
export { g as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-
|
|
3
|
-
import { P as PrivyEvents } from './useSolanaWallets-
|
|
4
|
-
export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-
|
|
1
|
+
import { W as Wallet, k as SolanaFundingConfig, e as SupportedSolanaTransaction, i as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, j as SignMessageModalUIOptions } from './types-CsAGoXth.js';
|
|
2
|
+
export { g as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-CsAGoXth.js';
|
|
3
|
+
import { P as PrivyEvents } from './useSolanaWallets-CFgYdjDv.js';
|
|
4
|
+
export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-CFgYdjDv.js';
|
|
5
5
|
import { SendTransactionOptions } from '@solana/wallet-adapter-base';
|
|
6
6
|
import { Connection } from '@solana/web3.js';
|
|
7
7
|
import 'react';
|
|
@@ -180,11 +180,11 @@ interface UseSignMessageInterface {
|
|
|
180
180
|
* @returns signMessage - prompts the user to sign a message using their embedded wallet
|
|
181
181
|
*/
|
|
182
182
|
declare function useSignMessage(callbacks?: PrivyEvents['signSolanaMessage']): {
|
|
183
|
-
signMessage: (
|
|
183
|
+
signMessage: ({ message: _message, options, }: {
|
|
184
184
|
message: Uint8Array;
|
|
185
185
|
options?: {
|
|
186
|
-
uiOptions?: SignMessageModalUIOptions;
|
|
187
186
|
address?: string;
|
|
187
|
+
uiOptions?: SignMessageModalUIOptions;
|
|
188
188
|
};
|
|
189
189
|
}) => Promise<Uint8Array>;
|
|
190
190
|
};
|
|
@@ -501,7 +501,7 @@ type LoginWithCode = {
|
|
|
501
501
|
};
|
|
502
502
|
declare const EMBEDDED_WALLET_CLIENT_TYPES: readonly ["privy"];
|
|
503
503
|
type EmbeddedWalletClientType = (typeof EMBEDDED_WALLET_CLIENT_TYPES)[number];
|
|
504
|
-
declare const INJECTED_WALLET_CLIENT_TYPES: readonly ["metamask", "phantom", "brave_wallet", "rainbow", "uniswap_wallet_extension", "uniswap_extension", "rabby_wallet", "bybit_wallet", "ronin_wallet", "crypto.com_wallet_extension", "crypto.com_onchain"];
|
|
504
|
+
declare const INJECTED_WALLET_CLIENT_TYPES: readonly ["metamask", "phantom", "brave_wallet", "rainbow", "uniswap_wallet_extension", "uniswap_extension", "rabby_wallet", "bybit_wallet", "ronin_wallet", "haha_wallet", "crypto.com_wallet_extension", "crypto.com_onchain"];
|
|
505
505
|
type InjectedWalletClientType = (typeof INJECTED_WALLET_CLIENT_TYPES)[number];
|
|
506
506
|
declare const COINBASE_WALLET_CLIENT_TYPES: readonly ["coinbase_wallet", "coinbase_smart_wallet"];
|
|
507
507
|
type CoinbaseWalletClientType = (typeof COINBASE_WALLET_CLIENT_TYPES)[number];
|
|
@@ -521,7 +521,7 @@ type WalletBranding = {
|
|
|
521
521
|
id: string;
|
|
522
522
|
icon?: string | EmbeddedSVG;
|
|
523
523
|
};
|
|
524
|
-
type LinkedAccountType = 'wallet' | 'smart_wallet' | 'email' | 'phone' | 'google_oauth' | 'twitter_oauth' | 'discord_oauth' | 'github_oauth' | 'spotify_oauth' | 'instagram_oauth' | 'tiktok_oauth' | 'linkedin_oauth' | 'apple_oauth' | 'custom_auth' | 'farcaster' | 'passkey' | 'telegram' | 'cross_app' | '
|
|
524
|
+
type LinkedAccountType = 'wallet' | 'smart_wallet' | 'email' | 'phone' | 'google_oauth' | 'twitter_oauth' | 'discord_oauth' | 'github_oauth' | 'spotify_oauth' | 'instagram_oauth' | 'tiktok_oauth' | 'linkedin_oauth' | 'apple_oauth' | 'custom_auth' | 'farcaster' | 'passkey' | 'telegram' | 'cross_app' | 'authorization_key' | 'guest';
|
|
525
525
|
/** @ignore */
|
|
526
526
|
interface LinkMetadata {
|
|
527
527
|
/** Account type, most commonly useful when filtering through linkedAccounts */
|
|
@@ -963,7 +963,7 @@ interface CrossAppAccount {
|
|
|
963
963
|
providerApp: ProviderAppMetadata;
|
|
964
964
|
subject: string;
|
|
965
965
|
}
|
|
966
|
-
interface
|
|
966
|
+
interface AuthorizationKeyAccount {
|
|
967
967
|
publicKey: string;
|
|
968
968
|
}
|
|
969
969
|
/** Object representation of a user's email, with additional metadata for advanced use cases. */
|
|
@@ -1055,15 +1055,15 @@ interface CrossAppAccountWithMetadata extends LinkMetadata, CrossAppAccount {
|
|
|
1055
1055
|
/** Denotes that this is a cross-app account */
|
|
1056
1056
|
type: 'cross_app';
|
|
1057
1057
|
}
|
|
1058
|
-
/** Object representation of a user's
|
|
1059
|
-
interface
|
|
1060
|
-
/** Denotes that this is
|
|
1061
|
-
type: '
|
|
1058
|
+
/** Object representation of a user's authorization key, with additional metadata for advanced use cases. */
|
|
1059
|
+
interface AuthorizationKeyAccountWithMetadata extends LinkMetadata, AuthorizationKeyAccount {
|
|
1060
|
+
/** Denotes that this is an authorization key */
|
|
1061
|
+
type: 'authorization_key';
|
|
1062
1062
|
}
|
|
1063
1063
|
/**
|
|
1064
1064
|
* Object representation of a user's linked accounts
|
|
1065
1065
|
*/
|
|
1066
|
-
type LinkedAccountWithMetadata = WalletWithMetadata | SmartWalletWithMetadata | EmailWithMetadata | PhoneWithMetadata | GoogleOAuthWithMetadata | TwitterOAuthWithMetadata | DiscordOAuthWithMetadata | GithubOAuthWithMetadata | SpotifyOAuthWithMetadata | InstagramOAuthWithMetadata | TiktokOAuthWithMetadata | LinkedInOAuthWithMetadata | AppleOAuthWithMetadata | CustomJwtAccountWithMetadata | FarcasterWithMetadata | PasskeyWithMetadata | TelegramWithMetadata | CrossAppAccountWithMetadata |
|
|
1066
|
+
type LinkedAccountWithMetadata = WalletWithMetadata | SmartWalletWithMetadata | EmailWithMetadata | PhoneWithMetadata | GoogleOAuthWithMetadata | TwitterOAuthWithMetadata | DiscordOAuthWithMetadata | GithubOAuthWithMetadata | SpotifyOAuthWithMetadata | InstagramOAuthWithMetadata | TiktokOAuthWithMetadata | LinkedInOAuthWithMetadata | AppleOAuthWithMetadata | CustomJwtAccountWithMetadata | FarcasterWithMetadata | PasskeyWithMetadata | TelegramWithMetadata | CrossAppAccountWithMetadata | AuthorizationKeyAccountWithMetadata;
|
|
1067
1067
|
interface User {
|
|
1068
1068
|
/** The Privy-issued DID for the user. If you need to store additional information
|
|
1069
1069
|
* about a user, you can use this DID to reference them. */
|
|
@@ -1223,7 +1223,7 @@ type PriceDisplayOptions = {
|
|
|
1223
1223
|
};
|
|
1224
1224
|
type WalletListEntry = 'metamask' | 'coinbase_wallet' | 'rainbow' | 'phantom' | 'zerion' | 'cryptocom' | 'uniswap' | 'okx_wallet' | 'universal_profile'
|
|
1225
1225
|
/** @deprecated Use `detected_ethereum_wallets` or `detected_solana_wallets` instead */
|
|
1226
|
-
| 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'rabby_wallet' | 'bybit_wallet' | 'ronin_wallet' | 'safe' | 'solflare' | 'backpack';
|
|
1226
|
+
| 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'rabby_wallet' | 'bybit_wallet' | 'ronin_wallet' | 'haha_wallet' | 'safe' | 'solflare' | 'backpack';
|
|
1227
1227
|
type NonEmptyArray<T> = [T, ...T[]];
|
|
1228
1228
|
type LoginMethodOrderOption = 'email' | 'sms' | WalletListEntry | OAuthProviderType | `privy:${string}` | 'farcaster' | 'telegram';
|
|
1229
1229
|
type ExternalWalletsConfig = {
|
|
@@ -501,7 +501,7 @@ type LoginWithCode = {
|
|
|
501
501
|
};
|
|
502
502
|
declare const EMBEDDED_WALLET_CLIENT_TYPES: readonly ["privy"];
|
|
503
503
|
type EmbeddedWalletClientType = (typeof EMBEDDED_WALLET_CLIENT_TYPES)[number];
|
|
504
|
-
declare const INJECTED_WALLET_CLIENT_TYPES: readonly ["metamask", "phantom", "brave_wallet", "rainbow", "uniswap_wallet_extension", "uniswap_extension", "rabby_wallet", "bybit_wallet", "ronin_wallet", "crypto.com_wallet_extension", "crypto.com_onchain"];
|
|
504
|
+
declare const INJECTED_WALLET_CLIENT_TYPES: readonly ["metamask", "phantom", "brave_wallet", "rainbow", "uniswap_wallet_extension", "uniswap_extension", "rabby_wallet", "bybit_wallet", "ronin_wallet", "haha_wallet", "crypto.com_wallet_extension", "crypto.com_onchain"];
|
|
505
505
|
type InjectedWalletClientType = (typeof INJECTED_WALLET_CLIENT_TYPES)[number];
|
|
506
506
|
declare const COINBASE_WALLET_CLIENT_TYPES: readonly ["coinbase_wallet", "coinbase_smart_wallet"];
|
|
507
507
|
type CoinbaseWalletClientType = (typeof COINBASE_WALLET_CLIENT_TYPES)[number];
|
|
@@ -521,7 +521,7 @@ type WalletBranding = {
|
|
|
521
521
|
id: string;
|
|
522
522
|
icon?: string | EmbeddedSVG;
|
|
523
523
|
};
|
|
524
|
-
type LinkedAccountType = 'wallet' | 'smart_wallet' | 'email' | 'phone' | 'google_oauth' | 'twitter_oauth' | 'discord_oauth' | 'github_oauth' | 'spotify_oauth' | 'instagram_oauth' | 'tiktok_oauth' | 'linkedin_oauth' | 'apple_oauth' | 'custom_auth' | 'farcaster' | 'passkey' | 'telegram' | 'cross_app' | '
|
|
524
|
+
type LinkedAccountType = 'wallet' | 'smart_wallet' | 'email' | 'phone' | 'google_oauth' | 'twitter_oauth' | 'discord_oauth' | 'github_oauth' | 'spotify_oauth' | 'instagram_oauth' | 'tiktok_oauth' | 'linkedin_oauth' | 'apple_oauth' | 'custom_auth' | 'farcaster' | 'passkey' | 'telegram' | 'cross_app' | 'authorization_key' | 'guest';
|
|
525
525
|
/** @ignore */
|
|
526
526
|
interface LinkMetadata {
|
|
527
527
|
/** Account type, most commonly useful when filtering through linkedAccounts */
|
|
@@ -963,7 +963,7 @@ interface CrossAppAccount {
|
|
|
963
963
|
providerApp: ProviderAppMetadata;
|
|
964
964
|
subject: string;
|
|
965
965
|
}
|
|
966
|
-
interface
|
|
966
|
+
interface AuthorizationKeyAccount {
|
|
967
967
|
publicKey: string;
|
|
968
968
|
}
|
|
969
969
|
/** Object representation of a user's email, with additional metadata for advanced use cases. */
|
|
@@ -1055,15 +1055,15 @@ interface CrossAppAccountWithMetadata extends LinkMetadata, CrossAppAccount {
|
|
|
1055
1055
|
/** Denotes that this is a cross-app account */
|
|
1056
1056
|
type: 'cross_app';
|
|
1057
1057
|
}
|
|
1058
|
-
/** Object representation of a user's
|
|
1059
|
-
interface
|
|
1060
|
-
/** Denotes that this is
|
|
1061
|
-
type: '
|
|
1058
|
+
/** Object representation of a user's authorization key, with additional metadata for advanced use cases. */
|
|
1059
|
+
interface AuthorizationKeyAccountWithMetadata extends LinkMetadata, AuthorizationKeyAccount {
|
|
1060
|
+
/** Denotes that this is an authorization key */
|
|
1061
|
+
type: 'authorization_key';
|
|
1062
1062
|
}
|
|
1063
1063
|
/**
|
|
1064
1064
|
* Object representation of a user's linked accounts
|
|
1065
1065
|
*/
|
|
1066
|
-
type LinkedAccountWithMetadata = WalletWithMetadata | SmartWalletWithMetadata | EmailWithMetadata | PhoneWithMetadata | GoogleOAuthWithMetadata | TwitterOAuthWithMetadata | DiscordOAuthWithMetadata | GithubOAuthWithMetadata | SpotifyOAuthWithMetadata | InstagramOAuthWithMetadata | TiktokOAuthWithMetadata | LinkedInOAuthWithMetadata | AppleOAuthWithMetadata | CustomJwtAccountWithMetadata | FarcasterWithMetadata | PasskeyWithMetadata | TelegramWithMetadata | CrossAppAccountWithMetadata |
|
|
1066
|
+
type LinkedAccountWithMetadata = WalletWithMetadata | SmartWalletWithMetadata | EmailWithMetadata | PhoneWithMetadata | GoogleOAuthWithMetadata | TwitterOAuthWithMetadata | DiscordOAuthWithMetadata | GithubOAuthWithMetadata | SpotifyOAuthWithMetadata | InstagramOAuthWithMetadata | TiktokOAuthWithMetadata | LinkedInOAuthWithMetadata | AppleOAuthWithMetadata | CustomJwtAccountWithMetadata | FarcasterWithMetadata | PasskeyWithMetadata | TelegramWithMetadata | CrossAppAccountWithMetadata | AuthorizationKeyAccountWithMetadata;
|
|
1067
1067
|
interface User {
|
|
1068
1068
|
/** The Privy-issued DID for the user. If you need to store additional information
|
|
1069
1069
|
* about a user, you can use this DID to reference them. */
|
|
@@ -1223,7 +1223,7 @@ type PriceDisplayOptions = {
|
|
|
1223
1223
|
};
|
|
1224
1224
|
type WalletListEntry = 'metamask' | 'coinbase_wallet' | 'rainbow' | 'phantom' | 'zerion' | 'cryptocom' | 'uniswap' | 'okx_wallet' | 'universal_profile'
|
|
1225
1225
|
/** @deprecated Use `detected_ethereum_wallets` or `detected_solana_wallets` instead */
|
|
1226
|
-
| 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'rabby_wallet' | 'bybit_wallet' | 'ronin_wallet' | 'safe' | 'solflare' | 'backpack';
|
|
1226
|
+
| 'detected_wallets' | 'detected_solana_wallets' | 'detected_ethereum_wallets' | 'wallet_connect' | 'rabby_wallet' | 'bybit_wallet' | 'ronin_wallet' | 'haha_wallet' | 'safe' | 'solflare' | 'backpack';
|
|
1227
1227
|
type NonEmptyArray<T> = [T, ...T[]];
|
|
1228
1228
|
type LoginMethodOrderOption = 'email' | 'sms' | WalletListEntry | OAuthProviderType | `privy:${string}` | 'farcaster' | 'telegram';
|
|
1229
1229
|
type ExternalWalletsConfig = {
|
package/dist/dts/ui.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { R as RuntimeLoginOverridableOptions, C as Chain } from './types-
|
|
2
|
+
import { R as RuntimeLoginOverridableOptions, C as Chain } from './types-CsAGoXth.js';
|
|
3
3
|
import { Hex } from 'viem';
|
|
4
4
|
import { Cluster } from '@privy-io/js-sdk-core';
|
|
5
5
|
import '@solana/wallet-adapter-base';
|
package/dist/dts/ui.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { R as RuntimeLoginOverridableOptions, C as Chain } from './types-
|
|
2
|
+
import { R as RuntimeLoginOverridableOptions, C as Chain } from './types-CsAGoXth.js';
|
|
3
3
|
import { Hex } from 'viem';
|
|
4
4
|
import { Cluster } from '@privy-io/js-sdk-core';
|
|
5
5
|
import '@solana/wallet-adapter-base';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
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, C as Chain, F as FundingMethod, f as SolanaCluster, g as ConnectedSolanaWallet, h as CreateWalletOptions } from './types-
|
|
1
|
+
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, C as Chain, F as FundingMethod, f as SolanaCluster, g as ConnectedSolanaWallet, h as CreateWalletOptions } from './types-CsAGoXth.js';
|
|
2
2
|
import { MouseEvent } from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -58,6 +58,23 @@ interface PrivyEvents {
|
|
|
58
58
|
*/
|
|
59
59
|
onError?: CallbackError;
|
|
60
60
|
};
|
|
61
|
+
connectOrCreateWallet: {
|
|
62
|
+
/**
|
|
63
|
+
* Callback that will execute once a successful `connectWallet` completes.
|
|
64
|
+
* This will not run in the case of a wallet-based authentication or link flow.
|
|
65
|
+
*
|
|
66
|
+
* @param params.wallet {@link BaseConnectedEthereumWallet | BaseConnectedSolanaWallet} the `wallet` object correspending to the connection
|
|
67
|
+
*/
|
|
68
|
+
onSuccess?: (params: {
|
|
69
|
+
wallet: BaseConnectedEthereumWallet | BaseConnectedSolanaWallet;
|
|
70
|
+
}) => void;
|
|
71
|
+
/**
|
|
72
|
+
* Callback that will execute in the case of a non-successful wallet connection.
|
|
73
|
+
*
|
|
74
|
+
* @param params.error {@link PrivyErrorCode} - the corresponding error code
|
|
75
|
+
*/
|
|
76
|
+
onError?: CallbackError;
|
|
77
|
+
};
|
|
61
78
|
createWallet: {
|
|
62
79
|
/**
|
|
63
80
|
* Callback that will execute once on a successful embedded wallet creation.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
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, C as Chain, F as FundingMethod, f as SolanaCluster, g as ConnectedSolanaWallet, h as CreateWalletOptions } from './types-
|
|
1
|
+
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, C as Chain, F as FundingMethod, f as SolanaCluster, g as ConnectedSolanaWallet, h as CreateWalletOptions } from './types-CsAGoXth.js';
|
|
2
2
|
import { MouseEvent } from 'react';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -58,6 +58,23 @@ interface PrivyEvents {
|
|
|
58
58
|
*/
|
|
59
59
|
onError?: CallbackError;
|
|
60
60
|
};
|
|
61
|
+
connectOrCreateWallet: {
|
|
62
|
+
/**
|
|
63
|
+
* Callback that will execute once a successful `connectWallet` completes.
|
|
64
|
+
* This will not run in the case of a wallet-based authentication or link flow.
|
|
65
|
+
*
|
|
66
|
+
* @param params.wallet {@link BaseConnectedEthereumWallet | BaseConnectedSolanaWallet} the `wallet` object correspending to the connection
|
|
67
|
+
*/
|
|
68
|
+
onSuccess?: (params: {
|
|
69
|
+
wallet: BaseConnectedEthereumWallet | BaseConnectedSolanaWallet;
|
|
70
|
+
}) => void;
|
|
71
|
+
/**
|
|
72
|
+
* Callback that will execute in the case of a non-successful wallet connection.
|
|
73
|
+
*
|
|
74
|
+
* @param params.error {@link PrivyErrorCode} - the corresponding error code
|
|
75
|
+
*/
|
|
76
|
+
onError?: CallbackError;
|
|
77
|
+
};
|
|
61
78
|
createWallet: {
|
|
62
79
|
/**
|
|
63
80
|
* Callback that will execute once on a successful embedded wallet creation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{hexToNumber as o,createWalletClient as r,custom as
|
|
1
|
+
import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{hexToNumber as o,createWalletClient as r,custom as t,http as i}from"viem";import{toAccount as n}from"viem/accounts";import{abstractTestnet as c}from"viem/chains";import{c as a,k as s,ak as l,j as p,ar as d,as as m,at as u,au as h,l as I}from"./privy-provider-u_cmfixS.mjs";import{u as y}from"./internal-context-O3TPYUku.mjs";import{g}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import{c as f}from"./smart-wallets-vK26EMrU.mjs";import"react/jsx-runtime";import"mipd";import"react";import"react-device-detect";import"viem/utils";import"uuid";import"jose";import"eventemitter3";import"@coinbase/wallet-sdk";import"@privy-io/js-sdk-core";import"@marsidev/react-turnstile";import"styled-components";import"tinycolor2";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/CheckIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"@heroicons/react/24/outline/WalletIcon";import"zustand";import"@walletconnect/ethereum-provider";import"@heroicons/react/24/outline/UserCircleIcon";import"@heroicons/react/24/outline/EnvelopeIcon";import"@heroicons/react/20/solid/CheckIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";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"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/LockClosedIcon";import"@heroicons/react/24/outline/PencilSquareIcon";import"@heroicons/react/24/solid/CheckCircleIcon";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/ShieldCheckIcon";import"qrcode";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/ChevronDownIcon";import"@heroicons/react/24/outline/CalendarIcon";import"@headlessui/react";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/solid/ArrowsRightLeftIcon";import"@heroicons/react/24/outline/GlobeAltIcon";import"ofetch";import"@heroicons/react/24/outline";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 C(){let{user:C}=a(),{hideWalletUIs:v,openPrivyModal:w,chains:P,appId:T,rpcConfig:k}=y(),{wallets:M}=s(),{setModalData:A}=l(),F=p(C),S=async(a=c.id)=>{let s=g(M);if(!s)throw Error("No connected wallet found");let l="string"==typeof a?o(a):a;if(![c.id,2741].includes(l))throw Error("Error, only Abstract chains are supported");let p=P.find((e=>e.id===l));if(!p)throw Error("Chain not configured");await s.switchChain(p.id);let d=await s.getEthereumProvider(),m=r({account:s.address,transport:t(d)}),u=n({address:s.address,signMessage:m.signMessage,signTransaction:m.signTransaction,signTypedData:m.signTypedData});return await e({chain:p,transport:i(I(p,k,T)),publicTransport:i(I(p,k,T)),signer:u})};return{signMessage:async({message:e},o)=>{let r=await S(o);return new Promise((async(o,t)=>{let{entropyId:i,entropyIdVerifier:n}=d(C);v.current=!0,A({connectWallet:{recoveryMethod:F.recoveryMethod,connectingWalletAddress:F.address,entropyId:i,entropyIdVerifier:n,onCompleteNavigateTo:m,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>r.signMessage({message:e}),onSuccess:e=>o(e),onFailure:t,uiOptions:{isCancellable:!0}}}),w(u)})).finally((()=>{v.current=!1}))},signTypedData:async(e,o)=>{let r=await S(o);return new Promise((async(o,t)=>{v.current=!0;let{entropyId:i,entropyIdVerifier:n}=d(C);A({connectWallet:{recoveryMethod:F.recoveryMethod,connectingWalletAddress:F.address,entropyId:i,entropyIdVerifier:n,onCompleteNavigateTo:m,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>r.signTypedData(e),onSuccess:e=>o(e),onFailure:t,uiOptions:{isCancellable:!0}}}),w(u)})).finally((()=>{v.current=!1}))},sendTransaction:async e=>{let o=await S(e.chainId),r=[],t="calls"in e&&void 0!==e.calls;return r=t?[...e.calls]:[e],new Promise((async(i,n)=>{v.current=!0;let{entropyId:c,entropyIdVerifier:a}=d(C);A({connectWallet:{recoveryMethod:F.recoveryMethod,connectingWalletAddress:F.address,entropyId:c,entropyIdVerifier:a,onCompleteNavigateTo:h,onFailure:()=>{}},sendTransaction:{transactionRequests:f({calls:r,chain:o.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:c,entropyIdVerifier:a,transactingWalletAddress:o.account.address,transactingWalletIndex:void 0,signOnly:!1,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:()=>t?o.sendTransactionBatch(e):o.sendTransaction(e),onSuccess:e=>i(e.hash),onFailure:n,uiOptions:{isCancellable:!0}}}),w(u)})).finally((()=>{v.current=!1}))},signTransaction:async e=>{let o=await S(e.chainId),r=[],t="calls"in e&&void 0!==e.calls;return r=t?[...e.calls]:[e],new Promise((async(i,n)=>{v.current=!0;let{entropyId:c,entropyIdVerifier:a}=d(C);A({connectWallet:{recoveryMethod:F.recoveryMethod,connectingWalletAddress:F.address,entropyId:c,entropyIdVerifier:a,onCompleteNavigateTo:h,onFailure:()=>{}},sendTransaction:{transactionRequests:f({calls:r,chain:o.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:c,entropyIdVerifier:a,transactingWalletAddress:o.account.address,transactingWalletIndex:void 0,signOnly:!0,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:()=>{if(!t)return o.signTransaction(e);throw Error("Batch transactions not supported for signing")},onSuccess:e=>i(e.hash),onFailure:n,uiOptions:{isCancellable:!0}}}),w(u)})).finally((()=>{v.current=!1}))}}}export{C as useAbstractSmartWallets};
|
package/dist/esm/farcaster.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as t}from"react";import{
|
|
1
|
+
import{useCallback as t}from"react";import{a as e,am as i,an as a,f as s,u as n}from"./internal-context-O3TPYUku.mjs";import"ofetch";class r{async init(){if(!this.api)throw new e("Auth flow has no API instance");let{nonce:t}=await this.api.post(i,{});return{nonce:t}}async authenticate(){if(!this.message||!this.signature||!this.fid)throw new e("Auth flow has no message, signature, or fid");if(!this.api)throw new e("Auth flow has no API instance");try{let t=await this.api.post(a,{message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new e("No response from authentication");return t}catch(t){throw s(t)}}async link(){throw Error("Not implemented")}setAuthData({message:t,signature:e,fid:i}){this.message=t,this.signature=e,this.fid=i}constructor(){this.meta={}}}const o=()=>{let{client:i,setAuthenticated:a,setUser:s}=n();return{initLoginToFrame:t((async()=>{let t=new r;if(!i)throw new e("Must initialize Privy client first.");return i.startAuthFlow(t),await t.init()}),[i]),loginToFrame:t((async({message:t,signature:n})=>{if(!i)throw new e("Must initialize Privy client first.");if(!(i.authFlow instanceof r))throw new e("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 e("Invalid message format; could not parse Farcaster ID.");i.authFlow.setAuthData({message:t,signature:n,fid:o});let{user:h}=await i.authenticate();return h&&(s(h),a(!0)),h}),[i,s,a])}};export{o as useLoginToFrame};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return e.find((e=>"privy"===e.walletClientType&&"embedded"===e.connectorType&&!e.imported))??null}export{e as g};
|