@mysten/docs 0.1.1 → 0.1.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.
Files changed (2) hide show
  1. package/dist/walrus/index.md +52 -0
  2. package/package.json +73 -65
@@ -261,6 +261,45 @@ async function handleCertify() {
261
261
  This approach ensures that each transaction signing step is separated into different user
262
262
  interactions, allowing wallet popups to work properly without being blocked by the browser.
263
263
 
264
+ ### Running the full flow
265
+
266
+ If you don't need separate user interactions for each step, you can use `run()` to execute the full
267
+ pipeline as an async iterator. Each step yields a `WriteBlobStep` that you can persist for crash
268
+ recovery:
269
+
270
+ ```ts
271
+ const flow = client.walrus.writeBlobFlow({ blob });
272
+
273
+ for await (const step of flow.run({ signer, epochs: 3, deletable: true })) {
274
+ await db.save(fileId, step); // persist for crash recovery
275
+ }
276
+ ```
277
+
278
+ The flow also provides `executeRegister` and `executeCertify` methods that handle signing and return
279
+ typed step results:
280
+
281
+ ```ts
282
+ const flow = client.walrus.writeBlobFlow({ blob });
283
+ const enc = await flow.encode();
284
+ const reg = await flow.executeRegister({ signer, epochs: 3, deletable: true, owner: address });
285
+ const up = await flow.upload({ digest: reg.txDigest });
286
+ const cert = await flow.executeCertify({ signer });
287
+ ```
288
+
289
+ ### Resuming uploads
290
+
291
+ To resume an upload after a crash, pass a saved `WriteBlobStep` as `resume`. The flow will skip
292
+ completed steps, validate the blobId, and only upload slivers that aren't already stored:
293
+
294
+ ```ts
295
+ const saved = await db.load(fileId);
296
+ const flow = client.walrus.writeBlobFlow({ blob, resume: saved });
297
+
298
+ for await (const step of flow.run({ signer, epochs: 3, deletable: true })) {
299
+ await db.save(fileId, step);
300
+ }
301
+ ```
302
+
264
303
  ## Writing blobs with an upload relay
265
304
 
266
305
  Writing blobs directly from a client requires a lot of requests to write data to all the storage
@@ -374,6 +413,19 @@ const { blobId } = await client.walrus.writeBlob({
374
413
  });
375
414
  ```
376
415
 
416
+ `writeBlob` and `writeFiles` also support `onStep` and `resume` for crash-recoverable uploads:
417
+
418
+ ```ts
419
+ const { blobId } = await client.walrus.writeBlob({
420
+ blob: file,
421
+ deletable: true,
422
+ epochs: 3,
423
+ signer: keypair,
424
+ onStep: (step) => db.save(fileId, step),
425
+ resume: await db.load(fileId), // pass a previously saved step to resume
426
+ });
427
+ ```
428
+
377
429
  ## Full API
378
430
 
379
431
  For a complete overview of the available methods on the `WalrusClient` you can reference type
package/package.json CHANGED
@@ -1,66 +1,74 @@
1
1
  {
2
- "name": "@mysten/docs",
3
- "version": "0.1.1",
4
- "description": "LLM-friendly documentation for the Sui TypeScript SDK ecosystem",
5
- "license": "Apache-2.0",
6
- "files": [
7
- "dist/"
8
- ],
9
- "scripts": {
10
- "build": "typedoc && next build && pnpm run build:docs",
11
- "build:docs": "tsx scripts/build-docs.ts --all",
12
- "dev": "next dev",
13
- "start": "next start",
14
- "postinstall": "fumadocs-mdx",
15
- "validate-docs": "tsx scripts/validate-llm-docs.ts",
16
- "prettier:check": "prettier -c --ignore-unknown .",
17
- "prettier:fix": "prettier -w --ignore-unknown .",
18
- "oxlint:check": "oxlint .",
19
- "oxlint:fix": "oxlint --fix",
20
- "lint": "pnpm run oxlint:check && pnpm run prettier:check",
21
- "lint:fix": "pnpm run oxlint:fix && pnpm run prettier:fix"
22
- },
23
- "dependencies": {
24
- "@mysten/bcs": "workspace:^",
25
- "@mysten/dapp-kit": "workspace:^",
26
- "@mysten/dapp-kit-core": "workspace:^",
27
- "@mysten/dapp-kit-react": "workspace:^",
28
- "@mysten/deepbook-v3": "workspace:^",
29
- "@mysten/enoki": "workspace:^",
30
- "@mysten/enoki-connect": "workspace:^",
31
- "@mysten/kiosk": "workspace:^",
32
- "@mysten/payment-kit": "workspace:^",
33
- "@mysten/seal": "workspace:^",
34
- "@mysten/signers": "workspace:^",
35
- "@mysten/slush-wallet": "workspace:^",
36
- "@mysten/sui": "workspace:^",
37
- "@mysten/suins": "workspace:^",
38
- "@mysten/utils": "workspace:^",
39
- "@mysten/wallet-standard": "workspace:^",
40
- "@mysten/walrus": "workspace:^",
41
- "@mysten/zksend": "workspace:^",
42
- "@tanstack/react-query": "^5.90.16",
43
- "fast-glob": "^3.3.3",
44
- "fumadocs-core": "16.4.7",
45
- "fumadocs-docgen": "^3.0.5",
46
- "fumadocs-mdx": "14.2.5",
47
- "fumadocs-typescript": "^5.0.1",
48
- "fumadocs-ui": "16.4.7",
49
- "gray-matter": "^4.0.3",
50
- "next": "^16.1.5",
51
- "react": "^19.2.3",
52
- "react-dom": "^19.2.3"
53
- },
54
- "devDependencies": {
55
- "@tailwindcss/postcss": "^4.1.18",
56
- "@types/mdx": "^2.0.13",
57
- "@types/node": "^25.0.8",
58
- "@types/react": "^19.2.8",
59
- "@types/react-dom": "^19.2.3",
60
- "postcss": "^8.5.6",
61
- "tailwindcss": "^4.1.18",
62
- "typedoc": "^0.28.16",
63
- "typedoc-plugin-mermaid": "^1.12.0",
64
- "typescript": "^5.9.3"
65
- }
66
- }
2
+ "name": "@mysten/docs",
3
+ "version": "0.1.2",
4
+ "description": "LLM-friendly documentation for the Sui TypeScript SDK ecosystem",
5
+ "license": "Apache-2.0",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/MystenLabs/ts-sdks.git"
9
+ },
10
+ "bugs": {
11
+ "url": "https://github.com/MystenLabs/ts-sdks/issues"
12
+ },
13
+ "homepage": "https://sdk.mystenlabs.com",
14
+ "files": [
15
+ "dist/"
16
+ ],
17
+ "dependencies": {
18
+ "@tanstack/react-query": "^5.90.16",
19
+ "fast-glob": "^3.3.3",
20
+ "fumadocs-core": "16.4.7",
21
+ "fumadocs-docgen": "^3.0.5",
22
+ "fumadocs-mdx": "14.2.5",
23
+ "fumadocs-typescript": "^5.0.1",
24
+ "fumadocs-ui": "16.4.7",
25
+ "gray-matter": "^4.0.3",
26
+ "next": "^16.1.6",
27
+ "react": "^19.2.3",
28
+ "react-dom": "^19.2.3",
29
+ "@mysten/dapp-kit-core": "1.2.0",
30
+ "@mysten/bcs": "2.0.3",
31
+ "@mysten/dapp-kit": "1.0.4",
32
+ "@mysten/dapp-kit-react": "2.0.1",
33
+ "@mysten/deepbook-v3": "1.2.1",
34
+ "@mysten/enoki": "1.0.4",
35
+ "@mysten/enoki-connect": "1.0.2",
36
+ "@mysten/seal": "1.1.1",
37
+ "@mysten/kiosk": "1.1.3",
38
+ "@mysten/signers": "1.0.1",
39
+ "@mysten/slush-wallet": "1.0.3",
40
+ "@mysten/sui": "2.9.1",
41
+ "@mysten/suins": "1.0.2",
42
+ "@mysten/wallet-standard": "0.20.1",
43
+ "@mysten/utils": "0.3.1",
44
+ "@mysten/walrus": "1.1.0",
45
+ "@mysten/zksend": "1.0.3",
46
+ "@mysten/payment-kit": "0.1.3"
47
+ },
48
+ "devDependencies": {
49
+ "@tailwindcss/postcss": "^4.1.18",
50
+ "@types/mdx": "^2.0.13",
51
+ "@types/node": "^25.0.8",
52
+ "@types/react": "^19.2.8",
53
+ "@types/react-dom": "^19.2.3",
54
+ "postcss": "^8.5.6",
55
+ "tailwindcss": "^4.1.18",
56
+ "typedoc": "^0.28.16",
57
+ "typedoc-plugin-mermaid": "^1.12.0",
58
+ "typescript": "^5.9.3"
59
+ },
60
+ "scripts": {
61
+ "build": "typedoc && next build && pnpm run build:docs",
62
+ "build:docs": "tsx scripts/build-docs.ts --all",
63
+ "dev": "next dev",
64
+ "start": "next start",
65
+ "postinstall": "fumadocs-mdx",
66
+ "validate-docs": "tsx scripts/validate-llm-docs.ts",
67
+ "prettier:check": "prettier -c --ignore-unknown .",
68
+ "prettier:fix": "prettier -w --ignore-unknown .",
69
+ "oxlint:check": "oxlint .",
70
+ "oxlint:fix": "oxlint --fix",
71
+ "lint": "pnpm run oxlint:check && pnpm run prettier:check",
72
+ "lint:fix": "pnpm run oxlint:fix && pnpm run prettier:fix"
73
+ }
74
+ }