@cogcoin/client 0.5.6 → 0.5.7

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.
Files changed (69) hide show
  1. package/README.md +11 -2
  2. package/dist/bitcoind/bootstrap/getblock-archive.d.ts +39 -0
  3. package/dist/bitcoind/bootstrap/getblock-archive.js +548 -0
  4. package/dist/bitcoind/bootstrap.d.ts +1 -0
  5. package/dist/bitcoind/bootstrap.js +1 -0
  6. package/dist/bitcoind/client/factory.js +84 -30
  7. package/dist/bitcoind/client/managed-client.js +2 -1
  8. package/dist/bitcoind/client/sync-engine.js +7 -0
  9. package/dist/bitcoind/errors.js +18 -0
  10. package/dist/bitcoind/indexer-daemon-main.js +78 -0
  11. package/dist/bitcoind/indexer-daemon.d.ts +3 -1
  12. package/dist/bitcoind/indexer-daemon.js +13 -6
  13. package/dist/bitcoind/node.js +2 -0
  14. package/dist/bitcoind/progress/constants.d.ts +1 -0
  15. package/dist/bitcoind/progress/constants.js +1 -0
  16. package/dist/bitcoind/progress/controller.d.ts +22 -0
  17. package/dist/bitcoind/progress/controller.js +48 -23
  18. package/dist/bitcoind/progress/formatting.js +25 -0
  19. package/dist/bitcoind/progress/render-policy.d.ts +35 -0
  20. package/dist/bitcoind/progress/render-policy.js +81 -0
  21. package/dist/bitcoind/service-paths.js +2 -6
  22. package/dist/bitcoind/service.d.ts +5 -1
  23. package/dist/bitcoind/service.js +93 -54
  24. package/dist/bitcoind/testing.d.ts +1 -1
  25. package/dist/bitcoind/testing.js +1 -1
  26. package/dist/bitcoind/types.d.ts +35 -1
  27. package/dist/cli/commands/follow.js +2 -0
  28. package/dist/cli/commands/getblock-archive-restart.d.ts +5 -0
  29. package/dist/cli/commands/getblock-archive-restart.js +15 -0
  30. package/dist/cli/commands/mining-admin.js +4 -0
  31. package/dist/cli/commands/mining-read.js +8 -5
  32. package/dist/cli/commands/mining-runtime.js +4 -0
  33. package/dist/cli/commands/status.js +2 -0
  34. package/dist/cli/commands/sync.js +2 -0
  35. package/dist/cli/commands/wallet-admin.js +29 -3
  36. package/dist/cli/commands/wallet-mutation.js +57 -4
  37. package/dist/cli/commands/wallet-read.js +2 -0
  38. package/dist/cli/context.js +5 -3
  39. package/dist/cli/mutation-command-groups.d.ts +2 -1
  40. package/dist/cli/mutation-command-groups.js +5 -0
  41. package/dist/cli/mutation-json.d.ts +18 -2
  42. package/dist/cli/mutation-json.js +47 -0
  43. package/dist/cli/mutation-success.d.ts +1 -0
  44. package/dist/cli/mutation-success.js +2 -2
  45. package/dist/cli/output.js +84 -1
  46. package/dist/cli/parse.d.ts +1 -1
  47. package/dist/cli/parse.js +127 -3
  48. package/dist/cli/preview-json.d.ts +10 -1
  49. package/dist/cli/preview-json.js +30 -0
  50. package/dist/cli/prompt.js +1 -1
  51. package/dist/cli/runner.js +3 -0
  52. package/dist/cli/types.d.ts +11 -4
  53. package/dist/cli/wallet-format.js +6 -0
  54. package/dist/wallet/lifecycle.d.ts +15 -1
  55. package/dist/wallet/lifecycle.js +147 -83
  56. package/dist/wallet/mining/visualizer.d.ts +11 -6
  57. package/dist/wallet/mining/visualizer.js +32 -15
  58. package/dist/wallet/reset.js +39 -27
  59. package/dist/wallet/runtime.d.ts +12 -1
  60. package/dist/wallet/runtime.js +53 -11
  61. package/dist/wallet/state/provider.d.ts +1 -0
  62. package/dist/wallet/state/provider.js +119 -3
  63. package/dist/wallet/state/seed-index.d.ts +43 -0
  64. package/dist/wallet/state/seed-index.js +151 -0
  65. package/dist/wallet/tx/anchor.d.ts +22 -0
  66. package/dist/wallet/tx/anchor.js +215 -8
  67. package/dist/wallet/tx/index.d.ts +1 -1
  68. package/dist/wallet/tx/index.js +1 -1
  69. package/package.json +1 -1
@@ -151,10 +151,13 @@ export function classifyCliError(error) {
151
151
  }
