@needmoretruth/nmts-cli 0.34.4 → 0.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.ko.md +15 -15
  3. package/README.md +1 -1
  4. package/dist/arg-options.d.ts +167 -0
  5. package/dist/arg-options.js +10 -0
  6. package/dist/args.d.ts +2 -157
  7. package/dist/args.js +2 -0
  8. package/dist/artifact-about.d.ts +1 -1
  9. package/dist/commands/extend.d.ts +2 -0
  10. package/dist/commands/extend.js +8 -1
  11. package/dist/commands/push-wallet.js +6 -0
  12. package/dist/commands/push.d.ts +2 -0
  13. package/dist/commands/put-payer.d.ts +8 -0
  14. package/dist/commands/put-payer.js +41 -0
  15. package/dist/commands/put-wallet.d.ts +9 -3
  16. package/dist/commands/put-wallet.js +105 -185
  17. package/dist/commands/put.d.ts +5 -7
  18. package/dist/commands/put.js +3 -26
  19. package/dist/commands/wallet-donate.d.ts +3 -0
  20. package/dist/commands/wallet-donate.js +6 -2
  21. package/dist/commands/wallet-list.d.ts +18 -0
  22. package/dist/commands/wallet-list.js +116 -0
  23. package/dist/commands/wallet-send.d.ts +4 -0
  24. package/dist/commands/wallet-send.js +6 -2
  25. package/dist/commands/wallet-use.d.ts +7 -0
  26. package/dist/commands/wallet-use.js +55 -0
  27. package/dist/commands/wallet.d.ts +4 -0
  28. package/dist/commands/wallet.js +20 -8
  29. package/dist/extend-plan.d.ts +2 -0
  30. package/dist/help.js +3 -1
  31. package/dist/index.d.ts +10 -1
  32. package/dist/index.js +14 -1
  33. package/dist/main.js +4 -4
  34. package/dist/product.d.ts +1 -1
  35. package/dist/product.js +1 -1
  36. package/dist/risk.d.ts +4 -0
  37. package/dist/risk.js +6 -0
  38. package/dist/shared/lib/drive/manifest-ops.d.ts +8 -30
  39. package/dist/shared/lib/drive/manifest-ops.js +7 -39
  40. package/dist/shared/lib/drive/manifest-settings-patch.d.ts +52 -0
  41. package/dist/shared/lib/drive/manifest-settings-patch.js +110 -0
  42. package/dist/shared/lib/drive/manifest-settings.d.ts +55 -4
  43. package/dist/shared/lib/drive/manifest-settings.js +66 -28
  44. package/dist/shared/lib/wallet/discover.d.ts +54 -0
  45. package/dist/shared/lib/wallet/discover.js +66 -0
  46. package/dist/standing-tip.d.ts +3 -0
  47. package/dist/standing-tip.js +1 -0
  48. package/dist/upload-wallet-put.d.ts +118 -0
  49. package/dist/upload-wallet-put.js +221 -0
  50. package/dist/upload-wallet.d.ts +3 -0
  51. package/dist/upload-wallet.js +2 -0
  52. package/dist/wallet-list-chain.d.ts +4 -0
  53. package/dist/wallet-list-chain.js +21 -0
  54. package/dist/wallet-pay-index.d.ts +21 -0
  55. package/dist/wallet-pay-index.js +68 -0
  56. package/dist/wallet-sign-seams.d.ts +57 -0
  57. package/dist/wallet-sign-seams.js +16 -0
  58. package/dist/wallet-sign.d.ts +3 -53
  59. package/dist/wallet-sign.js +22 -15
  60. package/dist/wallet.d.ts +13 -13
  61. package/dist/wallet.js +15 -15
  62. package/docs/commands/wallet.md +18 -4
  63. package/package.json +1 -1
package/dist/wallet.d.ts CHANGED
@@ -1,16 +1,16 @@
1
1
  import { type CryptoGlue } from "./crypto.ts";
2
2
  import type { Network } from "./network.ts";
