@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.
- package/dist/walrus/index.md +52 -0
- package/package.json +73 -65
package/dist/walrus/index.md
CHANGED
|
@@ -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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
+
}
|