152
152
  if (message === "wallet_typed_confirmation_rejected"
153
153
  || message === "wallet_export_overwrite_declined"
154
+ || message === "wallet_delete_confirmation_required"
154
155
  || message === "wallet_prompt_value_required"
155
156
  || message === "wallet_archive_passphrase_mismatch"
156
157
  || message === "wallet_restore_mnemonic_invalid"
157
158
  || message === "wallet_restore_replace_confirmation_required"
159
+ || message === "wallet_seed_name_invalid"
160
+ || message === "wallet_seed_name_reserved"
158
161
  || message === "reset_wallet_choice_invalid"
159
162
  || message === "reset_wallet_passphrase_required"
160
163
  || message === "reset_wallet_access_failed") {
@@ -185,6 +188,10 @@ function isBlockedError(message) {
185
188
  || message === "wallet_export_core_replica_not_ready"
186
189
  || message === "wallet_export_tip_mismatch"
187
190
  || message === "wallet_export_requires_quiescent_local_state"
191
+ || message === "wallet_restore_requires_main_wallet"
192
+ || message === "wallet_seed_name_exists"
193
+ || message === "wallet_seed_not_found"
194
+ || message === "wallet_delete_main_not_supported"
188
195
  || message === "wallet_repair_indexer_reset_requires_yes"
189
196
  || message === "managed_bitcoind_service_version_mismatch"
190
197
  || message === "managed_bitcoind_wallet_root_mismatch"
@@ -303,6 +310,34 @@ export function createCliErrorPresentation(errorCode, fallbackMessage) {
303
310
  next: "Run `cogcoin status` to inspect the existing wallet, or export/import it instead of reinitializing.",
304
311
  };
305
312
  }
313
+ if (errorCode === "wallet_restore_requires_main_wallet") {
314
+ return {
315
+ what: "Main wallet is required before importing another seed.",
316
+ why: "Named restore only creates imported seeds. Cogcoin requires the primary `main` wallet to exist first so shared local state has a canonical default seed.",
317
+ next: "Run `cogcoin init`, then rerun `cogcoin restore --seed <name>`.",
318
+ };
319
+ }
320
+ if (errorCode === "wallet_seed_name_exists") {
321
+ return {
322
+ what: "Seed name is already in use.",
323
+ why: "This machine already has a wallet seed registered with that name.",
324
+ next: "Choose a different `--seed` name, or delete the imported seed first with `cogcoin wallet delete --seed <name>`.",
325
+ };
326
+ }
327
+ if (errorCode === "wallet_seed_not_found") {
328
+ return {
329
+ what: "Seed was not found.",
330
+ why: "No local wallet seed is registered under that name.",
331
+ next: "Check `--seed <name>` and retry.",
332
+ };
333
+ }
334
+ if (errorCode === "wallet_delete_main_not_supported") {
335
+ return {
336
+ what: "The main wallet cannot be deleted with `wallet delete`.",
337
+ why: "This command only removes imported seeds. The canonical `main` wallet is part of the base local client state.",
338
+ next: "Use `cogcoin reset` if you need to remove the main wallet.",
339
+ };
340
+ }
306
341
  if (errorCode === "local-state-corrupt" || errorCode.includes("repair_required") || errorCode.includes("repair-required")) {
307
342
  return {
308
343
  what: "Local recovery is required.",
@@ -342,7 +377,7 @@ export function createCliErrorPresentation(errorCode, fallbackMessage) {
342
377
  return {
343
378
  what: "Recovery phrase is invalid.",
344
379
  why: "Mnemonic-only restore accepts only a valid 24-word English BIP39 phrase with a matching checksum.",
345
- next: "Rerun `cogcoin restore` and enter the 24 recovery words in the original order.",
380
+ next: "Rerun `cogcoin restore --seed <name>` and enter the 24 recovery words in the original order.",
346
381
  };
347
382
  }
348
383
  if (errorCode === "wallet_restore_replace_confirmation_required") {
@@ -352,6 +387,41 @@ export function createCliErrorPresentation(errorCode, fallbackMessage) {
352
387
  next: "Rerun `cogcoin restore` in an interactive terminal and type \"RESTORE\" when prompted.",
353
388
  };
354
389
  }
390
+ if (errorCode === "wallet_seed_name_invalid" || errorCode === "wallet_seed_name_reserved" || errorCode === "cli_invalid_seed_name") {
391
+ return {
392
+ what: "Seed name is invalid.",
393
+ why: "Wallet seed names must be lowercase slugs like `trading` or `cold-backup`, and `main` is reserved.",
394
+ next: "Choose a different seed name and retry.",
395
+ };
396
+ }
397
+ if (errorCode === "cli_missing_seed_name") {
398
+ return {
399
+ what: "A seed name is required.",
400
+ why: "This command needs `--seed <name>` to identify which imported wallet seed it should restore or delete.",
401
+ next: "Rerun the command with `--seed <name>`.",
402
+ };
403
+ }
404
+ if (errorCode === "cli_seed_not_supported_for_command" || errorCode === "wallet_init_seed_not_supported" || errorCode === "wallet_import_seed_not_supported") {
405
+ return {
406
+ what: "This command does not support `--seed`.",
407
+ why: "Only wallet-aware commands are seed-selectable. Global lifecycle and shared service commands still operate on the shared local client state.",
408
+ next: "Drop `--seed` for this command and retry.",
409
+ };
410
+ }
411
+ if (errorCode === "wallet_anchor_clear_inconsistent_state") {
412
+ return {
413
+ what: "Pending anchor state is inconsistent.",
414
+ why: "The domain still shows local pending anchor state, but the wallet could not find a matching clearable reserved anchor family.",
415
+ next: "Run `cogcoin repair`, then inspect the domain again before retrying `cogcoin anchor clear`.",
416
+ };
417
+ }
418
+ if (errorCode.startsWith("wallet_anchor_clear_not_clearable_")) {
419
+ return {
420
+ what: "Pending anchor cannot be cleared safely.",
421
+ why: "This command only clears a local pre-broadcast reservation. The anchor family is already beyond that safe stage or may have been observed by the wallet.",
422
+ next: "Rerun `cogcoin anchor <domain>` to reconcile the family, or run `cogcoin repair` if it remains unresolved.",
423
+ };
424
+ }
355
425
  if (errorCode === "mining_hooks_enable_trust_acknowledgement_required") {
356
426
  return {
357
427
  what: "Trust acknowledgement is still required.",
@@ -735,6 +805,8 @@ export function describeCanonicalCommand(parsed) {
735
805
  case "restore":
736
806
  case "wallet-restore":
737
807
  return "cogcoin restore";
808
+ case "wallet-delete":
809
+ return "cogcoin wallet delete";
738
810
  case "wallet-show-mnemonic":
739
811
  return "cogcoin wallet show-mnemonic";
740
812
  case "unlock":
@@ -749,6 +821,9 @@ export function describeCanonicalCommand(parsed) {
749
821
  case "anchor":
750
822
  case "domain-anchor":
751
823
  return `cogcoin anchor ${args[0] ?? "<domain>"}`;
824
+ case "anchor-clear":
825
+ case "domain-anchor-clear":
826
+ return `cogcoin anchor clear ${args[0] ?? "<domain>"}`;
752
827
  case "register":
753
828
  case "domain-register":
754
829
  return `cogcoin register ${args[0] ?? "<domain>"}`;
@@ -918,6 +993,8 @@ export function resolveStableMutationJsonSchema(parsed) {
918
993
  case "restore":
919
994
  case "wallet-restore":
920
995
  return "cogcoin/restore/v1";
996
+ case "wallet-delete":
997
+ return "cogcoin/wallet-delete/v1";
921
998
  case "unlock":
922
999
  case "wallet-unlock":
923
1000
  return "cogcoin/unlock/v1";
@@ -934,6 +1011,9 @@ export function resolveStableMutationJsonSchema(parsed) {
934
1011
  case "anchor":
935
1012
  case "domain-anchor":
936
1013
  return "cogcoin/anchor/v1";
1014
+ case "anchor-clear":
1015
+ case "domain-anchor-clear":
1016
+ return "cogcoin/anchor-clear/v1";
937
1017
  case "register":
938
1018
  case "domain-register":
939
1019
  return "cogcoin/register/v1";
@@ -1012,7 +1092,9 @@ export function resolvePreviewJsonSchema(parsed) {
1012
1092
  case "reset":
1013
1093
  case "repair":
1014
1094
  case "anchor":
1095
+ case "anchor-clear":
1015
1096
  case "domain-anchor":
1097
+ case "domain-anchor-clear":
1016
1098
  case "register":
1017
1099
  case "domain-register":
1018
1100
  case "transfer":
@@ -1067,6 +1149,7 @@ function createSchemaProbe(command) {
1067
1149
  dbPath: null,
1068
1150
  dataDir: null,
1069
1151
  progressOutput: "auto",
1152
+ seedName: null,
1070
1153
  unlockFor: null,
1071
1154
  assumeYes: false,
1072
1155
  forceRace: false,
@@ -1,3 +1,3 @@
1
1
  import type { ParsedCliArgs } from "./types.js";
2
- export declare const HELP_TEXT = "Usage: cogcoin <command> [options]\n\nCommands:\n status Show wallet-aware local service and chain status\n status --output json Emit the stable v1 machine-readable status envelope\n bitcoin start Start the managed Bitcoin daemon\n bitcoin stop Stop the managed Bitcoin daemon and paired indexer\n bitcoin status Show managed Bitcoin daemon status without starting it\n indexer start Start the managed Cogcoin indexer (and bitcoind if needed)\n indexer stop Stop the managed Cogcoin indexer only\n indexer status Show managed Cogcoin indexer status without starting it\n init Initialize a new local wallet root\n init --output json Emit the stable v1 machine-readable init result envelope\n restore Restore a fresh local wallet from a 24-word mnemonic; run sync afterward\n reset Factory-reset local Cogcoin state with interactive retention prompts\n repair Recover bounded wallet/indexer/runtime state\n unlock Clear an explicit wallet lock and unlock for a limited duration\n wallet address Alias for address\n wallet ids Alias for ids\n hooks enable mining Enable a validated custom mining hook\n hooks disable mining Return to built-in mining hooks\n hooks status Show mining hook validation and trust status\n mine Run the miner in the foreground\n mine start Start the miner as a background worker\n mine stop Stop the active background miner\n mine setup Configure the built-in mining provider\n mine setup --output json\n Emit the stable v1 machine-readable mine setup result envelope\n mine status Show mining control-plane health and readiness\n mine log Show recent mining control-plane events\n anchor <domain> Anchor an owned unanchored domain with the Tx1/Tx2 family\n register <domain> [--from <identity>]\n Register a root domain or subdomain\n transfer <domain> --to <btc-target>\n Transfer an unanchored domain to another BTC identity\n sell <domain> <price> List an unanchored domain for sale in COG\n unsell <domain> Clear an active domain listing\n buy <domain> [--from <identity>]\n Buy an unanchored listed domain in COG\n send <amount> --to <btc-target>\n Send COG from one local identity to another BTC target\n claim <lock-id> --preimage <32-byte-hex>\n Claim an active COG lock before timeout\n reclaim <lock-id> Reclaim an expired COG lock as the original locker\n cog lock <amount> --to-domain <domain> (--for <blocks-or-duration> | --until-height <height>) --condition <sha256hex>\n Lock COG to an anchored recipient domain\n wallet status Show detailed wallet-local status and service health\n wallet init Initialize a new local wallet root\n wallet restore Restore a fresh local wallet from a 24-word mnemonic; run sync afterward\n wallet show-mnemonic Reveal the initialized wallet recovery phrase after typed confirmation\n wallet unlock Clear an explicit wallet lock and unlock for a limited duration\n wallet lock Lock the local wallet and disable on-demand unlock\n wallet export <path> Export a portable encrypted wallet archive\n wallet import <path> Import a portable encrypted wallet archive\n address Show the BTC funding identity for this wallet\n ids List locally controlled identities\n balance Show per-identity COG balances\n locks Show locally related active COG locks\n domain list Alias for domains\n domain show <domain> Alias for show <domain>\n domains [--anchored] [--listed] [--mineable]\n Show locally related domains\n show <domain> Show one domain and its local-wallet relationship\n fields <domain> List current fields on a domain\n field <domain> <field> Show one current field value\n field create <domain> <field>\n Create a new anchored field, optionally with an initial value\n field set <domain> <field>\n Update an existing anchored field value\n field clear <domain> <field>\n Clear an existing anchored field value\n rep give <source-domain> <target-domain> <amount>\n Burn COG as anchored-domain reputation support\n rep revoke <source-domain> <target-domain> <amount>\n Revoke visible support without refunding burned COG\n\nOptions:\n --db <path> Override the SQLite database path\n --data-dir <path> Override the managed bitcoin datadir\n --for <duration> Unlock duration like 15m, 2h, or 1d when unlocking explicitly\n --message <text> Founding message text for anchor\n --to <btc-target> Transfer or send target as an address or spk:<hex>\n --from <identity> Resolve sender identity as id:<n>, domain:<name>, address, or spk:<hex>\n --to-domain <domain>\n Recipient domain for cog lock\n --condition <sha256hex>\n 32-byte lock condition hash\n --until-height <height>\n Absolute timeout height for cog lock\n --preimage <32-byte-hex>\n Claim preimage for an active lock\n --review <text> Optional public review text for reputation operations\n --text <utf8> UTF-8 payload text for endpoint or field writes\n --json <json> UTF-8 payload JSON text for endpoint or field writes\n --bytes <spec> Payload bytes as hex:<hex> or @<path>\n --permanent Create the field as permanent\n --format <spec> Advanced field format as raw:<u8>\n --value <spec> Advanced field value as hex:<hex>, @<path>, or utf8:<text>\n --claimable Show only currently claimable locks\n --reclaimable Show only currently reclaimable locks\n --anchored Show only anchored domains\n --listed Show only currently listed domains\n --mineable Show only locally mineable root domains\n --limit <n> Limit list rows (1..1000)\n --all Show all rows for list commands\n --verify Run full custom-hook verification\n --follow Follow mining log output\n --output <mode> Output mode: text, json, or preview-json\n --progress <mode> Progress output mode: auto, tty, or none\n --force-race Allow a visible root registration race\n --yes Approve eligible plain yes/no mutation confirmations non-interactively\n --help Show help\n --version Show package version\n\nQuickstart:\n 1. Run `cogcoin init` to create the wallet.\n 2. Run `cogcoin sync` to bootstrap assumeutxo and the managed Bitcoin/indexer state.\n 3. Run `cogcoin address`, then fund the wallet with about 0.0015 BTC so you can buy a 6+ character domain to start mining and still keep BTC available for mining transaction fees.\n\nExamples:\n cogcoin status --output json\n cogcoin bitcoin status\n cogcoin indexer status\n cogcoin init --output json\n cogcoin wallet address\n cogcoin domain list --mineable\n cogcoin register alpha-child\n cogcoin register weatherbot --from id:1\n cogcoin anchor alpha\n cogcoin buy alpha\n cogcoin buy alpha --from id:1\n cogcoin field create alpha bio --text \"hello\"\n cogcoin rep give alpha beta 10 --review \"great operator\"\n cogcoin hooks status\n cogcoin mine setup --output json\n cogcoin register alpha-child --output preview-json\n cogcoin mine status\n";
2
+ export declare const HELP_TEXT = "Usage: cogcoin <command> [options]\n\nCommands:\n status Show wallet-aware local service and chain status\n status --output json Emit the stable v1 machine-readable status envelope\n bitcoin start Start the managed Bitcoin daemon\n bitcoin stop Stop the managed Bitcoin daemon and paired indexer\n bitcoin status Show managed Bitcoin daemon status without starting it\n indexer start Start the managed Cogcoin indexer (and bitcoind if needed)\n indexer stop Stop the managed Cogcoin indexer only\n indexer status Show managed Cogcoin indexer status without starting it\n init Initialize a new local wallet root\n init --output json Emit the stable v1 machine-readable init result envelope\n restore Restore an imported named seed from a 24-word mnemonic; run sync afterward\n reset Factory-reset local Cogcoin state with interactive retention prompts\n repair Recover bounded wallet/indexer/runtime state\n unlock Clear an explicit wallet lock and unlock for a limited duration\n wallet address Alias for address\n wallet ids Alias for ids\n hooks enable mining Enable a validated custom mining hook\n hooks disable mining Return to built-in mining hooks\n hooks status Show mining hook validation and trust status\n mine Run the miner in the foreground\n mine start Start the miner as a background worker\n mine stop Stop the active background miner\n mine setup Configure the built-in mining provider\n mine setup --output json\n Emit the stable v1 machine-readable mine setup result envelope\n mine status Show mining control-plane health and readiness\n mine log Show recent mining control-plane events\n anchor <domain> Anchor an owned unanchored domain with the Tx1/Tx2 family\n anchor clear <domain> Clear a local-only pending anchor reservation before broadcast\n register <domain> [--from <identity>]\n Register a root domain or subdomain\n transfer <domain> --to <btc-target>\n Transfer an unanchored domain to another BTC identity\n sell <domain> <price> List an unanchored domain for sale in COG\n unsell <domain> Clear an active domain listing\n buy <domain> [--from <identity>]\n Buy an unanchored listed domain in COG\n send <amount> --to <btc-target>\n Send COG from one local identity to another BTC target\n claim <lock-id> --preimage <32-byte-hex>\n Claim an active COG lock before timeout\n reclaim <lock-id> Reclaim an expired COG lock as the original locker\n cog lock <amount> --to-domain <domain> (--for <blocks-or-duration> | --until-height <height>) --condition <sha256hex>\n Lock COG to an anchored recipient domain\n wallet status Show detailed wallet-local status and service health\n wallet init Initialize a new local wallet root\n wallet restore Restore an imported named seed from a 24-word mnemonic; run sync afterward\n wallet delete Delete one imported named seed without affecting main\n wallet show-mnemonic Reveal the initialized wallet recovery phrase after typed confirmation\n wallet unlock Clear an explicit wallet lock and unlock for a limited duration\n wallet lock Lock the local wallet and disable on-demand unlock\n wallet export <path> Export a portable encrypted wallet archive\n wallet import <path> Import a portable encrypted wallet archive\n address Show the BTC funding identity for this wallet\n ids List locally controlled identities\n balance Show per-identity COG balances\n locks Show locally related active COG locks\n domain list Alias for domains\n domain show <domain> Alias for show <domain>\n domains [--anchored] [--listed] [--mineable]\n Show locally related domains\n show <domain> Show one domain and its local-wallet relationship\n fields <domain> List current fields on a domain\n field <domain> <field> Show one current field value\n field create <domain> <field>\n Create a new anchored field, optionally with an initial value\n field set <domain> <field>\n Update an existing anchored field value\n field clear <domain> <field>\n Clear an existing anchored field value\n rep give <source-domain> <target-domain> <amount>\n Burn COG as anchored-domain reputation support\n rep revoke <source-domain> <target-domain> <amount>\n Revoke visible support without refunding burned COG\n\nOptions:\n --db <path> Override the SQLite database path\n --data-dir <path> Override the managed bitcoin datadir\n --for <duration> Unlock duration like 15m, 2h, or 1d when unlocking explicitly\n --message <text> Founding message text for anchor\n --to <btc-target> Transfer or send target as an address or spk:<hex>\n --from <identity> Resolve sender identity as id:<n>, domain:<name>, address, or spk:<hex>\n --to-domain <domain>\n Recipient domain for cog lock\n --condition <sha256hex>\n 32-byte lock condition hash\n --until-height <height>\n Absolute timeout height for cog lock\n --preimage <32-byte-hex>\n Claim preimage for an active lock\n --review <text> Optional public review text for reputation operations\n --text <utf8> UTF-8 payload text for endpoint or field writes\n --json <json> UTF-8 payload JSON text for endpoint or field writes\n --bytes <spec> Payload bytes as hex:<hex> or @<path>\n --permanent Create the field as permanent\n --format <spec> Advanced field format as raw:<u8>\n --value <spec> Advanced field value as hex:<hex>, @<path>, or utf8:<text>\n --claimable Show only currently claimable locks\n --reclaimable Show only currently reclaimable locks\n --anchored Show only anchored domains\n --listed Show only currently listed domains\n --mineable Show only locally mineable root domains\n --limit <n> Limit list rows (1..1000)\n --all Show all rows for list commands\n --verify Run full custom-hook verification\n --follow Follow mining log output\n --output <mode> Output mode: text, json, or preview-json\n --progress <mode> Progress output mode: auto, tty, or none\n --seed <name> Select an imported wallet seed for wallet-aware commands\n --force-race Allow a visible root registration race\n --yes Approve eligible plain yes/no mutation confirmations non-interactively\n --help Show help\n --version Show package version\n\nQuickstart:\n 1. Run `cogcoin init` to create the wallet.\n 2. Run `cogcoin sync` to bootstrap assumeutxo and the managed Bitcoin/indexer state.\n 3. Run `cogcoin address`, then fund the wallet with about 0.0015 BTC so you can buy a 6+ character domain to start mining and still keep BTC available for mining transaction fees.\n\nExamples:\n cogcoin status --output json\n cogcoin bitcoin status\n cogcoin indexer status\n cogcoin init --output json\n cogcoin restore --seed trading\n cogcoin wallet address\n cogcoin domain list --mineable\n cogcoin register alpha-child\n cogcoin register weatherbot --from id:1\n cogcoin anchor alpha\n cogcoin buy alpha\n cogcoin buy alpha --from id:1\n cogcoin field create alpha bio --text \"hello\"\n cogcoin rep give alpha beta 10 --review \"great operator\"\n cogcoin hooks status\n cogcoin mine setup --output json\n cogcoin register alpha-child --output preview-json\n cogcoin mine status\n";
3
3
  export declare function parseCliArgs(argv: string[]): ParsedCliArgs;
package/dist/cli/parse.js CHANGED
@@ -12,7 +12,7 @@ Commands:
12
12
  indexer status Show managed Cogcoin indexer status without starting it
13
13
  init Initialize a new local wallet root
14
14
  init --output json Emit the stable v1 machine-readable init result envelope
15
- restore Restore a fresh local wallet from a 24-word mnemonic; run sync afterward
15
+ restore Restore an imported named seed from a 24-word mnemonic; run sync afterward
16
16
  reset Factory-reset local Cogcoin state with interactive retention prompts
17
17
  repair Recover bounded wallet/indexer/runtime state
18
18
  unlock Clear an explicit wallet lock and unlock for a limited duration
@@ -30,6 +30,7 @@ Commands:
30
30
  mine status Show mining control-plane health and readiness
31
31
  mine log Show recent mining control-plane events
32
32
  anchor <domain> Anchor an owned unanchored domain with the Tx1/Tx2 family
33
+ anchor clear <domain> Clear a local-only pending anchor reservation before broadcast
33
34
  register <domain> [--from <identity>]
34
35
  Register a root domain or subdomain
35
36
  transfer <domain> --to <btc-target>
@@ -47,7 +48,8 @@ Commands:
47
48
  Lock COG to an anchored recipient domain
48
49
  wallet status Show detailed wallet-local status and service health
49
50
  wallet init Initialize a new local wallet root
50
- wallet restore Restore a fresh local wallet from a 24-word mnemonic; run sync afterward
51
+ wallet restore Restore an imported named seed from a 24-word mnemonic; run sync afterward
52
+ wallet delete Delete one imported named seed without affecting main
51
53
  wallet show-mnemonic Reveal the initialized wallet recovery phrase after typed confirmation
52
54
  wallet unlock Clear an explicit wallet lock and unlock for a limited duration
53
55
  wallet lock Lock the local wallet and disable on-demand unlock
@@ -108,6 +110,7 @@ Options:
108
110
  --follow Follow mining log output
109
111
  --output <mode> Output mode: text, json, or preview-json
110
112
  --progress <mode> Progress output mode: auto, tty, or none
113
+ --seed <name> Select an imported wallet seed for wallet-aware commands
111
114
  --force-race Allow a visible root registration race
112
115
  --yes Approve eligible plain yes/no mutation confirmations non-interactively
113
116
  --help Show help
@@ -123,6 +126,7 @@ Examples:
123
126
  cogcoin bitcoin status
124
127
  cogcoin indexer status
125
128
  cogcoin init --output json
129
+ cogcoin restore --seed trading
126
130
  cogcoin wallet address
127
131
  cogcoin domain list --mineable
128
132
  cogcoin register alpha-child
@@ -139,7 +143,12 @@ Examples:
139
143
  `;
140
144
  function supportsYesFlag(command) {
141
145
  switch (command) {
146
+ case "sync":
147
+ case "follow":
142
148
  case "repair":
149
+ case "wallet-delete":
150
+ case "anchor-clear":
151
+ case "domain-anchor-clear":
143
152
  case "register":
144
153
  case "domain-register":
145
154
  case "transfer":
@@ -174,6 +183,81 @@ function supportsYesFlag(command) {
174
183
  return false;
175
184
  }
176
185
  }
186
+ function supportsSeedFlag(command) {
187
+ switch (command) {
188
+ case "status":
189
+ case "unlock":
190
+ case "anchor":
191
+ case "anchor-clear":
192
+ case "domain-anchor":
193
+ case "domain-anchor-clear":
194
+ case "register":
195
+ case "domain-register":
196
+ case "transfer":
197
+ case "domain-transfer":
198
+ case "sell":
199
+ case "domain-sell":
200
+ case "unsell":
201
+ case "domain-unsell":
202
+ case "buy":
203
+ case "domain-buy":
204
+ case "domain-endpoint-set":
205
+ case "domain-endpoint-clear":
206
+ case "domain-delegate-set":
207
+ case "domain-delegate-clear":
208
+ case "domain-miner-set":
209
+ case "domain-miner-clear":
210
+ case "domain-canonical":
211
+ case "field-list":
212
+ case "field-show":
213
+ case "field-create":
214
+ case "field-set":
215
+ case "field-clear":
216
+ case "send":
217
+ case "claim":
218
+ case "reclaim":
219
+ case "cog-send":
220
+ case "cog-claim":
221
+ case "cog-reclaim":
222
+ case "cog-lock":
223
+ case "rep-give":
224
+ case "rep-revoke":
225
+ case "cog-balance":
226
+ case "cog-locks":
227
+ case "mine":
228
+ case "mine-start":
229
+ case "mine-stop":
230
+ case "mine-setup":
231
+ case "mine-status":
232
+ case "mine-log":
233
+ case "wallet-export":
234
+ case "wallet-delete":
235
+ case "wallet-restore":
236
+ case "restore":
237
+ case "wallet-show-mnemonic":
238
+ case "wallet-lock":
239
+ case "wallet-unlock":
240
+ case "wallet-status":
241
+ case "wallet-address":
242
+ case "wallet-ids":
243
+ case "address":
244
+ case "ids":
245
+ case "balance":
246
+ case "locks":
247
+ case "domain-list":
248
+ case "domains":
249
+ case "domain-show":
250
+ case "show":
251
+ case "fields":
252
+ case "field":
253
+ return true;
254
+ default:
255
+ return false;
256
+ }
257
+ }
258
+ function requiresSeedFlag(command) {
259
+ return command === "restore" || command === "wallet-restore" || command === "wallet-delete";
260
+ }
177
261
  export function parseCliArgs(argv) {
178
262
  let command = null;
179
263
  const args = [];
@@ -183,6 +267,7 @@ export function parseCliArgs(argv) {
183
267
  let dbPath = null;
184
268
  let dataDir = null;
185
269
  let progressOutput = "auto";
270
+ let seedName = null;
186
271
  let unlockFor = null;
187
272
  let assumeYes = false;
188
273
  let forceRace = false;
@@ -236,6 +321,17 @@ export function parseCliArgs(argv) {
236
321
  }
237
322
  continue;
238
323
  }
324
+ if (token === "--seed") {
325
+ index += 1;
326
+ seedName = argv[index] ?? null;
327
+ if (seedName === null) {
328
+ throw new Error("cli_missing_seed_name");
329
+ }
330
+ if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(seedName)) {
331
+ throw new Error("cli_invalid_seed_name");
332
+ }
333
+ continue;
334
+ }
239
335
  if (token === "--data-dir") {
240
336
  index += 1;
241
337
  dataDir = argv[index] ?? null;
@@ -452,6 +548,11 @@ export function parseCliArgs(argv) {
452
548
  index += 1;
453
549
  continue;
454
550
  }
551
+ if (subcommand === "delete") {
552
+ command = "wallet-delete";
553
+ index += 1;
554
+ continue;
555
+ }
455
556
  if (subcommand === "show-mnemonic") {
456
557
  command = "wallet-show-mnemonic";
457
558
  index += 1;
@@ -586,6 +687,12 @@ export function parseCliArgs(argv) {
586
687
  continue;
587
688
  }
588
689
  if (subcommand === "anchor") {
690
+ const action = argv[index + 2] ?? null;
691
+ if (action === "clear") {
692
+ command = "domain-anchor-clear";
693
+ index += 2;
694
+ continue;
695
+ }
589
696
  command = "domain-anchor";
590
697
  index += 1;
591
698
  continue;
@@ -761,6 +868,11 @@ export function parseCliArgs(argv) {
761
868
  || token === "domains"
762
869
  || token === "show"
763
870
  || token === "fields") {
871
+ if (token === "anchor" && argv[index + 1] === "clear") {
872
+ command = "anchor-clear";
873
+ index += 1;
874
+ continue;
875
+ }
764
876
  command = token;
765
877
  continue;
766
878
  }
@@ -780,6 +892,7 @@ export function parseCliArgs(argv) {
780
892
  || command === "reset"
781
893
  || command === "unlock"
782
894
  || command === "wallet-init"
895
+ || command === "wallet-delete"
783
896
  || command === "wallet-restore"
784
897
  || command === "wallet-lock"
785
898
  || command === "wallet-unlock"
@@ -812,7 +925,11 @@ export function parseCliArgs(argv) {
812
925
  if ((command === "register" || command === "domain-register") && args.length !== 1) {
813
926
  throw new Error("cli_missing_domain_argument");
814
927
  }
815
- if ((command === "anchor" || command === "domain-anchor") && args.length !== 1) {
928
+ if ((command === "anchor"
929
+ || command === "domain-anchor"
930
+ || command === "anchor-clear"
931
+ || command === "domain-anchor-clear")
932
+ && args.length !== 1) {
816
933
  throw new Error("cli_missing_domain_argument");
817
934
  }
818
935
  if ((command === "domain-endpoint-set"
@@ -868,6 +985,12 @@ export function parseCliArgs(argv) {
868
985
  if (assumeYes && !supportsYesFlag(command)) {
869
986
  throw new Error("cli_yes_not_supported_for_command");
870
987
  }
988
+ if (seedName !== null && !supportsSeedFlag(command)) {
989
+ throw new Error("cli_seed_not_supported_for_command");
990
+ }
991
+ if (requiresSeedFlag(command) && seedName === null) {
992
+ throw new Error("cli_missing_seed_name");
993
+ }
871
994
  if (forceRace && command !== "register" && command !== "domain-register") {
872
995
  throw new Error("cli_force_race_not_supported_for_command");
873
996
  }
@@ -1012,6 +1135,7 @@ export function parseCliArgs(argv) {
1012
1135
  dbPath,
1013
1136
  dataDir,
1014
1137
  progressOutput,
1138
+ seedName,
1015
1139
  unlockFor,
1016
1140
  assumeYes,
1017
1141
  forceRace,
@@ -1,4 +1,4 @@
1
- import type { AnchorDomainResult, CogMutationResult, DomainAdminMutationResult, DomainMarketMutationResult, FieldMutationResult, RegisterDomainResult, ReputationMutationResult } from "../wallet/tx/index.js";
1
+ import type { AnchorDomainResult, ClearPendingAnchorResult, CogMutationResult, DomainAdminMutationResult, DomainMarketMutationResult, FieldMutationResult, RegisterDomainResult, ReputationMutationResult } from "../wallet/tx/index.js";
2
2
  import type { WalletRepairResult, WalletResetPreview } from "../wallet/lifecycle.js";
3
3
  import type { MiningControlPlaneView, MiningRuntimeStatusV1 } from "../wallet/mining/index.js";
4
4
  export declare function buildSingleTxMutationPreviewData(options: {
@@ -223,6 +223,15 @@ export declare function buildAnchorPreviewData(result: AnchorDomainResult, optio
223
223
  };
224
224
  intent: Record<string, unknown>;
225
225
  };
226
+ export declare function buildAnchorClearPreviewData(result: ClearPendingAnchorResult): {
227
+ resultType: "state-change";
228
+ stateChange: {
229
+ kind: string;
230
+ before: Record<string, unknown> | null;
231
+ after: Record<string, unknown> | null;
232
+ };
233
+ state: Record<string, unknown>;
234
+ };
226
235
  export declare function buildDomainAdminPreviewData(result: DomainAdminMutationResult, options: {
227
236
  commandKind: "domain-endpoint-set" | "domain-endpoint-clear" | "domain-delegate-set" | "domain-delegate-clear" | "domain-miner-set" | "domain-miner-clear" | "domain-canonical";
228
237
  }): {
@@ -140,6 +140,36 @@ export function buildAnchorPreviewData(result, options) {
140
140
  },
141
141
  });
142
142
  }
143
+ export function buildAnchorClearPreviewData(result) {
144
+ const before = result.cleared
145
+ ? {
146
+ localAnchorIntent: "reserved",
147
+ dedicatedIndex: result.releasedDedicatedIndex,
148
+ familyStatus: result.previousFamilyStatus,
149
+ familyStep: result.previousFamilyStep,
150
+ }
151
+ : null;
152
+ const after = result.cleared
153
+ ? {
154
+ localAnchorIntent: "none",
155
+ dedicatedIndex: null,
156
+ familyStatus: "canceled",
157
+ familyStep: result.previousFamilyStep,
158
+ }
159
+ : null;
160
+ return buildStateChangePreviewData({
161
+ kind: "anchor-clear",
162
+ state: {
163
+ domainName: result.domainName,
164
+ cleared: result.cleared,
165
+ previousFamilyStatus: result.previousFamilyStatus,
166
+ previousFamilyStep: result.previousFamilyStep,
167
+ releasedDedicatedIndex: result.releasedDedicatedIndex,
168
+ },
169
+ before,
170
+ after,
171
+ });
172
+ }
143
173
  export function buildDomainAdminPreviewData(result, options) {
144
174
  const data = buildSingleTxMutationPreviewData({
145
175
  kind: options.commandKind,
@@ -53,7 +53,7 @@ export function createTerminalPrompter(input, output) {
53
53
  if (!input.isTTY || !output.isTTY) {
54
54
  return;
55
55
  }
56
- if (scope === "mnemonic-reveal") {
56
+ if (scope === "mnemonic-reveal" || scope === "restore-mnemonic-entry") {
57
57
  output.write(CLEAR_SENSITIVE_DISPLAY_SEQUENCE);
58
58
  }
59
59
  },
@@ -76,6 +76,7 @@ export async function runCli(argv, contextOverrides = {}) {
76
76
  || parsed.command === "wallet-export"
77
77
  || parsed.command === "wallet-import"
78
78
  || parsed.command === "wallet-init"
79
+ || parsed.command === "wallet-delete"
79
80
  || parsed.command === "wallet-restore"
80
81
  || parsed.command === "wallet-show-mnemonic"
81
82
  || parsed.command === "wallet-unlock"
@@ -83,7 +84,9 @@ export async function runCli(argv, contextOverrides = {}) {
83
84
  return runWalletAdminCommand(parsed, context);
84
85
  }
85
86
  if (parsed.command === "anchor"
87
+ || parsed.command === "anchor-clear"
86
88
  || parsed.command === "domain-anchor"
89
+ || parsed.command === "domain-anchor-clear"
87
90
  || parsed.command === "register"
88
91
  || parsed.command === "domain-register"
89
92
  || parsed.command === "transfer"
@@ -5,17 +5,17 @@ import { attachOrStartManagedBitcoindService, probeManagedBitcoindService, stopM
5
5
  import { openSqliteStore } from "../sqlite/index.js";
6
6
  import type { ClientStoreAdapter } from "../types.js";
7
7
  import type { WalletRuntimePaths } from "../wallet/runtime.js";
8
- import type { exportWallet, WalletPrompter, importWallet, initializeWallet, lockWallet, previewResetWallet, repairWallet, resetWallet, restoreWalletFromMnemonic, showWalletMnemonic, unlockWallet } from "../wallet/lifecycle.js";
8
+ import type { exportWallet, WalletPrompter, importWallet, initializeWallet, deleteImportedWalletSeed, lockWallet, previewResetWallet, repairWallet, resetWallet, restoreWalletFromMnemonic, showWalletMnemonic, unlockWallet } from "../wallet/lifecycle.js";
9
9
  import type { openWalletReadContext } from "../wallet/read/index.js";
10
10
  import { loadWalletExplicitLock } from "../wallet/state/explicit-lock.js";
11
11
  import { loadUnlockSession } from "../wallet/state/session.js";
12
12
  import { loadRawWalletStateEnvelope, loadWalletState } from "../wallet/state/storage.js";
13
13
  import type { WalletSecretProvider } from "../wallet/state/provider.js";
14
14
  import type { disableMiningHooks, enableMiningHooks, followMiningLog, inspectMiningControlPlane, readMiningLog, runForegroundMining, setupBuiltInMining, startBackgroundMining, stopBackgroundMining } from "../wallet/mining/index.js";
15
- import type { anchorDomain, buyDomain, claimCogLock, clearDomainDelegate, clearDomainEndpoint, clearDomainMiner, clearField, createField, giveReputation, lockCogToDomain, registerDomain, reclaimCogLock, revokeReputation, sendCog, setField, setDomainCanonical, setDomainDelegate, setDomainEndpoint, setDomainMiner, sellDomain, transferDomain } from "../wallet/tx/index.js";
15
+ import type { anchorDomain, clearPendingAnchor, buyDomain, claimCogLock, clearDomainDelegate, clearDomainEndpoint, clearDomainMiner, clearField, createField, giveReputation, lockCogToDomain, registerDomain, reclaimCogLock, revokeReputation, sendCog, setField, setDomainCanonical, setDomainDelegate, setDomainEndpoint, setDomainMiner, sellDomain, transferDomain } from "../wallet/tx/index.js";
16
16
  export type ProgressOutput = "auto" | "tty" | "none";
17
17
  export type OutputMode = "text" | "json" | "preview-json";
18
- export type CommandName = "init" | "restore" | "reset" | "repair" | "sync" | "status" | "follow" | "bitcoin-start" | "bitcoin-stop" | "bitcoin-status" | "indexer-start" | "indexer-stop" | "indexer-status" | "unlock" | "anchor" | "domain-anchor" | "register" | "domain-register" | "transfer" | "domain-transfer" | "sell" | "domain-sell" | "unsell" | "domain-unsell" | "buy" | "domain-buy" | "domain-endpoint-set" | "domain-endpoint-clear" | "domain-delegate-set" | "domain-delegate-clear" | "domain-miner-set" | "domain-miner-clear" | "domain-canonical" | "field-list" | "field-show" | "field-create" | "field-set" | "field-clear" | "send" | "claim" | "reclaim" | "cog-send" | "cog-claim" | "cog-reclaim" | "cog-lock" | "rep-give" | "rep-revoke" | "cog-balance" | "cog-locks" | "hooks-mining-enable" | "hooks-mining-disable" | "hooks-mining-status" | "mine" | "mine-start" | "mine-stop" | "mine-setup" | "mine-status" | "mine-log" | "wallet-export" | "wallet-import" | "wallet-init" | "wallet-restore" | "wallet-show-mnemonic" | "wallet-lock" | "wallet-unlock" | "wallet-status" | "wallet-address" | "wallet-ids" | "address" | "ids" | "balance" | "locks" | "domain-list" | "domains" | "domain-show" | "show" | "fields" | "field";
18
+ export type CommandName = "init" | "restore" | "reset" | "repair" | "sync" | "status" | "follow" | "bitcoin-start" | "bitcoin-stop" | "bitcoin-status" | "indexer-start" | "indexer-stop" | "indexer-status" | "unlock" | "anchor" | "anchor-clear" | "domain-anchor" | "domain-anchor-clear" | "register" | "domain-register" | "transfer" | "domain-transfer" | "sell" | "domain-sell" | "unsell" | "domain-unsell" | "buy" | "domain-buy" | "domain-endpoint-set" | "domain-endpoint-clear" | "domain-delegate-set" | "domain-delegate-clear" | "domain-miner-set" | "domain-miner-clear" | "domain-canonical" | "field-list" | "field-show" | "field-create" | "field-set" | "field-clear" | "send" | "claim" | "reclaim" | "cog-send" | "cog-claim" | "cog-reclaim" | "cog-lock" | "rep-give" | "rep-revoke" | "cog-balance" | "cog-locks" | "hooks-mining-enable" | "hooks-mining-disable" | "hooks-mining-status" | "mine" | "mine-start" | "mine-stop" | "mine-setup" | "mine-status" | "mine-log" | "wallet-export" | "wallet-import" | "wallet-init" | "wallet-delete" | "wallet-restore" | "wallet-show-mnemonic" | "wallet-lock" | "wallet-unlock" | "wallet-status" | "wallet-address" | "wallet-ids" | "address" | "ids" | "balance" | "locks" | "domain-list" | "domains" | "domain-show" | "show" | "fields" | "field";
19
19
  export interface WritableLike {
20
20
  isTTY?: boolean;
21
21
  write(chunk: string): void;
@@ -36,6 +36,7 @@ export interface ParsedCliArgs {
36
36
  dbPath: string | null;
37
37
  dataDir: string | null;
38
38
  progressOutput: ProgressOutput;
39
+ seedName: string | null;
39
40
  unlockFor: string | null;
40
41
  assumeYes: boolean;
41
42
  forceRace: boolean;
@@ -95,6 +96,10 @@ export interface CliRunnerContext {
95
96
  dataDir?: string;
96
97
  walletRootId?: string;
97
98
  progressOutput?: ProgressOutput;
99
+ confirmGetblockArchiveRestart?: (options: {
100
+ currentArchiveEndHeight: number | null;
101
+ nextArchiveEndHeight: number;
102
+ }) => Promise<boolean>;
98
103
  }) => Promise<ManagedClientLike>;
99
104
  attachManagedBitcoindService?: typeof attachOrStartManagedBitcoindService;
100
105
  probeManagedBitcoindService?: typeof probeManagedBitcoindService;
@@ -115,11 +120,13 @@ export interface CliRunnerContext {
115
120
  previewResetWallet?: typeof previewResetWallet;
116
121
  exportWallet?: typeof exportWallet;
117
122
  importWallet?: typeof importWallet;
123
+ deleteImportedWalletSeed?: typeof deleteImportedWalletSeed;
118
124
  showWalletMnemonic?: typeof showWalletMnemonic;
119
125
  unlockWallet?: typeof unlockWallet;
120
126
  lockWallet?: typeof lockWallet;
121
127
  registerDomain?: typeof registerDomain;
122
128
  anchorDomain?: typeof anchorDomain;
129
+ clearPendingAnchor?: typeof clearPendingAnchor;
123
130
  transferDomain?: typeof transferDomain;
124
131
  sellDomain?: typeof sellDomain;
125
132
  buyDomain?: typeof buyDomain;
@@ -156,7 +163,7 @@ export interface CliRunnerContext {
156
163
  readPackageVersion?: () => Promise<string>;
157
164
  resolveDefaultBitcoindDataDir?: () => string;
158
165
  resolveDefaultClientDatabasePath?: () => string;
159
- resolveWalletRuntimePaths?: () => WalletRuntimePaths;
166
+ resolveWalletRuntimePaths?: (seedName?: string | null) => WalletRuntimePaths;
160
167
  }
161
168
  export interface StopSignalWatcher {
162
169
  cleanup(): void;
@@ -104,6 +104,12 @@ export function getRepairRecommendation(context) {
104
104
  return null;
105
105
  }
106
106
  export function getMutationRecommendation(context) {
107
+ const clearableAnchorFamily = (context.localState.state?.proactiveFamilies ?? []).find((family) => family.type === "anchor"
108
+ && family.status === "draft"
109
+ && family.currentStep === "reserved");
110
+ if (clearableAnchorFamily?.domainName != null) {
111
+ return `Run \`cogcoin anchor clear ${clearableAnchorFamily.domainName}\` to cancel the local pending anchor reservation, or rerun \`cogcoin anchor ${clearableAnchorFamily.domainName}\` to continue anchoring.`;
112
+ }
107
113
  const unresolvedFamily = (context.localState.state?.proactiveFamilies ?? []).find((family) => (family.type === "anchor" || family.type === "field")
108
114
  && (family.status === "broadcast-unknown" || family.status === "repair-required"));
109
115
  if (unresolvedFamily !== undefined) {
@@ -12,7 +12,7 @@ export interface WalletPrompter {
12
12
  writeLine(message: string): void;
13
13
  prompt(message: string): Promise<string>;
14
14
  promptHidden?(message: string): Promise<string>;
15
- clearSensitiveDisplay?(scope: "mnemonic-reveal"): void | Promise<void>;
15
+ clearSensitiveDisplay?(scope: "mnemonic-reveal" | "restore-mnemonic-entry"): void | Promise<void>;
16
16
  }
17
17
  export interface WalletInitializationResult {
18
18
  walletRootId: string;
@@ -42,12 +42,18 @@ export interface WalletImportResult {
42
42
  state: WalletStateV1;
43
43
  }
44
44
  export interface WalletRestoreResult {
45
+ seedName?: string | null;
45
46
  walletRootId: string;
46
47
  fundingAddress: string;
47
48
  unlockUntilUnixMs: number;
48
49
  state: WalletStateV1;
49
50
  warnings?: string[];
50
51
  }
52
+ export interface WalletDeleteResult {
53
+ seedName: string;
54
+ walletRootId: string;
55
+ deleted: boolean;
56
+ }
51
57
  export interface WalletRepairResult {
52
58
  walletRootId: string;
53
59
  recoveredFromBackup: boolean;
@@ -214,6 +220,14 @@ export declare function restoreWalletFromMnemonic(options: {
214
220
  attachService?: typeof attachOrStartManagedBitcoindService;
215
221
  rpcFactory?: (config: Parameters<typeof createRpcClient>[0]) => WalletLifecycleRpcClient;
216
222
  }): Promise<WalletRestoreResult>;
223
+ export declare function deleteImportedWalletSeed(options: {
224
+ dataDir: string;
225
+ provider?: WalletSecretProvider;
226
+ prompter: WalletPrompter;
227
+ assumeYes?: boolean;
228
+ nowUnixMs?: number;
229
+ paths?: WalletRuntimePaths;
230
+ }): Promise<WalletDeleteResult>;
217
231
  export declare function repairWallet(options: {
218
232
  dataDir: string;
219
233
  databasePath: string;