@mysten/docs 0.1.74 → 0.1.75

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/sui/index.md +47 -7
  2. package/package.json +21 -21
package/dist/sui/index.md CHANGED
@@ -50,8 +50,8 @@ The following table lists the locations for Sui networks.
50
50
  | Network | Full node | faucet |
51
51
  | ------- | ------------------------------------- | ---------------------------------------- |
52
52
  | local | `http://127.0.0.1:9000` (default) | `http://127.0.0.1:9123/v2/gas` (default) |
53
- | Devnet | `https://fullnode.devnet.sui.io:443` | `https://faucet.devnet.sui.io/v2/gas` |
54
- | Testnet | `https://fullnode.testnet.sui.io:443` | `https://faucet.testnet.sui.io/v2/gas` |
53
+ | Devnet | `https://fullnode.devnet.sui.io:443` | `https://faucet.devnet.sui.io/v3/gas` |
54
+ | Testnet | `https://fullnode.testnet.sui.io:443` | `https://faucet.testnet.sui.io/v3/gas` |
55
55
  | Mainnet | `https://fullnode.mainnet.sui.io:443` | `null` |
56
56
 
57
57
  > **Warning:** Use dedicated nodes/shared services rather than public endpoints for production apps. The public
@@ -92,7 +92,7 @@ console.log('Address:', keypair.toSuiAddress());
92
92
  console.log('Secret key:', keypair.getSecretKey());
93
93
 
94
94
  // Request SUI from the devnet faucet
