@mysten/sui 2.16.1 → 2.16.2

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 (62) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/bcs/index.d.mts +20 -20
  3. package/dist/grpc/proto/sui/rpc/v2/ledger_service.client.d.mts +4 -4
  4. package/dist/grpc/proto/sui/rpc/v2/move_package_service.client.d.mts +4 -4
  5. package/dist/grpc/proto/sui/rpc/v2/name_service.client.d.mts +4 -4
  6. package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.mts +4 -4
  7. package/dist/grpc/proto/sui/rpc/v2/state_service.client.d.mts +4 -4
  8. package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.d.mts +4 -4
  9. package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.client.d.mts +4 -4
  10. package/dist/transactions/Transaction.d.mts +4 -4
  11. package/dist/transactions/data/internal.d.mts +109 -109
  12. package/dist/transactions/data/internal.d.mts.map +1 -1
  13. package/dist/transactions/data/v1.d.mts +220 -220
  14. package/dist/transactions/data/v1.d.mts.map +1 -1
  15. package/dist/transactions/data/v2.d.mts +16 -16
  16. package/dist/transactions/data/v2.d.mts.map +1 -1
  17. package/dist/version.mjs +1 -1
  18. package/dist/version.mjs.map +1 -1
  19. package/docs/bcs.md +134 -0
  20. package/docs/clients/core.md +622 -0
  21. package/docs/clients/graphql.md +101 -0
  22. package/docs/clients/grpc.md +210 -0
  23. package/docs/clients/index.md +95 -0
  24. package/docs/clients/json-rpc.md +239 -0
  25. package/docs/cryptography/keypairs.md +267 -0
  26. package/docs/cryptography/multisig.md +194 -0
  27. package/docs/cryptography/passkey.md +112 -0
  28. package/docs/cryptography/webcrypto-signer.md +81 -0
  29. package/docs/executors.md +150 -0
  30. package/docs/faucet.md +26 -0
  31. package/docs/hello-sui.md +115 -0
  32. package/docs/index.md +53 -0
  33. package/docs/install.md +61 -0
  34. package/docs/llm-docs.md +32 -0
  35. package/docs/llms-index.md +44 -0
  36. package/docs/migrations/0.38.md +58 -0
  37. package/docs/migrations/sui-1.0.md +455 -0
  38. package/docs/migrations/sui-2.0/agent-prompt.md +42 -0
  39. package/docs/migrations/sui-2.0/dapp-kit.md +350 -0
  40. package/docs/migrations/sui-2.0/deepbook-v3.md +33 -0
  41. package/docs/migrations/sui-2.0/index.md +158 -0
  42. package/docs/migrations/sui-2.0/json-rpc-migration.md +408 -0
  43. package/docs/migrations/sui-2.0/kiosk.md +120 -0
  44. package/docs/migrations/sui-2.0/sdk-maintainers.md +90 -0
  45. package/docs/migrations/sui-2.0/seal.md +14 -0
  46. package/docs/migrations/sui-2.0/sui.md +341 -0
  47. package/docs/migrations/sui-2.0/suins.md +44 -0
  48. package/docs/migrations/sui-2.0/wallet-builders.md +66 -0
  49. package/docs/migrations/sui-2.0/walrus.md +41 -0
  50. package/docs/migrations/sui-2.0/zksend.md +95 -0
  51. package/docs/plugins.md +258 -0
  52. package/docs/sdk-building.md +344 -0
  53. package/docs/transaction-building/basics.md +299 -0
  54. package/docs/transaction-building/gas.md +61 -0
  55. package/docs/transaction-building/intents.md +62 -0
  56. package/docs/transaction-building/offline.md +73 -0
  57. package/docs/transaction-building/sponsored-transactions.md +22 -0
  58. package/docs/utils/derived_objects.md +80 -0
  59. package/docs/utils/index.md +59 -0
  60. package/docs/zklogin.md +83 -0
  61. package/package.json +3 -3
  62. package/src/version.ts +1 -1
