@mysten/walrus 1.0.4 → 1.1.1

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 (45) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +52 -0
  3. package/dist/client.d.mts +108 -36
  4. package/dist/client.d.mts.map +1 -1
  5. package/dist/client.mjs +177 -345
  6. package/dist/client.mjs.map +1 -1
  7. package/dist/constants.d.mts.map +1 -1
  8. package/dist/constants.mjs +2 -1
  9. package/dist/constants.mjs.map +1 -1
  10. package/dist/contracts/utils/index.d.mts.map +1 -1
  11. package/dist/contracts/utils/index.mjs.map +1 -1
  12. package/dist/contracts/walrus/blob.d.mts +12 -12
  13. package/dist/contracts/walrus/blob.d.mts.map +1 -1
  14. package/dist/contracts/walrus/storage_node.d.mts +8 -8
  15. package/dist/contracts/walrus/storage_node.d.mts.map +1 -1
  16. package/dist/error.d.mts.map +1 -1
  17. package/dist/files/blob.d.mts.map +1 -1
  18. package/dist/files/file.d.mts.map +1 -1
  19. package/dist/files/readers/blob.d.mts.map +1 -1
  20. package/dist/files/readers/quilt-file.d.mts +0 -1
  21. package/dist/files/readers/quilt-file.d.mts.map +1 -1
  22. package/dist/files/readers/quilt.d.mts.map +1 -1
  23. package/dist/flows/write-blob.mjs +227 -0
  24. package/dist/flows/write-blob.mjs.map +1 -0
  25. package/dist/flows/write-files.mjs +112 -0
  26. package/dist/flows/write-files.mjs.map +1 -0
  27. package/dist/index.d.mts +3 -2
  28. package/dist/storage-node/client.d.mts.map +1 -1
  29. package/dist/storage-node/client.mjs +14 -0
  30. package/dist/storage-node/client.mjs.map +1 -1
  31. package/dist/storage-node/error.d.mts.map +1 -1
  32. package/dist/storage-node/types.d.mts +2 -1
  33. package/dist/storage-node/types.d.mts.map +1 -1
  34. package/dist/storage-node/utils.d.mts.map +1 -1
  35. package/dist/types.d.mts +82 -30
  36. package/dist/types.d.mts.map +1 -1
  37. package/dist/upload-relay/client.d.mts.map +1 -1
  38. package/dist/utils/bcs.d.mts +1 -2
  39. package/dist/utils/bcs.d.mts.map +1 -1
  40. package/dist/utils/bcs.mjs +14 -1
  41. package/dist/utils/bcs.mjs.map +1 -1
  42. package/dist/utils/quilts.d.mts +0 -1
  43. package/dist/utils/quilts.d.mts.map +1 -1
  44. package/docs/index.md +174 -129
  45. package/package.json +9 -9
package/docs/index.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  > Store and retrieve blobs on Walrus decentralized storage
4
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
+
5
17
  ## Installation
6
18
 
7
19
  ```bash npm2yarn
@@ -10,8 +22,8 @@ npm install --save @mysten/walrus @mysten/sui
10
22
 
11
23
  ## Setup
12
24
 
13
- To use the walrus SDK you will need to create a Client from the typescript SDK, and extend it with
14
- the walrus SDK.
25
+ To use the Walrus SDK, you need to create a client from the TypeScript SDK and extend it with the
26
+ Walrus SDK.
15
27
 
16
28
  ```ts
