> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crossmint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Hooks

> React hooks for React SDK reference for Crossmint wallets

## useWallet()

### Returns

**createDeviceSigner** `(address: string) =\> Promise\<DeviceSignerConfig\> | undefined`

Creates a Device Signer

**createPasskeySigner** `(passkeyName: string) =\> Promise\<RegisterSignerPasskeyParams\>`

Creates a Passkey Signer

**createWallet** `(props: ClientSideWalletCreateArgs\<C\>) =\> Promise\<Wallet | undefined\>`

Creates a new wallet.

**parameters**

**chain** `Chain`

The blockchain to create the wallet on (e.g. "base-sepolia").

**recovery** `SignerConfigForChain`

A single recovery method configuration (e.g. `{ type: "email" }`). Used for wallet recovery and adding new signers.

**recoveryMethods** `SignerConfigForChain[]`

Recovery methods, each able to authorize on its own.

**signers** `SignerConfigForChain[]`

Optional array of operational signers. Defaults to a device signer if omitted (e.g. `[{ type: "device" }]`).

**alias** `string`

Optional wallet alias.

**plugins** `WalletPlugin[]`

Optional array of wallet plugins.

**error** `WalletContextError | null`

Detail about the last failure, or null when there is no error.

**getWallet** `(props: Pick\<ClientSideWalletArgsFor\<C\>, "chain" | "alias"\>) =\> Promise\<Wallet | undefined\>`

Retrieves an existing wallet.

**parameters**

**chain** `Chain`

The blockchain of the wallet to retrieve (e.g. "base-sepolia").

**alias** `string`

Optional wallet alias to look up.

**status** `"not-loaded" | "in-progress" | "loaded" | "error"`

Current wallet status.

**wallet** `Wallet\<Chain\> | undefined`

The current wallet instance, or undefined if no wallet is loaded.

**parameters**

**constructor** `unknown`

**address** `string`

**alias** `string`

**chain** `C`

**owner** `string`

**apiClient** `unknown`

**recovery** `unknown`

**recoveryMethods** `unknown`

**signer** `unknown`

**addRecoveryMethod** `unknown`

**addSigner** `unknown`

**approve** `unknown`

**approveTransaction** `unknown`

**balances** `unknown`

**isSignerApproved** `unknown`

**needsRecovery** `unknown`

**nfts** `unknown`

**recover** `unknown`

**removeRecoveryMethod** `unknown`

**removeSigner** `unknown`

**send** `unknown`

**signerIsRegistered** `unknown`

**signers** `unknown`

**stagingFund** `unknown`

**transaction** `unknown`

**transactions** `unknown`

**transfers** `unknown`

**useRecoveryMethod** `unknown`

**useSigner** `unknown`

**waitForInit** `unknown`

### Usage

```tsx theme={null}
import { useWallet } from "@crossmint/client-sdk-react-ui";

function WalletActions() {
    const { wallet, status } = useWallet();

    if (status === "in-progress") return <p>Loading wallet...</p>;
    if (!wallet) return <p>No wallet</p>;

    const handleSend = async () => {
        const tx = await wallet.send("0x...", "usdc", "10");
        console.log("Transaction:", tx.explorerLink);
    };

    const handleBalances = async () => {
        const balances = await wallet.balances();
        console.log("USDC:", balances.usdc.amount);
        console.log("Native:", balances.nativeToken.amount);
    };

    return (
        <div>
            <p>Wallet: {wallet.address}</p>
            <button onClick={handleBalances}>Check Balances</button>
            <button onClick={handleSend}>Send USDC</button>
        </div>
    );
}
```

***

## Wallet Methods

The `wallet` instance returned by `useWallet()` provides methods for token transfers, balances, signing, and more.

Since the React SDK wraps the Wallets SDK, see the **[Wallets SDK Reference](https://docs.crossmint.com/sdk-reference/wallets/typescript/classes/Wallet.md)** for complete documentation.

| Method | Description |
| - | - |
| [`wallet.addRecoveryMethod()`](https://docs.crossmint.com/sdk-reference/wallets/typescript/classes/Wallet#addrecoverymethod) | Add a recovery method to the wallet. Always uses one of the existing recovery methods to approve the change, selected as in addSigner. |
| [`wallet.addSigner()`](https://docs.crossmint.com/sdk-reference/wallets/typescript/classes/Wallet#addsigner) | Add a signer to the wallet. Always uses a recovery method internally to approve the registration: the one selected via useRecoveryMethod, else the active signer when it is one of the recovery methods, else the wallet's single recovery method. Wallets with several recovery methods must select one first; an operational signer cannot authorize this. If the signer being added is the current operational signer, it will be reassembled with the new locator. Otherwise, the original signer is restored after the operation. |
| [`wallet.balances()`](https://docs.crossmint.com/sdk-reference/wallets/typescript/classes/Wallet#balances) | Get the wallet balances - always includes USDC and native token (ETH/SOL) |
| [`wallet.isSignerApproved()`](https://docs.crossmint.com/sdk-reference/wallets/typescript/classes/Wallet#issignerapproved) | Check if a signer is approved and usable for the current wallet chain. |
| [`wallet.needsRecovery()`](https://docs.crossmint.com/sdk-reference/wallets/typescript/classes/Wallet#needsrecovery) | Whether the wallet needs recovery (signer registration) before the next transaction. |
| [`wallet.nfts()`](https://docs.crossmint.com/sdk-reference/wallets/typescript/classes/Wallet#nfts) | Get the wallet NFTs |
| [`wallet.recover()`](https://docs.crossmint.com/sdk-reference/wallets/typescript/classes/Wallet#recover) | Register a device signer with the wallet using the recovery signer. Generates a new device key and registers it on-chain. Returns early if the device signer's locator is already approved on-chain. |
| [`wallet.removeRecoveryMethod()`](https://docs.crossmint.com/sdk-reference/wallets/typescript/classes/Wallet#removerecoverymethod) | Remove a recovery method from the wallet. Always uses one of the remaining recovery methods to approve the change, selected as in addSigner. |
| [`wallet.removeSigner()`](https://docs.crossmint.com/sdk-reference/wallets/typescript/classes/Wallet#removesigner) | Remove a signer from the wallet. Always uses a recovery method internally to approve the removal, selected as in addSigner. |
| [`wallet.send()`](https://docs.crossmint.com/sdk-reference/wallets/typescript/classes/Wallet#send) | Send a token to a wallet or user locator |
| [`wallet.signerIsRegistered()`](https://docs.crossmint.com/sdk-reference/wallets/typescript/classes/Wallet#signerisregistered) | Check if a signer is registered in this wallet. |
| [`wallet.signers()`](https://docs.crossmint.com/sdk-reference/wallets/typescript/classes/Wallet#signers) | List the signers for this wallet. Returns full signer objects with status. For EVM wallets, only signers with an approval (pending or completed) for the wallet's chain are included. |
| [`wallet.stagingFund()`](https://docs.crossmint.com/sdk-reference/wallets/typescript/classes/Wallet#stagingfund) | Funds the wallet with Crossmint's stablecoin (USDXM).  **Note:** This method is only available in staging environments and exclusively supports USDXM tokens. It cannot be used in production environments. |
| [`wallet.transaction()`](https://docs.crossmint.com/sdk-reference/wallets/typescript/classes/Wallet#transaction) | Get a transaction by id |
| [`wallet.transactions()`](https://docs.crossmint.com/sdk-reference/wallets/typescript/classes/Wallet#transactions) | Get the wallet transactions |
| [`wallet.transfers()`](https://docs.crossmint.com/sdk-reference/wallets/typescript/classes/Wallet#transfers) | Get the wallet transfers |
| [`wallet.useRecoveryMethod()`](https://docs.crossmint.com/sdk-reference/wallets/typescript/classes/Wallet#userecoverymethod) | Select which of the wallet's recovery methods authorizes admin operations (addSigner, removeSigner, addRecoveryMethod, removeRecoveryMethod). Unlike useSigner, this does not change the active signer used for transactions and signatures.  The config must refer to one of recoveryMethods; pass the fuller form when the method needs it to operate (an `onSign` callback for external wallets, the `secret` for server signers). |
| [`wallet.useSigner()`](https://docs.crossmint.com/sdk-reference/wallets/typescript/classes/Wallet#usesigner) | Set the active signer for this wallet. Accepts a signer config object. The locator is inferred internally. Works for both registered signers and the recovery signer.  For passkey signers: if no `id` is provided, the wallet will auto-select the passkey if exactly one passkey signer is registered. If multiple passkeys exist, an `id` must be specified.  For device signers: if no device key is found locally, the signer will be created automatically during the next transaction (via recovery).  For external-wallet signers: the config object must include an onSign callback (applies to both registered and recovery signers). |
| [`wallet.waitForInit()`](https://docs.crossmint.com/sdk-reference/wallets/typescript/classes/Wallet#waitforinit) | Wait for the wallet's internal signer initialization to complete. After this resolves, `needsRecovery()` reflects the true state. |

**Chain-specific:**

* [`EVMWallet`](https://docs.crossmint.com/sdk-reference/wallets/typescript/classes/EVMWallet) — `getViemClient()`, `sendTransaction()`, `signMessage()`, `signTypedData()`
* [`SolanaWallet`](https://docs.crossmint.com/sdk-reference/wallets/typescript/classes/SolanaWallet) — `sendTransaction()`
* [`StellarWallet`](https://docs.crossmint.com/sdk-reference/wallets/typescript/classes/StellarWallet) — `migrate()`, `sendTransaction()`, `upgrade()`
