Client: wallets
Create a wallet
Generate a BIP-39 wallet with optional paths, accounts, and bip39Passphrase.
Overview
Generates a new BIP-39 mnemonic wallet with one or more HD accounts. Always creates a new random seed—no duplicate check. Custom paths apply at create only and stay on account 0 for customized families.
Signature
js
await client.wallets.create(options?)Parameters
options?: CreateWalletOptions
| Field | Required | Description |
|---|---|---|
| label | No | `string` — UI name. |
| wordCount | No | `12 | 15 | 18 | 21 | 24` — mnemonic length. Default `12`. Prefer over `strength`. |
| strength | No | `128 | 160 | 192 | 224 | 256` — entropy bits (same as wordCount). Use one or the other. |
| bip39Passphrase | No | `string` — optional BIP-39 extension passphrase (“25th word”). Default `""`. Changes seed/addresses. |
| paths | No | `FamilyPaths` — custom HD paths at create only. Keys: `evm`, per-coin ids (`bitcoin`, `solana`, …)—not `ethereum`/`base`. |
| accounts | No | `number` — how many HD accounts to create. Default `1`. |
| password | No | `string` — keystore PIN when storage is encrypted (required if locked). Same as `GrayKeystore.create({ password })`. Ignored without storage or with `encryption: false`. |
Response
Promise<Wallet> — kind: "mnemonic"
ts
{
id: string; // "wal_…"
label: string;
kind: "mnemonic";
paths: FamilyPaths;
enabledChains: GrayChainId[];
accounts(): AccountSummary[];
account(indexOrId): Account;
addAccount / addAccounts / exportMnemonic / persist / renameLabel …
}Usage
js
const wallet = await client.wallets.create();
const wallet = await client.wallets.create({
label: "Main",
wordCount: 24,
accounts: 3,
bip39Passphrase: optional25th,
password: pin,
});
const wallet = await client.wallets.create({
label: "Main",
paths: {
evm: "m/44'/60'/0'/0/0",
bitcoin: "m/84'/0'/0'/0/0",
solana: "m/44'/501'/0'/0'",
monero: "m/44'/128'/0'/0/0",
},
password: pin,
});Throws
| Field | Required | Description |
|---|---|---|
| unauthorized | No | Encrypted keystore — missing or wrong `password`. |
| invalid_argument | No | Bad wordCount/strength, empty label rules, or illegal `paths` keys (e.g. `paths.utxo`). |
| conflict | No | Address collision after create when `duplicates` blocks overlapping receive addresses (rare for fresh seeds). |