17
29
  const client = new SuiGrpcClient({
@@ -20,9 +32,9 @@ const client = new SuiGrpcClient({
20
32
  }).$extend(walrus());
21
33
  ```
22
34
 
23
- The walrus SDK currently includes all the relevant package and object IDs needed for connecting to
24
- testnet. You can also manually configure the walrus sdk to use a different set of ids, allowing you
25
- to connect to a different network or updated deployment of the walrus contracts.
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.
26
38
 
27
39
  ```ts
28
40
  const client = new SuiGrpcClient({
@@ -38,7 +50,7 @@ const client = new SuiGrpcClient({
38
50
  );
39
51
  ```
40
52
 
41
- For some environments you may need to customize how data is fetched:
53
+ Some environments require you to customize how data is fetched:
42
54
 
43
55
  ```ts
44
56
  const client = new SuiGrpcClient({
@@ -57,37 +69,22 @@ const client = new SuiGrpcClient({
57
69
  );
58
70
  ```
59
71
 
60
- This can be used to implement a fetch function with custom timeouts, rate limits, retry logic, or
61
- any other desired behavior.
62
-
63
- ## SDK Overview
64
-
65
- The Walrus TS SDK is designed to work directly with walrus storage nodes, or with the walrus upload
66
- relay. When using the walrus SDK without an upload relay, it is important to understand that reading
67
- and writing walrus blobs requires a lot of requests (~2200 to write a blob, ~335 to read a blob).
68
- The upload relay will reduce the number of requests needed to write a blob, but reads through the
69
- walrus SDK will still require a lot of requests. For many applications, using publishers and
70
- aggregators is recommended, but the TS SDK can be useful when building applications where the
71
- application needs to directly interact with walrus or users need to pay for their own storage
72
- directly.
73
-
74
- The walrus sdk exposes high level methods for reading and writing blobs, as well as lower level
75
- methods for the individual steps in the process that can be used to implement more complex flows
76
- when you want more control to implement more optimized implementations.
72
+ You can use this approach to implement a fetch function with custom timeouts, rate limits, retry
73
+ logic, or any other desired behavior.
77
74
 
78
- ## WalrusFiles
75
+ ## `WalrusFile` API
79
76
 
80
- The `WalrusFile` API provides a higher level abstraction so that applications don't need to worry
81
- about how data is stored in walrus. Today it handles data stored directly in blobs, and data stored
82
- in Quilts, but may be expanded to cover other storage patterns in the future.
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.
83
80
 
84
81
  ### Reading files
85
82
 
86
- To read files, you can use the `getFiles` method. This method accepts both Blob IDs and Quilt IDs,
87
- and will return a `WalrusFile`.
83
+ To read files, use the `getFiles` method. This method accepts both blob IDs and quilt IDs, and
84
+ returns a `WalrusFile`.
88
85
 
89
- It is encouraged to always read files in batches when possible, which will allow the client to be
90
- more efficient when loading multiple files from the same quilt.
86
+ Read files in batches when possible, which allows the client to be more efficient when loading
87
+ multiple files from the same quilt.
91
88
 
92
89
  ```ts
93
90
  const [file1, file2] = await client.walrus.getFiles({ ids: [anyBlobId, orQuiltId] });
@@ -104,17 +101,16 @@ const text = await file1.text();
104
101
  const json = await file2.json();
105
102
  ```
106
103
 
107
- A `WalrusFile` may also have and `identifier` and `tags` properties if the file was stored in a
108
- quilt.
104
+ A `WalrusFile` might also have `identifier` and `tags` properties if the file was stored in a quilt.
109
105
 
110
106
  ```ts
111
107
  const identifier: string | null = await file1.getIdentifier();
112
108
  const tags: Record<string, string> = await file1.getTags();
113
109
  ```
114
110
 
115
- ### WalrusBlobs
111
+ #### `WalrusBlob`
116
112
 
117
- You can also get a `WalrusBlob` instead of a `WalrusFile` if you have the blobId:
113
+ You can also get a `WalrusBlob` instead of a `WalrusFile` if you have the `blobId`:
118
114
 
119
115
  ```ts
120
116
  const blob = await client.walrus.getBlob({ blobId });
@@ -135,8 +131,8 @@ const filesById = await blob.files({ ids: [quiltID] });
135
131
 
136
132
  ### Writing files
137
133
 
138
- You can also construct a `WalrusFile` from a `Uint8Array`, `Blob`, or a `string` which can then be
139
- stored on walrus:
134
+ You can also construct a `WalrusFile` from a `Uint8Array`, `Blob`, or a `string`, which you can then
135
+ store on Walrus:
140
136
 
141
137
  ```ts
142
138
  const file1 = WalrusFile.from({
@@ -156,15 +152,15 @@ const file3 = WalrusFile.from({
156
152
  });
157
153
  ```
158
154
 
159
- Once you have your files you can use the `writeFiles` method to write them to walrus.
155
+ After you have your files, use the `writeFiles` method to write them to Walrus.
160
156
 
161
- Along with the files, you will also need to provide a `Signer` instance that signs and pays for the
162
- transaction/storage fees. The signer's address will need to have sufficient `SUI` to cover the
163
- transactions that register the blob, and certify its availability after it's been uploaded. The
164
- Signer must own sufficient `WAL` to pay to store the blob for the specified number of epochs, as
165
- well as the write fee for writing the blob.
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.
166
162
 
167
- The exact costs will depend on the size of the blobs, as well as the current gas and storage prices.
163
+ The exact costs depend on the size of the blobs, as well as the current gas and storage prices.
168
164
 
169
165
  ```ts
170
166
  const results: {
@@ -179,32 +175,32 @@ const results: {
179
175
  });
180
176
  ```
181
177
 
182
- Currently, the provided files will all be written into a single quilt. Future versions of the SDK
183
- may optimize how files are stored to be more efficient by splitting files into multiple quilts.
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.
184
180
 
185
181
  The current quilt encoding is less efficient for single files, so writing multiple files together is
186
182
  recommended when possible. Writing raw blobs directly is also possible using the `writeBlob` API
187
- (described below)
183
+ described below.
188
184
 
189
- ### Writing files in browser environments
185
+ #### Writing files in browser environments
190
186
 
191
- When the transactions to upload a blob are signed by a wallet in a browser, some wallets will use
192
- popups to prompt the user for a signature. If the popups are not opened in direct response to a user
193
- interaction, they may be blocked by the browser.
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.
194
190
 
195
- To avoid this, we need to ensure that we execute the transactions that register and certify the blob
196
- in separate events handlers by creating separate buttons for the user to click for each step.
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.
197
193
 
198
194
  The `client.writeFilesFlow` method returns an object with a set of methods that break the write flow
199
195
  into several smaller steps:
200
196
 
201
- 1. `encode` - Encodes the files and generates a blobId
202
- 2. `register` - returns a transaction that will register the blob on-chain
203
- 3. `upload` - Uploads the data to storage nodes
204
- 4. `certify` - returns a transaction that will certify the blob on-chain
205
- 5. `listFiles` - returns a list of the created files
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.
206
202
 
207
- Here's a simplified example showing the core API usage with separate user interactions:
203
+ The following simplified example shows the core API usage with separate user interactions:
208
204
 
209
205
  ```tsx
210
206
  // Step 1: Create and encode the flow (can be done immediately when file is selected)
@@ -258,13 +254,51 @@ async function handleCertify() {
258
254
  This approach ensures that each transaction signing step is separated into different user
259
255
  interactions, allowing wallet popups to work properly without being blocked by the browser.
260
256
 
261
- ## Writing blobs with an upload relay
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
262
297
 
263
- Writing blobs directly from a client requires a lot of requests to write data to all the storage
264
- nodes. An upload relay can be used to offload the work of these writes to a server, reducing
265
- complexity for the client.
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.
266
300
 
267
- To use an upload relay, you can add the `uploadRelay` option when adding the walrus extension:
301
+ To use an upload relay, add the `uploadRelay` option when adding the Walrus extension:
268
302
 
269
303
  ```ts
270
304
  const client = new SuiGrpcClient({
@@ -282,18 +316,18 @@ const client = new SuiGrpcClient({
282
316
  );
283
317
  ```
284
318
 
285
- The `host` option is required, and indicates the url for your upload relay. Upload relays may
286
- require a tip to be included to cover the cost of writing the blob. You can configure a maximum tip
287
- (paid in MIST) and the `WalrusClient` will automatically determine the required tip for your upload
288
- relay, or you can manually configure the tip configuration as shown below.
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.
289
323
 
290
- The tip required by an upload relay can be found using the `tip-config` endpoint: (e.g.
291
- `https://upload-relay.testnet.walrus.space/v1/tip-config`) and may either be a `const` or a `linear`
292
- tip.
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.
293
327
 
294
328
  ### `const` tip
295
329
 
296
- A `const` will send a fixed amount for each blob written to the upload relay.
330
+ A `const` tip sends a fixed amount for each blob written to the upload relay.
297
331
 
298
332
  ```ts
299
333
  const client = new SuiGrpcClient({
@@ -316,8 +350,8 @@ const client = new SuiGrpcClient({
316
350
 
317
351
  ### `linear` tip
318
352
 
319
- A `linear` tip will send a fixed amount for each blob written to the fan out proxy, plus a
320
- multiplier based on the size of the blob.
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.
321
355
 
322
356
  ```ts
323
357
  const client = new SuiGrpcClient({
@@ -343,22 +377,22 @@ const client = new SuiGrpcClient({
343
377
 
344
378
  ## Interacting with blobs directly
345
379
 
346
- In case you do not want to use the `WalrusFile` abstractions, you can use the `readBlob` and
347
- `writeBlob` APIs directly
380
+ If you do not want to use the `WalrusFile` abstractions, use the `readBlob` and `writeBlob` APIs
381
+ directly.
348
382
 
349
383
  ### Reading blobs
350
384
 
351
- The `readBlob` method will read a blob given the blobId and return Uint8Array containing the blobs
385
+ The `readBlob` method reads a blob given the `blobId` and returns a `Uint8Array` containing the blob
352
386
  content:
353
387
 
354
388
  ```ts
355
389
  const blob = await client.walrus.readBlob({ blobId });
356
390
  ```
357
391
 
358
- ### Writing Blobs
392
+ ### Writing blobs
359
393
 
360
- The writeBlob method can be used to write a blob (as a `Uint8Array`) to walrus. You will need to
361
- specify how long the blob should be stored for, and if the blob should be deletable.
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.
362
396
 
363
397
  ```ts
364
398
  const file = new TextEncoder().encode('Hello from the TS SDK!!!\n');
@@ -371,26 +405,27 @@ const { blobId } = await client.walrus.writeBlob({
371
405
  });
372
406
  ```
373
407
 
374
- ## Full API
375
-
376
- For a complete overview of the available methods on the `WalrusClient` you can reference type
377
- [TypeDocs](/typedoc/classes/_mysten_walrus.WalrusClient.html)
378
-
379
- ## Examples
408
+ `writeBlob` and `writeFiles` also support `onStep` and `resume` for crash-recoverable uploads:
380
409
 
381
- There are a number of simple
382
- [examples you can reference](https://github.com/MystenLabs/ts-sdks/tree/main/packages/walrus/examples)
383
- in the `ts-sdks` repo that show things like building simple aggregators and publishers with the
384
- walrus SDK
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
+ ```
385
420
 
386
421
  ## Error handling
387
422
 
388
423
  The SDK exports all the error classes for different types of errors that can be thrown. Walrus is a
389
- fault-tolerant distributed system, where many types of errors can be recovered from. During epoch
390
- changes there may be times when the data cached in the `WalrusClient` can become invalid. Errors
391
- that result from this situation will extend the `RetryableWalrusClientError` class.
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.
392
427
 
393
- You can check for these errors, and reset the client before retrying:
428
+ You can check for these errors and reset the client before retrying:
394
429
 
395
430
  ```ts
396
431
  if (error instanceof RetryableWalrusClientError) {
@@ -400,25 +435,25 @@ if (error instanceof RetryableWalrusClientError) {
400
435
  }
401
436
  ```
402
437
 
403
- `RetryableWalrusClientError` are not guaranteed to succeed after resetting the client and retrying,
404
- but this pattern can be used to handle some edge cases.
438
+ `RetryableWalrusClientError` errors are not guaranteed to succeed after resetting the client and
439
+ retrying, but this pattern handles some edge cases.
405
440
 
406
- High level methods like `readBlob` already handle various error cases and will automatically retry
407
- when hitting these methods, as well as handling cases where only a subset of nodes need to respond
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
408
443
  successfully to read or publish a blob.
409
444
 
410
- When using the lower level methods to build your own read or publish flows, it is recommended to
411
- understand the number of shards/sliver that need to be successfully written or read for you
412
- operation to succeed, and gracefully handle cases where some nodes may be in a bad state.
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.
413
448
 
414
449
  ### Network errors
415
450
 
416
- Walrus is designed to handle some nodes being down, and the SDK will only throw errors when it can't
417
- read from or write to enough storage nodes. When trying to troubleshoot problems, it can be
418
- challenging to figure out what's going wrong when you don't see all the individual network errors.
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.
419
454
 
420
- You can pass an `onError` option in the storageNodeClientOptions to get the individual errors from
421
- failed requests:
455
+ Pass an `onError` option in the `storageNodeClientOptions` to get the individual errors from failed
456
+ requests:
422
457
 
423
458
  ```ts
424
459
  const client = new SuiGrpcClient({
@@ -435,16 +470,14 @@ const client = new SuiGrpcClient({
435
470
 
436
471
  ## Configuring network requests
437
472
 
438
- Reading and writing blobs directly from storage nodes requires a lot of requests. The walrus SDK
439
- will issue all requests needed to complete these operations, but does not handling all the
440
- complexities a robust aggregator or publisher might encounter.
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.
441
476
 
442
- By default, all requests are issued using the global `fetch` for whatever runtime the SDK is running
443
- in.
477
+ By default, all requests use the global `fetch` for whatever runtime the SDK runs in.
444
478
 
445
- This will not impose any limitations on concurrency, and will be subject to default timeouts and
446
- behavior defined by your runtime. To customize how requests are made, you can provide a custom
447
- `fetch` method:
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:
448
481
 
449
482
  ```ts
450
483
  const client = new SuiGrpcClient({
@@ -468,15 +501,15 @@ const client = new SuiGrpcClient({
468
501
  );
469
502
  ```
470
503
 
471
- ## Loading the wasm module in vite or client side apps
504
+ ## Loading the WASM module in Vite or client-side apps
472
505
 
473
- The walrus SDK requires wasm bindings to encode and decode blobs. When running in node or bun and
474
- some bundlers this will work without any additional configuration.
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.
475
508
 
476
- In some cases you may need to manually specify where the SDK loads the wasm bindings from.
509
+ In some cases, you might need to manually specify where the SDK loads the WASM bindings from.
477
510
 
478
- In vite you can get the url for the wasm bindings by importing the wasm file with a `?url` suffix,
479
- and then passed into the walrus client:
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:
480
513
 
481
514
  ```ts
482
515
  const client = new SuiGrpcClient({
@@ -489,8 +522,8 @@ const client = new SuiGrpcClient({
489
522
  );
490
523
  ```
491
524
 
492
- If you are unable to get a url for the wasm file in your bundler or build system, you can self host
493
- the wasm bindings, or load them from a CDN:
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:
494
527
 
495
528
  ```ts
496
529
  const client = new SuiGrpcClient({
@@ -503,8 +536,8 @@ const client = new SuiGrpcClient({
503
536
  );
504
537
  ```
505
538
 
506
- In next.js when using walrus in API routes, you may need to tell next.js to skip bundling for the
507
- walrus packages:
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:
508
541
 
509
542
  ```ts
510
543
  // next.config.ts
@@ -513,9 +546,21 @@ const nextConfig: NextConfig = {
513
546
  };
514
547
  ```
515
548
 
516
- ## Known fetch limitations you might run into
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.
517
555
 
518
- - Some nodes can be slow to respond. When running in node, the default connectTimeout is 10 seconds
519
- and can cause request timeouts
520
- - In `bun` the `abort` signal will stop requests from responding, but they still wait for completion
521
- before their promises reject
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mysten/walrus",
3
- "version": "1.0.4",
3
+ "version": "1.1.1",
4
4
  "private": false,
5
5
  "description": "Walrus SDK",
6
6
  "license": "Apache-2.0",
@@ -30,23 +30,23 @@
30
30
  },
31
31
  "homepage": "https://sdk.mystenlabs.com/walrus",
32
32
  "devDependencies": {
33
- "@hono/node-server": "^1.19.8",
33
+ "@hono/node-server": "^1.19.11",
34
34
  "@tanstack/react-query": "^5.90.16",
35
35
  "@types/node": "^25.0.8",
36
36
  "@types/react": "^19.2.8",
37
37
  "@types/react-dom": "^19.2.3",
38
38
  "@vitejs/plugin-react": "^5.1.2",
39
- "hono": "^4.12.2",
39
+ "hono": "^4.12.8",
40
40
  "react": "^19.2.3",
41
41
  "react-dom": "^19.2.3",
42
42
  "typescript": "^5.9.3",
43
- "undici": "^7.18.2",
44
- "vite": "^7.3.1",
43
+ "undici": "^7.24.4",
44
+ "vite": "^8.0.5",
45
45
  "vitest": "^4.0.17",
46
- "@mysten/codegen": "^0.8.3",
47
- "@mysten/dapp-kit-core": "^1.2.0",
46
+ "@mysten/codegen": "^0.8.4",
47
+ "@mysten/dapp-kit-core": "^1.3.0",
48
48
  "@mysten/dapp-kit-react": "^2.0.1",
49
- "@mysten/sui": "^2.8.0"
49
+ "@mysten/sui": "^2.15.0"
50
50
  },
51
51
  "dependencies": {
52
52
  "dataloader": "^2.2.3",
@@ -55,7 +55,7 @@
55
55
  "@mysten/walrus-wasm": "^0.2.0"
56
56
  },
57
57
  "peerDependencies": {
58
- "@mysten/sui": "^2.8.0"
58
+ "@mysten/sui": "^2.15.0"
59
59
  },
60
60
  "scripts": {
61
61
  "clean": "rm -rf tsconfig.tsbuildinfo ./dist",