3
3
  /**
4
- * The wallet this NMTS key opens by itself.
4
+ * The wallet this NMTS key opens by itself, when nobody has said which one.
5
5
  *
6
- * ⛔ IT IS WALLET 0 BECAUSE THAT IS THE ONE THE BROWSER OPENS. Every wallet, including this one,
7
- * comes out of `wallet_seed_for` — there is no special case for the first — so the index is the
8
- * whole of the difference between "the account's wallet" and somebody else's.
6
+ * ⛔ IT IS WALLET 0 BECAUSE THAT IS THE ONE EVERY ACCOUNT STARTS WITH. Every wallet, including this
7
+ * one, comes out of `wallet_seed_for` — there is no special case for the first — so the index is
8
+ * the whole of the difference between one wallet of this key and another.
9
9
  *
10
- * EXPORTED SO THE SIGNER CANNOT PICK ITS OWN. `extend-sign.ts` derives a keypair from the same
11
- * root and has to reach the SAME wallet as the address printed here; a second literal `0` over
12
- * there would be a second answer to a question with one right one, and the failure is silent —
13
- * a signature from an address nobody funded. `extend-sign.test.ts` compares the two.
10
+ * IT IS THE OFFLINE ANSWER, NOT THE PAYING ONE (2026-09-16). `nmts wallet address` asks
11
+ * nothing of anybody and so cannot know which wallet the account pays from; every command that
12
+ * SPENDS reads that number out of the sealed file list first (`wallet-pay-index.ts`) and refuses
13
+ * rather than falling back here — paying from the wrong wallet is not a thing to guess at.
14
14
  */
15
15
  export declare const BUILT_IN_WALLET_INDEX = 0;
16
16
  /** The chain's own coin. Its type is fixed by the chain itself and takes no network. */
@@ -50,12 +50,12 @@ export declare function walCoinType(network: Network): string;
50
50
  */
51
51
  export declare function addressFromSeed(seed: Uint8Array): string;
52
52
  /**
53
- * The address of the wallet this NMTS key derives. Offline: nothing is asked of anybody.
53
+ * The address of one of the wallets this NMTS key derives. Offline: nothing is asked of anybody.
54
54
  *
55
- * The same address on every network — an account has one wallet, and which chain it is looked up
56
- * on is a separate question from what it is called.
55
+ * The same address on every network — a wallet is the same wallet on every chain, and which chain
56
+ * it is looked up on is a separate question from what it is called.
57
57
  */
58
- export declare function walletAddress(code: string): Promise<string>;
58
+ export declare function walletAddress(code: string, index?: number): Promise<string>;
59
59
  /**
60
60
  * The engine functions this module uses. Narrowed to the one it actually calls.
61
61
  *
@@ -73,7 +73,7 @@ export type WalletGlue = Pick<CryptoGlue, "wallet_seed_for">;
73
73
  * engine expands from it — are wiped before it returns, on the failing path as well as the
74
74
  * good one. Neither one leaves.
75
75
  */
76
- export declare function addressFromDerived(glue: WalletGlue, derived: Uint8Array): string;
76
+ export declare function addressFromDerived(glue: WalletGlue, derived: Uint8Array, index?: number): string;
77
77
  /**
78
78
  * How much of one coin an address holds, exactly as the chain reported it — or why nobody knows.
79
79
  *
package/dist/wallet.js CHANGED
@@ -19,16 +19,16 @@ import { assertUsableCode } from "./account.js";
19
19
  import { DERIVED, loadCrypto } from "./crypto.js";
20
20
  import { NmtsError } from "./errors.js";
21
21
  /**
22
- * The wallet this NMTS key opens by itself.
22
+ * The wallet this NMTS key opens by itself, when nobody has said which one.
23
23
  *
24
- * ⛔ IT IS WALLET 0 BECAUSE THAT IS THE ONE THE BROWSER OPENS. Every wallet, including this one,
25
- * comes out of `wallet_seed_for` — there is no special case for the first — so the index is the
26
- * whole of the difference between "the account's wallet" and somebody else's.
24
+ * ⛔ IT IS WALLET 0 BECAUSE THAT IS THE ONE EVERY ACCOUNT STARTS WITH. Every wallet, including this
25
+ * one, comes out of `wallet_seed_for` — there is no special case for the first — so the index is
26
+ * the whole of the difference between one wallet of this key and another.
27
27
  *
28
- * EXPORTED SO THE SIGNER CANNOT PICK ITS OWN. `extend-sign.ts` derives a keypair from the same
29
- * root and has to reach the SAME wallet as the address printed here; a second literal `0` over
30
- * there would be a second answer to a question with one right one, and the failure is silent —
31
- * a signature from an address nobody funded. `extend-sign.test.ts` compares the two.
28
+ * IT IS THE OFFLINE ANSWER, NOT THE PAYING ONE (2026-09-16). `nmts wallet address` asks
29
+ * nothing of anybody and so cannot know which wallet the account pays from; every command that
30
+ * SPENDS reads that number out of the sealed file list first (`wallet-pay-index.ts`) and refuses
31
+ * rather than falling back here — paying from the wrong wallet is not a thing to guess at.
32
32
  */
33
33
  export const BUILT_IN_WALLET_INDEX = 0;
