@needmoretruth/nmts-cli 0.54.2 → 0.55.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 (41) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.ko.md +1 -1
  3. package/README.md +1 -1
  4. package/dist/artifact-about.d.ts +1 -1
  5. package/dist/commands/push.js +1 -1
  6. package/dist/commands/put-wallet.js +1 -1
  7. package/dist/commands/put.js +1 -1
  8. package/dist/manifest.js +3 -0
  9. package/dist/node-read.d.ts +2 -0
  10. package/dist/node-read.js +24 -0
  11. package/dist/product.d.ts +1 -1
  12. package/dist/product.js +1 -1
  13. package/dist/read-race.d.ts +35 -0
  14. package/dist/read-race.js +91 -0
  15. package/dist/road-hosts.generated.d.ts +4 -0
  16. package/dist/road-hosts.generated.js +284 -0
  17. package/dist/shared/lib/upload/wallet-storage-estimate.d.ts +16 -0
  18. package/dist/shared/lib/upload/wallet-storage-estimate.js +44 -0
  19. package/dist/shared/lib/wallet/graphql-history.d.ts +7 -2
  20. package/dist/shared/lib/wallet/graphql-history.js +7 -2
  21. package/dist/shared/lib/walrus/credit-tip.d.ts +24 -0
  22. package/dist/shared/lib/walrus/credit-tip.js +61 -0
  23. package/dist/shared/lib/walrus/node-certificate.d.ts +18 -0
  24. package/dist/shared/lib/walrus/node-certificate.js +77 -0
  25. package/dist/shared/lib/walrus/node-quorum.d.ts +17 -0
  26. package/dist/shared/lib/walrus/node-quorum.js +103 -0
  27. package/dist/shared/lib/walrus/tip-config.d.ts +33 -0
  28. package/dist/shared/lib/walrus/tip-config.js +68 -0
  29. package/dist/upload-road.d.ts +26 -4
  30. package/dist/upload-road.js +79 -17
  31. package/dist/upload-steps.js +1 -0
  32. package/dist/upload-wallet-chain.d.ts +1 -1
  33. package/dist/upload-wallet-chain.js +11 -4
  34. package/dist/upload-wallet.js +1 -0
  35. package/dist/upload-wire.d.ts +5 -0
  36. package/dist/upload.js +3 -3
  37. package/dist/walrus-write.js +68 -3
  38. package/dist/walrus.d.ts +20 -4
  39. package/dist/walrus.js +115 -36
  40. package/package.json +1 -1
  41. package/server.json +2 -2
package/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
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.55.0 — 2026-11-10
7
+
8
+ - Uploads (`put`, `push`) keep working when every company's upload relay is down. The order is now
9
+ Mysten Labs' relay, then Studio Mirai's relay, then the Walrus storage nodes straight from this
10
+ machine, and NMTS's own relay last. On the direct road the tool encodes the file itself and sends
11
+ about five times its size, with no relay fee; it stops once the storage nodes holding enough of
12
+ the network's shards have confirmed, which is the rule the chain checks.
13
+ - Uploads paid with credits can now go through Studio Mirai's relay too, but only while its fee for
14
+ that upload is at most three times Mysten Labs' fee; above that the upload goes to the storage nodes.
15
+ - `get` and the other downloads read the file from the storage nodes when no aggregator answers.
16
+ - Sui reads fall back to 01NODE and then PublicNode after Suiscan and Mysten Labs.
17
+
6
18
  ## 0.54.2 — 2026-11-09
7
19
 
