@mysten/walrus 1.1.4 → 1.1.5

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
@@ -1,5 +1,19 @@
1
1
  # @mysten/walrus
2
2
 
3
+ ## 1.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 9e067cf: Validate the new per-package release flow end-to-end across every public @mysten package.
8
+ No functional changes — empty patch bump to force the orchestrator to dispatch every
9
+ release-<pkg>.yml workflow with `dry_run=false` so each package publishes via OIDC trusted
10
+ publishing.
11
+ - Updated dependencies [9e067cf]
12
+ - @mysten/bcs@2.0.4
13
+ - @mysten/sui@2.16.1
14
+ - @mysten/utils@0.3.2
15
+ - @mysten/walrus-wasm@0.2.1
16
+
3
17
  ## 1.1.4
4
18
 
5
19
  ### Patch Changes
package/dist/client.d.mts CHANGED
@@ -3,7 +3,7 @@ import { WalrusFile } from "./files/file.mjs";
3
3
  import { Blob } from "./contracts/walrus/blob.mjs";
4
4
  import { CertifyBlobOptions, ComputeBlobMetadataOptions, DeleteBlobOptions, EncodingType, ExtendBlobOptions, GetBlobMetadataOptions, GetSecondarySliverOptions, GetSliversOptions, GetStorageConfirmationOptions, GetVerifiedBlobStatusOptions, ProtocolMessageCertificate, ReadBlobOptions, RegisterBlobOptions, SliversForNode, StorageWithSizeOptions, WalrusClientConfig, WalrusOptions, WriteBlobAttributesOptions, WriteBlobFlow, WriteBlobFlowOptions, WriteBlobOptions, WriteBlobToUploadRelayOptions, WriteEncodedBlobOptions, WriteEncodedBlobToNodesOptions, WriteFilesFlow, WriteFilesFlowOptions, WriteFilesOptions, WriteMetadataOptions, WriteQuiltOptions, WriteSliverOptions, WriteSliversToNodeOptions } from "./types.mjs";
5
5
  import { WalrusBlob } from "./files/blob.mjs";
6
- import * as _mysten_bcs15 from "@mysten/bcs";
6
+ import * as _mysten_bcs0 from "@mysten/bcs";
7
7
  import { Transaction, TransactionResult } from "@mysten/sui/transactions";
8
8
  import { ClientWithCoreApi } from "@mysten/sui/client";
9
9
  import { Signer } from "@mysten/sui/cryptography";
@@ -122,7 +122,7 @@ declare class WalrusClient {
122
122
  storage_price_per_unit_size: string;
123
123
  write_price_per_unit_size: string;
124
124
  } | null;
