@cogcoin/client 0.5.15 → 1.0.1

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 (174) hide show
  1. package/README.md +80 -25
  2. package/dist/app-paths.d.ts +5 -6
  3. package/dist/app-paths.js +8 -16
  4. package/dist/art/balance.txt +10 -0
  5. package/dist/art/welcome.txt +16 -0
  6. package/dist/bitcoind/bootstrap/controller.d.ts +1 -0
  7. package/dist/bitcoind/bootstrap/controller.js +53 -1
  8. package/dist/bitcoind/client/follow-block-times.d.ts +1 -0
  9. package/dist/bitcoind/client/follow-block-times.js +1 -1
  10. package/dist/bitcoind/client/internal-types.d.ts +7 -3
  11. package/dist/bitcoind/client/managed-client.d.ts +4 -2
  12. package/dist/bitcoind/client/managed-client.js +14 -0
  13. package/dist/bitcoind/client/sync-engine.js +72 -11
  14. package/dist/bitcoind/hash-order.d.ts +4 -0
  15. package/dist/bitcoind/hash-order.js +13 -0
  16. package/dist/bitcoind/indexer-daemon-main.js +11 -3
  17. package/dist/bitcoind/normalize.js +3 -2
  18. package/dist/bitcoind/processing-start-height.d.ts +5 -0
  19. package/dist/bitcoind/processing-start-height.js +7 -0
  20. package/dist/bitcoind/progress/constants.d.ts +4 -0
  21. package/dist/bitcoind/progress/constants.js +4 -0
  22. package/dist/bitcoind/progress/controller.d.ts +2 -1
  23. package/dist/bitcoind/progress/controller.js +3 -3
  24. package/dist/bitcoind/progress/follow-scene.d.ts +6 -2
  25. package/dist/bitcoind/progress/follow-scene.js +29 -6
  26. package/dist/bitcoind/progress/formatting.d.ts +1 -0
  27. package/dist/bitcoind/progress/formatting.js +6 -0
  28. package/dist/bitcoind/progress/train-scene.js +37 -18
  29. package/dist/bitcoind/progress/tty-renderer.d.ts +6 -1
  30. package/dist/bitcoind/progress/tty-renderer.js +8 -4
  31. package/dist/bitcoind/rpc.d.ts +2 -1
  32. package/dist/bitcoind/rpc.js +3 -0
  33. package/dist/bitcoind/types.d.ts +6 -0
  34. package/dist/bytes.d.ts +1 -0
  35. package/dist/bytes.js +3 -0
  36. package/dist/cli/art.d.ts +2 -0
  37. package/dist/cli/art.js +37 -0
  38. package/dist/cli/commands/client-admin.d.ts +2 -0
  39. package/dist/cli/commands/client-admin.js +91 -0
  40. package/dist/cli/commands/follow.js +0 -2
  41. package/dist/cli/commands/mining-admin.js +6 -47
  42. package/dist/cli/commands/mining-read.js +11 -50
  43. package/dist/cli/commands/mining-runtime.js +142 -5
  44. package/dist/cli/commands/service-runtime.js +0 -2
  45. package/dist/cli/commands/status.js +8 -2
  46. package/dist/cli/commands/sync.js +49 -92
  47. package/dist/cli/commands/wallet-admin.js +142 -136
  48. package/dist/cli/commands/wallet-mutation.js +91 -79
  49. package/dist/cli/commands/wallet-read.js +15 -18
  50. package/dist/cli/context.js +5 -14
  51. package/dist/cli/mining-format.d.ts +0 -1
  52. package/dist/cli/mining-format.js +5 -37
  53. package/dist/cli/mining-json.d.ts +0 -18
  54. package/dist/cli/mining-json.js +0 -35
  55. package/dist/cli/mutation-command-groups.d.ts +1 -2
  56. package/dist/cli/mutation-command-groups.js +0 -5
  57. package/dist/cli/mutation-json.d.ts +24 -145
  58. package/dist/cli/mutation-json.js +30 -136
  59. package/dist/cli/mutation-resolved-json.d.ts +0 -7
  60. package/dist/cli/mutation-resolved-json.js +4 -10
  61. package/dist/cli/mutation-success.d.ts +2 -0
  62. package/dist/cli/mutation-success.js +11 -1
  63. package/dist/cli/mutation-text-format.js +1 -3
  64. package/dist/cli/output.d.ts +1 -1
  65. package/dist/cli/output.js +254 -231
  66. package/dist/cli/parse.d.ts +1 -1
  67. package/dist/cli/parse.js +93 -122
  68. package/dist/cli/preview-json.d.ts +17 -120
  69. package/dist/cli/preview-json.js +14 -97
  70. package/dist/cli/prompt.js +8 -13
  71. package/dist/cli/read-json.d.ts +15 -37
  72. package/dist/cli/read-json.js +44 -140
  73. package/dist/cli/runner.js +10 -13
  74. package/dist/cli/sync-progress.d.ts +6 -0
  75. package/dist/cli/sync-progress.js +91 -0
  76. package/dist/cli/types.d.ts +9 -17
  77. package/dist/cli/types.js +0 -2
  78. package/dist/cli/wallet-format.d.ts +1 -0
  79. package/dist/cli/wallet-format.js +208 -144
  80. package/dist/cli/workflow-hints.d.ts +3 -3
  81. package/dist/cli/workflow-hints.js +11 -8
  82. package/dist/client/default-client.d.ts +3 -1
  83. package/dist/client/default-client.js +45 -2
  84. package/dist/client/factory.js +1 -1
  85. package/dist/client/initialization.js +23 -0
  86. package/dist/client/persistence.js +5 -5
  87. package/dist/client/store-adapter.js +1 -0
  88. package/dist/sqlite/checkpoints.d.ts +1 -0
  89. package/dist/sqlite/checkpoints.js +7 -0
  90. package/dist/sqlite/store.js +14 -1
  91. package/dist/types.d.ts +1 -0
  92. package/dist/wallet/coin-control.d.ts +41 -12
  93. package/dist/wallet/coin-control.js +100 -428
  94. package/dist/wallet/descriptor-normalization.d.ts +1 -3
  95. package/dist/wallet/descriptor-normalization.js +0 -16
  96. package/dist/wallet/lifecycle.d.ts +7 -99
  97. package/dist/wallet/lifecycle.js +513 -968
  98. package/dist/wallet/managed-core-wallet.d.ts +13 -0
  99. package/dist/wallet/managed-core-wallet.js +20 -0
  100. package/dist/wallet/mining/constants.d.ts +5 -12
  101. package/dist/wallet/mining/constants.js +5 -12
  102. package/dist/wallet/mining/control.d.ts +1 -13
  103. package/dist/wallet/mining/control.js +45 -349
  104. package/dist/wallet/mining/index.d.ts +4 -5
  105. package/dist/wallet/mining/index.js +2 -3
  106. package/dist/wallet/mining/runner.d.ts +123 -13
  107. package/dist/wallet/mining/runner.js +899 -511
  108. package/dist/wallet/mining/runtime-artifacts.js +23 -3
  109. package/dist/wallet/mining/sentence-protocol.d.ts +44 -0
  110. package/dist/wallet/mining/sentence-protocol.js +123 -0
  111. package/dist/wallet/mining/sentences.d.ts +4 -8
  112. package/dist/wallet/mining/sentences.js +3 -52
  113. package/dist/wallet/mining/state.d.ts +11 -6
  114. package/dist/wallet/mining/state.js +7 -6
  115. package/dist/wallet/mining/types.d.ts +2 -30
  116. package/dist/wallet/mining/visualizer.d.ts +31 -3
  117. package/dist/wallet/mining/visualizer.js +135 -13
  118. package/dist/wallet/read/context.d.ts +0 -2
  119. package/dist/wallet/read/context.js +119 -140
  120. package/dist/wallet/read/filter.js +2 -11
  121. package/dist/wallet/read/index.d.ts +1 -1
  122. package/dist/wallet/read/project.js +24 -77
  123. package/dist/wallet/read/types.d.ts +10 -25
  124. package/dist/wallet/reset.d.ts +0 -1
  125. package/dist/wallet/reset.js +60 -138
  126. package/dist/wallet/root-resolution.d.ts +1 -5
  127. package/dist/wallet/root-resolution.js +0 -18
  128. package/dist/wallet/runtime.d.ts +0 -6
  129. package/dist/wallet/runtime.js +0 -8
  130. package/dist/wallet/state/client-password-agent.js +208 -0
  131. package/dist/wallet/state/client-password.d.ts +65 -0
  132. package/dist/wallet/state/client-password.js +952 -0
  133. package/dist/wallet/state/crypto.d.ts +1 -20
  134. package/dist/wallet/state/crypto.js +0 -63
  135. package/dist/wallet/state/provider.d.ts +23 -11
  136. package/dist/wallet/state/provider.js +248 -290
  137. package/dist/wallet/state/storage.d.ts +2 -2
  138. package/dist/wallet/state/storage.js +48 -16
  139. package/dist/wallet/tx/anchor.d.ts +3 -28
  140. package/dist/wallet/tx/anchor.js +349 -1250
  141. package/dist/wallet/tx/bitcoin-transfer.d.ts +35 -0
  142. package/dist/wallet/tx/bitcoin-transfer.js +200 -0
  143. package/dist/wallet/tx/cog.d.ts +5 -1
  144. package/dist/wallet/tx/cog.js +149 -185
  145. package/dist/wallet/tx/common.d.ts +61 -8
  146. package/dist/wallet/tx/common.js +266 -146
  147. package/dist/wallet/tx/domain-admin.d.ts +3 -1
  148. package/dist/wallet/tx/domain-admin.js +61 -99
  149. package/dist/wallet/tx/domain-market.d.ts +5 -1
  150. package/dist/wallet/tx/domain-market.js +221 -228
  151. package/dist/wallet/tx/field.d.ts +4 -10
  152. package/dist/wallet/tx/field.js +83 -924
  153. package/dist/wallet/tx/identity-selector.d.ts +9 -3
  154. package/dist/wallet/tx/identity-selector.js +17 -35
  155. package/dist/wallet/tx/index.d.ts +3 -1
  156. package/dist/wallet/tx/index.js +2 -1
  157. package/dist/wallet/tx/register.d.ts +3 -1
  158. package/dist/wallet/tx/register.js +62 -220
  159. package/dist/wallet/tx/reputation.d.ts +3 -1
  160. package/dist/wallet/tx/reputation.js +58 -95
  161. package/dist/wallet/types.d.ts +8 -122
  162. package/package.json +5 -5
  163. package/dist/wallet/archive.d.ts +0 -4
  164. package/dist/wallet/archive.js +0 -41
  165. package/dist/wallet/mining/hook-protocol.d.ts +0 -47
  166. package/dist/wallet/mining/hook-protocol.js +0 -161
  167. package/dist/wallet/mining/hook-runner.js +0 -52
  168. package/dist/wallet/mining/hooks.d.ts +0 -38
  169. package/dist/wallet/mining/hooks.js +0 -520
  170. package/dist/wallet/state/explicit-lock.d.ts +0 -4
  171. package/dist/wallet/state/explicit-lock.js +0 -19
  172. package/dist/wallet/state/session.d.ts +0 -12
  173. package/dist/wallet/state/session.js +0 -23
  174. /package/dist/wallet/{mining/hook-runner.d.ts → state/client-password-agent.d.ts} +0 -0
