Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
aadd2c4
Cancellation reaches the paying wallet's check, sync and serve
nel349 Nov 1, 2026
38fe5da
Cancellation fails with the typed CancelledError everywhere
nel349 Nov 1, 2026
eb6f9c4
Layering: rules for the shell and the MCP server, checked by the suite
nel349 Nov 1, 2026
a211c60
Help's order from the definitions; config keys and global flags checked
nel349 Nov 1, 2026
d3ac568
MCP runner: a command's non-zero exit code is a failure
nel349 Nov 1, 2026
2a2cb26
Comments say what they mean, not where it was planned
nel349 Nov 1, 2026
92163c2
Tests: every tool that acts needs its token, and does nothing before
nel349 Nov 1, 2026
54b1479
Tests: the unknown-flag refusal through the real shell
nel349 Nov 1, 2026
5d7adaf
MCP runner: a call's SDK warnings are required, not a private fallback
nel349 Nov 1, 2026
d031a86
contract state stops when cancelled; cancellation tested on the network
nel349 Nov 2, 2026
cd2d4b0
Tests: what a command writes with --json against what its help names
nel349 Nov 2, 2026
d3840c4
Tests: the quiet call after a verbose one is shown to get as far
nel349 Nov 2, 2026
446b87a
MCP: on/off parameters are booleans, checked; generate with force is …
nel349 Nov 2, 2026
92660a0
MCP confirmations name the endpoints a call is sent to
nel349 Nov 2, 2026
c2af1b9
mn <command> --help shows the command's own help
nel349 Nov 2, 2026
2b42d22
The CLI refuses a flag that belongs to another subcommand
nel349 Nov 2, 2026
63aa3dc
wallet's and generate's help name the JSON fields they write
nel349 Nov 2, 2026
4b1bd57
Skills: the server's text says only what is true for every install
nel349 Nov 2, 2026
39395a1
The README's command table is generated from the registry
nel349 Nov 2, 2026
d4128b9
A node's refusal is reported with the node's reason
nel349 Nov 2, 2026
59c2312
Engine, part 1: the rc engine, and keys and addresses behind it
nel349 Nov 2, 2026
d82fd54
Engine, part 2: reading the ledger's bytes
nel349 Nov 2, 2026
7d23a93
Engine, part 3: the Dust and shielded readers
nel349 Nov 2, 2026
a0557b6
Engine, part 4: contracts' raw state, addresses, and the stragglers
nel349 Nov 2, 2026
efe0081
Engine, part 5: the contract scripts are the engine's
nel349 Nov 2, 2026
abe415a
Engine, part 6: the wallet core's SDK-free helpers in core
nel349 Nov 2, 2026
e2d6bb6
Engine, part 7: balance reads keys, NIGHT and shielded balance from t…
nel349 Nov 2, 2026
542af21
Engine, part 8: the wallet behind the engine; only the engine imports…
nel349 Nov 2, 2026
8f8d89d
The engine loader is the host's: the shell installs the engines it ships
nel349 Nov 2, 2026
c33df15
core is a package: @kuiralabs/midnight-cli-core (phase E, EJ)
nel349 Nov 2, 2026
4287faf
chain is a package: @kuiralabs/midnight-chain (phase E, EJ)
nel349 Nov 2, 2026
bacce96
The rc engine is a package, and mn declares no SDK (phase E, EJ)
nel349 Nov 2, 2026
6735b24
A contract compiled for another runtime is refused up front (phase E,…
nel349 Nov 2, 2026
9e3b47c
The runner's overlay stays out of the engine's install, one SDK set a…
nel349 Nov 2, 2026
824db40
Each network names its SDK set; the engine follows it (phase E, ED)
nel349 Nov 2, 2026
e81b418
Delete the unused Dust balance fast reader (Y34)
nel349 Nov 2, 2026
aff2b00
The wallet session: one typed API over the engine's connector (EF, D29)
nel349 Nov 2, 2026
34ce358
The beta engine and stagenet: the network picks the set (EG)
nel349 Nov 2, 2026
edf8e74
README: stagenet, on the beta SDK set
nel349 Nov 2, 2026
4200754
The runner links a tree whole only when it holds every script package
nel349 Nov 2, 2026
3256cbb
The beta engine runs wallet-sdk-node-client 2.0.0-beta.4
nel349 Nov 2, 2026
f861482
Both engines in CI; the release ships a shrinkwrap of the tested tree…
nel349 Nov 2, 2026
7ff233a
The connector's tests run on both engines
nel349 Nov 2, 2026
e8cb452
pack-release.mjs: the release packed for a local registry, reusable
nel349 Nov 2, 2026
21d38df
Each engine ships a shrinkwrap of the SDK set the tests ran on
nel349 Nov 2, 2026
7b1b1ef
The wallet session meets the SDK's cold-start race
nel349 Nov 2, 2026
a494dae
The chain package asks whether a swap offer's coins are spent (SC)
nel349 Nov 2, 2026
abdae55
Swap offers: read, made, taken, cancelled, and kept from being spent …
nel349 Nov 2, 2026
369ae25
mn swap: make, inspect, take, cancel and list offer files (SG)
nel349 Nov 2, 2026
8074271
mn balance lists every shielded token; swaps sync shielded everywhere
nel349 Nov 2, 2026
5568197
release 0.6.0-rc.11
nel349 Nov 3, 2026
6bbf573
mn tx status, and receipts for the commands that submit
nel349 Nov 3, 2026
e9bd29d
API reports for the public packages (3A)
nel349 Nov 3, 2026
1d4b7c1
release 0.6.0-rc.12
nel349 Nov 3, 2026
11a37bb
The host: createHost, and the shell's built with it (3B, 1 of 7)
nel349 Nov 3, 2026
b3464ff
A call's context carries its host (3B, 2 of 7)
nel349 Nov 3, 2026
d8835a2
Paths come from the host (3B, 3 of 7)
nel349 Nov 3, 2026
cf3603f
Prompter, notices and per-host state come from the host (3B, 4 of 7)
nel349 Nov 3, 2026
60dd240
Each host loads its own engine (3B, 5 of 7)
nel349 Nov 3, 2026
c26e1df
Every caller gets its engine from its host (3B, 6 of 7)
nel349 Nov 3, 2026
5bbec09
Settings come from the host; no library exports a setter (3B, 7 of 7)
nel349 Nov 3, 2026
4ae70d5
Error codes owned per package, classified by code (3C, 1-2 of 8)
nel349 Nov 3, 2026
d1f1741
Typed errors where failures are known: mn and chain (3C, 3-4 of 8)
nel349 Nov 3, 2026
d9d8d1c
Codes at the engine, contract, connector and grant boundaries (3C, 5-…
nel349 Nov 3, 2026
afdfe2c
No classification reads a message; code tables generated (3C, 7-8 of 8)
nel349 Nov 3, 2026
c31c4b6
Commands declare their error codes, checked against the code (3D)
nel349 Nov 3, 2026
7476232
Library functions for balance and Dust; shared shapes (3E, 1-3 of 8)
nel349 Nov 3, 2026
8901866
Library functions for transfer and airdrop; exact amounts (3E, 4-5 of 8)
nel349 Nov 3, 2026
982fde2
Library functions for contracts and swaps; one per handler (3E, 6-8 o…
nel349 Nov 3, 2026
e4bb204
Named entry points for core, chain and the engines (3F, 1-4 of 10)
nel349 Nov 4, 2026
efe3075
The wallet package, with swap (3F, 5 of 10)
nel349 Nov 4, 2026
0690695
The connect, contract and dev packages (3F, 6-8 of 10)
nel349 Nov 4, 2026
0d81ded
The grant package; every package published and checked (3F, 9-10 of 10)
nel349 Nov 4, 2026
6726d47
mn grant through the loaded engine, stagenet included (SL, part 1)
nel349 Nov 4, 2026
22799f5
What a host provides: ./process, the session, engines that let go (3G)
nel349 Nov 4, 2026
d72727c
Pin account-chain 0.3.0-rc.2: grant works on stagenet (SL, part 2)
nel349 Nov 4, 2026
b217530
mn grant deposit of any shielded token, and its shielded sync (Y62)
nel349 Nov 4, 2026
8fe90ef
release 0.6.0-rc.13
nel349 Nov 4, 2026
a0a0992
Mounting commands from core: runCommand, captureCommand, toolDescript…
nel349 Nov 4, 2026
63e4a68
Package READMEs, registry entries per package, two typed codes (3H, p…
nel349 Nov 4, 2026
0c59ebd
A command's spinners draw through its call's output (3H, part 3)
nel349 Nov 4, 2026
37ad93f
Engines find the script's packages under bun (3H, part 4)
nel349 Nov 4, 2026
e98c4de
Pin account-chain 0.3.0-rc.3 and account 0.2.0-rc.1 (Y64)
nel349 Nov 5, 2026
1b59a9c
Engines refuse a tree bun installed, before any SDK loads (3J)
nel349 Nov 5, 2026
82b171d
The clean-install check installs with bun too (3J)
nel349 Nov 5, 2026
418b2bb
swap make splits a coin; spends leave open offers' coins alone (SJ)
nel349 Nov 5, 2026
b9dbe1f
release 0.6.0-rc.14
nel349 Nov 6, 2026
09cb445
Release on npm 11: npm 12 drops npm-shrinkwrap.json
nel349 Nov 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 12 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,13 @@ jobs:
- name: Build
run: npm run build

- name: Run tests
run: npm test
# Once per SDK engine: each test file loads one engine at most, and the
# beta engine's are named for it (src/__tests__/test-engines.test.ts).
- name: Tests — rc engine (and the SDK-free rest)
run: npm run test:rc

- name: Tests — beta engine
run: npm run test:beta

# ── Connector package ──

Expand Down Expand Up @@ -79,10 +84,11 @@ jobs:
- name: Check CLI package
run: npm pack --dry-run

# The tests above run on the lockfile's dependency tree. A user's install
# has no lockfile: this installs the packed tarball as they would and
# checks the tree npm resolves today (one copy of each ledger package, a
# shielded address still parses).
# The tests above run on the lockfile's dependency tree. This packs mn
# with the shrinkwrap the release ships, installs it from a local
# registry as a user's npm would, and checks the tree it gets: one copy
# of each WASM package per SDK engine, both engines loading, a shielded
# address still parsing, the MCP server's files present.
- name: Check a fresh install
run: node scripts/fresh-install-check.mjs

Expand Down
33 changes: 31 additions & 2 deletions .github/workflows/release-sidecar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,10 @@ jobs:
- uses: oven-sh/setup-bun@v2
with:
bun-version-file: .bun-version
# OIDC trusted publishing needs npm >= 11.5.1; Node 22 ships npm 10.x.
# OIDC trusted publishing needs npm >= 11.5.1; Node 22 ships npm 10.x. Held at npm 11: npm 12 neither packs
# nor reads npm-shrinkwrap.json, which each engine and grant ship (and mn's own).
- name: Upgrade npm for OIDC trusted publishing
run: npm install -g npm@latest
run: npm install -g npm@11
- run: npm ci
- name: Download all platform binaries
if: env.PRERELEASE != 'true'
Expand Down Expand Up @@ -158,6 +159,34 @@ jobs:
echo "skipping $pkg — no binary"
fi
done
# mn depends on its workspace packages (core, chain, one engine per SDK
# set, wallet, connect, contract, dev, grant) at exact versions: each publishes first, unless that version is
# on npm already, under the same dist-tag as mn, in dependency order (a package after those it declares).
- run: npm run build
- name: Publish the workspace packages mn depends on
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
shell: bash
run: |
set -euo pipefail
for dir in packages/cli-core packages/chain packages/engine-rc packages/engine-beta packages/wallet packages/connect packages/contract packages/dev packages/grant; do
name="$(node -p "require('./$dir/package.json').name")"
version="$(node -p "require('./$dir/package.json').version")"
if npm view "$name@$version" version >/dev/null 2>&1; then
echo "$name@$version is published already"
else
# An engine ships the SDK set the tests ran on, for a program that installs it without mn; so does
# grant, whose account chain is built on the rc set.
case "$name" in @kuiralabs/midnight-engine-*|@kuiralabs/midnight-grant) node scripts/make-shrinkwrap.mjs --package "$dir" ;; esac
# Packed with the manifest it is published with: no exports entry names a source file.
tarball="$(node scripts/publish-manifest.mjs "$dir" "$RUNNER_TEMP/workspace-packs")"
npm publish "$tarball" --access public ${{ env.PRERELEASE == 'true' && '--tag next' || '' }}
fi
done
# The tree the tests ran on, shipped with mn so a user's npm installs it
# (each engine's SDK set kept apart). Written only here, never committed.
- name: Write the shrinkwrap mn ships
run: node scripts/make-shrinkwrap.mjs
- name: Publish main package
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ tasks/
# Native sidecar binaries — built fresh by CI into the platform packages, never committed
packages/dust-sync-*/dust-sync
packages/dust-sync-*/dust-sync.exe

# Written by the release job just before publishing (scripts/make-shrinkwrap.mjs), never kept.
/npm-shrinkwrap.json
/packages/*/npm-shrinkwrap.json
93 changes: 93 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,88 @@ All notable changes to midnight-wallet-cli will be documented in this file.

## [Unreleased]

## [0.6.0-rc.14] - 2026-11-05

### Added

- **Several open swap offers of one token.** `mn swap make` needs a free coin worth exactly what the offer gives. When the wallet has none, it first sends that amount to itself, paying a fee in Dust. It then waits for the receipt and for the new coin, and makes the offer from it. The JSON gains `split` (`txHash` and the receipt).
- **Mounting mn's commands in a program.** Core exports `runCommand` (what mn's shell does around a handler), `captureCommand` (the MCP form) and `toolDescription` (a tool's description with its codes). Each package's `./commands` exports its registry entry: `coreCommands`, `chainCommands`, `walletCommands`, `swapCommands`, `contractCommands`, `connectCommands`, `devCommands` and `grantCommands`.
- **A README for each package:** how to install it, its entry points, what you call, its codes, and an example that mounts its commands. Every example is run as written in the test suite.
- **New codes:** `CONTRACT_NOT_COMPILED` ("No compiled contract found") and `NO_TEST_CONFIG` ("No dapp.test.json found"). Both used to report `UNKNOWN`.

### Changed

- **Spends leave open offers' coins alone.** Both engines pick shielded coins with mn's own picker. A spend never takes an open offer's coins, except to cancel that offer, and it prefers a coin of the exact amount. `OFFER_COINS_IN_USE` now comes only when nothing else could pay, before any proof is made. `mn swap cancel` spends only the cancelled offer's coins, so the wallet's other offers stay live.
- **Install with npm 11 or older, run with Node or bun.** Each engine ships an `npm-shrinkwrap.json` with the SDK set it was tested on. npm 12 no longer reads one, and bun's installer ignores it, so both resolve the dependency ranges again. An engine installed that way is refused before any SDK loads, with `MIXED_SDK_LAYOUT` and the command to use instead. With npm 12, install with `npx -y npm@11 install -g midnight-wallet-cli@next`. A tree that npm 11 or older installed, nested or hoisted, runs under both Node and bun.
- **Grant on account-chain 0.3.0-rc.3:** both engines pin `@kuiralabs/midnight-account-chain` 0.3.0-rc.3, which batches inbox appends (one transaction for up to four entries), and grant pins `@kuiralabs/midnight-account` 0.2.0-rc.1. An account deployed with rc.2 has the older contract, so deploy a new one.

### Fixed

- **A program's mounted command drew its spinners on the process's stderr** whatever output the program gave it. Progress now draws through the call's output.
- **Under bun, a program's contract deploy failed** because the script couldn't import `ws`. The engines now find the script's packages under bun as Node does.

### Packages

- Every `@kuiralabs` workspace package moves to `0.1.0-rc.3`.

## [0.6.0-rc.13] - 2026-11-04

### Added

- **`mn grant` on stagenet.** Grants now work on both SDK sets. Each engine carries its own copy of `@kuiralabs/midnight-account-chain` 0.3.0-rc.2, and grant uses the loaded engine's copy: the stagenet build on stagenet (no caller pin), the full build on ledger-9 local chains. On stagenet, a request that names a caller is refused before any transaction (`CALLER_PIN_UNSUPPORTED`, exit 2).
- **`mn grant deposit <amount> --token <type>`** deposits any shielded token into the account. Give the raw type as `mn balance` lists it, and the amount in the token's smallest unit. Without `--token` it deposits NIGHT, as before.
- **Programs can use mn's packages directly.** mn is split into packages, each with named entry points:
- core: `.`, `./engine`, `./ui`, `./commands`, `./process`
- chain and every domain package: `.` and `./commands`
- each engine: `.`
- the domain packages: `@kuiralabs/midnight-wallet` (with swap), `-contract`, `-connect`, `-dev` and `-grant`

A program creates a host with `createHost` (its own state folder, settings, notices and engine) and passes it in. Two hosts in one process don't mix. Each command's work is a library function: `readWalletBalance`, `transferNight`, `airdropNight`, `registerDust`, `deployContract`, `makeSwapOffer`, `takeSwapOffer`, `transactionStatus` and the rest. Each takes plain values, and amounts are exact bigints. `openWalletSession` is exported again. `installSdkProcessGuard` and `syncHeapAdvice` give a program what mn's shell does for its own process; see "Your process" in core's README.
- **Error codes are owned per package and classified by code alone**, never by message text. Each command's help, the manuals and the MCP tool descriptions list the codes it can end with. New codes: `NO_STATE_ROOT`, `NO_PAYER`, `NO_NODE_RUNTIME`, `COMMAND_FAILED`, `CALLER_PIN_UNSUPPORTED`.

### Changed

- **Error codes that changed:**
- A missing passphrase reports `PASSPHRASE_REQUIRED` on the CLI too; it used to report `INVALID_ARGS`.
- A wallet with no NIGHT reports `INSUFFICIENT_BALANCE`.
- An unreachable indexer, node or proof server reports `NETWORK_ERROR`, whatever its message says.
- A ZK proof that times out reports `PROOF_TIMEOUT`.
- A contract script's refused transaction reports `TX_REJECTED` (or the stale-UTXO or Dust-proof code).
- Errors that only matched a code by accident of wording now report `UNKNOWN`.
- Bad-argument errors print as "Usage".
- **Exact amounts:** amounts are exact end to end, and an amount too large for a JS number is no longer refused.

### Fixed

- **Programs end after `close()`:** a program ends after `session.close()`. The engines open their node submission client only on the first submit, so a session that never submitted no longer keeps reconnecting to an unreachable node.
- **Shielded deposits on stagenet:** a grant deposit syncs the wallet's shielded side, as swaps do. On stagenet it used to see no shielded coins.

### Packages

- Every `@kuiralabs` workspace package now shares one version, `0.1.0-rc.2`. The existing ones are core, chain, engine-rc and engine-beta. The new ones are wallet, connect, contract, dev and grant. Both engines pin `@kuiralabs/midnight-account-chain` 0.3.0-rc.2.

## [0.6.0-rc.12] - 2026-11-03

### Added

- **`midnight tx status <hash or identifier>`: what became of a transaction**, from the indexer: its block (height, hash, time), the fee it paid in DUST (exact, and in specks), and its result (`SUCCESS`, `PARTIAL_SUCCESS` with each segment, or `FAILURE`). It takes the transaction's hash or any of its identifiers, which is what mn prints as `txHash` after a submit. The indexer lists only finalized transactions, so one it has is final; one it doesn't have is reported as `notFound` (not on chain yet, dropped, or never sent). `--wait` asks until it is listed, up to `--timeout` seconds (120 by default). MCP tool `midnight_tx_status`, read-only.
- **Receipts in the results of the commands that submit.** `transfer`, `airdrop`, `dust register`, `swap take` and `swap cancel` wait up to 60 s for the indexer to list their transaction and add a `receipt` to their `--json` output (block, fee and result, as `tx status` gives them) and its block and fee to their text. If the indexer has not listed it by then, `receipt` is null and `receiptMissing` says why; the transaction is submitted either way.

### Packages

- `@kuiralabs/midnight-chain` 0.1.0-rc.1 (adds the transaction status and receipts), and `@kuiralabs/midnight-engine-rc` and `-beta` 0.1.0-rc.1 (no change but their chain dependency). `@kuiralabs/midnight-cli-core` stays 0.1.0-rc.0.

## [0.6.0-rc.11] - 2026-11-02

### Added

- **Private swaps of shielded tokens, through offer files: `midnight swap make | inspect | take | cancel | list`.** The maker proves and signs its half of a swap (one shielded token for another, no fee) and `make` writes it as an offer file to hand on. `inspect` reads the file from its own bytes and asks the indexer whether its coins are still unspent. `take` adds the taker's half and the fee and submits, after checking, before anything is built or spent, that the file is an offer for this network, that it says what its bytes say, that its terms are the ones agreed (`--give`, `--give-token`, `--want`, `--want-token`), that the maker's expiry (`--expires-in`, a day by default) hasn't passed, and that it wasn't taken. The maker's open offers are recorded, and a later command of the maker's that would spend their coins is refused (`OFFER_COINS_IN_USE`); `cancel <id>` spends an offer's coins back to the wallet, which is what makes an expiry binding on chain; `list` shows the open offers and closes the ones taken. New error codes, exit code 2: `NOT_AN_OFFER`, `TERMS_MISMATCH`, `OFFER_EXPIRED`, `OFFER_COINS_IN_USE`.
- **MCP tools `midnight_swap_make`, `_inspect`, `_take`, `_cancel` and `_list`.** Make, take and cancel return a confirmation token; take's confirmation names what is paid and what is got, read from the offer itself, and a take at other terms is refused before a token is issued.
- **`mn balance` lists every shielded token the wallet holds**, by its raw type, after NIGHT: in the text, as `SHIELDED_<type>=<amount>` lines on stdout, and as `shielded.tokens` in `--json`. NIGHT's fields are unchanged.
- **Stagenet**, Midnight's public ledger-9 network, on the SDK's beta set: wallets get a stagenet address (an existing wallet gets one when it is next read), and every command, the help, the manuals and the MCP tools take `--network stagenet`. Stagenet skips the shielded sync unless a command needs it (a swap) or `--force-shielded` is passed, and reads Dust in WASM, with a notice, until a ledger-9 sidecar exists.
- **Two SDK engines, the network picks one.** The SDK sits behind an engine package: `@kuiralabs/midnight-engine-rc` (the local network) and `@kuiralabs/midnight-engine-beta` (stagenet). `midnight config set sdk-set <rc|beta> [--network <name>]` runs a network on the other set. A process that loaded one set refuses work on the other (`OTHER_SDK_SET`), and the MCP server says to start one for that network.
- **A wallet session for programs.** `openWalletSession` in `@kuiralabs/midnight-cli-core` opens a seed's wallet in the program's own process, on either engine, synced and with its Dust ready, and gives balances, addresses, signing, swaps (`swap`, `makeOffer`, `takeOffer`, `cancelOffers`), reading a transaction and submitting it, with hex and plain values only. Closing it reverts what it built but never submitted.

- **Every secret mn keeps is encrypted under one passphrase.** Each wallet's seed and mnemonic, and each account's owner key, records (its encryption secrets), roster of grants and private state, are sealed at rest: scrypt to a key, then AES-256-GCM, each secret bound to what it is for. A wallet's addresses stay readable, so `wallet list`, `wallet info` and anything that only reads addresses ask for nothing. A command that needs a secret asks for the passphrase once at a terminal, or reads `MN_PASSPHRASE` (scripts, CI, the MCP server); without one it is refused (`PASSPHRASE_REQUIRED`), and a wrong one changes nothing (`WRONG_PASSPHRASE`). The first new wallet sets it, at least 12 characters.
- **`midnight wallet protect`** sets the passphrase and encrypts every wallet and account an earlier mn wrote in plain text, in one step, without loss: an account's private state is moved off the public password every account used before onto a password of its own. An interrupted run is finished by running it again. Until then plain-text wallets and accounts keep working, with a warning.
- **`midnight grant export <file>` and `import <file>`**: an account's encrypted backup, everything another machine needs to act as the same owner, opened only with the passphrase.
Expand All @@ -16,6 +96,16 @@ All notable changes to midnight-wallet-cli will be documented in this file.

### Changed

- **mn comes with four packages of its own.** `midnight-wallet-cli` now depends on `@kuiralabs/midnight-cli-core`, `@kuiralabs/midnight-chain` and the two engines, at exact versions, and ships an `npm-shrinkwrap.json` of the tree its tests ran on; each engine ships one of its own SDK set, for a program that installs it without mn.
- **A contract compiled for another compact runtime is refused up front**, naming both runtimes and the compiler the network's engine needs: by `contract deploy` and `call` before the wallet starts, by their MCP tools before a confirmation token, and by the runner before any script. It used to fail inside its script after the wallet had synced ("Version mismatch").
- **A transaction the node refuses says why, everywhere.** The CLI and the MCP server report "The node refused the transaction: <reason>", as `INVALID_DUST_PROOF` or `STALE_UTXO` when the reason is known and `TX_REJECTED` otherwise (exit code 6). It was `UNKNOWN` (exit 1), the reason only in the node's log.
- **The CLI refuses a flag that belongs to another subcommand** (`INVALID_ARGS`, exit 2), naming the subcommands it is for: `mn dust register --seed x` ran and ignored the seed. The MCP server already refused it.
- **`mn <command> --help` shows the command's own help**, also on a subcommand line (`mn wallet generate --help`).
- **MCP confirmations name the endpoints a call is sent to**, given ones as given and configured ones marked "set with config".
- **MCP on/off parameters are booleans** (`force`, `shielded`, `no-cache`), and the server refuses a parameter of the wrong type or one a tool doesn't take (`INVALID_ARGS`): `"false"` used to switch them on. `midnight_wallet_generate` with `force` asks for confirmation, and `midnight_wallet_remove` asks too, refusing a wallet it can't remove before asking.
- **Every command stops when it is cancelled**, at the terminal or by an MCP client, with `CANCELLED`, including while its first network read hangs.
- **`mn contract` takes the configured network** (`midnight config set network`), as every other command does; it always took undeployed.

- **A new account's owner key is its own, encrypted.** It is made on this machine as a valid secp256k1 key, independent of the wallet's seed (MIP-0013), and kept encrypted with the account's records; results say `ownerKey: "sealed"`, or `"plain-text"` for an account an earlier mn made, until `wallet protect`.
- **`wallet seed`** asks for the passphrase.

Expand All @@ -27,6 +117,9 @@ All notable changes to midnight-wallet-cli will be documented in this file.

### Fixed

- **`mn contract state` outside the contract's directory shows the state**, as plain JSON, not the runtime's handle (`{"__wbg_ptr":…}`); and a cancelled `contract state` stops instead of waiting for ever on an indexer that never answers.
- **A wallet `mn contract` serves restores from the Dust checkpoint**: with no saved wallet it replayed the whole Dust history and, on stagenet, ran out of time (`SYNC_TIMEOUT`).

- **A refused `mn grant` command leaves no account folder behind.** The folder under `~/.midnight/accounts/<network>/<wallet>/` was made before the command checked its wallet or its account; now only `deploy`, `import` and `device new` make it, once the wallet's file is found. `wallet protect` passes over an empty one an earlier release left, rather than naming it as an account whose wallet is gone.

- **A transaction the node refuses says why.** When a submit through `mn serve`'s DApp connector (and `mn grant`, which pays through the same code) failed, it reported only `Transaction submission error`: the wallet SDK's error keeps the node's answer where mn did not look. It now carries the node's own words, such as `1010: Invalid Transaction: Custom error: 139`, so an app can tell the node refused it, and why.
Expand Down
Loading
Loading