midnight-wallet-cli 0.1.10 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![npm downloads](https://img.shields.io/npm/dm/midnight-wallet-cli)](https://npm-stat.com/charts.html?package=midnight-wallet-cli)
5
5
  [![License](https://img.shields.io/npm/l/midnight-wallet-cli)](https://www.apache.org/licenses/LICENSE-2.0)
6
6
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.9-blue?logo=typescript)](https://www.typescriptlang.org/)
7
- [![CI](https://github.com/nel349/midnight-wallet-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/nel349/midnight-wallet-cli/actions/workflows/ci.yml)
7
+
8
8
 
9
9
  A standalone CLI wallet for the Midnight blockchain. Manage wallets, check balances, transfer NIGHT tokens, and run a local network — all from the terminal.
10
10
 
@@ -20,7 +20,11 @@ This installs two commands: `midnight` (or `mn` for short) and `midnight-wallet-
20
20
 
21
21
  | Command | Description |
22
22
  |---------|-------------|
23
- | `midnight generate` | Generate a new wallet or restore from seed/mnemonic |
23
+ | `midnight wallet generate <name>` | Create a named wallet and set it as active |
24
+ | `midnight wallet list` | List all wallets with active marker |
25
+ | `midnight wallet use <name>` | Set the active wallet |
26
+ | `midnight wallet info [name]` | Show wallet details |
27
+ | `midnight wallet remove <name>` | Remove a wallet |
24
28
  | `midnight info` | Display wallet address, network, creation date |
25
29
  | `midnight balance [address]` | Check unshielded NIGHT balance |
26
30
  | `midnight transfer <to> <amount>` | Send NIGHT tokens to another address |
@@ -30,27 +34,38 @@ This installs two commands: `midnight` (or `mn` for short) and `midnight-wallet-
30
34
  | `midnight address --seed <hex>` | Derive an address from a seed |
31
35
  | `midnight genesis-address` | Show the genesis wallet address |
32
36
  | `midnight inspect-cost` | Display current block cost limits |
33
- | `midnight config get/set` | Manage persistent config (default network, etc.) |
37
+ | `midnight serve` | Start DApp Connector server (WebSocket JSON-RPC) |
38
+ | `midnight config get/set` | Manage persistent config (network, wallet, endpoints) |
34
39
  | `midnight localnet up/stop/down/status` | Manage a local Midnight network via Docker |
35
40
  | `midnight help [command]` | Show usage for all or a specific command |
36
41
 
37
42
  ## Quick Start
38
43
 
44
+ ### Preprod (testnet)
45
+
46
+ ```bash
47
+ # Generate a wallet on preprod
48
+ midnight wallet generate alice --network preprod
49
+
50
+ # Check balance
51
+ midnight balance
52
+ ```
53
+
54
+ ### Local development
55
+
39
56
  ```bash
40
57
  # Start local network
41
58
  midnight localnet up
42
59
 
43
60
  # Generate a wallet
44
- midnight generate --network undeployed
61
+ midnight wallet generate dev --network undeployed
45
62
 
46
63
  # Airdrop tokens and register dust
47
64
  midnight airdrop 1000
48
65
  midnight dust register
49
66
 
50
- # Check balance
67
+ # Check balance and transfer
51
68
  midnight balance
52
-
53
- # Transfer NIGHT
54
69
  midnight transfer mn_addr_undeployed1... 100
55
70
  ```
56
71
 
@@ -58,8 +73,11 @@ midnight transfer mn_addr_undeployed1... 100
58
73
 
59
74
  | Network | Description |
60
75
  |---------|-------------|
76
+ | `preprod` | Midnight pre-production testnet |
61
77
  | `undeployed` | Local network via Docker (`midnight localnet up`) |
62
78
 
79
+ Use `--network <name>` to select a network, or persist it with `midnight config set network preprod`.
80
+
63
81
  ## JSON Output for Automation
64
82
 
65
83
  Every command supports `--json` for structured output:
@@ -91,8 +109,7 @@ Create `.mcp.json` in your project root:
91
109
  {
92
110
  "mcpServers": {
93
111
  "midnight-wallet": {
94
- "command": "npx",
95
- "args": ["-y", "midnight-wallet-cli@latest", "--mcp"]
112
+ "command": "midnight-wallet-mcp"
96
113
  }
97
114
  }
98
115
  }
@@ -106,8 +123,7 @@ Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)
106
123
  {
107
124
  "mcpServers": {
108
125
  "midnight-wallet": {
109
- "command": "npx",
110
- "args": ["-y", "midnight-wallet-cli@latest", "--mcp"]
126
+ "command": "midnight-wallet-mcp"
111
127
  }
112
128
  }
113
129
  }
@@ -121,8 +137,7 @@ Create `.cursor/mcp.json` in your project root:
121
137
  {
122
138
  "mcpServers": {
123
139
  "midnight-wallet": {
124
- "command": "npx",
125
- "args": ["-y", "midnight-wallet-cli@latest", "--mcp"]
140
+ "command": "midnight-wallet-mcp"
126
141
  }
127
142
  }
128
143
  }
@@ -137,8 +152,7 @@ Create `.vscode/mcp.json` in your project root:
137
152
  "servers": {
138
153
  "midnight-wallet": {
139
154
  "type": "stdio",
140
- "command": "npx",
141
- "args": ["-y", "midnight-wallet-cli@latest", "--mcp"]
155
+ "command": "midnight-wallet-mcp"
142
156
  }
143
157
  }
144
158
  }
@@ -152,22 +166,26 @@ Add to `~/.codeium/windsurf/mcp_config.json`:
152
166
  {
153
167
  "mcpServers": {
154
168
  "midnight-wallet": {
155
- "command": "npx",
156
- "args": ["-y", "midnight-wallet-cli@latest", "--mcp"]
169
+ "command": "midnight-wallet-mcp"
157
170
  }
158
171
  }
159
172
  }
160
173
  ```
161
174
 
162
- > **Tip:** If you installed globally (`npm install -g midnight-wallet-cli`), you can use `"command": "midnight-wallet-mcp"` instead of the `npx` form.
175
+ > **Tip:** If you haven't installed globally, use `"command": "npx"` with `"args": ["-y", "midnight-wallet-cli@latest", "--mcp"]` instead.
163
176
 
164
177
  ### Available MCP Tools
165
178
 
166
- Once connected, your AI agent gets access to 17 tools:
179
+ Once connected, your AI agent gets access to 22 tools:
167
180
 
168
181
  | Tool | Description |
169
182
  |------|-------------|
170
- | `midnight_generate` | Generate or restore a wallet |
183
+ | `midnight_wallet_generate` | Create a named wallet |
184
+ | `midnight_wallet_list` | List all wallets |
185
+ | `midnight_wallet_use` | Set active wallet |
186
+ | `midnight_wallet_info` | Show wallet details |
187
+ | `midnight_wallet_remove` | Remove a wallet |
188
+ | `midnight_generate` | Generate a wallet (deprecated) |
171
189
  | `midnight_info` | Show wallet info (no secrets) |
172
190
  | `midnight_balance` | Check NIGHT balance |
173
191
  | `midnight_address` | Derive address from seed |
@@ -195,4 +213,4 @@ For documentation, guides, and more: [midnight-wallet-cli-hub](https://github.co
195
213
 
196
214
  - Node.js >= 20
197
215
  - Docker (for `midnight localnet` commands)
198
- - A running proof server on `localhost:6300` (for transactions on undeployed network)
216
+ - A running proof server on `localhost:6300` (for transactions — required on all networks)