Skip to content
Docs

Client: accounts and chains

Multi-account patterns

Patterns for multiple HD accounts, labels, and conflict-safe growth.

Overview

BIP-39 wallets can hold many HD accounts. Plan labels, path customization, and duplicate checks so users do not collide addresses across wallets.

Create with multiple accounts

js
const wallet = await client.wallets.create({
  label: "Main",
  accounts: 3,
  password: pin,
});
wallet.accounts(); // indices 0, 1, 2

Add more accounts

js
wallet.addAccount({ label: "Trading" });
wallet.addAccounts(5);

// Native Monero
await moneroWallet.addAccounts(5); // async
FieldRequiredDescription
custom pathsNoFamilies customized at create remain on account 0. Accounts added afterwards use the default paths for those families.
duplicatesNo`addAccount` can throw `conflict` when a derived address already exists under strict/address policy.

Labels

js
wallet.renameLabel("Personal");
wallet.account(0).renameLabel("Savings");
// Monero subaddresses:
await a.monero.renameSubaddressLabel(1, "Tips");

Default labels when omitted: Account {index+1} / Subaddress {index}.

UI checklist

  • List wallets via client.wallets.list(), then open one
  • Show wallet.accounts() and let users switch account(index)
  • Use setActiveChain only for network chips—never as the sign target
  • For Monero receive, allocate subaddresses with createSubaddress
  • Before import, call findMnemonic / findPrivateKey

Throws

FieldRequiredDescription
conflictNoNew account address overlaps another wallet under the duplicate policy.
unsupported_capabilityNoaddAccount on private_key / watch wallets.
invalid_argumentNoNegative index, empty label, or conflicting id.