125
- epoch_state: _mysten_bcs15.EnumOutputShapeWithKeys<{
125
+ epoch_state: _mysten_bcs0.EnumOutputShapeWithKeys<{
126
126
  EpochChangeSync: number;
127
127
  EpochChangeDone: string;
128
128
  NextParamsSelected: string;
@@ -157,17 +157,17 @@ declare class WalrusClient {
157
157
  blobId: string;
158
158
  metadata: {
159
159
  V1: {
160
- encoding_type: _mysten_bcs15.EnumOutputShapeWithKeys<{
160
+ encoding_type: _mysten_bcs0.EnumOutputShapeWithKeys<{
161
161
  RedStuff: true;
162
162
  RS2: true;
163
163
  }, "RedStuff" | "RS2">;
164
164
  unencoded_length: string;
165
165
  hashes: {
166
- primary_hash: _mysten_bcs15.EnumOutputShapeWithKeys<{
166
+ primary_hash: _mysten_bcs0.EnumOutputShapeWithKeys<{
167
167
  Empty: true;
168
168
  Digest: Uint8Array<ArrayBufferLike>;
169
169
  }, "Empty" | "Digest">;
170
- secondary_hash: _mysten_bcs15.EnumOutputShapeWithKeys<{
170
+ secondary_hash: _mysten_bcs0.EnumOutputShapeWithKeys<{
171
171
  Empty: true;
172
172
  Digest: Uint8Array<ArrayBufferLike>;
173
173
  }, "Empty" | "Digest">;
@@ -644,11 +644,11 @@ declare class WalrusClient {
644
644
  };
645
645
  unencoded_length: string | number | bigint;
646
646
  hashes: Iterable<{
647
- primary_hash: _mysten_bcs15.EnumInputShape<{
647
+ primary_hash: _mysten_bcs0.EnumInputShape<{
648
648
  Empty: boolean | object | null;
649
649
  Digest: Iterable<number>;
650
650
  }>;
651
- secondary_hash: _mysten_bcs15.EnumInputShape<{
651
+ secondary_hash: _mysten_bcs0.EnumInputShape<{
652
652
  Empty: boolean | object | null;
653
653
  Digest: Iterable<number>;
654
654
  }>;
@@ -1 +1 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ysten/sui/bcs";
3
3
  import { BcsType } from "@mysten/sui/bcs";
4
4
 
5
5
  //#region src/utils/bcs.d.ts
6
6
  declare const BlobMetadata: _mysten_sui_bcs0.BcsEnum<{
7
7
  V1: _mysten_sui_bcs0.BcsStruct<{
8
- encoding_type: BcsType<_mysten_bcs0.EnumOutputShapeWithKeys<{
8
+ encoding_type: BcsType<_mysten_bcs5.EnumOutputShapeWithKeys<{
9
9
  RedStuff: true;
10
10
  RS2: true;
11
11
  }, "RedStuff" | "RS2">, "RedStuff" | "RS2" | {
@@ -15,20 +15,20 @@ declare const BlobMetadata: _mysten_sui_bcs0.BcsEnum<{
15
15
  }, "EncodingType">;
16
16
  unencoded_length: BcsType<string, string | number | bigint, "u64">;
17
17
  hashes: BcsType<{
18
- primary_hash: _mysten_bcs0.EnumOutputShapeWithKeys<{
18
+ primary_hash: _mysten_bcs5.EnumOutputShapeWithKeys<{
19
19
  Empty: true;
20
20
  Digest: Uint8Array<ArrayBufferLike>;
21
21
  }, "Empty" | "Digest">;
22
- secondary_hash: _mysten_bcs0.EnumOutputShapeWithKeys<{
22
+ secondary_hash: _mysten_bcs5.EnumOutputShapeWithKeys<{
23
23
  Empty: true;
24
24
  Digest: Uint8Array<ArrayBufferLike>;
25
25
  }, "Empty" | "Digest">;
26
26
  }[], Iterable<{
27
- primary_hash: _mysten_bcs0.EnumInputShape<{
27
+ primary_hash: _mysten_bcs5.EnumInputShape<{
28
28
  Empty: boolean | object | null;
29
29
  Digest: Iterable<number>;
30
30
  }>;
31
- secondary_hash: _mysten_bcs0.EnumInputShape<{
31
+ secondary_hash: _mysten_bcs5.EnumInputShape<{
32
32
  Empty: boolean | object | null;
33
33
  Digest: Iterable<number>;
34
34
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mysten/walrus",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "private": false,
5
5
  "description": "Walrus SDK",
6
6
  "license": "Apache-2.0",
@@ -42,25 +42,21 @@
42
42
  "typescript": "^5.9.3",
43
43
  "undici": "^7.24.4",
44
44
  "vite": "^8.0.5",
45
- "vitest": "^4.0.17",
46
- "@mysten/codegen": "^0.10.3",
47
- "@mysten/dapp-kit-core": "^1.3.0",
48
- "@mysten/dapp-kit-react": "^2.0.1",
49
- "@mysten/sui": "^2.16.0"
45
+ "vitest": "^4.0.17"
50
46
  },
51
47
  "dependencies": {
52
48
  "dataloader": "^2.2.3",
53
- "@mysten/bcs": "^2.0.3",
54
- "@mysten/utils": "^0.3.1",
55
- "@mysten/walrus-wasm": "^0.2.0"
49
+ "@mysten/utils": "^0.3.2",
50
+ "@mysten/bcs": "^2.0.4",
51
+ "@mysten/walrus-wasm": "^0.2.1"
56
52
  },
57
53
  "peerDependencies": {
58
- "@mysten/sui": "^2.16.0"
54
+ "@mysten/sui": "^2.16.1"
59
55
  },
60
56
  "scripts": {
61
57
  "clean": "rm -rf tsconfig.tsbuildinfo ./dist",
62
58
  "build": "rm -rf dist && tsc --noEmit && tsdown",
63
- "build:docs": "tsx ../docs/scripts/build-docs.ts",
59
+ "build:docs": "node ../docs/scripts/build-docs.ts",
64
60
  "test": "pnpm test:examples && NODE_OPTIONS='--expose-gc' vitest run",
65
61
  "test:examples": "tsc --project examples/tsconfig.json --noEmit",
66
62
  "codegen": "sui-ts-codegen generate && pnpm lint:fix",
package/docs/index.md DELETED
@@ -1,566 +0,0 @@
1
- # Walrus SDK
2
-
3
- > Store and retrieve blobs on Walrus decentralized storage using the TypeScript SDK.
4
-
5
- The Walrus TypeScript SDK works directly with Walrus storage nodes or with the Walrus upload relay.
6
- When you use the Walrus SDK without an upload relay, reading and writing Walrus blobs requires many
7
- requests (approximately 2200 to write a blob and approximately 335 to read a blob). The upload relay
8
- reduces the number of requests needed to write a blob, but reads through the Walrus SDK still
9
- require many requests. For many applications, using publishers and aggregators is recommended, but
10
- the TypeScript SDK is useful when building applications where the application needs to directly
11
- interact with Walrus, or when users need to pay for their own storage directly.
12
-
13
- The Walrus SDK exposes high-level methods for reading and writing blobs, as well as lower-level
14
- methods for the individual steps in the process. You can use the lower-level methods to implement
15
- more complex flows when you want more control over optimization.
16
-
17
- ## Installation
18
-
19
- ```bash npm2yarn
20
- npm install --save @mysten/walrus @mysten/sui
21
- ```
22
-
23
- ## Setup
24
-
25
- To use the Walrus SDK, you need to create a client from the TypeScript SDK and extend it with the
26
- Walrus SDK.
27
-
28
- ```ts
29
- const client = new SuiGrpcClient({
30
- network: 'testnet',
31
- baseUrl: 'https://fullnode.testnet.sui.io:443',
32
- }).$extend(walrus());
33
- ```
34
-
35
- The Walrus SDK includes all the relevant package and object IDs needed for connecting to Testnet.
36
- You can also manually configure the Walrus SDK to use a different set of IDs, allowing you to
37
- connect to a different network or updated deployment of the Walrus contracts.
38
-
39
- ```ts
40
- const client = new SuiGrpcClient({
41
- network: 'testnet',
42
- baseUrl: 'https://fullnode.testnet.sui.io:443',
43
- }).$extend(
44
- walrus({
45
- packageConfig: {
46
- systemObjectId: '0x98ebc47370603fe81d9e15491b2f1443d619d1dab720d586e429ed233e1255c1',
47
- stakingPoolId: '0x20266a17b4f1a216727f3eef5772f8d486a9e3b5e319af80a5b75809c035561d',
48
- },
49
- }),
50
- );
51
- ```
52
-
53
- Some environments require you to customize how data is fetched:
54
-
55
- ```ts
56
- const client = new SuiGrpcClient({
57
- network: 'testnet',
58
- baseUrl: 'https://fullnode.testnet.sui.io:443',
59
- }).$extend(
60
- walrus({
61
- storageNodeClientOptions: {
62
- fetch: (url, options) => {
63
- console.log('fetching', url);
64
- return fetch(url, options);
65
- },
66
- timeout: 60_000,
67
- },
68
- }),
69
- );
70
- ```
71
-
72
- You can use this approach to implement a fetch function with custom timeouts, rate limits, retry
73
- logic, or any other desired behavior.
74
-
75
- ## `WalrusFile` API
76
-
77
- The `WalrusFile` API provides a higher-level abstraction so that applications do not need to worry
78
- about how data is stored in Walrus. It handles data stored directly in blobs and data stored in
79
- quilts, but might expand to cover other storage patterns in the future.
80
-
81
- ### Reading files
82
-
83
- To read files, use the `getFiles` method. This method accepts both blob IDs and quilt IDs, and
84
- returns a `WalrusFile`.
85
-
86
- Read files in batches when possible, which allows the client to be more efficient when loading
87
- multiple files from the same quilt.
88
-
89
- ```ts
90
- const [file1, file2] = await client.walrus.getFiles({ ids: [anyBlobId, orQuiltId] });
91
- ```
92
-
93
- A `WalrusFile` works like a `Response` object from the `fetch` API:
94
-
95
- ```ts
96
- // get contents as a Uint8Array
97
- const bytes = await file1.bytes();
98
- // Parse the contents as a `utf-8` string
99
- const text = await file1.text();
100
- // Parse the contents as JSON
101
- const json = await file2.json();
102
- ```
103
-
104
- A `WalrusFile` might also have `identifier` and `tags` properties if the file was stored in a quilt.
105
-
106
- ```ts
107
- const identifier: string | null = await file1.getIdentifier();
108
- const tags: Record<string, string> = await file1.getTags();
109
- ```
110
-
111
- #### `WalrusBlob`
112
-
113
- You can also get a `WalrusBlob` instead of a `WalrusFile` if you have the `blobId`:
114
-
115
- ```ts
116
- const blob = await client.walrus.getBlob({ blobId });
117
- ```
118
-
119
- If the blob is a quilt, you can read the files in the quilt:
120
-
121
- ```ts
122
- // Get all files:
123
- const files = await blob.files();
124
- // Get files by identifier
125
- const [readme] = await blob.files({ identifiers: ['README.md'] });
126
- // Get files by tag
127
- const textFiles = await blob.files({ tags: [{ 'content-type': 'text/plain' }] });
128
- // Get files by quilt id
129
- const filesById = await blob.files({ ids: [quiltID] });
130
- ```
131
-
132
- ### Writing files
133
-
134
- You can also construct a `WalrusFile` from a `Uint8Array`, `Blob`, or a `string`, which you can then
135
- store on Walrus:
136
-
137
- ```ts
138
- const file1 = WalrusFile.from({
139
- contents: new Uint8Array([1, 2, 3]),
140
- identifier: 'file1.bin',
141
- });
142
- const file2 = WalrusFile.from({
143
- contents: new Blob([new Uint8Array([1, 2, 3])]),
144
- identifier: 'file2.bin',
145
- });
146
- const file3 = WalrusFile.from({
147
- contents: new TextEncoder().encode('Hello from the TS SDK!!!\n'),
148
- identifier: 'README.md',
149
- tags: {
150
- 'content-type': 'text/plain',
151
- },
152
- });
153
- ```
154
-
155
- After you have your files, use the `writeFiles` method to write them to Walrus.
156
-
157
- Along with the files, you also need to provide a `Signer` instance that signs and pays for the
158
- transaction and storage fees. The signer's address needs sufficient SUI to cover the transactions
159
- that register the blob and certify its availability after upload. The signer must own sufficient WAL
160
- to pay to store the blob for the specified number of epochs, as well as the write fee for writing
161
- the blob.
162
-
163
- The exact costs depend on the size of the blobs, as well as the current gas and storage prices.
164
-
165
- ```ts
166
- const results: {
167
- id: string;
168
- blobId: string;
169
- blobObject: Blob.$inferType;
170
- }[] = await client.walrus.writeFiles({
171
- files: [file1, file2, file3],
172
- epochs: 3,
173
- deletable: true,
174
- signer: keypair,
175
- });
176
- ```
177
-
178
- The provided files are all written into a single quilt. Future versions of the SDK might optimize
179
- how files are stored to be more efficient by splitting files into multiple quilts.
180
-
181
- The current quilt encoding is less efficient for single files, so writing multiple files together is
182
- recommended when possible. Writing raw blobs directly is also possible using the `writeBlob` API
183
- described below.
184
-
185
- #### Writing files in browser environments
186
-
187
- When the transactions to upload a blob are signed by a wallet in a browser, some wallets use popups
188
- to prompt you for a signature. If the popups are not opened in direct response to a user
189
- interaction, the browser might block them.
190
-
191
- To avoid this, execute the transactions that register and certify the blob in separate event
192
- handlers by creating separate buttons for each step.
193
-
194
- The `client.writeFilesFlow` method returns an object with a set of methods that break the write flow
195
- into several smaller steps:
196
-
197
- 1. `encode`: Encodes the files and generates a `blobId`.
198
- 2. `register`: Returns a transaction that registers the blob onchain.
199
- 3. `upload`: Uploads the data to storage nodes.
200
- 4. `certify`: Returns a transaction that certifies the blob onchain.
201
- 5. `listFiles`: Returns a list of the created files.
202
-
203
- The following simplified example shows the core API usage with separate user interactions:
204
-
205
- ```tsx
206
- // Step 1: Create and encode the flow (can be done immediately when file is selected)
207
- const flow = client.walrus.writeFilesFlow({
208
- files: [
209
- WalrusFile.from({
210
- contents: new Uint8Array(fileData),
211
- identifier: 'my-file.txt',
212
- }),
213
- ],
214
- });
215
-
216
- await flow.encode();
217
-
218
- // Step 2: Register the blob (triggered by user clicking a register button after the encode step)
219
- async function handleRegister() {
220
- const registerTx = flow.register({
221
- epochs: 3,
222
- owner: currentAccount.address,
223
- deletable: true,
224
- });
225
- const result = await signAndExecuteTransaction({ transaction: registerTx });
226
-
227
- // Check transaction status
228
- if (result.$kind === 'FailedTransaction') {
229
- throw new Error(`Registration failed: ${result.FailedTransaction.status.error?.message}`);
230
- }
231
-
232
- // Step 3: Upload the data to storage nodes
233
- // This can be done immediately after the register step, or as a separate step the user initiates
234
- await flow.upload({ digest: result.Transaction.digest });
235
- }
236
-
237
- // Step 4: Certify the blob (triggered by user clicking a certify button after the blob is uploaded)
238
- async function handleCertify() {
239
- const certifyTx = flow.certify();
240
-
241
- const result = await signAndExecuteTransaction({ transaction: certifyTx });
242
-
243
- // Check transaction status
244
- if (result.$kind === 'FailedTransaction') {
245
- throw new Error(`Certification failed: ${result.FailedTransaction.status.error?.message}`);
246
- }
247
-
248
- // Step 5: Get the new files
249
- const files = await flow.listFiles();
250
- console.log('Uploaded files', files);
251
- }
252
- ```
253
-
254
- This approach ensures that each transaction signing step is separated into different user
255
- interactions, allowing wallet popups to work properly without being blocked by the browser.
256
-
257
- ### Running the full flow
258
-
259
- If you do not need separate user interactions for each step, use `run()` to execute the full
260
- pipeline as an async iterator.
261
-
262
- ```ts
263
- const flow = client.walrus.writeBlobFlow({ blob });
264
-
265
- for await (const step of flow.run({ signer, epochs: 3, deletable: true })) {
266
- await db.save(fileId, step); // persist for crash recovery
267
- }
268
- ```
269
-
270
- The flow also provides `executeRegister` and `executeCertify` methods that handle signing and return
271
- typed step results:
272
-
273
- ```ts
274
- const flow = client.walrus.writeBlobFlow({ blob });
275
- const enc = await flow.encode();
276
- const reg = await flow.executeRegister({ signer, epochs: 3, deletable: true, owner: address });
277
- const up = await flow.upload({ digest: reg.txDigest });
278
- const cert = await flow.executeCertify({ signer });
279
- ```
280
-
281
- #### Resuming uploads
282
-
283
- Each step executed by `run()` produces a `WriteBlobStep` that you can persist for crash recovery. To
284
- resume an upload after a crash, pass a saved `WriteBlobStep` as `resume`. The flow skips completed
285
- steps, validates the `blobId`, and only uploads slivers that are not already stored:
286
-
287
- ```ts
288
- const saved = await db.load(fileId);
289
- const flow = client.walrus.writeBlobFlow({ blob, resume: saved });
290
-
291
- for await (const step of flow.run({ signer, epochs: 3, deletable: true })) {
292
- await db.save(fileId, step);
293
- }
294
- ```
295
-
296
- ## Using an upload relay
297
-
298
- Writing blobs directly from a client requires many requests to write data to all the storage nodes.
299
- An upload relay offloads the work of these writes to a server, reducing complexity for the client.
300
-
301
- To use an upload relay, add the `uploadRelay` option when adding the Walrus extension:
302
-
303
- ```ts
304
- const client = new SuiGrpcClient({
305
- network: 'testnet',
306
- baseUrl: 'https://fullnode.testnet.sui.io:443',
307
- }).$extend(
308
- walrus({
309
- uploadRelay: {
310
- host: 'https://upload-relay.testnet.walrus.space',
311
- sendTip: {
312
- max: 1_000,
313
- },
314
- },
315
- }),
316
- );
317
- ```
318
-
319
- The `host` option is required and indicates the URL for your upload relay. Upload relays might
320
- require a tip to cover the cost of writing the blob. You can configure a maximum tip (paid in MIST)
321
- and the `WalrusClient` automatically determines the required tip for your upload relay. You can also
322
- manually configure the tip as shown below.
323
-
324
- Find the tip required by an upload relay using the `tip-config` endpoint (for example,
325
- `https://upload-relay.testnet.walrus.space/v1/tip-config`). The tip is either a `const` or a
326
- `linear` type.
327
-
328
- ### `const` tip
329
-
330
- A `const` tip sends a fixed amount for each blob written to the upload relay.
331
-
332
- ```ts
333
- const client = new SuiGrpcClient({
334
- network: 'testnet',
335
- baseUrl: 'https://fullnode.testnet.sui.io:443',
336
- }).$extend(
337
- walrus({
338
- uploadRelay: {
339
- host: 'https://upload-relay.testnet.walrus.space',
340
- sendTip: {
341
- address: '0x123...',
342
- kind: {
343
- const: 105,
344
- },
345
- },
346
- },
347
- }),
348
- );
349
- ```
350
-
351
- ### `linear` tip
352
-
353
- A `linear` tip sends a fixed amount for each blob written to the upload relay, plus a multiplier
354
- based on the size of the blob.
355
-
356
- ```ts
357
- const client = new SuiGrpcClient({
358
- network: 'testnet',
359
- baseUrl: 'https://fullnode.testnet.sui.io:443',
360
- }).$extend(
361
- walrus({
362
- uploadRelay: {
363
- host: 'https://upload-relay.testnet.walrus.space',
364
- sendTip: {
365
- address: '0x123...',
366
- kind: {
367
- linear: {
368
- base: 105,
369
- perEncodedKib: 10,
370
- },
371
- },
372
- },
373
- },
374
- }),
375
- );
376
- ```
377
-
378
- ## Interacting with blobs directly
379
-
380
- If you do not want to use the `WalrusFile` abstractions, use the `readBlob` and `writeBlob` APIs
381
- directly.
382
-
383
- ### Reading blobs
384
-
385
- The `readBlob` method reads a blob given the `blobId` and returns a `Uint8Array` containing the blob
386
- content:
387
-
388
- ```ts
389
- const blob = await client.walrus.readBlob({ blobId });
390
- ```
391
-
392
- ### Writing blobs
393
-
394
- The `writeBlob` method writes a blob (as a `Uint8Array`) to Walrus. You need to specify how long the
395
- blob should be stored for and whether the blob should be deletable.
396
-
397
- ```ts
398
- const file = new TextEncoder().encode('Hello from the TS SDK!!!\n');
399
-
400
- const { blobId } = await client.walrus.writeBlob({
401
- blob: file,
402
- deletable: false,
403
- epochs: 3,
404
- signer: keypair,
405
- });
406
- ```
407
-
408
- `writeBlob` and `writeFiles` also support `onStep` and `resume` for crash-recoverable uploads:
409
-
410
- ```ts
411
- const { blobId } = await client.walrus.writeBlob({
412
- blob: file,
413
- deletable: true,
414
- epochs: 3,
415
- signer: keypair,
416
- onStep: (step) => db.save(fileId, step),
417
- resume: await db.load(fileId), // pass a previously saved step to resume
418
- });
419
- ```
420
-
421
- ## Error handling
422
-
423
- The SDK exports all the error classes for different types of errors that can be thrown. Walrus is a
424
- fault-tolerant distributed system where many types of errors can be recovered from. During epoch
425
- changes, the data cached in the `WalrusClient` can become invalid. Errors that result from this
426
- situation extend the `RetryableWalrusClientError` class.
427
-
428
- You can check for these errors and reset the client before retrying:
429
-
430
- ```ts
431
- if (error instanceof RetryableWalrusClientError) {
432
- client.walrus.reset();
433
-
434
- /* retry your operation */
435
- }
436
- ```
437
-
438
- `RetryableWalrusClientError` errors are not guaranteed to succeed after resetting the client and
439
- retrying, but this pattern handles some edge cases.
440
-
441
- High-level methods like `readBlob` already handle various error cases and automatically retry when
442
- encountering these errors, as well as handling cases where only a subset of nodes need to respond
443
- successfully to read or publish a blob.
444
-
445
- When using the lower-level methods to build your own read or publish flows, understand the number of
446
- shards and slivers that need to be successfully written or read for your operation to succeed.
447
- Gracefully handle cases where some nodes might be in a bad state.
448
-
449
- ### Network errors
450
-
451
- Walrus handles some nodes being down, and the SDK only throws errors when it cannot read from or
452
- write to enough storage nodes. When troubleshooting problems, figuring out what went wrong can be
453
- challenging because you do not see all the individual network errors.
454
-
455
- Pass an `onError` option in the `storageNodeClientOptions` to get the individual errors from failed
456
- requests:
457
-
458
- ```ts
459
- const client = new SuiGrpcClient({
460
- network: 'testnet',
461
- baseUrl: 'https://fullnode.testnet.sui.io:443',
462
- }).$extend(
463
- walrus({
464
- storageNodeClientOptions: {
465
- onError: (error) => console.log(error),
466
- },
467
- }),
468
- );
469
- ```
470
-
471
- ## Configuring network requests
472
-
473
- Reading and writing blobs directly from storage nodes requires many requests. The Walrus SDK issues
474
- all requests needed to complete these operations, but does not handle all the complexities a robust
475
- aggregator or publisher might encounter.
476
-
477
- By default, all requests use the global `fetch` for whatever runtime the SDK runs in.
478
-
479
- This does not impose any limitations on concurrency, and is subject to default timeouts and behavior
480
- defined by your runtime. To customize how requests are made, provide a custom `fetch` method:
481
-
482
- ```ts
483
- const client = new SuiGrpcClient({
484
- network: 'testnet',
485
- baseUrl: 'https://fullnode.testnet.sui.io:443',
486
- }).$extend(
487
- walrus({
488
- storageNodeClientOptions: {
489
- timeout: 60_000,
490
- fetch: (url, init) => {
491
- // Some casting may be required because undici types may not exactly match the @node/types types
492
- return fetch(url as RequestInfo, {
493
- ...(init as RequestInit),
494
- dispatcher: new Agent({
495
- connectTimeout: 60_000,
496
- }),
497
- }) as unknown as Promise<Response>;
498
- },
499
- },
500
- }),
501
- );
502
- ```
503
-
504
- ## Loading the WASM module in Vite or client-side apps
505
-
506
- The Walrus SDK requires WASM bindings to encode and decode blobs. When running in Node.js or Bun,
507
- and with some bundlers, this works without any additional configuration.
508
-
509
- In some cases, you might need to manually specify where the SDK loads the WASM bindings from.
510
-
511
- In Vite, get the URL for the WASM bindings by importing the WASM file with a `?url` suffix, then
512
- pass it into the Walrus client:
513
-
514
- ```ts
515
- const client = new SuiGrpcClient({
516
- network: 'testnet',
517
- baseUrl: 'https://fullnode.testnet.sui.io:443',
518
- }).$extend(
519
- walrus({
520
- wasmUrl: walrusWasmUrl,
521
- }),
522
- );
523
- ```
524
-
525
- If you are unable to get a URL for the WASM file in your bundler or build system, you can self-host
526
- the WASM bindings or load them from a CDN:
527
-
528
- ```ts
529
- const client = new SuiGrpcClient({
530
- network: 'testnet',
531
- baseUrl: 'https://fullnode.testnet.sui.io:443',
532
- }).$extend(
533
- walrus({
534
- wasmUrl: 'https://unpkg.com/@mysten/walrus-wasm@latest/web/walrus_wasm_bg.wasm',
535
- }),
536
- );
537
- ```
538
-
539
- In Next.js, when using Walrus in API routes, you might need to tell Next.js to skip bundling for the
540
- Walrus packages:
541
-
542
- ```ts
543
- // next.config.ts
544
- const nextConfig: NextConfig = {
545
- serverExternalPackages: ['@mysten/walrus', '@mysten/walrus-wasm'],
546
- };
547
- ```
548
-
549
- ## Known fetch limitations
550
-
551
- - Some nodes can be slow to respond. When running in Node.js, the default `connectTimeout` is 10
552
- seconds and can cause request timeouts.
553
- - In Bun, the `abort` signal stops requests from responding, but the requests still wait for
554
- completion before their promises reject.
555
-
556
- ## Full API
557
-
558
- For a complete overview of the available methods on the `WalrusClient`, reference the
559
- [TypeDocs](/typedoc/classes/_mysten_walrus.WalrusClient.html).
560
-
561
- ## Examples
562
-
563
- There are a number of
564
- [examples you can reference](https://github.com/MystenLabs/ts-sdks/tree/main/packages/walrus/examples)
565
- in the `ts-sdks` repository that show things like building aggregators and publishers with the
566
- Walrus SDK.
@@ -1,6 +0,0 @@
1
- # Walrus
2
-
3
- > Publish and Read blobs directly from walrus storage nodes
4
-
5
- - [Walrus SDK](..md): Store and retrieve blobs on Walrus decentralized storage using the TypeScript
6
- SDK.