95
- await requestSuiFromFaucetV2({
95
+ await requestSuiFromFaucetV3({
96
96
  host: getFaucetHost('devnet'),
97
97
  recipient: keypair.toSuiAddress(),
98
98
  });
@@ -183,17 +183,57 @@ node transfer.ts
183
183
 
184
184
  ### Faucet
185
185
 
186
- Devnet, Testnet, and local networks include faucets that mint SUI. Use `requestSuiFromFaucetV2` to
187
- request SUI programmatically:
186
+ Use `requestSuiFromFaucetV3` on Devnet and Testnet. It fetches a challenge from `/v3/challenge`,
187
+ computes Argon2d proof-of-work, and submits the proof to `/v3/gas`:
188
188
 
189
189
  ```typescript
190
190
 
191
- await requestSuiFromFaucetV2({
191
+ const result = await requestSuiFromFaucetV3({
192
192
  host: getFaucetHost('testnet'),
193
- recipient: '0xYourAddress',
193
+ recipient: '0xYourAddress', // Replace with your Sui address.
194
+ timeout: 180_000,
194
195
  });
196
+
197
+ console.log(result.digest, result.amountMist);
195
198
  ```
196
199
 
200
+ V3 credits the recipient's address balance, not a coin object. Its response contains `digest`,
201
+ `recipient`, `amountMist`, and `difficulty`; it does not contain V2's `coins_sent`. Amounts are
202
+ returned as decimal strings to preserve precision. The faucet sets the payout amount.
203
+
204
+ Set `host` to the faucet's origin (scheme, hostname, and optional port), such as
205
+ `https://faucet.testnet.sui.io`. The API must serve `/v3/challenge` and `/v3/gas` at the origin
206
+ root. Path prefixes such as `/faucet` are not supported; any path in `host` is discarded.
207
+
208
+ Optional `headers` apply to both requests. The `timeout` covers fetching, solving, and submission,
209
+ and defaults to 180,000 milliseconds. Pass an `AbortSignal` as `signal` to cancel earlier.
210
+
211
+ The helper uses Node's asynchronous native Argon2d when available (Node 24.7 or newer), with Noble
212
+ as the fallback for Node 22 and browsers. Native hashing does not require an addon. Browser apps can
213
+ run the helper in a Web Worker to keep proof-of-work off the UI thread.
214
+
215
+ For a local **no-PoW faucet**, keep using V2:
216
+
217
+ ```typescript
218
+
219
+ await requestSuiFromFaucetV2({
220
+ host: getFaucetHost('localnet'),
221
+ recipient: '0xYourAddress', // Replace with your Sui address.
222
+ });
223
+ ```
224
+
225
+ For a local **PoW faucet**, use `requestSuiFromFaucetV3` and set `host` to its origin, with
226
+ `/v3/challenge` and `/v3/gas` served at the origin root. If it listens on the default local faucet
227
+ port, use `getFaucetHost('localnet')`. The helper does not infer the protocol from the host or fall
228
+ back to V2.
229
+
230
+ V3 refreshes expired challenges before submission but never automatically retries a payout. HTTP 429
231
+ throws `FaucetRateLimitError`. Other HTTP errors throw `FaucetError`, which exposes `status` and,
232
+ when provided by the server, `code` and a transaction `digest`. Non-JSON error responses use a
233
+ fallback message and preserve the parse error as `cause`. If a digest is present, resolve that
234
+ transaction before requesting another payout. A timeout or connection loss during submission does
235
+ not prove the payout failed; do not blindly retry it.
236
+
197
237
  > **Note:** Faucets on Devnet and Testnet are rate limited. If you hit the limit, wait before trying again.
198
238
  > For Testnet, you can also get SUI through the web UI at `faucet.sui.io` or through the [Sui
199
239
  > Discord](https://discord.gg/sui) faucet channels.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mysten/docs",
3
- "version": "0.1.74",
3
+ "version": "0.1.75",
4
4
  "description": "LLM-friendly documentation for the Sui TypeScript SDK ecosystem",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -25,30 +25,30 @@
25
25
  "fumadocs-mdx": "15.2.3",
26
26
  "fumadocs-typescript": "^5.3.0",
27
27
  "fumadocs-ui": "16.14.4",
28
- "next": "^16.3.4",
28
+ "next": "^16.3.6",
29
29
  "react": "^19.2.8",
30
30
  "react-dom": "^19.2.8",
31
- "@mysten/aws-kms-signer": "0.3.28",
32
- "@mysten/dapp-kit-core": "1.6.35",
33
- "@mysten/deepbook-v3": "2.6.6",
34
- "@mysten/enoki": "1.2.29",
35
- "@mysten/dapp-kit-react": "2.1.37",
36
- "@mysten/gcp-kms-signer": "0.2.31",
37
- "@mysten/kiosk": "1.4.17",
38
31
  "@mysten/bcs": "2.1.2",
39
- "@mysten/enoki-connect": "1.1.33",
40
- "@mysten/ledger-signer": "0.2.31",
41
- "@mysten/payment-kit": "0.2.31",
42
- "@mysten/seal": "1.4.17",
43
- "@mysten/signers": "1.1.31",
44
- "@mysten/slush-wallet": "1.3.1",
45
- "@mysten/sui": "2.33.2",
46
- "@mysten/suins": "2.0.13",
32
+ "@mysten/dapp-kit-core": "1.6.36",
33
+ "@mysten/deepbook-v3": "2.6.7",
34
+ "@mysten/enoki": "1.2.30",
35
+ "@mysten/aws-kms-signer": "0.3.29",
36
+ "@mysten/dapp-kit-react": "2.1.38",
37
+ "@mysten/enoki-connect": "1.1.34",
38
+ "@mysten/gcp-kms-signer": "0.2.32",
39
+ "@mysten/kiosk": "1.4.18",
40
+ "@mysten/ledger-signer": "0.2.32",
41
+ "@mysten/payment-kit": "0.2.32",
42
+ "@mysten/signers": "1.1.32",
43
+ "@mysten/seal": "1.4.18",
44
+ "@mysten/slush-wallet": "1.3.2",
45
+ "@mysten/sui": "2.34.0",
46
+ "@mysten/suins": "2.0.14",
47
+ "@mysten/wallet-standard": "0.21.32",
47
48
  "@mysten/utils": "0.4.1",
48
- "@mysten/wallet-standard": "0.21.31",
49
- "@mysten/walrus": "1.2.32",
50
- "@mysten/zksend": "1.2.34",
51
- "@mysten/webcrypto-signer": "0.2.31"
49
+ "@mysten/webcrypto-signer": "0.2.32",
50
+ "@mysten/zksend": "1.2.35",
51
+ "@mysten/walrus": "1.2.33"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@tailwindcss/postcss": "^4.3.3",