package/docs/bcs.md ADDED
@@ -0,0 +1,134 @@
1
+ # BCS
2
+
3
+ > Binary Canonical Serialization for encoding Sui Move types.
4
+
5
+ The `@mysten/sui/bcs` package extends `@mysten/bcs` with Sui specific scheme definitions.
6
+
7
+ To learn more about using BCS see the [BCS documentation](/bcs).
8
+
9
+ the `bcs` export of `@mysten/sui/bcs` contains all the same exports as `bcs` from `@mysten/bcs` plus
10
+ the following pre-defined schemes:
11
+
12
+ - `U8`
13
+ - `U16`
14
+ - `U32`
15
+ - `U64`
16
+ - `U128`
17
+ - `U256`
18
+ - `ULEB128`
19
+ - `Bool`
20
+ - `String`
21
+ - `Address`
22
+ - `Argument`
23
+ - `CallArg`
24
+ - `CompressedSignature`
25
+ - `GasData`
26
+ - `MultiSig`
27
+ - `MultiSigPkMap`
28
+ - `MultiSigPublicKey`
29
+ - `ObjectArg`
30
+ - `ObjectDigest`
31
+ - `ProgrammableMoveCall`
32
+ - `ProgrammableTransaction`
33
+ - `PublicKey`
34
+ - `SenderSignedData`
35
+ - `SharedObjectRef`
36
+ - `StructTag`
37
+ - `SuiObjectRef`
38
+ - `Transaction`
39
+ - `TransactionData`
40
+ - `TransactionDataV1`
41
+ - `TransactionExpiration`
42
+ - `TransactionKind`
43
+ - `TypeTag`
44
+ - `Object`: Complete object with data, owner, previousTransaction, and storageRebate
45
+ - `TransactionEffects`: Transaction execution effects (supports both V1 and V2)
46
+ - `TransactionEffectsV1`: Legacy transaction effects format
47
+ - `TransactionEffectsV2`: Current transaction effects format with detailed object changes
48
+
49
+ All the upper-cased values are `BcsType` instances, and can be used directly to parse and serialize
50
+ data.
51
+
52
+ ```typescript
53
+
54
+ bcs.U8.serialize(1);
55
+ bcs.Address.serialize('0x1');
56
+ bcs.TypeTag.serialize({
57
+ vector: {
58
+ u8: true,
59
+ },
60
+ });
61
+ ```
62
+
63
+ ## Working with objects
64
+
65
+ To parse onchain objects, fetch them with `include: { content: true }` and pass `object.content` to
66
+ a generated BCS type or a manual struct definition. The `content` field contains only the inner Move
67
+ struct bytes:
68
+
69
+ ```typescript
70
+
71
+ const { object } = await client.core.getObject({
72
+ objectId: '0x123...',
73
+ include: { content: true },
74
+ });
75
+
76
+ const parsed = MyStruct.parse(object.content);
77
+ ```
78
+
79
+ ### `bcs.Object`: Full object envelope
80
+
81
+ The `bcs.Object` schema represents the complete onchain object, including metadata (type, owner,
82
+ version, previous transaction, storage rebate) wrapping the inner struct bytes. This is what the
83
+ `objectBcs` include option returns. Most of this metadata is already available as fields on the
84
+ object response, so you typically only need `content`.
85
+
86
+ ```typescript
87
+
88
+ // Parse a full object envelope (from objectBcs include option)
89
+ const envelope = bcs.Object.parse(object.objectBcs);
90
+ console.log('Owner:', envelope.owner);
91
+ console.log('Inner struct bytes:', envelope.data.Move.contents);
92
+
93
+ // Serialize a full object envelope
94
+ const serialized = bcs.Object.serialize({
95
+ data: {
96
+ Move: {
97
+ type: { GasCoin: null },
98
+ hasPublicTransfer: true,
99
+ version: '1',
100
+ contents: new Uint8Array([...]),
101
+ },
102
+ },
103
+ owner: { AddressOwner: '0x...' },
104
+ previousTransaction: '...',
105
+ storageRebate: '1000',
106
+ });
107
+ ```
108
+
109
+ > **Warning:** Do not pass `objectBcs` bytes to a Move struct parser. It contains wrapping metadata that will
110
+ > cause parsing to fail. Use `content` for parsing Move struct fields. See the [Core API
111
+ > docs](/sui/clients/core#objectbcs) for details.
112
+
113
+ ## Working with transaction effects
114
+
115
+ The `bcs.TransactionEffects` schema can be used to parse transaction effects:
116
+
117
+ ```typescript
118
+
119
+ // Parse transaction effects
120
+ const effects = bcs.TransactionEffects.parse(effectsBytes);
121
+
122
+ // Check execution status
123
+ if (effects.V2.status.$kind === 'Success') {
124
+ console.log('Transaction succeeded');
125
+ } else {
126
+ console.log('Transaction failed:', effects.V2.status.Failure.error);
127
+ }
128
+
129
+ // Access changed objects
130
+ for (const [objectId, change] of effects.V2.changedObjects) {
131
+ console.log('Object:', objectId);
132
+ console.log('Output state:', change.outputState.$kind);
133
+ }
134
+ ```