@needmoretruth/nmts-cli 0.52.0 → 0.52.2

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,21 @@
3
3
  Each version's entry is what changed for the person or the program using `nmts`. The product's own
4
4
  update history, which covers the site and the server too, is at https://nmts.me/updates.
5
5
 
6
+ ## 0.52.2 — 2026-11-07
7
+
8
+ - `nmts wallet activity` and `nmts wallet list` still failed on a node that keeps fewer checkpoints
9
+ than 0.52.1 skipped above its lowest one (Suiscan's testnet node keeps about 13 seconds): the node
10
+ refused that start as above its newest checkpoint. The read now starts in the middle of such a
11
+ node's range, and when no start is accepted (Suiscan's testnet servers disagree by more than their
12
+ range) the older history comes from Sui's GraphQL service instead of the command failing.
13
+
14
+ ## 0.52.1 — 2026-11-07
15
+
16
+ - `nmts wallet activity` and `nmts wallet list` failed on mainnet from about 5 November: the Sui
17
+ nodes now refuse a transaction query that starts at the first checkpoint, and that refusal stopped
18
+ the command before Sui's GraphQL service was asked for the older history. A refused query is now
19
+ asked again from just inside the node's range, and the older history comes from GraphQL as before.
20
+
6
21
  ## 0.52.0 — 2026-10-24
7
22
 
8
23
  - `nmts` talks to Sui over gRPC-web instead of JSON-RPC, which Sui retired in October 2026. The
package/README.ko.md CHANGED
@@ -50,7 +50,7 @@ nmts --help
50
50
 
51
51
  ```sh
52
52
  npm install -g github:needmoretruth/nmts-cli # 기본 브랜치
53
- npm install -g github:needmoretruth/nmts-cli#v0.52.0 # 버전을 고정할 때
53
+ npm install -g github:needmoretruth/nmts-cli#v0.52.2 # 버전을 고정할 때
54
54
  npm install -g https://github.com/needmoretruth/nmts-cli/releases/latest/download/nmts.tgz
55
55
  ```
56
56
 
package/README.md CHANGED
@@ -51,7 +51,7 @@ default branch, from a pinned version, or from the tarball attached to the
51
51
 
52
52
  ```sh
53
53
  npm install -g github:needmoretruth/nmts-cli # the default branch
54
- npm install -g github:needmoretruth/nmts-cli#v0.52.0 # a pinned version
54
+ npm install -g github:needmoretruth/nmts-cli#v0.52.2 # a pinned version
55
55
  npm install -g https://github.com/needmoretruth/nmts-cli/releases/latest/download/nmts.tgz
56
56
  ```
57
57
 
@@ -11,7 +11,7 @@ export declare const CRYPTO_SPEC_URL = "https://github.com/needmoretruth/nmts-re
11
11
  * is the field's own contract — what the writer says about itself — and a person holding two
12
12
  * copies of one account's artefacts can then tell which program made each.
13
13
  */
14
- export declare const WRITTEN_BY = "nmts-cli 0.52.0";
14
+ export declare const WRITTEN_BY = "nmts-cli 0.52.2";
15
15
  /** Which of the three artefacts a wrapper is. A reader holding several can sort them. */
16
16
  export type ArtifactKind = "recovery-list" | "file-list" | "recovery-kit";
17
17
  /**
@@ -7,5 +7,5 @@ export type ClientKind = "cli" | "mcp" | "sdk";
7
7
  * points with `"sdk"` and the SDK's own version.
8
8
  */
9
9
  export declare function identifyClient(next: ClientKind, nextVersion?: string): void;
10
- /** `cli/0.52.0`, `mcp/0.52.0`, `sdk/0.17.0`. */
10
+ /** `cli/0.52.2`, `mcp/0.52.2`, `sdk/0.17.0`. */
11
11
  export declare function clientHeaderValue(): string;
package/dist/client-id.js CHANGED
@@ -24,7 +24,7 @@ export function identifyClient(next, nextVersion = VERSION) {
24
24
  kind = next;
25
25
  version = nextVersion;
26
26
  }
27
- /** `cli/0.52.0`, `mcp/0.52.0`, `sdk/0.17.0`. */
27
+ /** `cli/0.52.2`, `mcp/0.52.2`, `sdk/0.17.0`. */
28
28
  export function clientHeaderValue() {
29
29
  return `${kind}/${version}`;
30
30
  }
package/dist/product.d.ts CHANGED
@@ -9,7 +9,7 @@ export declare const BINARY_NAME = "nmts";
9
9
  * beside it. Here rather than in `main.ts` because the MCP server has to say it too, and a