@@ -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 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";
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 client unlock Unlock password-protected local wallet secrets for a limited time\n client lock Flush the cached client password unlock session\n client change-password Rotate the client password that protects local wallet secrets\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 bitcoin transfer <sats> --to <address>\n Send plain BTC from the wallet address\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 wallet address Alias for address\n wallet ids Alias for ids\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 wallet address\n register <domain>\n Register a root domain or subdomain\n transfer <domain> --to <btc-target>\n Transfer an unanchored domain to another BTC address or script\n sell <domain> <price> List an unanchored domain for sale in COG\n unsell <domain> Clear an active domain listing\n buy <domain>\n Buy an unanchored listed domain in COG\n send <amount> --to <btc-target>\n Send COG from the wallet address 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 address Show the BTC wallet address for this wallet\n ids Show the local wallet address\n balance Show local wallet 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 empty anchored field\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> Relative timeout for cog lock, like 15m, 2h, or 1d\n --message <text> Founding message text for anchor\n --to <btc-target> Transfer or send target as an 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 --satvb <n> Override the mutation fee rate in sat/vB\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 --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 Reserved for future use\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 anchor alpha\n cogcoin register alpha --satvb 12.5\n cogcoin buy alpha\n cogcoin field set alpha bio --text \"hello\"\n cogcoin rep give alpha beta 10 --review \"great operator\"\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
@@ -1,12 +1,18 @@
1
+ import { isWalletMutationCommand } from "./mutation-command-groups.js";
1
2
  import { isJsonOutputSupportedCommand, isPreviewJsonOutputSupportedCommand, } from "./output.js";