34
34
  /**
@@ -83,12 +83,12 @@ export function addressFromSeed(seed) {
83
83
  return Ed25519Keypair.fromSecretKey(seed).toSuiAddress();
84
84
  }
85
85
  /**
86
- * The address of the wallet this NMTS key derives. Offline: nothing is asked of anybody.
86
+ * The address of one of the wallets this NMTS key derives. Offline: nothing is asked of anybody.
87
87
  *
88
- * The same address on every network — an account has one wallet, and which chain it is looked up
89
- * on is a separate question from what it is called.
88
+ * The same address on every network — a wallet is the same wallet on every chain, and which chain
89
+ * it is looked up on is a separate question from what it is called.
90
90
  */
91
- export async function walletAddress(code) {
91
+ export async function walletAddress(code, index = BUILT_IN_WALLET_INDEX) {
92
92
  // ⛔ The one refusal text for a malformed code lives in `account.ts`. Checking here means a typo
93
93
  // fails the same way it fails everywhere else in this tool rather than as an engine error.
94
94
  await assertUsableCode(code);
@@ -108,7 +108,7 @@ export async function walletAddress(code) {
108
108
  // everything sliced out of it, on the failing paths as well as the good one.
109
109
  const derived = glue.kdf_derive(bytes);
110
110
  try {
111
- return addressFromDerived(glue, derived);
111
+ return addressFromDerived(glue, derived, index);
112
112
  }
113
113
  finally {
114
114
  derived.fill(0);
@@ -123,12 +123,12 @@ export async function walletAddress(code) {
123
123
  * engine expands from it — are wiped before it returns, on the failing path as well as the
124
124
  * good one. Neither one leaves.
125
125
  */
126
- export function addressFromDerived(glue, derived) {
126
+ export function addressFromDerived(glue, derived, index = BUILT_IN_WALLET_INDEX) {
127
127
  const [from, to] = DERIVED.walletRoot;
128
128
  const root = derived.slice(from, to);
129
129
  let seed = null;
130
130
  try {
131
- seed = glue.wallet_seed_for(root, BUILT_IN_WALLET_INDEX);
131
+ seed = glue.wallet_seed_for(root, index);
132
132
  return addressFromSeed(seed);
133
133
  }
134
134
  finally {
@@ -1,12 +1,26 @@
1
1
  # nmts wallet — the wallet your NMTS key derives
2
2
 
3
3
  Commands: wallet
4
- Tiers: wallet=none · wallet.send=high(wallet) · wallet.swap=high(wallet) · wallet.donate=high(donate) · wallet.storage.reshape=high(wallet) · wallet.storage.give=high(wallet) · wallet.hall=none · wallet.hall.set=medium
4
+ Tiers: wallet=none · wallet.use=low · wallet.send=high(wallet) · wallet.swap=high(wallet) · wallet.donate=high(donate) · wallet.storage.reshape=high(wallet) · wallet.storage.give=high(wallet) · wallet.hall=none · wallet.hall.set=medium
5
5
 
6
6
  `wallet` shows the address and its SUI and WAL balances; `wallet address` derives the address
7
- offline (`--qr` draws it); `wallet activity` lists recent transactions, named only where the chain
8
- proves it; `wallet storage` lists storage resources (size × time) held outside any file. None of
9
- these signs.
7
+ offline (`--qr` draws it, `--index N` derives another of this key's wallets); `wallet activity`
8
+ lists recent transactions, named only where the chain proves it; `wallet storage` lists storage
9
+ resources (size × time) held outside any file. None of these signs.
10
+
11
+ ## One key, many wallets
12
+
13
+ Your NMTS key derives a wallet at every number from 0 upwards, and one of them pays. `wallet list`
14
+ walks them — it shows each number, its address and its balances, marks the one that pays, and stops
15
+ after twenty unused wallets in a row. `wallet use <number>` moves which one pays: the number is
16
+ kept inside your sealed file list, so the browser, this tool and every other device agree on it.
17
+ Numbers come from the key, so a wallet cannot be deleted, and a wallet you leave keeps whatever is
18
+ in it.
19
+
20
+ `put`, `push`, `extend`, `wallet send` and `wallet donate` all pay from that wallet, and each takes
21
+ `--wallet <number>` to pay from a different one for that run only, without changing the setting.
22
+ ⛔ If the file list cannot be read, they refuse rather than falling back to wallet 0 — paying from
23
+ a wallet nobody chose is not a thing to guess at.
10
24
 
11
25
  ## Where SUI comes from, and why it is SUI
12
26
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needmoretruth/nmts-cli",
3
- "version": "0.34.4",
3
+ "version": "0.35.0",
4
4
  "description": "Command-line and MCP access to NMTS (NeedMoreTruthStorage, https://nmts.me): open-source, end-to-end encrypted storage on the Walrus network. No fee to NMTS; you pay the network from your own wallet. For people and for their agents.",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {