@mysten/docs 0.1.56 → 0.1.58

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.
@@ -55,16 +55,39 @@ console.log(transaction.digest, result.protoJson);
55
55
 
56
56
  ## Transport options
57
57
 
58
- By default, `SuiGrpcClient` uses `GrpcWebFetchTransport` from
59
- [protobuf-ts](https://github.com/timostamm/protobuf-ts), which works in browsers and Node.js through
60
- the Fetch API. The `GrpcWebFetchTransport` class, `GrpcWebOptions` type, and `RpcTransport` type are
61
- re-exported from `@mysten/sui/grpc`, so you can configure a transport without adding
62
- `@protobuf-ts/*` as a direct dependency.
58
+ By default, `SuiGrpcClient` uses `GrpcWebFetchTransport`, which works in browsers and Node.js
59
+ through the Fetch API. `@mysten/sui/grpc` exports it alongside the `GrpcWebOptions` and
60
+ `RpcTransport` types, and the `RpcError` class and `GrpcStatusCode` enum that gRPC failures use, so
61
+ you can configure a transport and handle its errors without adding `@protobuf-ts/*` as a direct
62
+ dependency.
63
+
64
+ That class extends the transport of the same name from
65
+ [protobuf-ts](https://github.com/timostamm/protobuf-ts) and fixes two defects in it:
66
+
67
+ - It decodes status messages, rather than delivering them as `Object%20not%20found:%200x1`.
68
+ - It codes a call that an abort ended from the reason the abort carried: `DEADLINE_EXCEEDED` for an
69
+ `AbortSignal.timeout`, the status on a reason carrying one, and `CANCELLED` otherwise. Upstream
70
+ reports all but a standard `AbortError` cancellation as `INTERNAL`.
71
+
72
+ Build custom transports from this class. `SuiGrpcClient` uses a transport you pass it as given.
63
73
 
64
74
  ### gRPC-web transport (default)
65
75
 
66
- The default transport uses the gRPC-web protocol over HTTP/1.1 or HTTP/2. Pass
67
- `GrpcWebFetchTransport` options to customize it:
76
+ The default transport uses the gRPC-web protocol over HTTP/1.1 or HTTP/2. `SuiGrpcClient` passes the
77
+ `GrpcWebOptions` it is given to the transport it builds, so most configuration needs no transport of
78
+ your own. The one exception is `abort`: Core API calls each carry their own signal, so a client-wide
79
+ one is not forwarded.
80
+
81
+ ```typescript
82
+
83
+ const client = new SuiGrpcClient({
84
+ network: 'testnet',
85
+ baseUrl: 'https://your-custom-grpc-endpoint.com',
86
+ format: 'binary', // default is 'text' (base64-encoded)
87
+ });
88
+ ```
89
+
90
+ Build the transport yourself to share one between clients, or to subclass it:
68
91
 
69
92
  ```typescript
70
93
 
@@ -228,6 +251,7 @@ const result = parseGrpcTransactionResponse(response.transaction!, {
228
251
  | `parseGrpcTransactionResponse` | Raw `ExecutedTransaction` to the unified result shape |
229
252
  | `parseGrpcSimulateTransactionResponse` | Raw simulation response to the unified result shape |
230
253
  | `GrpcWebFetchTransport`, `GrpcWebOptions`, `RpcTransport` | Configuring a [transport](#transport-options) |
254
+ | `RpcError`, `GrpcStatusCode` | Narrowing and coding gRPC failures |
231
255
  | `SuiGrpcClientOptions`, `GrpcTransactionInclude`, … | Typing your own wrappers around the client |
232
256
  | `isSuiGrpcClient` | Type guard for narrowing an unknown client |
233
257
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mysten/docs",
3
- "version": "0.1.56",
3
+ "version": "0.1.58",
4
4
  "description": "LLM-friendly documentation for the Sui TypeScript SDK ecosystem",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -28,27 +28,27 @@
28
28
  "next": "^16.3.1",
29
29
  "react": "^19.2.8",
30
30
  "react-dom": "^19.2.8",
31
- "@mysten/aws-kms-signer": "0.3.18",
31
+ "@mysten/aws-kms-signer": "0.3.19",
32
32
  "@mysten/bcs": "2.1.1",
33
- "@mysten/deepbook-v3": "2.1.3",
34
- "@mysten/dapp-kit-react": "2.1.23",
35
- "@mysten/dapp-kit-core": "1.6.21",
36
- "@mysten/enoki": "1.2.19",
37
- "@mysten/enoki-connect": "1.1.21",
38
- "@mysten/kiosk": "1.4.7",
39
- "@mysten/ledger-signer": "0.2.21",
40
- "@mysten/payment-kit": "0.2.21",
41
- "@mysten/gcp-kms-signer": "0.2.21",
42
- "@mysten/seal": "1.4.7",
43
- "@mysten/slush-wallet": "1.1.21",
44
- "@mysten/signers": "1.1.21",
45
- "@mysten/sui": "2.28.0",
33
+ "@mysten/dapp-kit-react": "2.1.25",
34
+ "@mysten/deepbook-v3": "2.1.4",
35
+ "@mysten/dapp-kit-core": "1.6.23",
36
+ "@mysten/enoki": "1.2.20",
37
+ "@mysten/enoki-connect": "1.1.22",
38
+ "@mysten/gcp-kms-signer": "0.2.22",
39
+ "@mysten/kiosk": "1.4.8",
40
+ "@mysten/seal": "1.4.8",
41
+ "@mysten/signers": "1.1.22",
42
+ "@mysten/ledger-signer": "0.2.22",
43
+ "@mysten/slush-wallet": "1.1.23",
44
+ "@mysten/payment-kit": "0.2.22",
45
+ "@mysten/sui": "2.29.0",
46
+ "@mysten/suins": "2.0.4",
46
47
  "@mysten/utils": "0.4.1",
47
- "@mysten/wallet-standard": "0.21.21",
48
- "@mysten/suins": "2.0.3",
49
- "@mysten/walrus": "1.2.22",
50
- "@mysten/webcrypto-signer": "0.2.21",
51
- "@mysten/zksend": "1.2.22"
48
+ "@mysten/wallet-standard": "0.21.22",
49
+ "@mysten/walrus": "1.2.23",
50
+ "@mysten/webcrypto-signer": "0.2.22",
51
+ "@mysten/zksend": "1.2.23"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@tailwindcss/postcss": "^4.3.3",