midnight-wallet-cli 0.1.11 → 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 +33 -10
- package/dist/mcp-server.js +244 -149
- package/dist/wallet.js +334 -186
- package/package.json +13 -9
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://npm-stat.com/charts.html?package=midnight-wallet-cli)
|
|
5
5
|
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
6
6
|
[](https://www.typescriptlang.org/)
|
|
7
|
-
|
|
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
|
|
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
|
|
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:
|
|
@@ -158,11 +176,16 @@ Add to `~/.codeium/windsurf/mcp_config.json`:
|
|
|
158
176
|
|
|
159
177
|
### Available MCP Tools
|
|
160
178
|
|
|
161
|
-
Once connected, your AI agent gets access to
|
|
179
|
+
Once connected, your AI agent gets access to 22 tools:
|
|
162
180
|
|
|
163
181
|
| Tool | Description |
|
|
164
182
|
|------|-------------|
|
|
165
|
-
| `
|
|
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) |
|
|
166
189
|
| `midnight_info` | Show wallet info (no secrets) |
|
|
167
190
|
| `midnight_balance` | Check NIGHT balance |
|
|
168
191
|
| `midnight_address` | Derive address from seed |
|
|
@@ -190,4 +213,4 @@ For documentation, guides, and more: [midnight-wallet-cli-hub](https://github.co
|
|
|
190
213
|
|
|
191
214
|
- Node.js >= 20
|
|
192
215
|
- Docker (for `midnight localnet` commands)
|
|
193
|
-
- A running proof server on `localhost:6300` (for transactions on
|
|
216
|
+
- A running proof server on `localhost:6300` (for transactions — required on all networks)
|