account-kit/react-native
Interfaces
Interface | Description |
---|---|
MessageSigner | - |
SendVerificationCodeParams | - |
SolanaConnection | Returned from the solana connection. |
SolanaTransaction | We wanted to make sure that this will be using the same useMutation that the useSendUserOperation does. We are going to flatten it to make sure that we are abstracting it, and that we have the flattened version here for readability. |
TransactionSigner | - |
UseChainResult | - |
Type Aliases
Variables
Variable | Description |
---|---|
DEFAULT_UI_CONFIG | - |
EMPTY_WALLET_CONTEXT_STATE | A frozen, no-op implementation of WalletContextState returned when Solana support is not configured in the current app. All imperative methods either resolve immediately or reject with a clear error, and connection flags are set to their safe defaults. |
getListAuthMethodsQueryKey | - |
useAlchemyAccountContext | Internal Only hook used to access the alchemy account context. This hook is meant to be consumed by other hooks exported by this package. |
useBundlerClient | Custom hook to get a bundler client using the Alchemy account context. It uses useSyncExternalStore to watch for any changes in the bundler client configuration and provides the updated bundler client. React hooks don’t handle their own state management directly, so they rely on external stores, like useSyncExternalStore , to manage state. useBundlerClient ’s only job is to call the bundler JSON RPC methods directly; it does not do additional processing, unlike useSmartAccountClient . For example, if you call sendUserOperation , it expects a fully formed user operation. It is an extension of Viem’s Public Client and provides access to public actions, talking to public RPC APIs like getBlock , eth_call , etc. It does not require an account as context. Use cases: connecting with a EOA or checking for gas eligibility. |
useConnect | Re-exported wagmi hook for connecting an EOA. This hook uses the internal wagmi config though so that the state is in sync with the rest of the Alchemy Account hook state. Useful if you wnat to connect to an EOA. |
useListAuthMethods | A hook to list the authentication methods for a user. |
useSigner | Hook for accessing the current Alchemy signer within a React component. It uses a synchronous external store for updates. This is a good use case if you want to use the signer as an EOA, giving you direct access to it. The signer returned from useSigner just does a personal_sign or eth_signTypedData without any additional logic, but a smart contract account might have additional logic for creating signatures for 1271 validation so useSignMessage or useSignTypeData instead. |
useSignerStatus | Hook to get the signer status, optionally using an override configuration, useful if you’re building your own login. |
useSolanaSigner | This hook is used to create a SolanaSigner instance. It is used to sign transactions and messages for the Solana blockchain. |
useUser | A React hook that returns the current user information, either from an External Owned Account (EOA) or from the client store. It uses the Alchemy account context and synchronizes with external store updates. The best way to check if user is logged in for both smart account contract users and EOA. |
Functions
Function | Description |
---|---|
AlchemyAccountProvider | Provider for Alchemy accounts. |
createConfig | Creates an AlchemyAccountsConfig by using the provided parameters to configure the core settings, including the required transport. It includes a signer creation function internally. |
createUiConfigStore | - |
UiConfigProvider | - |
useAccount | Hook to subscribe to account state and interactions, including creation, connection, and status monitoring. It synchronizes with external store updates and provides status-dependent results. The supported account types are: LightAccount, MultiOwnerLightAccount, MultiOwnerModularAccount, and ModularAccountV2. Primarily used to get the smart account address before deployment. Dependent on the signer: if the signer has not been initialized and authenticated, address and isLoadingAccount return null. |
useAddOauthProvider | A custom hook to handle adding an OAuth provider to an already authenticated account, which includes executing a mutation with optional parameters. |
useAddPasskey | A custom hook to handle the addition of a passkey to an already authenticated account, which includes executing a mutation with optional parameters. |
useAuthenticate | Hook that provides functions and state for authenticating a user using a signer. It includes methods for both synchronous and asynchronous mutations. Useful if building your own UI components and want to control the authentication flow. For authenticate vs authenticateAsync, use authenticate when you want the hook the handle state changes for you, authenticateAsync when you need to wait for the result to finish processing. |
useAuthError | Returns the error returned from the current auth step, if it exists |
useChain | A hook that returns the current chain as well as a function to set the chain. Note: when calling setChain the chain that’s passed in must be defined in your initial createConfig call. Calling setChain causes the chain to change across the board. For example, if you use set chain then use useSmartAccountClient , the client will flip to the loading state and address for the account on the changed chain. |
useClientActions | A hook that allows you to leverage client decorators to execute actions and await them in your UX. This is particularly useful for using Plugins with Modular Accounts. |
useConnectedUser | A React hook that returns the currently connected user across external wallets (EVM or Solana) or the smart account user from the client store. It prioritizes the EVM wallet connection, then Solana, and finally the smart account user. |
useConnection | A hook that returns the current connection including chain, policy, and transport that you’re currently using. |
useDropAndReplaceUserOperation | Custom hook that handles the drop and replace user operation for a given client and mutation arguments. |
useElementHeight | - |
useExportAccount | A hook used to export the private key for an account. It returns the mutation functions to kick off the export process, as well as a component to render the account recovery details in an iframe. What is returned is dependent on what you used most recently used to authenticate. If your session was initiated with a passkey, then a private key is returned. Otherwise, a seed phrase. |
useLogout | Provides a hook to log out a user, disconnecting the signer and triggering the disconnectAsync function. This will disconnect both EVM and Solana wallets. |
useMFA | Hook that provides functions and state for managing multi-factor authentication (MFA) operations. Handles adding, verifying, removing, and getting MFA factors for an authenticated account. |
useRemoveEmail | A custom hook to handle the removal of an email from an already authenticated account, which includes executing a mutation with optional parameters. |
useRemoveOauthProvider | A custom hook to handle removing an OAuth provider from an already authenticated account, which includes executing a mutation with optional parameters. |
useRemovePasskey | A custom hook to handle the addition of a passkey to an already authenticated account, which includes executing a mutation with optional parameters. |
useResizeObserver | - |
useSendUserOperation | A hook that returns functions for sending user operations. You can also optionally wait for a user operation to be mined and get the transaction hash before returning using waitForTx . Like any method that takes a smart account client, throws an error if client undefined or is signer not authenticated. |
useSendVerificationCode | A custom hook to send OTP verification codes to email or SMS for account verification. |
useSetEmail | A custom hook to set an email address for an already authenticated account. |
useSignMessage | Custom hook to sign a message using the provided client. Provides a way to sign messages within the context of an account using Ethereum-specific signature in EIP-191 format. Uses personal_sign to sign arbitrary messages (usually strings). Accepts any plain message as input. |
useSignTypedData | Similar to useSignMessage , hook for signing typed data, supporting both connected accounts and clients in EIP 712 format. |
useSmartAccountClient | - |
useSolanaConnection | This hook is used for establishing a connection to Solana and returns the connection object and the signer object. |
useSolanaTransaction | This is the hook that will be used to send a transaction. It will prioritize external connected Solana wallets, falling back to the internal signer when not connected. Supports sponsorship for both external wallets and internal signers. |
useSolanaWallet | A React hook that mirrors the behavior and return type of useWallet from @solana/wallet-adapter-react , but safely degrades when Solana is not enabled for your application. |
useUiConfig | - |
useWaitForUserOperationTransaction | Custom hook to wait for a user operation transaction and manage its state (pending, error, result). |