8
20
  - When Mysten Labs' upload relay does not answer, uploads (`put`, `push`) now go through NMTS's own
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.54.2 # 버전을 고정할 때
53
+ npm install -g github:needmoretruth/nmts-cli#v0.55.0 # 버전을 고정할 때
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.54.2 # a pinned version
54
+ npm install -g github:needmoretruth/nmts-cli#v0.55.0 # 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.54.2";
14
+ export declare const WRITTEN_BY = "nmts-cli 0.55.0";
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
  /**
@@ -73,7 +73,7 @@ export async function push(target, options = {}) {
73
73
  const session = await openSession({ server: options.server, network: options.network });
74
74
  // ⛔ THE ROAD BEFORE THE PRICE (D50): on NMTS's own relay the parts are 64 MiB, and the credits
75
75
  // quoted below are the credits of those parts.
76
- await chooseUploadRoad({ network: session.network, server: session.server, apiKey: session.apiKey });
76
+ await chooseUploadRoad({ network: session.network, server: session.server, apiKey: session.apiKey, credit: true });
77
77
  const partSize = partSizeForRoad(partSizeFor(options.partSize));
78
78
  // ⛔ READ BEFORE ANYTHING IS SEALED OR PAID FOR — a typo must not surface after the money.
79
79
  const asked = parseAsked(options.onCollision);
@@ -63,7 +63,7 @@ export async function putWithWallet(target, options) {
63
63
  const network = resolveNetwork(server, options.network ?? stored?.network);
64
64
  // ⛔ THE ROAD BEFORE THE PRICE (D50): on NMTS's own relay the parts are 64 MiB, and the credits
65
65
  // quoted below are the credits of those parts.
66
- await chooseUploadRoad({ network, server, apiKey: key.key });
66
+ await chooseUploadRoad({ network, server, apiKey: key.key, otherCompanies: true });
67
67
  const identity = await identityOf(resolved.code);
68
68
  const crypt = await loadCrypto();
69
69
  const asked = parseAsked(options.onCollision);
@@ -109,7 +109,7 @@ export async function put(target, options = {}) {
109
109
  const network = resolveNetwork(server, options.network ?? stored?.network);
110
110
  // ⛔ THE ROAD BEFORE THE PRICE (D50): on NMTS's own relay the parts are 64 MiB, and the credits
111
111
  // quoted below are the credits of those parts.
112
- await chooseUploadRoad({ network, server, apiKey: key.key });
112
+ await chooseUploadRoad({ network, server, apiKey: key.key, credit: true });
113
113
  const partSize = partSizeForRoad(partSizeFor(options.partSize));
114
114
  const identity = await identityOf(resolved.code);
115
115
  const crypt = await loadCrypto();
package/dist/manifest.js CHANGED
@@ -225,6 +225,9 @@ export async function readFileList(base, apiKey, accountCode, accountId) {
225
225
  "account sealed. Nothing was changed.",
226
226
  });
227
227
  }
228
+ // ⛔ The index is packed with zstd whenever the writer had the codec, and this is the first read
229
+ // in a fresh process: the codec registers here, before the index, not only in `openChunks`.
230
+ await host().zstd.register();
228
231
  const doc = await decodeFileList(body);
229
232
  body.fill(0);
230
233
  const io = { server: base, apiKey, accountId, crypt, key };
@@ -0,0 +1,2 @@
1
+ /** One blob, or one file inside a quilt, read and decoded from the storage nodes. */
2
+ export declare function readFromNodes(network: string, kind: "blob" | "patch", id: string): Promise<Uint8Array>;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Reading straight from the Walrus storage nodes: the last road for a download (D51, 2026-11-09).
3
+ *
4
+ * ⛔ WHY. Every read went through an aggregator, a company's server that asks the nodes for you. On
5
+ * the day none of them answers, a file is still on the nodes; this asks them itself, through the
6
+ * same SDK the uploads use, and decodes the blob here. It is slower and asks many hosts (one per
7
+ * shard holder), so it runs only after every aggregator failed for a reason other than "not found".
8
+ *
9
+ * ⛔ IN ITS OWN FILE, LOADED ONLY WHEN NEEDED. The SDK and its encoder are large; a `get` that an
10
+ * aggregator served never loads them.
11
+ */
12
+ import { walrus } from "@mysten/walrus";
13
+ import { reachFetch } from "./reach.js";
14
+ import { suiClient } from "./sui-rpc.js";
15
+ /** One blob, or one file inside a quilt, read and decoded from the storage nodes. */
16
+ export async function readFromNodes(network, kind, id) {
17
+ const client = suiClient(network === "mainnet" ? "mainnet" : "testnet").$extend(walrus({ storageNodeClientOptions: { fetch: reachFetch } }));
18
+ if (kind === "blob")
19
+ return client.walrus.readBlob({ blobId: id });
20
+ const [file] = await client.walrus.getFiles({ ids: [id] });
21
+ if (file === undefined)
22
+ throw new Error(`the storage nodes returned nothing for ${id}`);
23
+ return file.bytes();
24
+ }
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.54.2";
12
+ export declare const VERSION = "0.55.0";
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.54.2";
21
+ export const VERSION = "0.55.0";
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. */
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Asking many aggregators for one object without paying a timeout per dead one (D51, 2026-11-09).
3
+ *
4
+ * ⛔ WHY. The read list became every aggregator in Walrus's operator registry that served the probe
5
+ * blob (dozens). Asked one after another, a dead first row cost its whole timeout before the second
6
+ * was asked. Here the first host is asked at once and the next when one fails or after `hedgeMs`
7
+ * with no answer; the first to send its headers wins, the others are cancelled, and only that one
8
+ * sends a body. A dead row costs `hedgeMs`, not a minute.
9
+ *
10
+ * ⛔ A HOST THAT DOES NOT ANSWER IS GIVEN UP AFTER `headerTimeoutMs`, so hanging rows cannot fill the
11
+ * in-flight cap for long. With every row hanging, the whole list is through in about
12
+ * (rows ÷ cap) × header timeout, and the storage nodes are asked after it (`walrus.ts`).
13
+ */
14
+ /** What one host said: the response to read, a 404, or something else. */
15
+ export type Reply = {
16
+ response: Response;
17
+ } | "not-found" | "failed";
18
+ export interface RaceOptions {
19
+ /** Ask the next host as well after this long with no answer. */
20
+ hedgeMs: number;
21
+ /** At most this many hosts waiting at once, hanging ones included. */
22
+ maxInFlight: number;
23
+ /** A host with no headers after this long is given up. */
24
+ headerTimeoutMs: number;
25
+ /** This many 404s and no other answer mean the object is not there. */
26
+ notFoundQuorum: number;
27
+ signal?: AbortSignal | undefined;
28
+ }
29
+ /**
30
+ * Race `hosts`. `ask` sends the request with the signal it is given and answers with the reply; the
31
+ * first reply carrying a response wins and is handed to `read`, which turns its body into the value.
32
+ * When `read` throws, that host counts as failed and the race goes on with the hosts not yet asked.
33
+ * Null when nobody gave a body (`tried` holds each host's reason).
34
+ */
35
+ export declare function raceHosts<T>(hosts: readonly string[], ask: (host: string, signal: AbortSignal) => Promise<Reply>, read: (host: string, response: Response) => Promise<T>, options: RaceOptions): Promise<T | null>;
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Asking many aggregators for one object without paying a timeout per dead one (D51, 2026-11-09).
3
+ *
4
+ * ⛔ WHY. The read list became every aggregator in Walrus's operator registry that served the probe
5
+ * blob (dozens). Asked one after another, a dead first row cost its whole timeout before the second
6
+ * was asked. Here the first host is asked at once and the next when one fails or after `hedgeMs`
7
+ * with no answer; the first to send its headers wins, the others are cancelled, and only that one
8
+ * sends a body. A dead row costs `hedgeMs`, not a minute.
9
+ *
10
+ * ⛔ A HOST THAT DOES NOT ANSWER IS GIVEN UP AFTER `headerTimeoutMs`, so hanging rows cannot fill the
11
+ * in-flight cap for long. With every row hanging, the whole list is through in about
12
+ * (rows ÷ cap) × header timeout, and the storage nodes are asked after it (`walrus.ts`).
13
+ */
14
+ /**
15
+ * Race `hosts`. `ask` sends the request with the signal it is given and answers with the reply; the
16
+ * first reply carrying a response wins and is handed to `read`, which turns its body into the value.
17
+ * When `read` throws, that host counts as failed and the race goes on with the hosts not yet asked.
18
+ * Null when nobody gave a body (`tried` holds each host's reason).
19
+ */
20
+ export function raceHosts(hosts, ask, read, options) {
21
+ return new Promise((resolve, reject) => {
22
+ const queue = [...hosts];
23
+ const live = new Map();
24
+ let notFound = 0;
25
+ let failed = 0;
26
+ let reading = false;
27
+ let done = false;
28
+ let hedge = null;
29
+ const settle = (fn) => {
30
+ if (done)
31
+ return;
32
+ done = true;
33
+ if (hedge)
34
+ clearTimeout(hedge);
35
+ for (const c of live.values())
36
+ c.abort();
37
+ live.clear();
38
+ fn();
39
+ };
40
+ options.signal?.addEventListener("abort", () => settle(() => reject(options.signal?.reason)), { once: true });
41
+ const next = () => {
42
+ if (done || reading)
43
+ return;
44
+ if (hedge)
45
+ clearTimeout(hedge);
46
+ hedge = null;
47
+ if (notFound >= options.notFoundQuorum && failed === 0)
48
+ return settle(() => resolve(null));
49
+ if (queue.length === 0) {
50
+ if (live.size === 0)
51
+ settle(() => resolve(null));
52
+ return;
53
+ }
54
+ if (live.size >= options.maxInFlight)
55
+ return;
56
+ const host = queue.shift() ?? "";
57
+ const controller = new AbortController();
58
+ live.set(host, controller);
59
+ const giveUp = setTimeout(() => controller.abort(new DOMException("no answer in time", "TimeoutError")), options.headerTimeoutMs);
60
+ void ask(host, controller.signal)
61
+ .catch(() => "failed")
62
+ .then((reply) => {
63
+ clearTimeout(giveUp);
64
+ live.delete(host);
65
+ if (done)
66
+ return;
67
+ if (reply === "not-found" || reply === "failed") {
68
+ if (reply === "not-found")
69
+ notFound++;
70
+ else
71
+ failed++;
72
+ return next();
73
+ }
74
+ // The first headers win: the others stop, and only this host sends a body.
75
+ reading = true;
76
+ if (hedge)
77
+ clearTimeout(hedge);
78
+ for (const c of live.values())
79
+ c.abort();
80
+ live.clear();
81
+ read(host, reply.response).then((value) => settle(() => resolve(value)), () => {
82
+ reading = false;
83
+ failed++;
84
+ next();
85
+ });
86
+ });
87
+ hedge = setTimeout(next, options.hedgeMs);
88
+ };
89
+ next();
90
+ });
91
+ }
@@ -0,0 +1,4 @@
1
+ /** Aggregators from Walrus's operator registry that served the probe blob to https://nmts.me, pinned first rows first, then fastest first. */
2
+ export declare const REGISTRY_AGGREGATORS: Readonly<Record<"testnet" | "mainnet", readonly string[]>>;
3
+ /** The live Walrus committee's storage nodes a https page can call — the last road for uploads and downloads. */
4
+ export declare const STORAGE_NODE_ORIGINS: Readonly<Record<"testnet" | "mainnet", readonly string[]>>;
@@ -0,0 +1,284 @@
1
+ // GENERATED by deploy/gen-roads.mjs on 2026-11-09 — do not edit by hand; run `node deploy/gen-roads.mjs --write`.
2
+ // The browser, its CSP (web/next.config.ts) and the command line read these same rows; the probe that
3
+ // chose them is deploy/roads/probe.json, and `node deploy/gen-roads.mjs --check` says when they drift.
4
+ /** Aggregators from Walrus's operator registry that served the probe blob to https://nmts.me, pinned first rows first, then fastest first. */
5
+ export const REGISTRY_AGGREGATORS = {
6
+ testnet: [
7
+ "https://aggregator.walrus-testnet.walrus.space",
8
+ "https://walrus-testnet-aggregator.nodeinfra.com",
9
+ "https://testnet-aggregator-walrus.kiliglab.io",
10
+ "https://aggregator.testnet.walrus.mirai.cloud",
11
+ "https://suiftly-testnet-agg.mhax.io",
12
+ "https://walrus-test-aggregator.thepassivetrust.com",
13
+ "https://aggregator.walrus.banansen.dev",
14
+ "https://walrus-testnet-aggregator.stakely.io",
15
+ "https://aggregator.walrus-testnet.h2o-nodes.com",
16
+ "https://walrus-aggregator-testnet.cetus.zone",
17
+ "https://aggregator.walrus-01.tududes.com",
18
+ "https://walrus-aggregator-testnet.haedal.xyz",
19
+ "https://walrus-testnet-aggregator.stakingdefenseleague.com",
20
+ "https://testnet.aggregator.walrus.silentvalidator.com",
21
+ "https://sui-walrus-tn-aggregator.bwarelabs.com",
22
+ "https://walrus-testnet-aggregator.chainbase.online",
23
+ "https://walrus-aggregator-testnet.staking4all.org",
24
+ "https://walrus-aggregator-testnet.n1stake.com",
25
+ "https://testnet-aggregator.walrus.graphyte.dev",
26
+ "https://walrus-testnet-aggregator.dzdaic.com",
27
+ "https://walrus-testnet-aggregator-1.zkv.xyz",
28
+ "https://walrus-agg-testnet.chainode.tech:9002",
29
+ "https://walrus-testnet-aggregator.redundex.com",
30
+ "https://walrus-testnet-aggregator.stakecraft.com",
31
+ "https://walrus-agg.testnet.obelisk.sh",
32
+ "https://walrus-testnet-aggregator.rpc101.org",
33
+ "https://walrus-testnet-aggregator.starduststaking.com",
34
+ "https://walrus-testnet-aggregator.nodes.guru",
35
+ "https://walrus-testnet.veera.com",
36
+ "https://walrus-tn.juicystake.io:9443",
37
+ "https://walrus-testnet.blockscope.net",
38
+ "https://walrus-testnet-aggregator.talentum.id",
39
+ "https://walrus-agg-test.bucketprotocol.io",
40
+ "https://walrus.testnet.aggregator.stakepool.dev.br",
41
+ "https://walrus-testnet-aggregator.luckyresearch.org",
42
+ "https://walrus-aggregator.thcloud.dev",
43
+ "https://walrusagg.testnet.pops.one",
44
+ ],
45
+ mainnet: [
46
+ "https://aggregator.walrus-mainnet.walrus.space",
47
+ "https://sui-walrus-mainnet-aggregator.bwarelabs.com",
48
+ "https://suiftly.mhax.io",
49
+ "https://mainnet-walrus-aggregator.kiliglab.io",
50
+ "https://aggregator.mainnet.walrus.mirai.cloud",
51
+ "https://walrus-aggregator.stakely.io",
52
+ "https://walrus-aggregator.thepassivetrust.com",
53
+ "https://walrus-main-aggregator.4everland.org",
54
+ "https://walrus-aggregator.natsai.xyz",
55
+ "https://aggregator.walrus.silentvalidator.com",
56
+ "https://aggregator.suicore.com",
57
+ "https://walrus-mainnet-aggregator.stakingdefenseleague.com",
58
+ "https://aggregator.walrus-mainnet.h2o-nodes.com",
59
+ "https://walrus-aggregator.chainbase.online",
60
+ "https://walmain.agg.chainflow.io",
61
+ "https://walrus-aggregator.n1stake.com",
62
+ "https://walrus-aggregator.starduststaking.com",
63
+ "https://walrus-aggregator-mainnet.chainode.tech:9002",
64
+ "https://mainnet-aggregator.walrus.graphyte.dev",
65
+ "https://aggregator.walrus-mainnet.tududes.com",
66
+ "https://walrus-aggregator.talentum.id",
67
+ "https://walrus-aggregator.staking4all.org",
68
+ "https://walrus-mainnet-aggregator.nami.cloud",
69
+ "https://walrus-mainnet-aggregator.dzdaic.com",
70
+ "https://walrus.prostaking.com:9443",
71
+ "https://walrus-mainnet-aggregator-1.zkv.xyz",
72
+ "https://walrus-mainnet-aggregator.stakecraft.com",
73
+ "https://walrus-mainnet-aggregator.imperator.co",
74
+ "https://walrus-mainnet-aggregator.crouton.digital",
75
+ "https://walrus-mainnet-aggregator.nodeinfra.com",
76
+ "https://walrus.aggregator.stakepool.dev.br",
77
+ "https://walrus-mainnet-aggregator.redundex.com",
78
+ "https://walrus-agg.mainnet.obelisk.sh",
79
+ "https://walrus.blockscope.net",
80
+ "https://walrus.globalstake.io",
81
+ "https://walrus-mainnet-aggregator.trusted-point.com",
82
+ "https://walrus.veera.com",
83
+ "https://walrus-mainnet-aggregator.rpc101.org",
84
+ "https://walrusagg.pops.one",
85
+ ],
86
+ };
87
+ /** The live Walrus committee's storage nodes a https page can call — the last road for uploads and downloads. */
88
+ export const STORAGE_NODE_ORIGINS = {
89
+ testnet: [
90
+ "https://walrus-01.tududes.com:9185",
91
+ "https://walrus-node.thcloud.dev:9185",
92
+ "https://lhr-tnt-sto-00.walrus-testnet.walrus.space:9185",
93
+ "https://walrus-testnet-storage.talentum.id:9185",
94
+ "https://testnet.walrus.node.interestlabs.io:9185",
95
+ "https://storage.testnet.walrus.mirai.cloud:9185",
96
+ "https://waltest.chainflow.io:9185",
97
+ "https://walrus-testnet.n1stake.com:9185",
98
+ "https://testnet-walrus.rockfin.io:9185",
99
+ "https://suiftly-testnet-node.mhax.io:9185",
100
+ "https://walrus-testnet-operator1.lithiumdigital.com:9185",
101
+ "https://chartreuse-ljubljana-3b884.walrus.bdnodes.net:9002",
102
+ "https://wal-t01.solsticestaking.net:9185",
103
+ "https://walrus-testnet.luckyresearch.org:9185",
104
+ "https://walrus-testnet-validator-md002.blockpi.me:9185",
105
+ "https://storage.testnet.sui.rpcpool.com:9185",
106
+ "https://walrus-testnet-storage-node-1.zkv.xyz:9285",
107
+ "https://walrus-node-testnet.haedal.xyz:9185",
108
+ "https://walrus01.validator.karrier.one:9185",
109
+ "https://walrus-testnet.imperator.co:9185",
110
+ "https://sn01.walrus.testnet.republiccrypto-runtime.com:9185",
111
+ "https://walrus-testnet.contributiondao.com:9185",
112
+ "https://walrus-storage-testnet.hashedpotatoes-sui.com:9185",
113
+ "https://walrus-storage-testnet.overclock.run:9185",
114
+ "https://ewr-tnt-sto-00.walrus-testnet.walrus.space:9185",
115
+ "https://walrus-testnet-storage.stakeme.pro:9185",
116
+ "https://walrus-testnet.citadel.one:9195",
117
+ "https://walrus-testnet-storage.stakecraft.com:9185",
118
+ "https://walrus-testnet.brightlystake.com:9185",
119
+ "https://walrus-node-testnet.cetus.zone:9185",
120
+ "https://walrus-testnet.h2o-nodes.com:9185",
121
+ "https://suilend-walrus-testnet.hanabi.so:9185",
122
+ "https://walrus-testnet.typus.finance:9185",
123
+ "https://storage.walrus.testnet.nodz.io:9185",
124
+ "https://dev-walrus.vol-047f616210f55794d.dev.stake.capital:9185",
125
+ "https://walrus-testnet.rpc101.org:9185",
126
+ "https://walrus-testnet-node.nami.cloud:9185",
127
+ "https://testnet-walrus.hoh.zone:9185",
128
+ "https://walrus-testnet-storage.stakin-nodes.com:9185",
129
+ "https://walrus-testnet-node.stakeengine.co.uk:9185",
130
+ "https://walrus-testnet.thepassivetrust.com:9185",
131
+ "https://testnet.walrus.piconbello.com:9185",
132
+ "https://walrus-testnet.senseinode.com:9185",
133
+ "https://walrus-testnet-storage.nodeinfra.com:9185",
134
+ "https://walrus-storage-testnet.scallop.io:9185",
135
+ "https://walrus-testnet.starduststaking.com:9185",
136
+ "https://walrus-testnet-node.stakely.io:9185",
137
+ "https://walrus1.dcentnetworks.nl:9185",
138
+ "https://walrus-test.astrostakers.com:9185",
139
+ "https://walrus-testnet.cosmostation.io:9185",
140
+ "https://walrus-testnet.redundex.com:9185",
141
+ "https://testnet-storage-walrus.kiliglab.io:9185",
142
+ "https://storage-node-walrus-1.test.piertwo.io.:9185",
143
+ "https://walrus-tn.juicystake.io:9185",
144
+ "https://walrus-testnet.crouton.digital:9185",
145
+ "https://walrus-testnet.lgns.xyz:9185",
146
+ "https://walrus-testnet.blockscope.net:9185",
147
+ "https://testnet.stakepool.dev.br:9185",
148
+ "https://walrus.nonprod.scw.chirpwireless.io:9185",
149
+ "https://testnet.storage.walrus.silentvalidator.com:9185",
150
+ "https://walrus-testnet.nodes.guru:9185",
151
+ "https://walrus-testnet.4pillars.info:9185",
152
+ "https://walrus-testnet-node.chainbase.online:9185",
153
+ "https://walrus.testnet.pops.one:9185",
154
+ "https://wal-storage-node-testnet.staketab.org:9185",
155
+ "https://walrus-storage-testnet.latitude-sui.com:9185",
156
+ "https://walrus-testnet.delightlabs.sh:9185",
157
+ "https://testnet-storage.walrus.graphyte.dev:9185",
158
+ "https://walrus-testnet.staking4all.org:9185",
159
+ "https://walrus-testnet-storage-node.rubynodes.io:9185",
160
+ "https://walrus-testnet-storage.trusted-point.com:9185",
161
+ "https://walrus-testnet.ntt-dg.com:9185",
162
+ "https://walrus.testnet.obelisk.sh:9185",
163
+ "https://walrus-storage.testnet.nelrann.org:9185",
164
+ "https://test-storage-node-walrus.inf-node.xyz:9185",
165
+ "https://sui-walrus-testnet.bwarelabs.com:9185",
166
+ "https://walrus-testnet.bucketprotocol.io:9185",
167
+ "https://storage.walrus.banansen.dev:9185",
168
+ "https://walrus-testnet-node.natsai.xyz:9185",
169
+ "https://testnet-walrus-storage.szns.solutions:9185",
170
+ "https://walrus-testnet.stakingdefenseleague.com:9185",
171
+ "https://walrus-testnet.auranode.xyz:9185",
172
+ "https://walrus-testnet.dzdaic.com:9185",
173
+ "https://testnet-walrus.globalstake.io:9185",
174
+ "https://eyl1-testnet.walrus.zeroservices.eu:9185",
175
+ "https://mia-tnt-sto-00.walrus-testnet.walrus.space:9185",
176
+ "https://uc1-tnt-sto-00.walrus-testnet.walrus.space:9185",
177
+ "https://walrus-testnet.proofgp.com:30000",
178
+ "https://walrus-testnet.sentio.xyz:9185",
179
+ "https://walrus-testnet.veera.com:9185",
180
+ "https://walrus-testnet.aftermath.finance:9185",
181
+ "https://walrus-testnet.suicore.com:9185",
182
+ "https://testnet-walrus01.tradeport.xyz:9185",
183
+ "https://walrus-testnet.cosmicvalidator.com:9185",
184
+ "https://walrus-storage.4everland.org:9185",
185
+ "https://walrus-testnet.chainode.tech:9185",
186
+ "https://walrus-testnet.equinoxdao.xyz:9185",
187
+ ],
188
+ mainnet: [
189
+ "https://walrus.blockscope.net:9185",
190
+ "https://walrus-mainnet.stakingdefenseleague.com:9185",
191
+ "https://walrus-mainnet-storage.stakeme.pro:9185",
192
+ "https://walmain.chainflow.io:9185",
193
+ "https://sn01.walrus.mainnet.republiccrypto-runtime.com:9185",
194
+ "https://storage-001.walrus.rockfinlabs.com:9185",
195
+ "https://walrus.suicore.com:9185",
196
+ "https://walrus-storage-node.rubynodes.io:9185",
197
+ "https://walrus-mainnet.aftermath.finance:9185",
198
+ "https://walrus.nodes.guru:9185",
199
+ "https://wal-storage-node-mainnet.staketab.org:9185",
200
+ "https://walrus.delightlabs.sh:9185",
201
+ "https://walrus.typus.finance:9185",
202
+ "https://walrus-main.astrostakers.com:9185",
203
+ "https://walrus-validator-md001.blockpi.me:9185",
204
+ "https://walrus.staking4all.org:9185",
205
+ "https://walrus-mainnet-operator1.lithiumdigital.com:9185",
206
+ "https://walrus-node-mainnet.ankr.com:9185",
207
+ "https://walrus-mainnet.tududes.com:9185",
208
+ "https://walrus01.validator.karrier.one:9185",
209
+ "https://suiftly-node.mhax.io:9185",
210
+ "https://storage.mainnet.sui.rpcpool.com:9185",
211
+ "https://walrus.brightlystake.com:9185",
212
+ "https://walrus-node.natsai.xyz:9185",
213
+ "https://walrus-mainnet.h2o-nodes.com:9185",
214
+ "https://walrus-node.stakely.io:9185",
215
+ "https://walrus.sentio.xyz:9185",
216
+ "https://walrus.globalstake.io:9185",
217
+ "https://walrus-mainnet-node.piertwo.io:9185",
218
+ "https://eyl1.walrus.zeroservices.eu:9185",
219
+ "https://walrus.vol-0e0c175f9734fdf77.prod.stake.capital:9185",
220
+ "https://walrus-mainnet.dzdaic.com:9185",
221
+ "https://walrus-mainnet.4pillars.info:9185",
222
+ "https://walrus-main.dcentnetworks.nl:9185",
223
+ "https://storage.walrus.mainnet.nodz.io:9185",
224
+ "https://walrus-storage.n1stake.com:9185",
225
+ "https://walrus.stakin-nodes.com:9185",
226
+ "https://walrus-main.bucketprotocol.io:9185",
227
+ "https://walrus.chainbase.online:9185",
228
+ "https://walrus-mainnet.luckyresearch.org:9185",
229
+ "https://walrus.piconbello.com:9185",
230
+ "https://walrus.prostaking.com:9185",
231
+ "https://walrus-mainnet-storage-node-1.zkv.xyz:9185",
232
+ "https://walrus.starduststaking.com:9185",
233
+ "https://walrus.thepassivetrust.com:9185",
234
+ "https://storage.walrus.nansen.ai:9185",
235
+ "https://walrus-mainnet.senseinode.com:9185",
236
+ "https://walrus-mainnet-storage.nodeinfra.com:9185",
237
+ "https://walrus-mainnet.citadel.one:9185",
238
+ "https://walrus-mainnet.redundex.com:9185",
239
+ "https://walrus.contributiondao.com:9185",
240
+ "https://walrus.mainnet.obelisk.sh:9185",
241
+ "https://wal-m01.solsticestaking.net:9185",
242
+ "https://ash-mnt-sto-01.walrus-mainnet.walrus.space:9185",
243
+ "https://walrus-mainnet.crouton.digital:9185",
244
+ "https://walrus-mainnet.imperator.co:9185",
245
+ "https://main-storage-node-walrus.inf-node.xyz:9185",
246
+ "https://walrus-storage.ntt.nodeops.ninja:9185",
247
+ "https://walrus-storage-mainnet.scallop.io:9185",
248
+ "https://walrus-mainnet.proofgp.com:31000",
249
+ "https://mainnet-walrus-storage.szns.solutions:9185",
250
+ "https://walrus-mainnet-node.stakeengine.co.uk:9185",
251
+ "https://walrus-mainnet.chainode.tech:9185",
252
+ "https://walrus-main-storage.4everland.org:9185",
253
+ "https://walrus.stakepool.dev.br:9185",
254
+ "https://walrus-node-mainnet.cetus.zone:9185",
255
+ "https://mainnet-storage.walrus.graphyte.dev:9185",
256
+ "https://walrus-mainnet-storage.stakecraft.com:9185",
257
+ "https://walrus-node-mainnet.haedal.xyz:9185",
258
+ "https://walrus-storage-mainnet.hashedpotatoes-sui.com:9185",
259
+ "https://storage.mainnet.walrus.mirai.cloud:9185",
260
+ "https://walrus-mainnet.rpc101.org:9185",
261
+ "https://walrus.pops.one:9185",
262
+ "https://sui-walrus-mainnet.bwarelabs.com:9185",
263
+ "https://walrus.prod.scw.chirpwireless.io:9185",
264
+ "https://walrus.auranode.xyz:9185",
265
+ "https://walrus-node.thcloud.ai:9185",
266
+ "https://walrus.equinoxdao.xyz:9185",
267
+ "https://walrus-storage-mainnet.overclock.run:9185",
268
+ "https://walrus-storage.talentum.id:9185",
269
+ "https://walrus.veera.com:9185",
270
+ "https://walrus-mainnet.cosmicvalidator.com:9185",
271
+ "https://walrus-storage-mainnet.latitude-sui.com:9195",
272
+ "https://walrus01.tradeport.xyz:9185",
273
+ "https://walrus.node.interestlabs.io:9185",
274
+ "https://suilend-walrus-mainnet.hanabi.so:9185",
275
+ "https://walrus-store.lgns.net:9185",
276
+ "https://storage.walrus.silentvalidator.com:9185",
277
+ "https://walrus-mainnet-storage.trusted-point.com:9185",
278
+ "https://mainnet-walrus.hoh.zone:9185",
279
+ "https://ash-mnt-sto-00.walrus-mainnet.walrus.space:9185",
280
+ "https://mainnet-walrus-storage.kiliglab.io:9185",
281
+ "https://walrus-storage.nelrann.org:9185",
282
+ "https://walrus-mainnet-node.nami.cloud:9185",
283
+ ],
284
+ };
@@ -0,0 +1,16 @@
1
+ /** Shards on the Walrus networks NMTS uses (mainnet and testnet both, measured 2026-09-03). */
2
+ export declare const N_SHARDS = 1000;
3
+ /** `encodedBlobLength` as the SDK computes it for RS2 encoding. */
4
+ export declare function encodedBlobLength(unencodedLength: number, nShards?: number): number;
5
+ export interface WalletStorageEstimate {
6
+ /** Raw bytes of the files in the batch. */
7
+ rawBytes: number;
8
+ /** What an empty blob already costs — the part every batch carries whatever is in it. */
9
+ fixedBytes: number;
10
+ /** Bytes the batch buys in total, coding and fixed part included. */
11
+ boughtBytes: number;
12
+ /** How much of what is bought is the fixed part — near 1 for one small file. */
13
+ fixedShare: number;
14
+ }
15
+ /** What one batch (one blob) buys for `rawBytes` of files. */
16
+ export declare function estimateWalletStorage(rawBytes: number): WalletStorageEstimate;
@@ -0,0 +1,44 @@
1
+ // What a small-file batch actually BUYS on the storage network when the person's own wallet pays
2
+ // for it: a file uploaded alone pays the fixed part of a blob by itself.
3
+ //
4
+ // THE PHYSICS, FROM THE SDK'S OWN ARITHMETIC. `@mysten/walrus` computes a blob's encoded length as
5
+ // metadata (n_shards × (n_shards × 32 × 2 + 32)) plus the slivers (RS2: (primary + secondary
6
+ // symbols) × symbol size × n_shards), and that function is not exported from the package index, so
7
+ // the same arithmetic is written here and pinned by test to the SDK's numbers at 1,000 shards:
8
+ // 0 B → 66,034,000 · 500 KiB → 68,036,000 · 1 MiB → 70,038,000 · 1 GiB → 4,888,852,000.
9
+ // So an empty blob already costs 63.0 MiB, a 500 KiB file alone 64.9 MiB, and 400 such files in
10
+ // one batch about 2.3 MiB each. The batch on the pending panel is ONE blob (a quilt), so the fixed
11
+ // part is paid once per press of the upload button, however many files are in it.
12
+ //
13
+ // ⛔ WALLET RAIL ONLY. On the credit rail the person pays for encrypted bytes at 1 credit per
14
+ // MiB·28 days and the treasury carries the coding and the fixed part, so this number
15
+ // would be false there. The panel shows this line only when the wallet is the chosen purse.
16
+ //
17
+ // ⚠ AN ESTIMATE, NOT THE QUOTE. The signed quote at register time is the price; this is the same
18
+ // arithmetic ahead of it so the person can change their mind before pressing. Both networks run
19
+ // 1,000 shards today; the count is a parameter so a move shows up as one number, not a rewrite.
20
+ const DIGEST_LEN = 32;
21
+ const BLOB_ID_LEN = 32;
22
+ /** Shards on the Walrus networks NMTS uses (mainnet and testnet both, measured 2026-09-03). */
23
+ export const N_SHARDS = 1_000;
24
+ /** `encodedBlobLength` as the SDK computes it for RS2 encoding. */
25
+ export function encodedBlobLength(unencodedLength, nShards = N_SHARDS) {
26
+ if (!Number.isFinite(unencodedLength) || unencodedLength < 0) {
27
+ throw new RangeError(`unencodedLength must be a non-negative finite number, got ${String(unencodedLength)}`);
28
+ }
29
+ const maxFaulty = Math.floor((nShards - 1) / 3);
30
+ const minCorrect = nShards - maxFaulty;
31
+ const primary = minCorrect - maxFaulty;
32
+ const secondary = minCorrect;
33
+ let symbolSize = Math.floor((Math.max(unencodedLength, 1) - 1) / (primary * secondary)) + 1;
34
+ if (symbolSize % 2 === 1)
35
+ symbolSize += 1;
36
+ const slivers = (primary + secondary) * symbolSize * nShards;
37
+ return nShards * (nShards * DIGEST_LEN * 2 + BLOB_ID_LEN) + slivers;
38
+ }
39
+ /** What one batch (one blob) buys for `rawBytes` of files. */
40
+ export function estimateWalletStorage(rawBytes) {
41
+ const fixedBytes = encodedBlobLength(0);
42
+ const boughtBytes = encodedBlobLength(rawBytes);
43
+ return { rawBytes, fixedBytes, boughtBytes, fixedShare: fixedBytes / boughtBytes };
44
+ }