2
3
  export const HELP_TEXT = `Usage: cogcoin <command> [options]
3
4
 
4
5
  Commands:
5
6
  status Show wallet-aware local service and chain status
6
7
  status --output json Emit the stable v1 machine-readable status envelope
8
+ client unlock Unlock password-protected local wallet secrets for a limited time
9
+ client lock Flush the cached client password unlock session
10
+ client change-password Rotate the client password that protects local wallet secrets
7
11
  bitcoin start Start the managed Bitcoin daemon
8
12
  bitcoin stop Stop the managed Bitcoin daemon and paired indexer
9
13
  bitcoin status Show managed Bitcoin daemon status without starting it
14
+ bitcoin transfer <sats> --to <address>
15
+ Send plain BTC from the wallet address
10
16
  indexer start Start the managed Cogcoin indexer (and bitcoind if needed)
11
17
  indexer stop Stop the managed Cogcoin indexer only
12
18
  indexer status Show managed Cogcoin indexer status without starting it
@@ -15,12 +21,8 @@ Commands:
15
21
  restore Restore an imported named seed from a 24-word mnemonic; run sync afterward
16
22
  reset Factory-reset local Cogcoin state with interactive retention prompts
17
23
  repair Recover bounded wallet/indexer/runtime state
18
- unlock Clear an explicit wallet lock and unlock for a limited duration
19
24
  wallet address Alias for address
20
25
  wallet ids Alias for ids
21
- hooks enable mining Enable a validated custom mining hook
22
- hooks disable mining Return to built-in mining hooks
23
- hooks status Show mining hook validation and trust status
24
26
  mine Run the miner in the foreground
25
27
  mine start Start the miner as a background worker
26
28
  mine stop Stop the active background miner
@@ -29,18 +31,17 @@ Commands:
29
31
  Emit the stable v1 machine-readable mine setup result envelope
30
32
  mine status Show mining control-plane health and readiness
31
33
  mine log Show recent mining control-plane events
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
34
- register <domain> [--from <identity>]
34
+ anchor <domain> Anchor an owned unanchored domain with the wallet address
35
+ register <domain>
35
36
  Register a root domain or subdomain
36
37
  transfer <domain> --to <btc-target>
37
- Transfer an unanchored domain to another BTC identity
38
+ Transfer an unanchored domain to another BTC address or script
38
39
  sell <domain> <price> List an unanchored domain for sale in COG
39
40
  unsell <domain> Clear an active domain listing
40
- buy <domain> [--from <identity>]
41
+ buy <domain>
41
42
  Buy an unanchored listed domain in COG
42
43
  send <amount> --to <btc-target>
43
- Send COG from one local identity to another BTC target
44
+ Send COG from the wallet address to another BTC target
44
45
  claim <lock-id> --preimage <32-byte-hex>
45
46
  Claim an active COG lock before timeout
46
47
  reclaim <lock-id> Reclaim an expired COG lock as the original locker
@@ -51,13 +52,9 @@ Commands:
51
52
  wallet restore Restore an imported named seed from a 24-word mnemonic; run sync afterward
52
53
  wallet delete Delete one imported named seed without affecting main
53
54
  wallet show-mnemonic Reveal the initialized wallet recovery phrase after typed confirmation
54
- wallet unlock Clear an explicit wallet lock and unlock for a limited duration
55
- wallet lock Lock the local wallet and disable on-demand unlock
56
- wallet export <path> Export a portable encrypted wallet archive
57
- wallet import <path> Import a portable encrypted wallet archive
58
- address Show the BTC funding identity for this wallet
59
- ids List locally controlled identities
60
- balance Show per-identity COG balances
55
+ address Show the BTC wallet address for this wallet
56
+ ids Show the local wallet address
57
+ balance Show local wallet COG balances
61
58
  locks Show locally related active COG locks
62
59
  domain list Alias for domains
63
60
  domain show <domain> Alias for show <domain>
@@ -67,7 +64,7 @@ Commands:
67
64
  fields <domain> List current fields on a domain
68
65
  field <domain> <field> Show one current field value
69
66
  field create <domain> <field>
70
- Create a new anchored field, optionally with an initial value
67
+ Create a new empty anchored field
71
68
  field set <domain> <field>
72
69
  Update an existing anchored field value
73
70
  field clear <domain> <field>
@@ -80,10 +77,9 @@ Commands:
80
77
  Options:
81
78
  --db <path> Override the SQLite database path
82
79
  --data-dir <path> Override the managed bitcoin datadir
83
- --for <duration> Unlock duration like 15m, 2h, or 1d when unlocking explicitly
80
+ --for <duration> Relative timeout for cog lock, like 15m, 2h, or 1d
84
81
  --message <text> Founding message text for anchor
85
82
  --to <btc-target> Transfer or send target as an address or spk:<hex>
86
- --from <identity> Resolve sender identity as id:<n>, domain:<name>, address, or spk:<hex>
87
83
  --to-domain <domain>
88
84
  Recipient domain for cog lock
89
85
  --condition <sha256hex>
@@ -93,6 +89,7 @@ Options:
93
89
  --preimage <32-byte-hex>
94
90
  Claim preimage for an active lock
95
91
  --review <text> Optional public review text for reputation operations
92
+ --satvb <n> Override the mutation fee rate in sat/vB
96
93
  --text <utf8> UTF-8 payload text for endpoint or field writes
97
94
  --json <json> UTF-8 payload JSON text for endpoint or field writes
98
95
  --bytes <spec> Payload bytes as hex:<hex> or @<path>
@@ -106,11 +103,11 @@ Options:
106
103
  --mineable Show only locally mineable root domains
107
104
  --limit <n> Limit list rows (1..1000)
108
105
  --all Show all rows for list commands
109
- --verify Run full custom-hook verification
110
106
  --follow Follow mining log output
111
107
  --output <mode> Output mode: text, json, or preview-json
112
108
  --progress <mode> Progress output mode: auto, tty, or none
113
109
  --seed <name> Select an imported wallet seed for wallet-aware commands
110
+ --force Reserved for future use
114
111
  --force-race Allow a visible root registration race
115
112
  --yes Approve eligible plain yes/no mutation confirmations non-interactively
116
113
  --help Show help
@@ -130,13 +127,11 @@ Examples:
130
127
  cogcoin wallet address
131
128
  cogcoin domain list --mineable
132
129
  cogcoin register alpha-child
133
- cogcoin register weatherbot --from id:1
134
130
  cogcoin anchor alpha
131
+ cogcoin register alpha --satvb 12.5
135
132
  cogcoin buy alpha
136
- cogcoin buy alpha --from id:1
137
- cogcoin field create alpha bio --text "hello"
133
+ cogcoin field set alpha bio --text "hello"
138
134
  cogcoin rep give alpha beta 10 --review "great operator"
139
- cogcoin hooks status
140
135
  cogcoin mine setup --output json
141
136
  cogcoin register alpha-child --output preview-json
142
137
  cogcoin mine status
@@ -145,10 +140,9 @@ function supportsYesFlag(command) {
145
140
  switch (command) {
146
141
  case "sync":
147
142
  case "follow":
143
+ case "bitcoin-transfer":
148
144
  case "repair":
149
145
  case "wallet-delete":
150
- case "anchor-clear":
151
- case "domain-anchor-clear":
152
146
  case "register":
153
147
  case "domain-register":
154
148
  case "transfer":
@@ -186,11 +180,9 @@ function supportsYesFlag(command) {
186
180
  function supportsSeedFlag(command) {
187
181
  switch (command) {
188
182
  case "status":
189
- case "unlock":
183
+ case "bitcoin-transfer":
190
184
  case "anchor":
191
- case "anchor-clear":
192
185
  case "domain-anchor":
193
- case "domain-anchor-clear":
194
186
  case "register":
195
187
  case "domain-register":
196
188
  case "transfer":
@@ -230,13 +222,10 @@ function supportsSeedFlag(command) {
230
222
  case "mine-setup":
231
223
  case "mine-status":
232
224
  case "mine-log":
233
- case "wallet-export":
234
225
  case "wallet-delete":
235
226
  case "wallet-restore":
236
227
  case "restore":
237
228
  case "wallet-show-mnemonic":
238
- case "wallet-lock":
239
- case "wallet-unlock":
240
229
  case "wallet-status":
241
230
  case "wallet-address":
242
231
  case "wallet-ids":
@@ -270,6 +259,7 @@ export function parseCliArgs(argv) {
270
259
  let seedName = null;
271
260
  let unlockFor = null;
272
261
  let assumeYes = false;
262
+ let force = false;
273
263
  let forceRace = false;
274
264
  let anchorMessage = null;
275
265
  let transferTarget = null;
@@ -279,12 +269,12 @@ export function parseCliArgs(argv) {
279
269
  let fieldPermanent = false;
280
270
  let fieldFormat = null;
281
271
  let fieldValue = null;
282
- let fromIdentity = null;
283
272
  let lockRecipientDomain = null;
284
273
  let conditionHex = null;
285
274
  let untilHeight = null;
286
275
  let preimageHex = null;
287
276
  let reviewText = null;
277
+ let satvb = null;
288
278
  let locksClaimableOnly = false;
289
279
  let locksReclaimableOnly = false;
290
280
  let domainsAnchoredOnly = false;
@@ -292,7 +282,6 @@ export function parseCliArgs(argv) {
292
282
  let domainsMineableOnly = false;
293
283
  let listLimit = null;
294
284
  let listAll = false;
295
- let verify = false;
296
285
  let follow = false;
297
286
  for (let index = 0; index < argv.length; index += 1) {
298
287
  const token = argv[index];
@@ -418,12 +407,7 @@ export function parseCliArgs(argv) {
418
407
  continue;
419
408
  }
420
409
  if (token === "--from") {
421
- index += 1;
422
- fromIdentity = argv[index] ?? null;
423
- if (fromIdentity === null) {
424
- throw new Error("cli_missing_from_identity");
425
- }
426
- continue;
410
+ throw new Error("cli_from_not_supported_for_command");
427
411
  }
428
412
  if (token === "--to-domain") {
429
413
  index += 1;
@@ -465,6 +449,18 @@ export function parseCliArgs(argv) {
465
449
  }
466
450
  continue;
467
451
  }
452
+ if (token === "--satvb") {
453
+ index += 1;
454
+ const value = argv[index] ?? null;
455
+ if (value === null || value.startsWith("--")) {
456
+ throw new Error("cli_missing_satvb");
457
+ }
458
+ satvb = Number(value);
459
+ if (!Number.isFinite(satvb) || satvb <= 0) {
460
+ throw new Error("cli_invalid_satvb");
461
+ }
462
+ continue;
463
+ }
468
464
  if (token === "--claimable") {
469
465
  locksClaimableOnly = true;
470
466
  continue;
@@ -501,10 +497,6 @@ export function parseCliArgs(argv) {
501
497
  listAll = true;
502
498
  continue;
503
499
  }
504
- if (token === "--verify") {
505
- verify = true;
506
- continue;
507
- }
508
500
  if (token === "--follow") {
509
501
  follow = true;
510
502
  continue;
@@ -513,6 +505,10 @@ export function parseCliArgs(argv) {
513
505
  assumeYes = true;
514
506
  continue;
515
507
  }
508
+ if (token === "--force") {
509
+ force = true;
510
+ continue;
511
+ }
516
512
  if (token === "--force-race") {
517
513
  forceRace = true;
518
514
  continue;
@@ -558,25 +554,11 @@ export function parseCliArgs(argv) {
558
554
  index += 1;
559
555
  continue;
560
556
  }
561
- if (subcommand === "unlock") {
562
- command = "wallet-unlock";
563
- index += 1;
564
- continue;
565
- }
566
- if (subcommand === "lock") {
567
- command = "wallet-lock";
568
- index += 1;
569
- continue;
570
- }
571
557
  if (subcommand === "export") {
572
- command = "wallet-export";
573
- index += 1;
574
- continue;
558
+ throw new Error("cli_wallet_export_removed");
575
559
  }
576
560
  if (subcommand === "import") {
577
- command = "wallet-import";
578
- index += 1;
579
- continue;
561
+ throw new Error("cli_wallet_import_removed");
580
562
  }
581
563
  throw new Error(`cli_unknown_command_wallet${subcommand === null ? "" : `_${subcommand}`}`);
582
564
  }
@@ -597,8 +579,32 @@ export function parseCliArgs(argv) {
597
579
  index += 1;
598
580
  continue;
599
581
  }
582
+ if (subcommand === "transfer") {
583
+ command = "bitcoin-transfer";
584
+ index += 1;
585
+ continue;
586
+ }
600
587
  throw new Error(`cli_unknown_command_bitcoin${subcommand === null ? "" : `_${subcommand}`}`);
601
588
  }
589
+ if (token === "client") {
590
+ const subcommand = argv[index + 1] ?? null;
591
+ if (subcommand === "unlock") {
592
+ command = "client-unlock";
593
+ index += 1;
594
+ continue;
595
+ }
596
+ if (subcommand === "lock") {
597
+ command = "client-lock";
598
+ index += 1;
599
+ continue;
600
+ }
601
+ if (subcommand === "change-password") {
602
+ command = "client-change-password";
603
+ index += 1;
604
+ continue;
605
+ }
606
+ throw new Error(`cli_unknown_command_client${subcommand === null ? "" : `_${subcommand}`}`);
607
+ }
602
608
  if (token === "indexer") {
603
609
  const subcommand = argv[index + 1] ?? null;
604
610
  if (subcommand === "start") {
@@ -618,24 +624,6 @@ export function parseCliArgs(argv) {
618
624
  }
619
625
  throw new Error(`cli_unknown_command_indexer${subcommand === null ? "" : `_${subcommand}`}`);
620
626
  }
621
- if (token === "hooks") {
622
- const subcommand = argv[index + 1] ?? null;
623
- if (subcommand === "status") {
624
- command = "hooks-mining-status";
625
- index += 1;
626
- continue;
627
- }
628
- if (subcommand === "enable" || subcommand === "disable") {
629
- const target = argv[index + 2] ?? null;
630
- if (target !== "mining") {
631
- throw new Error(`cli_unknown_command_hooks_${subcommand}${target === null ? "" : `_${target}`}`);
632
- }
633
- command = subcommand === "enable" ? "hooks-mining-enable" : "hooks-mining-disable";
634
- index += 2;
635
- continue;
636
- }
637
- throw new Error(`cli_unknown_command_hooks${subcommand === null ? "" : `_${subcommand}`}`);
638
- }
639
627
  if (token === "mine") {
640
628
  const subcommand = argv[index + 1] ?? null;
641
629
  if (subcommand === null || subcommand.startsWith("--")) {
@@ -689,9 +677,7 @@ export function parseCliArgs(argv) {
689
677
  if (subcommand === "anchor") {
690
678
  const action = argv[index + 2] ?? null;
691
679
  if (action === "clear") {
692
- command = "domain-anchor-clear";
693
- index += 2;
694
- continue;
680
+ throw new Error("cli_anchor_clear_removed");
695
681
  }
696
682
  command = "domain-anchor";
697
683
  index += 1;
@@ -851,7 +837,6 @@ export function parseCliArgs(argv) {
851
837
  || token === "sync"
852
838
  || token === "status"
853
839
  || token === "follow"
854
- || token === "unlock"
855
840
  || token === "anchor"
856
841
  || token === "register"
857
842
  || token === "transfer"
@@ -869,9 +854,7 @@ export function parseCliArgs(argv) {
869
854
  || token === "show"
870
855
  || token === "fields") {
871
856
  if (token === "anchor" && argv[index + 1] === "clear") {
872
- command = "anchor-clear";
873
- index += 1;
874
- continue;
857
+ throw new Error("cli_anchor_clear_removed");
875
858
  }
876
859
  command = token;
877
860
  continue;
@@ -890,19 +873,13 @@ export function parseCliArgs(argv) {
890
873
  || command === "init"
891
874
  || command === "restore"
892
875
  || command === "reset"
893
- || command === "unlock"
894
876
  || command === "wallet-init"
895
877
  || command === "wallet-delete"
896
878
  || command === "wallet-restore"
897
- || command === "wallet-lock"
898
- || command === "wallet-unlock"
899
879
  || command === "wallet-status"
900
880
  || command === "repair"
901
881
  || command === "sync"
902
882
  || command === "follow"
903
- || command === "hooks-mining-enable"
904
- || command === "hooks-mining-disable"
905
- || command === "hooks-mining-status"
906
883
  || command === "mine"
907
884
  || command === "mine-start"
908
885
  || command === "mine-stop"
@@ -926,9 +903,7 @@ export function parseCliArgs(argv) {
926
903
  throw new Error("cli_missing_domain_argument");
927
904
  }
928
905
  if ((command === "anchor"
929
- || command === "domain-anchor"
930
- || command === "anchor-clear"
931
- || command === "domain-anchor-clear")
906
+ || command === "domain-anchor")
932
907
  && args.length !== 1) {
933
908
  throw new Error("cli_missing_domain_argument");
934
909
  }
@@ -955,7 +930,7 @@ export function parseCliArgs(argv) {
955
930
  if ((command === "unsell" || command === "domain-unsell" || command === "buy" || command === "domain-buy") && args.length !== 1) {
956
931
  throw new Error("cli_missing_domain_argument");
957
932
  }
958
- if ((command === "send" || command === "cog-send" || command === "cog-lock") && args.length !== 1) {
933
+ if ((command === "send" || command === "cog-send" || command === "cog-lock" || command === "bitcoin-transfer") && args.length !== 1) {
959
934
  throw new Error("cli_missing_amount_argument");
960
935
  }
961
936
  if ((command === "claim" || command === "cog-claim" || command === "reclaim" || command === "cog-reclaim") && args.length !== 1) {
@@ -970,15 +945,10 @@ export function parseCliArgs(argv) {
970
945
  if (command === "field-list" && args.length !== 1) {
971
946
  throw new Error("cli_missing_domain_argument");
972
947
  }
973
- if ((command === "wallet-export" || command === "wallet-import") && args.length !== 1) {
974
- throw new Error(command === "wallet-export" ? "cli_missing_export_path" : "cli_missing_import_path");
975
- }
976
948
  if ((command === "field" || command === "field-show" || command === "field-create" || command === "field-set" || command === "field-clear") && args.length !== 2) {
977
949
  throw new Error("cli_missing_field_arguments");
978
950
  }
979
951
  if (unlockFor !== null
980
- && command !== "unlock"
981
- && command !== "wallet-unlock"
982
952
  && command !== "cog-lock") {
983
953
  throw new Error("cli_unlock_duration_not_supported_for_command");
984
954
  }
@@ -994,6 +964,9 @@ export function parseCliArgs(argv) {
994
964
  if (forceRace && command !== "register" && command !== "domain-register") {
995
965
  throw new Error("cli_force_race_not_supported_for_command");
996
966
  }
967
+ if (force) {
968
+ throw new Error("cli_force_not_supported_for_command");
969
+ }
997
970
  if (anchorMessage !== null && command !== "anchor" && command !== "domain-anchor") {
998
971
  throw new Error("cli_message_not_supported_for_command");
999
972
  }
@@ -1014,16 +987,19 @@ export function parseCliArgs(argv) {
1014
987
  if (hasRawPayloadFlags && command !== "field-create" && command !== "field-set") {
1015
988
  throw new Error("cli_field_value_not_supported_for_command");
1016
989
  }
1017
- if ((command === "field-create" || command === "field-set") && namedPayloadFlagCount > 0 && hasRawPayloadFlags) {
990
+ if (command === "field-create" && (namedPayloadFlagCount > 0 || hasRawPayloadFlags)) {
991
+ throw new Error("cli_field_create_initial_value_not_supported");
992
+ }
993
+ if (command === "field-set" && namedPayloadFlagCount > 0 && hasRawPayloadFlags) {
1018
994
  throw new Error("cli_field_conflicting_payload_flags");
1019
995
  }
1020
- if ((command === "field-create" || command === "field-set") && namedPayloadFlagCount > 1) {
996
+ if (command === "field-set" && namedPayloadFlagCount > 1) {
1021
997
  throw new Error("cli_field_requires_exactly_one_named_payload_flag");
1022
998
  }
1023
- if ((command === "field-create" || command === "field-set") && fieldFormat !== null && fieldValue === null) {
999
+ if (command === "field-set" && fieldFormat !== null && fieldValue === null) {
1024
1000
  throw new Error("cli_missing_field_value");
1025
1001
  }
1026
- if ((command === "field-create" || command === "field-set") && fieldFormat === null && fieldValue !== null) {
1002
+ if (command === "field-set" && fieldFormat === null && fieldValue !== null) {
1027
1003
  throw new Error("cli_missing_field_format");
1028
1004
  }
1029
1005
  if (command === "field-set" && namedPayloadFlagCount === 0 && !hasRawPayloadFlags) {
@@ -1034,23 +1010,18 @@ export function parseCliArgs(argv) {
1034
1010
  throw new Error("cli_field_flags_not_supported_for_command");
1035
1011
  }
1036
1012
  if (transferTarget !== null && command !== "transfer" && command !== "domain-transfer") {
1037
- if (command !== "send" && command !== "cog-send") {
1013
+ if (command !== "send" && command !== "cog-send" && command !== "bitcoin-transfer") {
1038
1014
  throw new Error("cli_to_not_supported_for_command");
1039
1015
  }
1040
1016
  }
1041
- if ((command === "transfer" || command === "domain-transfer" || command === "send" || command === "cog-send") && transferTarget === null) {
1017
+ if ((command === "transfer"
1018
+ || command === "domain-transfer"
1019
+ || command === "send"
1020
+ || command === "cog-send"
1021
+ || command === "bitcoin-transfer")
1022
+ && transferTarget === null) {
1042
1023
  throw new Error("cli_missing_transfer_target");
1043
1024
  }
1044
- if (fromIdentity !== null
1045
- && command !== "register"
1046
- && command !== "domain-register"
1047
- && command !== "buy"
1048
- && command !== "domain-buy"
1049
- && command !== "send"
1050
- && command !== "cog-send"
1051
- && command !== "cog-lock") {
1052
- throw new Error("cli_from_not_supported_for_command");
1053
- }
1054
1025
  if (lockRecipientDomain !== null && command !== "cog-lock") {
1055
1026
  throw new Error("cli_to_domain_not_supported_for_command");
1056
1027
  }
@@ -1066,6 +1037,9 @@ export function parseCliArgs(argv) {
1066
1037
  if (reviewText !== null && command !== "rep-give" && command !== "rep-revoke") {
1067
1038
  throw new Error("cli_review_not_supported_for_command");
1068
1039
  }
1040
+ if (satvb !== null && !isWalletMutationCommand(command)) {
1041
+ throw new Error("cli_satvb_not_supported_for_command");
1042
+ }
1069
1043
  if ((locksClaimableOnly || locksReclaimableOnly)
1070
1044
  && command !== "locks"
1071
1045
  && command !== "cog-locks") {
@@ -1094,9 +1068,6 @@ export function parseCliArgs(argv) {
1094
1068
  if (listAll && listLimit !== null) {
1095
1069
  throw new Error("cli_conflicting_lock_limits");
1096
1070
  }
1097
- if (verify && command !== "hooks-mining-status") {
1098
- throw new Error("cli_verify_not_supported_for_command");
1099
- }
1100
1071
  if (follow && command !== "mine-log") {
1101
1072
  throw new Error("cli_follow_not_supported_for_command");
1102
1073
  }
@@ -1138,6 +1109,7 @@ export function parseCliArgs(argv) {
1138
1109
  seedName,
1139
1110
  unlockFor,
1140
1111
  assumeYes,
1112
+ force,
1141
1113
  forceRace,
1142
1114
  anchorMessage,
1143
1115
  transferTarget,
@@ -1147,12 +1119,12 @@ export function parseCliArgs(argv) {
1147
1119
  fieldPermanent,
1148
1120
  fieldFormat,
1149
1121
  fieldValue,
1150
- fromIdentity,
1151
1122
  lockRecipientDomain,
1152
1123
  conditionHex,
1153
1124
  untilHeight,
1154
1125
  preimageHex,
1155
1126
  reviewText,
1127
+ satvb,
1156
1128
  locksClaimableOnly,
1157
1129
  locksReclaimableOnly,
1158
1130
  domainsAnchoredOnly,
@@ -1160,7 +1132,6 @@ export function parseCliArgs(argv) {
1160
1132
  domainsMineableOnly,
1161
1133
  listLimit,
1162
1134
  listAll,
1163
- verify,
1164
1135
  follow,
1165
1136
  };
1166
1137
  }