Client: wallets
List, open, rename, and remove
List metas, open Wallet or MoneroWallet, rename, remove, or wipe all wallets.
Overview
Lifecycle APIs on client.wallets and instance methods on Wallet / MoneroWallet. open returns OpenedWallet = Wallet | MoneroWallet.
list
Signature
js
await client.wallets.list()Parameters
None.
Response
Promise<GrayWalletMeta[]>
ts
[
{
id: string; // "wal_…"
label: string;
kind: "mnemonic" | "private_key" | "watch";
paths?: FamilyPaths;
createdAt?: string; // ISO
updatedAt?: string;
},
]js
const list = await client.wallets.list();
// → [{ id: "wal_…", label: "Main", kind: "mnemonic" }, …]open
Signature
js
await client.wallets.open(walletId, options?)Parameters
| Field | Required | Description |
|---|---|---|
| walletId | Yes | `string` — from `list()[].id`. |
| options.password | No | `string` — keystore PIN when storage is encrypted. |
Response
Promise<OpenedWallet> where OpenedWallet = Wallet | MoneroWallet
ts
// BIP-39 / PK / watch → Wallet
// Native Polyseed / Legacy Monero → MoneroWallet
const opened = await client.wallets.open(id, { password: pin });
if ("monero" in opened && opened.kind /* … */) {
// branch on kind / instanceof as needed for native Monero
}js
const wallet = await client.wallets.open(list[0].id, { password: pin });
const a = wallet.account(0);Throws
| Field | Required | Description |
|---|---|---|
| not_found | No | Unknown wallet id. |
| unauthorized | No | Encrypted storage — bad or missing PIN. |
renameLabel
js
wallet.renameLabel(label)| Field | Required | Description |
|---|---|---|
| label | Yes | `string` — non-empty UI name. |
Response: this (chainable). Persists when storage is set.
remove
js
await client.wallets.remove(walletId, options?)| Field | Required | Description |
|---|---|---|
| walletId | Yes | `string` — wallet to delete. |
| options.password | No | `string` — keystore PIN when encrypted. |
Response: Promise<void>
js
await client.wallets.remove(wallet.id, { password: pin });reset
js
await client.wallets.reset({ password })| Field | Required | Description |
|---|---|---|
| password | No | `string` — required for encrypted keystore (works even if locked). Omit when no storage or `encryption: false`. |
Response: Promise<void>. Wipes all wallets in memory + local DB.
js
await client.wallets.reset({ password: pin }); // wrong PIN → unauthorized
await client.wallets.reset(); // ok when no storage or encryption: falseexportMnemonic / persist
js
const phrase = wallet.exportMnemonic(); // mnemonic wallets only
await wallet.persist(); // no-op without storage| Field | Required | Description |
|---|---|---|
| exportMnemonic | No | Throws if kind is not mnemonic (e.g. private_key / watch). |