Skip to content
Docs

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

FieldRequiredDescription
labelNo`string` — UI name.
wordCountNo`12 | 15 | 18 | 21 | 24` — mnemonic length. Default `12`. Prefer over `strength`.
strengthNo`128 | 160 | 192 | 224 | 256` — entropy bits (same as wordCount). Use one or the other.
bip39PassphraseNo`string` — optional BIP-39 extension passphrase (“25th word”). Default `""`. Changes seed/addresses.
pathsNo`FamilyPaths` — custom HD paths at create only. Keys: `evm`, per-coin ids (`bitcoin`, `solana`, …)—not `ethereum`/`base`.
accountsNo`number` — how many HD accounts to create. Default `1`.
passwordNo`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

FieldRequiredDescription
unauthorizedNoEncrypted keystore — missing or wrong `password`.
invalid_argumentNoBad wordCount/strength, empty label rules, or illegal `paths` keys (e.g. `paths.utxo`).
conflictNoAddress collision after create when `duplicates` blocks overlapping receive addresses (rare for fresh seeds).