From: merge-script Date: Thu, 3 Dec 2026 14:10:17 +0000 (+0100) Subject: Merge bitcoindevkit/bdk-cli#396: refactor: drop the `types` module and build JSON... X-Git-Url: http://internal-gitweb-vhost/-script/trait.impl/rand/distributions/distribution/trait.DistString.js?a=commitdiff_plain;h=HEAD;p=bdk-cli Merge bitcoindevkit/bdk-cli#396: refactor: drop the `types` module and build JSON output in each command 537fbb914f3723dca8c1605c0df91f1320a5107e refactor(key): move derive_master_key_from_mnemonic to utils (Vihiga Tyonum) 497d7f31f76161b06113dabca9193126e2a1f2a8 fix(payjoin,dns): print JSON objects instead of JSON inside a message string (Vihiga Tyonum) cac3733ab02b4cc997cb6157a97c3bc055b7e512 refactor: drop the types module and build JSON in each command (Vihiga Tyonum) Pull request description: ### Description Since `--pretty` was removed, JSON is the only output format, so the structs in `src/utils/types.rs` only existed to be serialized once. Several still carried pretty-format leftovers: `TransactionDetails` had #[serde(skip)] fields nothing read, and `UnspentDetails::from_local_output` took an unused network argument. This PR removes the module and ensured that a command's JSON is built in its own `execute` method. ### Notes to the reviewers - `AppCommand::execute / AsyncAppCommand::execute` return `Result`. The associated `Output` type is dropped. - Helpers return domain values, not JSON - Absent values are left out, as `skip_serializing_if` did before. The exception is `payjoin_history `rows, which keep `completed_at: null` so every row has the same keys. - NEW_FEATURE.md "Step 2" is rewritten for the new convention. - `receive_payjoin`, `send_payjoin`, `resume_payjoin`, `payjoin_history `and `resolve_dns_recipient` now print their JSON directly instead of as an escaped string in a message field. `resolve_dns_recipient` leaves out `description`, `min_amount` and `max_amount` when they're not set. ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk-cli/blob/master/CONTRIBUTING.md) * [x] I ran `just pre-push` before pushing ACKs for top commit: vadim-anfv: tACK 537fbb914f3723dca8c1605c0df91f1320a5107e Tree-SHA512: a1d2c2e9a04eedfc5220e6b27272f8ad461fbacf0a97fa72c67c14886e71c23410203babc33b1587e1f9f523b2d2d85cdf61d0b2867d2cdf1546201dfc4ec91e --- 06191e52b1548e3033620edf595413ba5ffdf85d