10
10
  * command importing the entry point is a cycle waiting to bite.
11
11
  */
12
- export declare const VERSION = "0.52.0";
12
+ export declare const VERSION = "0.52.2";
13
13
  /** Where the product lives, for messages that need to send somebody somewhere real. */
14
14
  export declare const HOME_URL = "https://nmts.me";
15
15
  /** The source, so a person holding only the built program can find what it was built from. */
package/dist/product.js CHANGED
@@ -18,7 +18,7 @@ export const BINARY_NAME = "nmts";
18
18
  * beside it. Here rather than in `main.ts` because the MCP server has to say it too, and a
19
19
  * command importing the entry point is a cycle waiting to bite.
20
20
  */
21
- export const VERSION = "0.52.0";
21
+ export const VERSION = "0.52.2";
22
22
  /** Where the product lives, for messages that need to send somebody somewhere real. */
23
23
  export const HOME_URL = "https://nmts.me";
24
24
  /** The source, so a person holding only the built program can find what it was built from. */
@@ -20,6 +20,26 @@ export type DeeperHistory = (address: string, limit: number, signal?: AbortSigna
20
20
  * here leaves the answer `complete: false`, never "nothing there".
21
21
  */
22
22
  export declare const SUI_GRAPHQL_URLS: Readonly<Record<"mainnet" | "testnet", string>>;
23
+ /**
24
+ * How far above a node's lowest checkpoint a read starts, at most. Mainnet seals about four
25
+ * checkpoints a second, so 20,000 is over an hour of pruning before the start falls out of the window
26
+ * again. A node whose whole window is shorter (Suiscan's testnet node held 54 checkpoints, about
27
+ * 13 seconds, on 2026-11-07) refuses that start as above its top and names the top; the start is then
28
+ * the middle of the window it named. Same rule as the chain service's gift reader.
29
+ */
30
+ export declare const WINDOW_MARGIN = 20000n;
31
+ /**
32
+ * The checkpoint a node's window ends below, read from its refusal of a start above it, or `null`
33
+ * for any other error. Suiscan and Mysten Labs answered `requested data above latest available;
34
+ * start_checkpoint is <s>, and only checkpoints below <n> are available` on 2026-11-07.
35
+ */
36
+ export declare function highestAvailable(e: unknown): bigint | null;
37
+ /**
38
+ * The lowest checkpoint a node said it holds, read from its refusal, or `null` for any other error.
39
+ * Suiscan and Mysten Labs both answered `requested data below earliest available; lowest available
40
+ * checkpoint is <n>` on 2026-11-07.
41
+ */
42
+ export declare function lowestAvailable(e: unknown): bigint | null;
23
43
  /**
24
44
  * The newest transactions that moved `address`'s state, newest first.
25
45
  *
@@ -20,6 +20,14 @@
20
20
  // filter back to 2023 on both networks; its rows are read by the SAME parser as the node's (its
21
21
  // `transactionJson` and `balanceChangesJson` are the gRPC messages written as JSON).
22
22
  //
23
+ // ⛔ A REQUEST WITHOUT A START IS REFUSED (measured 2026-11-07). Without `startCheckpoint` a scan
24
+ // starts at genesis, and since about 2026-11-05 Suiscan and Mysten Labs refuse that ("requested data
25
+ // below earliest available; lowest available checkpoint is <n>"), which failed every wallet walk and
26
+ // activity list before the deeper source was asked. A refused read is sent again from just above the
27
+ // floor it names (or, when the node holds fewer checkpoints than the margin and refuses that as above
28
+ // its top, from the middle of the window), the window is remembered per network, and the scan ends
29
+ // at that start: what lies below it is the deeper source's to answer.
30
+ //
23
31
  // ⛔ A SCAN THAT STOPPED SHORT IS NOT "NOTHING THERE". The node also bounds how much of its index one
24
32
  // request reads; a request can end with fewer items than asked — even none — and say it stopped
25
33
  // because of that bound (`SCAN_LIMIT`). This file follows the cursor for a bounded number of
@@ -41,6 +49,76 @@ export const SUI_GRAPHQL_URLS = {
41
49
  };
42
50
  /** How many requests one question may take before it answers with what it has. */
43
51
  const MAX_REQUESTS = 8;
52
+ /**
53
+ * How far above a node's lowest checkpoint a read starts, at most. Mainnet seals about four
54
+ * checkpoints a second, so 20,000 is over an hour of pruning before the start falls out of the window
55
+ * again. A node whose whole window is shorter (Suiscan's testnet node held 54 checkpoints, about
56
+ * 13 seconds, on 2026-11-07) refuses that start as above its top and names the top; the start is then
57
+ * the middle of the window it named. Same rule as the chain service's gift reader.
58
+ */
59
+ export const WINDOW_MARGIN = 20000n;
60
+ /** Refusals answered by moving the start before the read counts as failed (floor, top, one stale floor). */
61
+ const MAX_WINDOW_RETRIES = 3;
62
+ // Per network (or per client when it names none, as a test's fake does), so a page that asks many
63
+ // times pays the refusals once. Hosts of one network share it: a floor too low for another host is
64
+ // refused and corrected, and half the shortest span is inside every host's window.
65
+ const windowByNetwork = new Map();
66
+ const windowByClient = new WeakMap();
67
+ function networkOf(client) {
68
+ return "network" in client && typeof client.network === "string" ? client.network : undefined;
69
+ }
70
+ function knownWindow(client) {
71
+ const network = networkOf(client);
72
+ return network === undefined ? windowByClient.get(client) : windowByNetwork.get(network);
73
+ }
74
+ function rememberWindow(client, window) {
75
+ const network = networkOf(client);
76
+ if (network === undefined)
77
+ windowByClient.set(client, window);
78
+ else
79
+ windowByNetwork.set(network, window);
80
+ }
81
+ /** Where a read starts inside what is known of the window; `undefined` (genesis) until a refusal said. */
82
+ function startInside(window) {
83
+ if (window === undefined)
84
+ return undefined;
85
+ const half = window.span === null ? WINDOW_MARGIN : window.span / 2n;
86
+ return window.floor + (half < WINDOW_MARGIN ? half : WINDOW_MARGIN);
87
+ }
88
+ /** Learns from a window refusal and says whether it was one; any other error teaches nothing. */
89
+ function learnWindow(client, e) {
90
+ const known = knownWindow(client);
91
+ const lowest = lowestAvailable(e);
92
+ if (lowest !== null) {
93
+ rememberWindow(client, { floor: lowest, span: known?.span ?? null });
94
+ return true;
95
+ }
96
+ const below = highestAvailable(e);
97
+ if (below === null || known === undefined)
98
+ return false;
99
+ rememberWindow(client, { floor: known.floor, span: below > known.floor ? below - known.floor : 1n });
100
+ return true;
101
+ }
102
+ /**
103
+ * The checkpoint a node's window ends below, read from its refusal of a start above it, or `null`
104
+ * for any other error. Suiscan and Mysten Labs answered `requested data above latest available;
105
+ * start_checkpoint is <s>, and only checkpoints below <n> are available` on 2026-11-07.
106
+ */
107
+ export function highestAvailable(e) {
108
+ const message = e instanceof Error ? e.message : typeof e === "string" ? e : "";
109
+ const found = /only checkpoints below (\d{1,20}) are available/.exec(message);
110
+ return found === null || found[1] === undefined ? null : BigInt(found[1]);
111
+ }
112
+ /**
113
+ * The lowest checkpoint a node said it holds, read from its refusal, or `null` for any other error.
114
+ * Suiscan and Mysten Labs both answered `requested data below earliest available; lowest available
115
+ * checkpoint is <n>` on 2026-11-07.
116
+ */
117
+ export function lowestAvailable(e) {
118
+ const message = e instanceof Error ? e.message : typeof e === "string" ? e : "";
119
+ const found = /lowest available checkpoint is (\d{1,20})/.exec(message);
120
+ return found === null || found[1] === undefined ? null : BigInt(found[1]);
121
+ }
44
122
  /** The fields the parser reads for `{ transaction, balanceChanges }` (the SDK's own read mask, by name). */
45
123
  const READ_MASK = [
46
124
  "digest",
@@ -59,41 +137,62 @@ async function recentTransactions(client, address, limit, signal) {
59
137
  const transactions = [];
60
138
  let before;
61
139
  for (let request = 0; request < MAX_REQUESTS; request += 1) {
62
- const call = client.ledgerService.listTransactions({
63
- readMask: { paths: READ_MASK },
64
- filter: {
65
- terms: [
66
- {
67
- literals: [
68
- { negated: false, predicate: { oneofKind: "affectedAddress", affectedAddress: { address } } },
69
- ],
70
- },
71
- ],
72
- },
73
- options: {
74
- limit: limit - transactions.length,
75
- ordering: GrpcTypes.Ordering.DESCENDING,
76
- ...(before === undefined ? {} : { before }),
77
- },
78
- }, signal === undefined ? {} : { abort: signal });
79
140
  let frontier;
80
141
  let reachedCheckpoint;
81
142
  let reason;
82
- for await (const frame of call.responses) {
83
- if (frame.watermark?.cursor !== undefined)
84
- frontier = frame.watermark.cursor;
85
- if (frame.watermark?.checkpoint !== undefined)
86
- reachedCheckpoint = frame.watermark.checkpoint;
87
- if (frame.transaction !== undefined && transactions.length < limit) {
88
- const parsed = parseGrpcTransactionResponse(frame.transaction, {
89
- include: { transaction: true, balanceChanges: true },
90
- });
91
- const tx = parsed.Transaction ?? parsed.FailedTransaction;
92
- if (tx !== undefined)
93
- transactions.push(tx);
143
+ for (let attempt = 0;; attempt += 1) {
144
+ const startCheckpoint = startInside(knownWindow(client));
145
+ // Rows of one attempt are kept only if the attempt finishes: a refusal mid-stream adds nothing.
146
+ const rows = [];
147
+ frontier = undefined;
148
+ reachedCheckpoint = undefined;
149
+ reason = undefined;
150
+ try {
151
+ const call = client.ledgerService.listTransactions({
152
+ ...(startCheckpoint === undefined ? {} : { startCheckpoint }),
153
+ readMask: { paths: READ_MASK },
154
+ filter: {
155
+ terms: [
156
+ {
157
+ literals: [
158
+ { negated: false, predicate: { oneofKind: "affectedAddress", affectedAddress: { address } } },
159
+ ],
160
+ },
161
+ ],
162
+ },
163
+ options: {
164
+ limit: limit - transactions.length,
165
+ ordering: GrpcTypes.Ordering.DESCENDING,
166
+ ...(before === undefined ? {} : { before }),
167
+ },
168
+ }, signal === undefined ? {} : { abort: signal });
169
+ for await (const frame of call.responses) {
170
+ if (frame.watermark?.cursor !== undefined)
171
+ frontier = frame.watermark.cursor;
172
+ if (frame.watermark?.checkpoint !== undefined)
173
+ reachedCheckpoint = frame.watermark.checkpoint;
174
+ if (frame.transaction !== undefined && transactions.length + rows.length < limit) {
175
+ const parsed = parseGrpcTransactionResponse(frame.transaction, {
176
+ include: { transaction: true, balanceChanges: true },
177
+ });
178
+ const tx = parsed.Transaction ?? parsed.FailedTransaction;
179
+ if (tx !== undefined)
180
+ rows.push(tx);
181
+ }
182
+ if (frame.end !== undefined)
183
+ reason = frame.end.reason;
184
+ }
185
+ transactions.push(...rows);
186
+ break;
187
+ }
188
+ catch (e) {
189
+ if (!learnWindow(client, e))
190
+ throw e;
191
+ // ⛔ A window no start can hit (Suiscan's testnet replicas disagreed by more than its 54
192
+ // checkpoints, 2026-11-07) leaves the node nothing to give, as when it stopped at its edge.
193
+ if (attempt >= MAX_WINDOW_RETRIES)
194
+ return { transactions, fromGenesis: false };
94
195
  }
95
- if (frame.end !== undefined)
96
- reason = frame.end.reason;
97
196
  }
98
197
  if (transactions.length >= limit)
99
198
  return { transactions, fromGenesis: true };
@@ -11,7 +11,7 @@ export interface SignedTransaction {
11
11
  /**
12
12
  * The wallet that pays, from outside this tool.
13
13
  *
14
- * ⚠ THE SHAPE IS THE WALLET STANDARD'S, so a page hands over what `useSignTransaction()` gives it
14
+ * ⚠ THE SHAPE IS THE WALLET STANDARD'S, so a page hands over what `useDAppKit().signTransaction()` gives it
15
15
  * and a server hands over whatever signs for the person whose storage this is.
16
16
  */
17
17
  export interface ExternalPayer {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@needmoretruth/nmts-cli",
3
- "version": "0.52.0",
3
+ "version": "0.52.2",
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": {
package/server.json CHANGED
@@ -6,13 +6,13 @@
6
6
  "url": "https://github.com/needmoretruth/nmts-cli",
7
7
  "source": "github"
8
8
  },
9
- "version": "0.52.0",
9
+ "version": "0.52.2",
10
10
  "packages": [
11
11
  {
12
12
  "registryType": "npm",
13
13
  "registryBaseUrl": "https://registry.npmjs.org",
14
14
  "identifier": "@needmoretruth/nmts-cli",
15
- "version": "0.52.0",
15
+ "version": "0.52.2",
16
16
  "transport": {
17
17
  "type": "stdio"
18
18
  },