Skip to main content
This page has been updated for Wallets SDK V1. If you are using the previous version, see the previous version of this page or the V1 migration guide.

Prerequisites

  • API Key: Ensure you have an API key with the scopes: wallets.create.

Try it Live

Experience wallet creation in action with this interactive demo. Create a Solana testnet wallet using just your email address:

Creating a Wallet

Wallet creation requires a recovery signer — used for account recovery and adding new signers. On client-side SDKs, a device signer is automatically added as the default operational signer.
import { useWallet } from '@crossmint/client-sdk-react-ui';

const { createWallet } = useWallet();

const wallet = await createWallet({
    chain: "base-sepolia",
    recovery: {
        type: "email",
        email: "user@example.com",
    },
});
See the React SDK reference for all parameters.
The REST API uses adminSigner (recovery role) and delegatedSigners (operational signers). These map to recovery and signers in the SDK.

Retrieving an Existing Wallet

Use getWallet() to retrieve a wallet that was previously created. If the wallet does not exist, it throws a WalletNotAvailableError.
import { useWallet } from '@crossmint/client-sdk-react-ui';

const { getWallet } = useWallet();

const wallet = await getWallet({ chain: "base-sepolia" });

Get-or-Create Pattern

If you want to retrieve an existing wallet or create one if it does not exist, use WalletNotAvailableError to implement the pattern:
import { useWallet, WalletNotAvailableError } from '@crossmint/client-sdk-react-ui';

const { getWallet, createWallet } = useWallet();

let wallet;
try {
    wallet = await getWallet({ chain: "base-sepolia" });
} catch (error) {
    if (error instanceof WalletNotAvailableError) {
        wallet = await createWallet({
            chain: "base-sepolia",
            recovery: {
                type: "email",
                email: "user@example.com",
            },
        });
    } else {
        throw error;
    }
}
On client-side SDKs (React, React Native), if you use CrossmintWalletProvider with the createOnLogin prop, the wallet is created automatically when the user logs in — no manual createWallet call is needed.

Next Steps

Transfer tokens

Send tokens between wallets

Add signers

Register operational signers on your wallet

Fund your wallet

Get testnet tokens to start testing