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:Create a Wallet
- React
- Node.js
- React Native
- Swift
- REST
Report incorrect code
Copy
Ask AI
import { useWallet } from '@crossmint/client-sdk-react-ui';
const { getOrCreateWallet } = useWallet();
const wallet = await getOrCreateWallet({
chain: "base-sepolia",
signer: {
type: "email",
email: "user@example.com"
},
});
Report incorrect code
Copy
Ask AI
import { CrossmintWallets, createCrossmint } from "@crossmint/wallets-sdk";
const crossmint = createCrossmint({
apiKey: "<your-server-api-key>",
});
const crossmintWallets = CrossmintWallets.from(crossmint);
const wallet = await crossmintWallets.createWallet({
chain: "base-sepolia",
signer: {
type: "email",
email: "user@example.com"
},
});
Parameters
The chain to use the wallet on.See all supported chains for more details. On staging only testnet chains are supported.Note: For EVM-compatible chains, wallets are created for all
chains as part of the shared address space derived from the same private key. However, to
interact with a specific chain using the SDK, you must instantiate a wallet object per chain.
This allows the SDK to correctly route interactions to the appropriate network configuration.
An optional identifier for the wallet, used to organize multiple wallets on the same chain.Aliases are:
- Unique per wallet type and chain.
- Must use only lowercase letters, numbers, underscores, or hyphens (
a-z,0-9,_,-). - No spaces or empty strings allowed.
trading, long-term-holdings, treasuryUse
owner to tie a wallet to a specific user identity. It must be a string in the form type:value:email:email@example.comuserId:userId1- Only used when bringing your own authphoneNumber:phoneNumber1twitter:handle1x:handle1
email, phoneNumber, twitter or x. Once created, Crossmint Auth will automatically resolve to that wallet on login.For example, if you set “owner”: “x:acme”, then whenever the user logs in via X through Crossmint Auth, Crossmint will automatically return the created wallet for that handle.Bring your own auth
If you use your own authentication system, you can only set owner to userId:userId. Crossmint will extract that ID automatically from the sub claim of the JWT when the user signs in.The options to use the wallet with.
Show experimental_callbacks
Show experimental_callbacks
Returns
The created wallet.
Report incorrect code
Copy
Ask AI
import { useWallet } from '@crossmint/client-sdk-react-native-ui';
const { getOrCreateWallet } = useWallet();
const wallet = await getOrCreateWallet({
chain: "base-sepolia",
signer: {
type: "email",
email: "user@example.com"
},
});
Report incorrect code
Copy
Ask AI
import CrossmintClient
import Wallet
let sdk = CrossmintSDK.shared
let wallet = try await sdk.crossmintWallets.getOrCreateWallet(
chain: .baseSepolia,
signer: .email(email: "user@example.com")
)
Parameters
The chain to use the wallet on.See all supported chains for more details. On staging only testnet chains are supported.Note: For EVM-compatible chains, wallets are created for all
chains as part of the shared address space derived from the same private key. However, to
interact with a specific chain using the SDK, you must instantiate a wallet object per chain.
This allows the SDK to correctly route interactions to the appropriate network configuration.
An optional identifier for the wallet, used to organize multiple wallets on the same chain.Aliases are:
- Unique per wallet type and chain.
- Must use only lowercase letters, numbers, underscores, or hyphens (
a-z,0-9,_,-). - No spaces or empty strings allowed.
trading, long-term-holdings, treasuryReturns
The created wallet.
Report incorrect code
Copy
Ask AI
curl --request POST \
--url https://staging.crossmint.com/api/2025-06-09/wallets \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <x-api-key>' \
--data '{
"chainType": "evm",
"config": {
"adminSigner": {
"type": "email",
"email": "user@example.com"
}
},
"owner": "email:user@example.com"
}'

