@privy-io/react-auth 2.22.0 → 2.22.1-beta-20250828223449
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/extended-chains.js +1 -1
- package/dist/cjs/farcaster.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/{internal-context-B_aIJuQh.js → internal-context-C3Ps4gAt.js} +1 -1
- package/dist/cjs/{privy-provider-DXrPQcjO.js → privy-provider-BGGwqhy8.js} +24 -24
- package/dist/cjs/{smart-wallets-ohOqJE5r.js → smart-wallets-D_tk0f-g.js} +1 -1
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/ui.js +1 -1
- package/dist/cjs/{use-sign-with-user-signer-mIruAdfm.js → use-sign-with-user-signer-L1_W0zce.js} +1 -1
- package/dist/cjs/{useActiveWallet-BOhTaQoP.js → useActiveWallet-BMB7qP1P.js} +1 -1
- package/dist/cjs/{useFundWallet-BlDOcTKs.js → useFundWallet-BsYB4eyD.js} +1 -1
- package/dist/dts/extended-chains.d.mts +1 -1
- package/dist/dts/extended-chains.d.ts +1 -1
- package/dist/dts/farcaster.d.mts +1 -1
- package/dist/dts/farcaster.d.ts +1 -1
- package/dist/dts/index.d.mts +93 -5
- package/dist/dts/index.d.ts +93 -5
- package/dist/dts/smart-wallets.d.mts +1 -1
- package/dist/dts/smart-wallets.d.ts +1 -1
- package/dist/dts/solana.d.mts +4 -4
- package/dist/dts/solana.d.ts +4 -4
- package/dist/dts/{types-koC7eIOP.d.mts → types-m7jrPKbg.d.mts} +28 -2
- package/dist/dts/{types-koC7eIOP.d.ts → types-m7jrPKbg.d.ts} +28 -2
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/dts/{useSolanaWallets-CDu74ZFA.d.mts → useSolanaWallets-CDKQPgEx.d.mts} +1 -1
- package/dist/dts/{useSolanaWallets-CDu74ZFA.d.ts → useSolanaWallets-CDKQPgEx.d.ts} +1 -1
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/extended-chains.mjs +1 -1
- package/dist/esm/farcaster.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/{internal-context-qdNgTV5f.mjs → internal-context-D0EM1HLm.mjs} +1 -1
- package/dist/esm/{privy-provider-CoOSBvfN.mjs → privy-provider-CKlbanJT.mjs} +21 -21
- package/dist/esm/{smart-wallets-TO2YIcTb.mjs → smart-wallets-DvhjmUML.mjs} +1 -1
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/ui.mjs +1 -1
- package/dist/esm/{use-sign-with-user-signer-u7zZ9cLA.mjs → use-sign-with-user-signer-BWQ0PcRX.mjs} +1 -1
- package/dist/esm/{useActiveWallet-DknggGRp.mjs → useActiveWallet-DBY0VGHM.mjs} +1 -1
- package/dist/esm/{useFundWallet-DvuaQdcB.mjs → useFundWallet-9dDh5PMy.mjs} +1 -1
- package/package.json +4 -4
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 UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as EIP1193Provider, u as EntropyIdVerifier$1, H as HDWalletWithMetadata, v as RequestArguments, w as WalletConnector, B as BaseConnectedEthereumWallet, x as PrivyProxyProvider, y as WalletClientType, z as ConnectedWalletMetadata, A as PrivyClientConfig, D as ConnectorType, G as SetBaseAccountSdkType, I as WalletListEntry, J as AppConfig, K as BaseConnectedWallet, m as SolanaWalletConnector, U as User, N as ConnectWalletModalOptions, Q as LoginModalOptions, f as CreateWalletOptions, W as Wallet, T as SetWalletRecoveryOptions, j as SignMessageModalUIOptions, V as SignTypedDataParams, M as MfaMethod, X as UnsignedTransactionRequest, i as SendTransactionModalUIOptions, Y as FundWalletConfig, Z as ConnectedWallet, O as OAuthTokens, _ as CrossAppProviderDetails, $ as OAuthProviderType, a0 as MoonpaySignRequest, a1 as MoonpaySignResponse, a2 as SmartWalletConfig,
|
|
4
|
-
export {
|
|
3
|
+
import { c as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as EIP1193Provider, u as EntropyIdVerifier$1, H as HDWalletWithMetadata, v as RequestArguments, w as WalletConnector, B as BaseConnectedEthereumWallet, x as PrivyProxyProvider, y as WalletClientType, z as ConnectedWalletMetadata, A as PrivyClientConfig, D as ConnectorType, G as SetBaseAccountSdkType, I as WalletListEntry, J as AppConfig, K as BaseConnectedWallet, m as SolanaWalletConnector, U as User, N as ConnectWalletModalOptions, Q as LoginModalOptions, f as CreateWalletOptions, W as Wallet, T as SetWalletRecoveryOptions, j as SignMessageModalUIOptions, V as SignTypedDataParams, M as MfaMethod, X as UnsignedTransactionRequest, i as SendTransactionModalUIOptions, Y as FundWalletConfig, Z as ConnectedWallet, O as OAuthTokens, _ as CrossAppProviderDetails, $ as OAuthProviderType, a0 as MoonpaySignRequest, a1 as MoonpaySignResponse, a2 as SmartWalletConfig, a3 as SiwsMessageType, L as LoginMethod, a4 as ExternalWalletMetadata, a5 as TelegramAuthResult, a6 as TelegramWebAppData, a7 as OAuthUserInfo, a8 as OAuthFlowState, a9 as LoginWithCode, aa as OtpFlowState, ab as PasskeyFlowState, ac as SiweFlowState, ad as SiwsFlowState, a as LinkedAccountWithMetadata, ae as BaseAccountSdkType, af as UnsignedTransactionRequestWithChainId, ag as BaseConnectedWalletType, C as ConnectedSolanaWallet, ah as SessionSignerInput, ai as TelegramAuthFlowState } from './types-m7jrPKbg.js';
|
|
4
|
+
export { aB as Apple, aO as AppleOAuthWithMetadata, aW as ContractUIOptions, aF as CrossAppAccount, aR as CrossAppAccountWithMetadata, ay as Discord, aJ as DiscordOAuthWithMetadata, aT as Email, at as EmailWithMetadata, a_ as Farcaster, aP as FarcasterWithMetadata, az as Github, aK as GithubOAuthWithMetadata, aw as Google, aH as GoogleOAuthWithMetadata, aD as Line, aM as LineOAuthWithMetadata, aG as LinkedAccountType, aA as LinkedIn, aN as LinkedInOAuthWithMetadata, b0 as LoginMethodOrderOption, ak as MessageTypes, am as MoonpayConfig, an as MoonpayCurrencyCode, aY as MoonpayFundingConfig, ao as MoonpayPaymentMethod, aX as NativeFundingConfig, as as NonEmptyArray, a$ as Passkey, aS as PasskeyWithMetadata, aU as Phone, au as PhoneWithMetadata, aZ as PriceDisplayOptions, P as PrivyErrorCode, ap as Quantity, al as SmartWallet, e as SolanaCluster, l as SolanaFundingConfig, S as SolanaTransactionReceipt, d as SupportedSolanaTransaction, aE as Telegram, aQ as TelegramWithMetadata, aC as Tiktok, aL as TiktokOAuthWithMetadata, aq as TransactionLog, ar as TransactionReceipt, aV as TransactionUIOptions, ax as Twitter, aI as TwitterOAuthWithMetadata, aj as TypedMessage, av as WalletWithMetadata } from './types-m7jrPKbg.js';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import { TurnstileProps } from '@marsidev/react-turnstile';
|
|
7
7
|
import { AppKit } from '@reown/appkit';
|
|
@@ -16,8 +16,8 @@ import * as _simplewebauthn_types from '@simplewebauthn/types';
|
|
|
16
16
|
import { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types';
|
|
17
17
|
import { Cluster } from '@solana/web3.js';
|
|
18
18
|
import { FetchOptions } from 'ofetch';
|
|
19
|
-
import { P as PrivyEvents } from './useSolanaWallets-
|
|
20
|
-
export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-
|
|
19
|
+
import { P as PrivyEvents } from './useSolanaWallets-CDKQPgEx.js';
|
|
20
|
+
export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-CDKQPgEx.js';
|
|
21
21
|
import * as viem_accounts from 'viem/accounts';
|
|
22
22
|
import '@coinbase/wallet-sdk';
|
|
23
23
|
import '@solana/wallet-adapter-base';
|
|
@@ -2742,6 +2742,23 @@ declare class PrivyClient {
|
|
|
2742
2742
|
walletClientType?: string;
|
|
2743
2743
|
connectorType?: string;
|
|
2744
2744
|
}): Promise<User>;
|
|
2745
|
+
/**
|
|
2746
|
+
* Authenticates with Privy via the Sign-In with Solana spec and returns a User object.
|
|
2747
|
+
*
|
|
2748
|
+
* @param params - Authentication parameters
|
|
2749
|
+
* @returns User object and new user flag
|
|
2750
|
+
*/
|
|
2751
|
+
authenticateWithSiws({ message, signature, walletClientType, connectorType, mode, messageType, }: {
|
|
2752
|
+
message: string;
|
|
2753
|
+
signature: string;
|
|
2754
|
+
walletClientType?: string;
|
|
2755
|
+
connectorType?: string;
|
|
2756
|
+
mode: 'no-signup' | 'login-or-sign-up';
|
|
2757
|
+
messageType: SiwsMessageType;
|
|
2758
|
+
}): Promise<{
|
|
2759
|
+
user: User;
|
|
2760
|
+
isNewUser: boolean;
|
|
2761
|
+
}>;
|
|
2745
2762
|
/**
|
|
2746
2763
|
*
|
|
2747
2764
|
*/
|
|
@@ -3145,6 +3162,77 @@ type UseLoginWithSiwe = {
|
|
|
3145
3162
|
};
|
|
3146
3163
|
declare const useLoginWithSiwe: (callbacks?: PrivyEvents["login"]) => UseLoginWithSiwe;
|
|
3147
3164
|
|
|
3165
|
+
type UseLoginWithSiws = {
|
|
3166
|
+
/**
|
|
3167
|
+
* Given a Solana wallet address, creates a Sign-In with Solana (SIWS) message for signing.
|
|
3168
|
+
* To be used for a SIWS implementation without Privy UIs
|
|
3169
|
+
*
|
|
3170
|
+
* @param opts options for generating a SIWS message for
|
|
3171
|
+
* @param opts.address {string} Base58-encoded Solana address performing the signing.
|
|
3172
|
+
* @returns {string} SIWS message for signing.
|
|
3173
|
+
*/
|
|
3174
|
+
generateSiwsMessage: ({ address, disableSignup, }: {
|
|
3175
|
+
address: string;
|
|
3176
|
+
disableSignup?: boolean;
|
|
3177
|
+
}) => Promise<string>;
|
|
3178
|
+
/**
|
|
3179
|
+
* Log a user in with a SIWS message and signature.
|
|
3180
|
+
*
|
|
3181
|
+
* @param opts options for verifying a signature for a SIWS message
|
|
3182
|
+
* @param opts.signature {string} The signature corresponding to the message that the user had been given.
|
|
3183
|
+
* @param opts.message {string} SIWS message for signing. Returned from the generateSiwsMessage call
|
|
3184
|
+
* @returns The user response object.
|
|
3185
|
+
*/
|
|
3186
|
+
loginWithSiws: ({ signature, message, disableSignup, }: {
|
|
3187
|
+
signature: string;
|
|
3188
|
+
message: string;
|
|
3189
|
+
disableSignup?: boolean;
|
|
3190
|
+
}) => Promise<User>;
|
|
3191
|
+
/**
|
|
3192
|
+
* The current state of the SIWS login operation
|
|
3193
|
+
*/
|
|
3194
|
+
state: SiwsFlowState;
|
|
3195
|
+
};
|
|
3196
|
+
declare const useLoginWithSiws: (callbacks?: PrivyEvents["login"]) => UseLoginWithSiws;
|
|
3197
|
+
|
|
3198
|
+
type UseLinkWithSiws = {
|
|
3199
|
+
/**
|
|
3200
|
+
* Given a Solana wallet address, creates a Sign-In with Solana (SIWS) message for signing.
|
|
3201
|
+
* To be used for a SIWS implementation without Privy UIs
|
|
3202
|
+
*
|
|
3203
|
+
* @param opts options for generating a SIWS message for
|
|
3204
|
+
* @param opts.address {string} Base58-encoded Solana address performing the signing.
|
|
3205
|
+
* @returns {string} SIWS message for signing.
|
|
3206
|
+
*/
|
|
3207
|
+
generateSiwsMessage: ({ address }: {
|
|
3208
|
+
address: string;
|
|
3209
|
+
}) => Promise<string>;
|
|
3210
|
+
/**
|
|
3211
|
+
* Link a user's account with a SIWS message and signature.
|
|
3212
|
+
*
|
|
3213
|
+
* @param opts options for verifying a signature for a SIWS message
|
|
3214
|
+
* @param opts.signature {string} The signature corresponding to the message that the user had been given.
|
|
3215
|
+
* @param opts.message {string} SIWS message for signing. Returned from the generateSiwsMessage call
|
|
3216
|
+
* @param opts.walletClientType {string} (optional) the wallet client type used to connect the wallet
|
|
3217
|
+
* @param opts.connectorType {string} (optional) the method used to connect the wallet to the application
|
|
3218
|
+
* @returns The user response object and linked account information.
|
|
3219
|
+
*/
|
|
3220
|
+
linkWithSiws: ({ signature, message, walletClientType, connectorType, }: {
|
|
3221
|
+
signature: string;
|
|
3222
|
+
message: string;
|
|
3223
|
+
walletClientType?: string;
|
|
3224
|
+
connectorType?: string;
|
|
3225
|
+
}) => Promise<{
|
|
3226
|
+
user: User;
|
|
3227
|
+
linkedAccount: LinkedAccountWithMetadata | null;
|
|
3228
|
+
}>;
|
|
3229
|
+
/**
|
|
3230
|
+
* The current state of the SIWS link operation
|
|
3231
|
+
*/
|
|
3232
|
+
state: SiwsFlowState;
|
|
3233
|
+
};
|
|
3234
|
+
declare const useLinkWithSiws: (callbacks?: PrivyEvents["linkAccount"]) => UseLinkWithSiws;
|
|
3235
|
+
|
|
3148
3236
|
/**
|
|
3149
3237
|
* Use this hook to sign a transaction using the embedded wallet.
|
|
3150
3238
|
*
|
|
@@ -4245,4 +4333,4 @@ declare const useMigrateWallets: () => {
|
|
|
4245
4333
|
}>;
|
|
4246
4334
|
};
|
|
4247
4335
|
|
|
4248
|
-
export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, type CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, type JwtAuthFlowState, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseAuthorizationSignatureInterface, type UseBaseAccountSdkInterface, type UseConnectBaseAccountInterface, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkJwtAccount, type UseLinkWithPasskey, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseRecoverEmbeddedWalletInterface, type UseSessionSignersInterface, type UseSignupWithPasskey, type UseSubscribeToJwtAuthWithFlagInput, type UseSyncJwtBasedAuthStateInput, type UseSyncJwtBasedAuthStateInterface, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, toViemAccount, useActiveWallet, useAuthMfa, useAuthMfaEnrollment, useAuthorizationSignature, useBaseAccountSdk, useConnectBaseAccount, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkJwtAccount, useLinkWithPasskey, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSiwe, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useMigrateWallets, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSessionSigners, useSetWalletPassword, useSetWalletRecovery, useSign7702Authorization, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useSubscribeToJwtAuthWithFlag, useSyncJwtBasedAuthState, useToken, useUpdateAccount, useUpdateEmail, useUser, useWallets };
|
|
4336
|
+
export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, type CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, type JwtAuthFlowState, LinkedAccountWithMetadata, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, SiwsFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseAuthorizationSignatureInterface, type UseBaseAccountSdkInterface, type UseConnectBaseAccountInterface, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkJwtAccount, type UseLinkWithPasskey, type UseLinkWithSiws, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSiws, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseRecoverEmbeddedWalletInterface, type UseSessionSignersInterface, type UseSignupWithPasskey, type UseSubscribeToJwtAuthWithFlagInput, type UseSyncJwtBasedAuthStateInput, type UseSyncJwtBasedAuthStateInterface, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, toViemAccount, useActiveWallet, useAuthMfa, useAuthMfaEnrollment, useAuthorizationSignature, useBaseAccountSdk, useConnectBaseAccount, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkJwtAccount, useLinkWithPasskey, useLinkWithSiwe, useLinkWithSiws, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSiwe, useLoginWithSiws, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useMigrateWallets, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSessionSigners, useSetWalletPassword, useSetWalletRecovery, useSign7702Authorization, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useSubscribeToJwtAuthWithFlag, useSyncJwtBasedAuthState, useToken, useUpdateAccount, useUpdateEmail, 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 UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as EIP1193Provider, u as EntropyIdVerifier$1, H as HDWalletWithMetadata, v as RequestArguments, w as WalletConnector, B as BaseConnectedEthereumWallet, x as PrivyProxyProvider, y as WalletClientType, z as ConnectedWalletMetadata, A as PrivyClientConfig, D as ConnectorType, G as SetBaseAccountSdkType, I as WalletListEntry, J as AppConfig, K as BaseConnectedWallet, m as SolanaWalletConnector, U as User, N as ConnectWalletModalOptions, Q as LoginModalOptions, f as CreateWalletOptions, W as Wallet, T as SetWalletRecoveryOptions, j as SignMessageModalUIOptions, V as SignTypedDataParams, M as MfaMethod, X as UnsignedTransactionRequest, i as SendTransactionModalUIOptions, Y as FundWalletConfig, Z as ConnectedWallet, O as OAuthTokens, _ as CrossAppProviderDetails, $ as OAuthProviderType, a0 as MoonpaySignRequest, a1 as MoonpaySignResponse, a2 as SmartWalletConfig,
|
|
4
|
-
export {
|
|
3
|
+
import { c as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as EIP1193Provider, u as EntropyIdVerifier$1, H as HDWalletWithMetadata, v as RequestArguments, w as WalletConnector, B as BaseConnectedEthereumWallet, x as PrivyProxyProvider, y as WalletClientType, z as ConnectedWalletMetadata, A as PrivyClientConfig, D as ConnectorType, G as SetBaseAccountSdkType, I as WalletListEntry, J as AppConfig, K as BaseConnectedWallet, m as SolanaWalletConnector, U as User, N as ConnectWalletModalOptions, Q as LoginModalOptions, f as CreateWalletOptions, W as Wallet, T as SetWalletRecoveryOptions, j as SignMessageModalUIOptions, V as SignTypedDataParams, M as MfaMethod, X as UnsignedTransactionRequest, i as SendTransactionModalUIOptions, Y as FundWalletConfig, Z as ConnectedWallet, O as OAuthTokens, _ as CrossAppProviderDetails, $ as OAuthProviderType, a0 as MoonpaySignRequest, a1 as MoonpaySignResponse, a2 as SmartWalletConfig, a3 as SiwsMessageType, L as LoginMethod, a4 as ExternalWalletMetadata, a5 as TelegramAuthResult, a6 as TelegramWebAppData, a7 as OAuthUserInfo, a8 as OAuthFlowState, a9 as LoginWithCode, aa as OtpFlowState, ab as PasskeyFlowState, ac as SiweFlowState, ad as SiwsFlowState, a as LinkedAccountWithMetadata, ae as BaseAccountSdkType, af as UnsignedTransactionRequestWithChainId, ag as BaseConnectedWalletType, C as ConnectedSolanaWallet, ah as SessionSignerInput, ai as TelegramAuthFlowState } from './types-m7jrPKbg.js';
|
|
4
|
+
export { aB as Apple, aO as AppleOAuthWithMetadata, aW as ContractUIOptions, aF as CrossAppAccount, aR as CrossAppAccountWithMetadata, ay as Discord, aJ as DiscordOAuthWithMetadata, aT as Email, at as EmailWithMetadata, a_ as Farcaster, aP as FarcasterWithMetadata, az as Github, aK as GithubOAuthWithMetadata, aw as Google, aH as GoogleOAuthWithMetadata, aD as Line, aM as LineOAuthWithMetadata, aG as LinkedAccountType, aA as LinkedIn, aN as LinkedInOAuthWithMetadata, b0 as LoginMethodOrderOption, ak as MessageTypes, am as MoonpayConfig, an as MoonpayCurrencyCode, aY as MoonpayFundingConfig, ao as MoonpayPaymentMethod, aX as NativeFundingConfig, as as NonEmptyArray, a$ as Passkey, aS as PasskeyWithMetadata, aU as Phone, au as PhoneWithMetadata, aZ as PriceDisplayOptions, P as PrivyErrorCode, ap as Quantity, al as SmartWallet, e as SolanaCluster, l as SolanaFundingConfig, S as SolanaTransactionReceipt, d as SupportedSolanaTransaction, aE as Telegram, aQ as TelegramWithMetadata, aC as Tiktok, aL as TiktokOAuthWithMetadata, aq as TransactionLog, ar as TransactionReceipt, aV as TransactionUIOptions, ax as Twitter, aI as TwitterOAuthWithMetadata, aj as TypedMessage, av as WalletWithMetadata } from './types-m7jrPKbg.js';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import { TurnstileProps } from '@marsidev/react-turnstile';
|
|
7
7
|
import { AppKit } from '@reown/appkit';
|
|
@@ -16,8 +16,8 @@ import * as _simplewebauthn_types from '@simplewebauthn/types';
|
|
|
16
16
|
import { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types';
|
|
17
17
|
import { Cluster } from '@solana/web3.js';
|
|
18
18
|
import { FetchOptions } from 'ofetch';
|
|
19
|
-
import { P as PrivyEvents } from './useSolanaWallets-
|
|
20
|
-
export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-
|
|
19
|
+
import { P as PrivyEvents } from './useSolanaWallets-CDKQPgEx.js';
|
|
20
|
+
export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-CDKQPgEx.js';
|
|
21
21
|
import * as viem_accounts from 'viem/accounts';
|
|
22
22
|
import '@coinbase/wallet-sdk';
|
|
23
23
|
import '@solana/wallet-adapter-base';
|
|
@@ -2742,6 +2742,23 @@ declare class PrivyClient {
|
|
|
2742
2742
|
walletClientType?: string;
|
|
2743
2743
|
connectorType?: string;
|
|
2744
2744
|
}): Promise<User>;
|
|
2745
|
+
/**
|
|
2746
|
+
* Authenticates with Privy via the Sign-In with Solana spec and returns a User object.
|
|
2747
|
+
*
|
|
2748
|
+
* @param params - Authentication parameters
|
|
2749
|
+
* @returns User object and new user flag
|
|
2750
|
+
*/
|
|
2751
|
+
authenticateWithSiws({ message, signature, walletClientType, connectorType, mode, messageType, }: {
|
|
2752
|
+
message: string;
|
|
2753
|
+
signature: string;
|
|
2754
|
+
walletClientType?: string;
|
|
2755
|
+
connectorType?: string;
|
|
2756
|
+
mode: 'no-signup' | 'login-or-sign-up';
|
|
2757
|
+
messageType: SiwsMessageType;
|
|
2758
|
+
}): Promise<{
|
|
2759
|
+
user: User;
|
|
2760
|
+
isNewUser: boolean;
|
|
2761
|
+
}>;
|
|
2745
2762
|
/**
|
|
2746
2763
|
*
|
|
2747
2764
|
*/
|
|
@@ -3145,6 +3162,77 @@ type UseLoginWithSiwe = {
|
|
|
3145
3162
|
};
|
|
3146
3163
|
declare const useLoginWithSiwe: (callbacks?: PrivyEvents["login"]) => UseLoginWithSiwe;
|
|
3147
3164
|
|
|
3165
|
+
type UseLoginWithSiws = {
|
|
3166
|
+
/**
|
|
3167
|
+
* Given a Solana wallet address, creates a Sign-In with Solana (SIWS) message for signing.
|
|
3168
|
+
* To be used for a SIWS implementation without Privy UIs
|
|
3169
|
+
*
|
|
3170
|
+
* @param opts options for generating a SIWS message for
|
|
3171
|
+
* @param opts.address {string} Base58-encoded Solana address performing the signing.
|
|
3172
|
+
* @returns {string} SIWS message for signing.
|
|
3173
|
+
*/
|
|
3174
|
+
generateSiwsMessage: ({ address, disableSignup, }: {
|
|
3175
|
+
address: string;
|
|
3176
|
+
disableSignup?: boolean;
|
|
3177
|
+
}) => Promise<string>;
|
|
3178
|
+
/**
|
|
3179
|
+
* Log a user in with a SIWS message and signature.
|
|
3180
|
+
*
|
|
3181
|
+
* @param opts options for verifying a signature for a SIWS message
|
|
3182
|
+
* @param opts.signature {string} The signature corresponding to the message that the user had been given.
|
|
3183
|
+
* @param opts.message {string} SIWS message for signing. Returned from the generateSiwsMessage call
|
|
3184
|
+
* @returns The user response object.
|
|
3185
|
+
*/
|
|
3186
|
+
loginWithSiws: ({ signature, message, disableSignup, }: {
|
|
3187
|
+
signature: string;
|
|
3188
|
+
message: string;
|
|
3189
|
+
disableSignup?: boolean;
|
|
3190
|
+
}) => Promise<User>;
|
|
3191
|
+
/**
|
|
3192
|
+
* The current state of the SIWS login operation
|
|
3193
|
+
*/
|
|
3194
|
+
state: SiwsFlowState;
|
|
3195
|
+
};
|
|
3196
|
+
declare const useLoginWithSiws: (callbacks?: PrivyEvents["login"]) => UseLoginWithSiws;
|
|
3197
|
+
|
|
3198
|
+
type UseLinkWithSiws = {
|
|
3199
|
+
/**
|
|
3200
|
+
* Given a Solana wallet address, creates a Sign-In with Solana (SIWS) message for signing.
|
|
3201
|
+
* To be used for a SIWS implementation without Privy UIs
|
|
3202
|
+
*
|
|
3203
|
+
* @param opts options for generating a SIWS message for
|
|
3204
|
+
* @param opts.address {string} Base58-encoded Solana address performing the signing.
|
|
3205
|
+
* @returns {string} SIWS message for signing.
|
|
3206
|
+
*/
|
|
3207
|
+
generateSiwsMessage: ({ address }: {
|
|
3208
|
+
address: string;
|
|
3209
|
+
}) => Promise<string>;
|
|
3210
|
+
/**
|
|
3211
|
+
* Link a user's account with a SIWS message and signature.
|
|
3212
|
+
*
|
|
3213
|
+
* @param opts options for verifying a signature for a SIWS message
|
|
3214
|
+
* @param opts.signature {string} The signature corresponding to the message that the user had been given.
|
|
3215
|
+
* @param opts.message {string} SIWS message for signing. Returned from the generateSiwsMessage call
|
|
3216
|
+
* @param opts.walletClientType {string} (optional) the wallet client type used to connect the wallet
|
|
3217
|
+
* @param opts.connectorType {string} (optional) the method used to connect the wallet to the application
|
|
3218
|
+
* @returns The user response object and linked account information.
|
|
3219
|
+
*/
|
|
3220
|
+
linkWithSiws: ({ signature, message, walletClientType, connectorType, }: {
|
|
3221
|
+
signature: string;
|
|
3222
|
+
message: string;
|
|
3223
|
+
walletClientType?: string;
|
|
3224
|
+
connectorType?: string;
|
|
3225
|
+
}) => Promise<{
|
|
3226
|
+
user: User;
|
|
3227
|
+
linkedAccount: LinkedAccountWithMetadata | null;
|
|
3228
|
+
}>;
|
|
3229
|
+
/**
|
|
3230
|
+
* The current state of the SIWS link operation
|
|
3231
|
+
*/
|
|
3232
|
+
state: SiwsFlowState;
|
|
3233
|
+
};
|
|
3234
|
+
declare const useLinkWithSiws: (callbacks?: PrivyEvents["linkAccount"]) => UseLinkWithSiws;
|
|
3235
|
+
|
|
3148
3236
|
/**
|
|
3149
3237
|
* Use this hook to sign a transaction using the embedded wallet.
|
|
3150
3238
|
*
|
|
@@ -4245,4 +4333,4 @@ declare const useMigrateWallets: () => {
|
|
|
4245
4333
|
}>;
|
|
4246
4334
|
};
|
|
4247
4335
|
|
|
4248
|
-
export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, type CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, type JwtAuthFlowState, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseAuthorizationSignatureInterface, type UseBaseAccountSdkInterface, type UseConnectBaseAccountInterface, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkJwtAccount, type UseLinkWithPasskey, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseRecoverEmbeddedWalletInterface, type UseSessionSignersInterface, type UseSignupWithPasskey, type UseSubscribeToJwtAuthWithFlagInput, type UseSyncJwtBasedAuthStateInput, type UseSyncJwtBasedAuthStateInterface, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, toViemAccount, useActiveWallet, useAuthMfa, useAuthMfaEnrollment, useAuthorizationSignature, useBaseAccountSdk, useConnectBaseAccount, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkJwtAccount, useLinkWithPasskey, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSiwe, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useMigrateWallets, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSessionSigners, useSetWalletPassword, useSetWalletRecovery, useSign7702Authorization, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useSubscribeToJwtAuthWithFlag, useSyncJwtBasedAuthState, useToken, useUpdateAccount, useUpdateEmail, useUser, useWallets };
|
|
4336
|
+
export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, type CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, type JwtAuthFlowState, LinkedAccountWithMetadata, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, SiwsFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseAuthorizationSignatureInterface, type UseBaseAccountSdkInterface, type UseConnectBaseAccountInterface, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkJwtAccount, type UseLinkWithPasskey, type UseLinkWithSiws, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSiws, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseRecoverEmbeddedWalletInterface, type UseSessionSignersInterface, type UseSignupWithPasskey, type UseSubscribeToJwtAuthWithFlagInput, type UseSyncJwtBasedAuthStateInput, type UseSyncJwtBasedAuthStateInterface, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, toViemAccount, useActiveWallet, useAuthMfa, useAuthMfaEnrollment, useAuthorizationSignature, useBaseAccountSdk, useConnectBaseAccount, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkJwtAccount, useLinkWithPasskey, useLinkWithSiwe, useLinkWithSiws, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSiwe, useLoginWithSiws, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useMigrateWallets, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSessionSigners, useSetWalletPassword, useSetWalletRecovery, useSign7702Authorization, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useSubscribeToJwtAuthWithFlag, useSyncJwtBasedAuthState, useToken, useUpdateAccount, useUpdateEmail, useUser, useWallets };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import react__default from 'react';
|
|
3
|
-
import { i as SendTransactionModalUIOptions, j as SignMessageModalUIOptions } from './types-
|
|
3
|
+
import { i as SendTransactionModalUIOptions, j as SignMessageModalUIOptions } from './types-m7jrPKbg.js';
|
|
4
4
|
import { SmartAccountClient } from 'permissionless';
|
|
5
5
|
import { SendTransactionParameters, Chain, Hash, SignableMessage, Hex, TypedData, SignTypedDataParameters, EIP1193Provider, PublicClient, HttpTransport, WalletClient, PaymasterRpcSchema } from 'viem';
|
|
6
6
|
import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstraction';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import react__default from 'react';
|
|
3
|
-
import { i as SendTransactionModalUIOptions, j as SignMessageModalUIOptions } from './types-
|
|
3
|
+
import { i as SendTransactionModalUIOptions, j as SignMessageModalUIOptions } from './types-m7jrPKbg.js';
|
|
4
4
|
import { SmartAccountClient } from 'permissionless';
|
|
5
5
|
import { SendTransactionParameters, Chain, Hash, SignableMessage, Hex, TypedData, SignTypedDataParameters, EIP1193Provider, PublicClient, HttpTransport, WalletClient, PaymasterRpcSchema } from 'viem';
|
|
6
6
|
import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstraction';
|
package/dist/dts/solana.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { W as Wallet, k as SolanaStandardWallet, l as SolanaFundingConfig, d as SupportedSolanaTransaction, i as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, j as SignMessageModalUIOptions, f as CreateWalletOptions } from './types-
|
|
2
|
-
export { C as ConnectedSolanaWallet, m 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 SolanaStandardWallet, l as SolanaFundingConfig, d as SupportedSolanaTransaction, i as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, j as SignMessageModalUIOptions, f as CreateWalletOptions } from './types-m7jrPKbg.js';
|
|
2
|
+
export { C as ConnectedSolanaWallet, m as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-m7jrPKbg.js';
|
|
3
|
+
import { P as PrivyEvents } from './useSolanaWallets-CDKQPgEx.js';
|
|
4
|
+
export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-CDKQPgEx.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';
|
package/dist/dts/solana.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { W as Wallet, k as SolanaStandardWallet, l as SolanaFundingConfig, d as SupportedSolanaTransaction, i as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, j as SignMessageModalUIOptions, f as CreateWalletOptions } from './types-
|
|
2
|
-
export { C as ConnectedSolanaWallet, m 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 SolanaStandardWallet, l as SolanaFundingConfig, d as SupportedSolanaTransaction, i as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, j as SignMessageModalUIOptions, f as CreateWalletOptions } from './types-m7jrPKbg.js';
|
|
2
|
+
export { C as ConnectedSolanaWallet, m as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-m7jrPKbg.js';
|
|
3
|
+
import { P as PrivyEvents } from './useSolanaWallets-CDKQPgEx.js';
|
|
4
|
+
export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-CDKQPgEx.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';
|
|
@@ -590,7 +590,7 @@ type CoinbaseWalletClientType = (typeof COINBASE_WALLET_CLIENT_TYPES)[number];
|
|
|
590
590
|
type WalletConnectWalletClientType = (typeof WALLET_CONNECT_WALLET_CLIENT_TYPES)[number];
|
|
591
591
|
declare const UNKNOWN_WALLET_CLIENT_TYPES: readonly ["unknown"];
|
|
592
592
|
type UnknownWalletClientType = (typeof UNKNOWN_WALLET_CLIENT_TYPES)[number];
|
|
593
|
-
declare const SOLANA_WALLET_CLIENT_TYPES: readonly ["phantom", "solflare", "glow", "backpack"];
|
|
593
|
+
declare const SOLANA_WALLET_CLIENT_TYPES: readonly ["phantom", "solflare", "glow", "backpack", "mobile_wallet_adapter"];
|
|
594
594
|
type SolanaWalletClientType = (typeof SOLANA_WALLET_CLIENT_TYPES)[number];
|
|
595
595
|
type WalletClientType = InjectedWalletClientType | CoinbaseWalletClientType | WalletConnectWalletClientType | EmbeddedWalletClientType | UnknownWalletClientType | SolanaWalletClientType;
|
|
596
596
|
declare const SUPPORTED_CONNECTOR_TYPES: string[];
|
|
@@ -1521,6 +1521,17 @@ interface PrivyClientConfig {
|
|
|
1521
1521
|
privacyPolicyUrl?: string | null;
|
|
1522
1522
|
};
|
|
1523
1523
|
walletConnectCloudProjectId?: string;
|
|
1524
|
+
/**
|
|
1525
|
+
* Custom redirect URL for OAuth flows, useful for mobile applications.
|
|
1526
|
+
* If not provided, defaults to window.location.href.
|
|
1527
|
+
*
|
|
1528
|
+
* For Capacitor/mobile apps, use a custom URL scheme like:
|
|
1529
|
+
* 'com.yourapp.oauth://callback' or 'yourapp://oauth'
|
|
1530
|
+
*
|
|
1531
|
+
* Make sure to register this URL scheme in your app configuration
|
|
1532
|
+
* and add it to your app's allowed URL schemes in the Privy dashboard.
|
|
1533
|
+
*/
|
|
1534
|
+
customOAuthRedirectUrl?: string;
|
|
1524
1535
|
/**
|
|
1525
1536
|
* A list of supported chains, used to specify which chains should be used throughout the application.
|
|
1526
1537
|
*
|
|
@@ -1957,6 +1968,7 @@ type AppConfig = {
|
|
|
1957
1968
|
};
|
|
1958
1969
|
fundingMethodConfig: NonNullable<PrivyClientConfig['fundingMethodConfig']>;
|
|
1959
1970
|
whatsAppEnabled: boolean;
|
|
1971
|
+
customOAuthRedirectUrl?: string;
|
|
1960
1972
|
};
|
|
1961
1973
|
/** Privy's generated color palette.
|
|
1962
1974
|
* This will be generated, given a passed theme and accent color (from configuration),
|
|
@@ -2083,6 +2095,20 @@ type SiweFlowState = {
|
|
|
2083
2095
|
} | {
|
|
2084
2096
|
status: 'done';
|
|
2085
2097
|
};
|
|
2098
|
+
type SiwsFlowState = {
|
|
2099
|
+
status: 'initial';
|
|
2100
|
+
} | {
|
|
2101
|
+
status: 'error';
|
|
2102
|
+
error: Error | null;
|
|
2103
|
+
} | {
|
|
2104
|
+
status: 'generating-message';
|
|
2105
|
+
} | {
|
|
2106
|
+
status: 'awaiting-signature';
|
|
2107
|
+
} | {
|
|
2108
|
+
status: 'submitting-signature';
|
|
2109
|
+
} | {
|
|
2110
|
+
status: 'done';
|
|
2111
|
+
};
|
|
2086
2112
|
type OAuthFlowState = {
|
|
2087
2113
|
status: 'initial';
|
|
2088
2114
|
} | {
|
|
@@ -2375,4 +2401,4 @@ type SessionSignerInput = {
|
|
|
2375
2401
|
policyIds?: string[];
|
|
2376
2402
|
}[];
|
|
2377
2403
|
|
|
2378
|
-
export { type OAuthProviderType as $, type PrivyClientConfig as A, type BaseConnectedEthereumWallet as B, type ConnectedSolanaWallet as C, type ConnectorType as D, type EthereumRpcRequestType as E, type FundingMethod as F, type SetBaseAccountSdkType as G, type HDWalletWithMetadata as H, type WalletListEntry as I, type AppConfig as J, type BaseConnectedWallet as K, type LoginMethod as L, type MfaMethod as M, type ConnectWalletModalOptions as N, type OAuthTokens as O, PrivyErrorCode as P, type LoginModalOptions as Q, type RuntimeLoginOverridableOptions as R, type SolanaTransactionReceipt as S, type SetWalletRecoveryOptions as T, type User as U, type SignTypedDataParams as V, type Wallet as W, type UnsignedTransactionRequest as X, type FundWalletConfig as Y, type ConnectedWallet as Z, type CrossAppProviderDetails as _, type LinkedAccountWithMetadata as a, type
|
|
2404
|
+
export { type OAuthProviderType as $, type PrivyClientConfig as A, type BaseConnectedEthereumWallet as B, type ConnectedSolanaWallet as C, type ConnectorType as D, type EthereumRpcRequestType as E, type FundingMethod as F, type SetBaseAccountSdkType as G, type HDWalletWithMetadata as H, type WalletListEntry as I, type AppConfig as J, type BaseConnectedWallet as K, type LoginMethod as L, type MfaMethod as M, type ConnectWalletModalOptions as N, type OAuthTokens as O, PrivyErrorCode as P, type LoginModalOptions as Q, type RuntimeLoginOverridableOptions as R, type SolanaTransactionReceipt as S, type SetWalletRecoveryOptions as T, type User as U, type SignTypedDataParams as V, type Wallet as W, type UnsignedTransactionRequest as X, type FundWalletConfig as Y, type ConnectedWallet as Z, type CrossAppProviderDetails as _, type LinkedAccountWithMetadata as a, type Passkey as a$, type MoonpaySignRequest as a0, type MoonpaySignResponse as a1, type SmartWalletConfig as a2, type SiwsMessageType as a3, type ExternalWalletMetadata as a4, type TelegramAuthResult as a5, type TelegramWebAppData as a6, type OAuthUserInfo as a7, type OAuthFlowState as a8, type LoginWithCode as a9, type LinkedIn as aA, type Apple as aB, type Tiktok as aC, type Line as aD, type Telegram as aE, type CrossAppAccount as aF, type LinkedAccountType as aG, type GoogleOAuthWithMetadata as aH, type TwitterOAuthWithMetadata as aI, type DiscordOAuthWithMetadata as aJ, type GithubOAuthWithMetadata as aK, type TiktokOAuthWithMetadata as aL, type LineOAuthWithMetadata as aM, type LinkedInOAuthWithMetadata as aN, type AppleOAuthWithMetadata as aO, type FarcasterWithMetadata as aP, type TelegramWithMetadata as aQ, type CrossAppAccountWithMetadata as aR, type PasskeyWithMetadata as aS, type Email as aT, type Phone as aU, type TransactionUIOptions as aV, type ContractUIOptions as aW, type NativeFundingConfig as aX, type MoonpayFundingConfig as aY, type PriceDisplayOptions as aZ, type Farcaster as a_, type OtpFlowState as aa, type PasskeyFlowState as ab, type SiweFlowState as ac, type SiwsFlowState as ad, type BaseAccountSdkType as ae, type UnsignedTransactionRequestWithChainId as af, type BaseConnectedWalletType as ag, type SessionSignerInput as ah, type TelegramAuthFlowState as ai, type TypedMessage as aj, type MessageTypes as ak, type SmartWallet as al, type MoonpayConfig as am, type MoonpayCurrencyCode as an, type MoonpayPaymentMethod as ao, type Quantity as ap, type TransactionLog as aq, type TransactionReceipt as ar, type NonEmptyArray as as, type EmailWithMetadata as at, type PhoneWithMetadata as au, type WalletWithMetadata as av, type Google as aw, type Twitter as ax, type Discord as ay, type Github as az, type BaseConnectedSolanaWallet as b, type LoginMethodOrderOption as b0, type UserRecoveryMethod as c, type SupportedSolanaTransaction as d, type SolanaCluster as e, type CreateWalletOptions as f, type LoginToFrame as g, type LoginToMiniApp as h, type SendTransactionModalUIOptions as i, type SignMessageModalUIOptions as j, type SolanaStandardWallet as k, type SolanaFundingConfig as l, SolanaWalletConnector as m, type PrivyFarcasterSignerInitResponse as n, type MfaSubmitArgs as o, type SolanaRpcRequestType as p, type EthereumRpcResponseType as q, type SolanaRpcResponseType as r, type EIP1193Provider as s, toSolanaWalletConnectors as t, type EntropyIdVerifier as u, type RequestArguments as v, WalletConnector as w, PrivyProxyProvider as x, type WalletClientType as y, type ConnectedWalletMetadata as z };
|
|
@@ -590,7 +590,7 @@ type CoinbaseWalletClientType = (typeof COINBASE_WALLET_CLIENT_TYPES)[number];
|
|
|
590
590
|
type WalletConnectWalletClientType = (typeof WALLET_CONNECT_WALLET_CLIENT_TYPES)[number];
|
|
591
591
|
declare const UNKNOWN_WALLET_CLIENT_TYPES: readonly ["unknown"];
|
|
592
592
|
type UnknownWalletClientType = (typeof UNKNOWN_WALLET_CLIENT_TYPES)[number];
|
|
593
|
-
declare const SOLANA_WALLET_CLIENT_TYPES: readonly ["phantom", "solflare", "glow", "backpack"];
|
|
593
|
+
declare const SOLANA_WALLET_CLIENT_TYPES: readonly ["phantom", "solflare", "glow", "backpack", "mobile_wallet_adapter"];
|
|
594
594
|
type SolanaWalletClientType = (typeof SOLANA_WALLET_CLIENT_TYPES)[number];
|
|
595
595
|
type WalletClientType = InjectedWalletClientType | CoinbaseWalletClientType | WalletConnectWalletClientType | EmbeddedWalletClientType | UnknownWalletClientType | SolanaWalletClientType;
|
|
596
596
|
declare const SUPPORTED_CONNECTOR_TYPES: string[];
|
|
@@ -1521,6 +1521,17 @@ interface PrivyClientConfig {
|
|
|
1521
1521
|
privacyPolicyUrl?: string | null;
|
|
1522
1522
|
};
|
|
1523
1523
|
walletConnectCloudProjectId?: string;
|
|
1524
|
+
/**
|
|
1525
|
+
* Custom redirect URL for OAuth flows, useful for mobile applications.
|
|
1526
|
+
* If not provided, defaults to window.location.href.
|
|
1527
|
+
*
|
|
1528
|
+
* For Capacitor/mobile apps, use a custom URL scheme like:
|
|
1529
|
+
* 'com.yourapp.oauth://callback' or 'yourapp://oauth'
|
|
1530
|
+
*
|
|
1531
|
+
* Make sure to register this URL scheme in your app configuration
|
|
1532
|
+
* and add it to your app's allowed URL schemes in the Privy dashboard.
|
|
1533
|
+
*/
|
|
1534
|
+
customOAuthRedirectUrl?: string;
|
|
1524
1535
|
/**
|
|
1525
1536
|
* A list of supported chains, used to specify which chains should be used throughout the application.
|
|
1526
1537
|
*
|
|
@@ -1957,6 +1968,7 @@ type AppConfig = {
|
|
|
1957
1968
|
};
|
|
1958
1969
|
fundingMethodConfig: NonNullable<PrivyClientConfig['fundingMethodConfig']>;
|
|
1959
1970
|
whatsAppEnabled: boolean;
|
|
1971
|
+
customOAuthRedirectUrl?: string;
|
|
1960
1972
|
};
|
|
1961
1973
|
/** Privy's generated color palette.
|
|
1962
1974
|
* This will be generated, given a passed theme and accent color (from configuration),
|
|
@@ -2083,6 +2095,20 @@ type SiweFlowState = {
|
|
|
2083
2095
|
} | {
|
|
2084
2096
|
status: 'done';
|
|
2085
2097
|
};
|
|
2098
|
+
type SiwsFlowState = {
|
|
2099
|
+
status: 'initial';
|
|
2100
|
+
} | {
|
|
2101
|
+
status: 'error';
|
|
2102
|
+
error: Error | null;
|
|
2103
|
+
} | {
|
|
2104
|
+
status: 'generating-message';
|
|
2105
|
+
} | {
|
|
2106
|
+
status: 'awaiting-signature';
|
|
2107
|
+
} | {
|
|
2108
|
+
status: 'submitting-signature';
|
|
2109
|
+
} | {
|
|
2110
|
+
status: 'done';
|
|
2111
|
+
};
|
|
2086
2112
|
type OAuthFlowState = {
|
|
2087
2113
|
status: 'initial';
|
|
2088
2114
|
} | {
|
|
@@ -2375,4 +2401,4 @@ type SessionSignerInput = {
|
|
|
2375
2401
|
policyIds?: string[];
|
|
2376
2402
|
}[];
|
|
2377
2403
|
|
|
2378
|
-
export { type OAuthProviderType as $, type PrivyClientConfig as A, type BaseConnectedEthereumWallet as B, type ConnectedSolanaWallet as C, type ConnectorType as D, type EthereumRpcRequestType as E, type FundingMethod as F, type SetBaseAccountSdkType as G, type HDWalletWithMetadata as H, type WalletListEntry as I, type AppConfig as J, type BaseConnectedWallet as K, type LoginMethod as L, type MfaMethod as M, type ConnectWalletModalOptions as N, type OAuthTokens as O, PrivyErrorCode as P, type LoginModalOptions as Q, type RuntimeLoginOverridableOptions as R, type SolanaTransactionReceipt as S, type SetWalletRecoveryOptions as T, type User as U, type SignTypedDataParams as V, type Wallet as W, type UnsignedTransactionRequest as X, type FundWalletConfig as Y, type ConnectedWallet as Z, type CrossAppProviderDetails as _, type LinkedAccountWithMetadata as a, type
|
|
2404
|
+
export { type OAuthProviderType as $, type PrivyClientConfig as A, type BaseConnectedEthereumWallet as B, type ConnectedSolanaWallet as C, type ConnectorType as D, type EthereumRpcRequestType as E, type FundingMethod as F, type SetBaseAccountSdkType as G, type HDWalletWithMetadata as H, type WalletListEntry as I, type AppConfig as J, type BaseConnectedWallet as K, type LoginMethod as L, type MfaMethod as M, type ConnectWalletModalOptions as N, type OAuthTokens as O, PrivyErrorCode as P, type LoginModalOptions as Q, type RuntimeLoginOverridableOptions as R, type SolanaTransactionReceipt as S, type SetWalletRecoveryOptions as T, type User as U, type SignTypedDataParams as V, type Wallet as W, type UnsignedTransactionRequest as X, type FundWalletConfig as Y, type ConnectedWallet as Z, type CrossAppProviderDetails as _, type LinkedAccountWithMetadata as a, type Passkey as a$, type MoonpaySignRequest as a0, type MoonpaySignResponse as a1, type SmartWalletConfig as a2, type SiwsMessageType as a3, type ExternalWalletMetadata as a4, type TelegramAuthResult as a5, type TelegramWebAppData as a6, type OAuthUserInfo as a7, type OAuthFlowState as a8, type LoginWithCode as a9, type LinkedIn as aA, type Apple as aB, type Tiktok as aC, type Line as aD, type Telegram as aE, type CrossAppAccount as aF, type LinkedAccountType as aG, type GoogleOAuthWithMetadata as aH, type TwitterOAuthWithMetadata as aI, type DiscordOAuthWithMetadata as aJ, type GithubOAuthWithMetadata as aK, type TiktokOAuthWithMetadata as aL, type LineOAuthWithMetadata as aM, type LinkedInOAuthWithMetadata as aN, type AppleOAuthWithMetadata as aO, type FarcasterWithMetadata as aP, type TelegramWithMetadata as aQ, type CrossAppAccountWithMetadata as aR, type PasskeyWithMetadata as aS, type Email as aT, type Phone as aU, type TransactionUIOptions as aV, type ContractUIOptions as aW, type NativeFundingConfig as aX, type MoonpayFundingConfig as aY, type PriceDisplayOptions as aZ, type Farcaster as a_, type OtpFlowState as aa, type PasskeyFlowState as ab, type SiweFlowState as ac, type SiwsFlowState as ad, type BaseAccountSdkType as ae, type UnsignedTransactionRequestWithChainId as af, type BaseConnectedWalletType as ag, type SessionSignerInput as ah, type TelegramAuthFlowState as ai, type TypedMessage as aj, type MessageTypes as ak, type SmartWallet as al, type MoonpayConfig as am, type MoonpayCurrencyCode as an, type MoonpayPaymentMethod as ao, type Quantity as ap, type TransactionLog as aq, type TransactionReceipt as ar, type NonEmptyArray as as, type EmailWithMetadata as at, type PhoneWithMetadata as au, type WalletWithMetadata as av, type Google as aw, type Twitter as ax, type Discord as ay, type Github as az, type BaseConnectedSolanaWallet as b, type LoginMethodOrderOption as b0, type UserRecoveryMethod as c, type SupportedSolanaTransaction as d, type SolanaCluster as e, type CreateWalletOptions as f, type LoginToFrame as g, type LoginToMiniApp as h, type SendTransactionModalUIOptions as i, type SignMessageModalUIOptions as j, type SolanaStandardWallet as k, type SolanaFundingConfig as l, SolanaWalletConnector as m, type PrivyFarcasterSignerInitResponse as n, type MfaSubmitArgs as o, type SolanaRpcRequestType as p, type EthereumRpcResponseType as q, type SolanaRpcResponseType as r, type EIP1193Provider as s, toSolanaWalletConnectors as t, type EntropyIdVerifier as u, type RequestArguments as v, WalletConnector as w, PrivyProxyProvider as x, type WalletClientType as y, type ConnectedWalletMetadata as z };
|
package/dist/dts/ui.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { R as RuntimeLoginOverridableOptions } from './types-
|
|
2
|
+
import { R as RuntimeLoginOverridableOptions } from './types-m7jrPKbg.js';
|
|
3
3
|
import { Hex } from 'viem';
|
|
4
4
|
import { Chain, Cluster } from '@privy-io/js-sdk-core';
|
|
5
5
|
import '@coinbase/wallet-sdk';
|
package/dist/dts/ui.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { R as RuntimeLoginOverridableOptions } from './types-
|
|
2
|
+
import { R as RuntimeLoginOverridableOptions } from './types-m7jrPKbg.js';
|
|
3
3
|
import { Hex } from 'viem';
|
|
4
4
|
import { Chain, Cluster } from '@privy-io/js-sdk-core';
|
|
5
5
|
import '@coinbase/wallet-sdk';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Chain } from '@privy-io/js-sdk-core';
|
|
2
|
-
import { P as PrivyErrorCode, U as User, L as LoginMethod, a as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, b as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, c as UserRecoveryMethod, S as SolanaTransactionReceipt, d as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, e as SolanaCluster, C as ConnectedSolanaWallet, f as CreateWalletOptions } from './types-
|
|
2
|
+
import { P as PrivyErrorCode, U as User, L as LoginMethod, a as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, b as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, c as UserRecoveryMethod, S as SolanaTransactionReceipt, d as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, e as SolanaCluster, C as ConnectedSolanaWallet, f as CreateWalletOptions } from './types-m7jrPKbg.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, L as LoginMethod, a as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, b as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, c as UserRecoveryMethod, S as SolanaTransactionReceipt, d as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, e as SolanaCluster, C as ConnectedSolanaWallet, f as CreateWalletOptions } from './types-
|
|
2
|
+
import { P as PrivyErrorCode, U as User, L as LoginMethod, a as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, b as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, c as UserRecoveryMethod, S as SolanaTransactionReceipt, d as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, e as SolanaCluster, C as ConnectedSolanaWallet, f as CreateWalletOptions } from './types-m7jrPKbg.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 t}from"@abstract-foundation/agw-client/actions";import{hexToNumber as r,createWalletClient as o,custom as n,http as i}from"viem";import{toAccount as a}from"viem/accounts";import{abstractTestnet as s}from"viem/chains";import{u as c,g as l,c as p}from"./use-sign-with-user-signer-
|
|
1
|
+
import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{getBatchTransactionObject as t}from"@abstract-foundation/agw-client/actions";import{hexToNumber as r,createWalletClient as o,custom as n,http as i}from"viem";import{toAccount as a}from"viem/accounts";import{abstractTestnet as s}from"viem/chains";import{u as c,g as l,c as p}from"./use-sign-with-user-signer-BWQ0PcRX.mjs";import{o as d,w as m,e as u,a as h,a$ as y,b0 as g,b1 as I,x as f}from"./privy-provider-CKlbanJT.mjs";import{u as v}from"./internal-context-D0EM1HLm.mjs";import{g as w}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import{c as C}from"./smart-wallets-DvhjmUML.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"lucide-react";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/20/solid/CheckIcon";import"@heroicons/react/24/outline/EnvelopeIcon";import"@heroicons/react/24/outline/WalletIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"@heroicons/react/24/outline/CheckIcon";import"qrcode";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/solid/CheckCircleIcon";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/XCircleIcon";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"@heroicons/react/24/outline/ClipboardDocumentIcon";import"@heroicons/react/24/solid/CheckBadgeIcon";import"@heroicons/react/24/solid/IdentificationIcon";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/outline/ClockIcon";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}=c(),{hideWalletUIs:P,openPrivyModal:S,chains:b,appId:A,rpcConfig:W,client:M}=v(),k=d(),{wallets:F}=m(),{setModalData:x}=u(),_=l(T),q=!!_&&p(_),E=async(t=s.id)=>{let c=w(F);if(!c)throw Error("No connected wallet found");let l="string"==typeof t?r(t):t;if(![s.id,2741].includes(l))throw Error("Error, only Abstract chains are supported");let p=b.find((e=>e.id===l));if(!p)throw Error("Chain not configured");await c.switchChain(p.id);let d=await c.getEthereumProvider(),m=o({account:c.address,transport:n(d)}),u=a({address:c.address,signMessage:m.signMessage,signTransaction:m.signTransaction,signTypedData:m.signTypedData});return await e({chain:p,transport:i(f(p,W,A)),publicTransport:i(f(p,W,A)),signer:u})};return{signMessage:async({message:e},t)=>{let r=await E(t);return new Promise((async(t,o)=>{let{entropyId:n,entropyIdVerifier:i}=h(T);P.current=!0,x({connectWallet:{recoveryMethod:_.recoveryMethod,connectingWalletAddress:_.address,isUnifiedWallet:q,entropyId:n,entropyIdVerifier:i,onCompleteNavigateTo:y,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>r.signMessage({message:e}),onSuccess:e=>t(e),onFailure:o,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))},signTypedData:async(e,t)=>{let r=await E(t);return new Promise((async(t,o)=>{P.current=!0;let{entropyId:n,entropyIdVerifier:i}=h(T);x({connectWallet:{recoveryMethod:_.recoveryMethod,connectingWalletAddress:_.address,isUnifiedWallet:q,entropyId:n,entropyIdVerifier:i,onCompleteNavigateTo:y,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>r.signTypedData(e),onSuccess:e=>t(e),onFailure:o,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))},sendTransaction:async e=>{let r=await E(e.chainId),o=[],n="calls"in e&&void 0!==e.calls;return o=n?[...e.calls]:[e],new Promise((async(i,a)=>{P.current=!0;let{entropyId:s,entropyIdVerifier:c}=h(T);x({connectWallet:{recoveryMethod:_.recoveryMethod,connectingWalletAddress:_.address,isUnifiedWallet:q,entropyId:s,entropyIdVerifier:c,onCompleteNavigateTo:I,onFailure:()=>{}},sendTransaction:{transactionRequests:C({calls:o,chain:r.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:s,entropyIdVerifier:c,transactingWalletAddress:r.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let o=n?t(r.account.address,e):e;return await r.prepareAbstractTransactionRequest(o)},scanTransaction:async()=>{if(!M)throw Error("Privy client not found");let o=n?t(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest(o);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 E(e.chainId),o=[],n="calls"in e&&void 0!==e.calls;return o=n?[...e.calls]:[e],new Promise((async(i,a)=>{P.current=!0;let{entropyId:s,entropyIdVerifier:c}=h(T);x({connectWallet:{recoveryMethod:_.recoveryMethod,connectingWalletAddress:_.address,isUnifiedWallet:q,entropyId:s,entropyIdVerifier:c,onCompleteNavigateTo:I,onFailure:()=>{}},sendTransaction:{transactionRequests:C({calls:o,chain:r.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:s,entropyIdVerifier:c,transactingWalletAddress:r.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let o=n?t(r.account.address,e):e;return await r.prepareAbstractTransactionRequest(o)},scanTransaction:async()=>{if(!M)throw Error("Privy client not found");let o=n?t(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest(o);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:!0,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:async()=>{let o=n?t(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest(o);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-
|
|
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-D0EM1HLm.mjs";import{u as i,a as s,f as n,c as o}from"./use-sign-with-user-signer-BWQ0PcRX.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,d,e])};export{u as useCreateWallet,d as useSignRawHash};
|
package/dist/esm/farcaster.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback as t}from"react";import{F as i}from"./frame-DMd4vZ0H.mjs";import{P as e}from"./paths-DCwuPDUk.mjs";import{u as a}from"./internal-context-
|
|
1
|
+
import{useCallback as t}from"react";import{F as i}from"./frame-DMd4vZ0H.mjs";import{P as e}from"./paths-DCwuPDUk.mjs";import{u as a}from"./internal-context-D0EM1HLm.mjs";import"ofetch";const n=()=>{let{client:n,setAuthenticated:r,setUser:s}=a();return{initLoginToMiniApp:t((async()=>{let t=new i;if(!n)throw new e("Must initialize Privy client first.");return n.startAuthFlow(t),await t.init()}),[n]),loginToMiniApp:t((async({message:t,signature:a})=>{if(!n)throw new e("Must initialize Privy client first.");if(!(n.authFlow instanceof i))throw new e("Must initialize Farcaster Mini App flow first.");let o=(t=>{let i=t.match(/farcaster:\/\/fid\/(\d+)/);return i&&i[1]?parseInt(i[1],10):null})(t);if(!o)throw new e("Invalid message format; could not parse Farcaster ID.");n.authFlow.setAuthData({message:t,signature:a,fid:o});let{user:l}=await n.authenticate();return l&&(s(l),r(!0)),l}),[n,s,r])}},r=()=>{let{initLoginToMiniApp:i,loginToMiniApp:e}=n();return{initLoginToFrame:t((async()=>await i()),[i]),loginToFrame:t((async({message:t,signature:i})=>await e({message:t,signature:i})),[e])}};export{r as useLoginToFrame,n as useLoginToMiniApp};
|