@mysten/docs 0.1.4 → 0.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.
@@ -345,6 +345,21 @@ console.log(result.effects);
345
345
  console.log(result.balanceChanges);
346
346
  ```
347
347
 
348
+ #### Disabling Checks
349
+
350
+ By default, `simulateTransaction` runs with full transaction validation. For example when inspecting
351
+ non-public or non-entry Move functions set `checksEnabled: false`:
352
+
353
+ ```typescript
354
+ const result = await client.core.simulateTransaction({
355
+ transaction: transactionBytes,
356
+ checksEnabled: false,
357
+ include: {
358
+ commandResults: true,
359
+ },
360
+ });
361
+ ```
362
+
348
363
  ### signAndExecuteTransaction
349
364
 
350
365
  Sign and execute a transaction in one step.
@@ -54,11 +54,27 @@ These JSON-RPC methods have direct replacements in the core API:
54
54
  | `multiGetObjects` | `getObjects` |
55
55
  | `getDynamicFields` | `listDynamicFields` |
56
56
  | `getDynamicFieldObject` | `getDynamicField` |
57
- | `devInspectTransactionBlock` | `simulateTransaction` |
57
+ | `devInspectTransactionBlock` | `simulateTransaction` with `checksEnabled: false` |
58
58
  | `dryRunTransactionBlock` | `simulateTransaction` |
59
59
  | `getNormalizedMoveFunction` | `getMoveFunction` |
60
60
  | `getMoveFunctionArgTypes` | `getMoveFunction` |
61
61
 
62
+ ### Example: Migrating devInspectTransactionBlock
63
+
64
+ ```diff
65
+ - const result = await jsonRpcClient.devInspectTransactionBlock({
66
+ - sender: '0xabc...',
67
+ - transactionBlock: tx,
68
+ - });
69
+ - const returnValues = result.results?.[0]?.returnValues;
70
+ + const result = await client.core.simulateTransaction({
71
+ + transaction: tx,
72
+ + checksEnabled: false,
73
+ + include: { commandResults: true },
74
+ + });
75
+ + const returnValues = result.commandResults?.[0]?.returnValues;
76
+ ```
77
+
62
78
  ### Example: Migrating getOwnedObjects
63
79
 
64
80
  ```diff
@@ -56,4 +56,25 @@ const key = bcsType.serialize({ value: 1 }).toBytes();
56
56
 
57
57
  // Derive the object ID for the key `DemoStruct { value: 1 }`.
58
58
  deriveObjectID('0xc0ffee', `0xc0ffee::demo::DemoStruct`, key);
59
- ```
59
+ ```
60
+
61
+ ### Deriving with fieldless structs
62
+
63
+ In Move, structs with no user-defined fields automatically get a `dummy_field: bool` injected by the
64
+ compiler. This means their BCS encoding is not empty — it's a single `0x00` byte (the encoding of
65
+ `false`). You can treat this as a constant.
66
+
67
+ A real-world example is `0x2::coin_registry::CurrencyKey<T>`, which is a fieldless generic struct
68
+ used to derive `Currency` objects from the coin registry (`0xc`) based on their type:
69
+
70
+ ```typescript
71
+ // On-chain: `public struct CurrencyKey<phantom T>() has copy, store, drop`
72
+ // The compiler injects `dummy_field: bool`, always `false`.
73
+ const key = new Uint8Array([0]);
74
+
75
+ const coinType = '0x2::sui::SUI';
76
+ const currencyId = deriveObjectID('0xc', `0x2::coin_registry::CurrencyKey<${coinType}>`, key);
77
+ ```
78
+
79
+ This applies to any struct with no fields — phantom type parameters don't add any BCS-encoded data,
80
+ so the key is always `new Uint8Array([0])`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mysten/docs",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "LLM-friendly documentation for the Sui TypeScript SDK ecosystem",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -23,26 +23,26 @@
23
23
  "fumadocs-typescript": "^5.0.1",
24
24
  "fumadocs-ui": "16.4.7",
25
25
  "gray-matter": "^4.0.3",
26
- "next": "^16.1.6",
26
+ "next": "^16.1.7",
27
27
  "react": "^19.2.3",
28
28
  "react-dom": "^19.2.3",
29
29
  "@mysten/bcs": "2.0.3",
30
30
  "@mysten/dapp-kit": "1.0.4",
31
- "@mysten/dapp-kit-core": "1.2.0",
31
+ "@mysten/dapp-kit-core": "1.2.1",
32
32
  "@mysten/dapp-kit-react": "2.0.1",
33
33
  "@mysten/deepbook-v3": "1.2.1",
34
+ "@mysten/enoki": "1.0.4",
34
35
  "@mysten/enoki-connect": "1.0.2",
35
36
  "@mysten/kiosk": "1.1.3",
36
37
  "@mysten/payment-kit": "0.1.3",
37
38
  "@mysten/seal": "1.1.1",
38
39
  "@mysten/signers": "1.0.2",
39
40
  "@mysten/slush-wallet": "1.0.3",
40
- "@mysten/enoki": "1.0.4",
41
+ "@mysten/sui": "2.12.0",
41
42
  "@mysten/suins": "1.0.2",
42
- "@mysten/sui": "2.11.0",
43
+ "@mysten/utils": "0.3.1",
43
44
  "@mysten/wallet-standard": "0.20.1",
44
45
  "@mysten/walrus": "1.1.0",
45
- "@mysten/utils": "0.3.1",
46
46
  "@mysten/zksend": "1.0.3"
47
47
  },
48
48
  "devDependencies": {