@mysten/sui 2.6.0 → 2.8.0

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 (99) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/bcs/bcs.d.mts +6 -6
  3. package/dist/bcs/index.d.mts +20 -20
  4. package/dist/client/types.d.mts +17 -0
  5. package/dist/client/types.d.mts.map +1 -1
  6. package/dist/cryptography/signature.d.mts +14 -14
  7. package/dist/graphql/core.d.mts.map +1 -1
  8. package/dist/graphql/core.mjs +21 -8
  9. package/dist/graphql/core.mjs.map +1 -1
  10. package/dist/graphql/generated/queries.d.mts.map +1 -1
  11. package/dist/graphql/generated/queries.mjs +18 -3
  12. package/dist/graphql/generated/queries.mjs.map +1 -1
  13. package/dist/graphql/generated/tada-env.d.mts +703 -73
  14. package/dist/grpc/core.d.mts.map +1 -1
  15. package/dist/grpc/core.mjs +15 -2
  16. package/dist/grpc/core.mjs.map +1 -1
  17. package/dist/grpc/proto/sui/rpc/v2/move_package_service.client.d.mts +4 -4
  18. package/dist/grpc/proto/sui/rpc/v2/object.d.mts +38 -1
  19. package/dist/grpc/proto/sui/rpc/v2/object.d.mts.map +1 -1
  20. package/dist/grpc/proto/sui/rpc/v2/object.mjs +26 -1
  21. package/dist/grpc/proto/sui/rpc/v2/object.mjs.map +1 -1
  22. package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.mts +4 -4
  23. package/dist/grpc/proto/sui/rpc/v2/state_service.client.d.mts +4 -4
  24. package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.d.mts +4 -4
  25. package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.client.d.mts +4 -4
  26. package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.d.mts +8 -0
  27. package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.d.mts.map +1 -1
  28. package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.mjs +23 -12
  29. package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.mjs.map +1 -1
  30. package/dist/grpc/proto/types.d.mts +2 -2
  31. package/dist/grpc/proto/types.mjs +2 -1
  32. package/dist/jsonRpc/core.d.mts.map +1 -1
  33. package/dist/jsonRpc/core.mjs +10 -3
  34. package/dist/jsonRpc/core.mjs.map +1 -1
  35. package/dist/keypairs/passkey/keypair.d.mts +11 -4
  36. package/dist/keypairs/passkey/keypair.d.mts.map +1 -1
  37. package/dist/keypairs/passkey/keypair.mjs +19 -6
  38. package/dist/keypairs/passkey/keypair.mjs.map +1 -1
  39. package/dist/transactions/Transaction.d.mts +9 -9
  40. package/dist/transactions/Transaction.d.mts.map +1 -1
  41. package/dist/version.mjs +2 -2
  42. package/dist/version.mjs.map +1 -1
  43. package/dist/zklogin/bcs.d.mts +14 -14
  44. package/docs/bcs.md +131 -0
  45. package/docs/clients/core.md +601 -0
  46. package/docs/clients/graphql.md +99 -0
  47. package/docs/clients/grpc.md +152 -0
  48. package/docs/clients/index.md +93 -0
  49. package/docs/clients/json-rpc.md +235 -0
  50. package/docs/cryptography/keypairs.md +258 -0
  51. package/docs/cryptography/multisig.md +192 -0
  52. package/docs/cryptography/passkey.md +111 -0
  53. package/docs/cryptography/webcrypto-signer.md +81 -0
  54. package/docs/executors.md +147 -0
  55. package/docs/faucet.md +26 -0
  56. package/docs/hello-sui.md +114 -0
  57. package/docs/index.md +54 -0
  58. package/docs/install.md +61 -0
  59. package/docs/llm-docs.md +32 -0
  60. package/docs/llms-index.md +60 -0
  61. package/docs/migrations/0.38.md +57 -0
  62. package/docs/migrations/sui-1.0.md +453 -0
  63. package/docs/migrations/sui-2.0/agent-prompt.md +42 -0
  64. package/docs/migrations/sui-2.0/dapp-kit.md +350 -0
  65. package/docs/migrations/sui-2.0/deepbook-v3.md +33 -0
  66. package/docs/migrations/sui-2.0/index.md +157 -0
  67. package/docs/migrations/sui-2.0/json-rpc-migration.md +383 -0
  68. package/docs/migrations/sui-2.0/kiosk.md +120 -0
  69. package/docs/migrations/sui-2.0/sdk-maintainers.md +90 -0
  70. package/docs/migrations/sui-2.0/seal.md +14 -0
  71. package/docs/migrations/sui-2.0/sui.md +341 -0
  72. package/docs/migrations/sui-2.0/suins.md +42 -0
  73. package/docs/migrations/sui-2.0/wallet-builders.md +66 -0
  74. package/docs/migrations/sui-2.0/walrus.md +41 -0
  75. package/docs/migrations/sui-2.0/zksend.md +94 -0
  76. package/docs/plugins.md +255 -0
  77. package/docs/sdk-building.md +340 -0
  78. package/docs/transaction-building/basics.md +297 -0
  79. package/docs/transaction-building/gas.md +62 -0
  80. package/docs/transaction-building/intents.md +61 -0
  81. package/docs/transaction-building/offline.md +71 -0
  82. package/docs/transaction-building/sponsored-transactions.md +22 -0
  83. package/docs/utils/derived_objects.md +59 -0
  84. package/docs/utils/index.md +52 -0
  85. package/docs/zklogin.md +78 -0
  86. package/package.json +5 -3
  87. package/src/client/types.ts +16 -0
  88. package/src/graphql/core.ts +34 -13
  89. package/src/graphql/generated/queries.ts +252 -14
  90. package/src/graphql/generated/schema.graphql +324 -8
  91. package/src/graphql/generated/tada-env.ts +844 -99
  92. package/src/graphql/queries/objects.graphql +10 -0
  93. package/src/graphql/queries/verifyZkLoginSignature.graphql +0 -1
  94. package/src/grpc/core.ts +34 -0
  95. package/src/grpc/proto/sui/rpc/v2/object.ts +44 -0
  96. package/src/grpc/proto/sui/rpc/v2/transaction_execution_service.ts +16 -0
  97. package/src/jsonRpc/core.ts +9 -0
  98. package/src/keypairs/passkey/keypair.ts +20 -6
  99. package/src/version.ts +2 -2
@@ -0,0 +1,383 @@
1
+ # Migrating from JSON-RPC
2
+
3
+ > Migrate from JSON-RPC to the new Core API
4
+
5
+ This guide covers migrating from `SuiJsonRpcClient` to the new client APIs. The JSON-RPC API is
6
+ being deprecated in favor of `SuiGrpcClient` and `SuiGraphQLClient`.
7
+
8
+ > **Note:** We recommend using `SuiGrpcClient` for most operations and `SuiGraphQLClient` for
9
+ > complex queries like filtering transactions and events.
10
+
11
+ ## Choosing a Client
12
+
13
+ | Client | Best For |
14
+ | ------------------ | --------------------------------------------------------------- |
15
+ | `SuiGrpcClient` | Most operations, SDK integrations, real-time data |
16
+ | `SuiGraphQLClient` | Complex queries, filtering transactions/events, historical data |
17
+
18
+ ## Quick Migration to gRPC
19
+
20
+ For most use cases, migrate to `SuiGrpcClient`:
21
+
22
+ ```diff
23
+ - import { SuiJsonRpcClient, getJsonRpcFullnodeUrl } from '@mysten/sui/jsonRpc';
24
+ + import { SuiGrpcClient } from '@mysten/sui/grpc';
25
+
26
+ - const client = new SuiJsonRpcClient({
27
+ - url: getJsonRpcFullnodeUrl('mainnet'),
28
+ - network: 'mainnet',
29
+ - });
30
+ + const client = new SuiGrpcClient({
31
+ + baseUrl: 'https://fullnode.mainnet.sui.io:443',
32
+ + network: 'mainnet',
33
+ + });
34
+ ```
35
+
36
+ Both clients use the same full node URLs, so you can use the same endpoint when migrating.
37
+
38
+ ## Core API Methods
39
+
40
+ The gRPC client should work with almost all mysten SDKs as a drop in replacement for the JSON-RPC
41
+ client. When using the client directly, the methods and data returned will not be exactly the same
42
+ as what was available in JSON-RPC.
43
+
44
+ ## Methods Replaced by Core API
45
+
46
+ These JSON-RPC methods have direct replacements in the core API:
47
+
48
+ | JSON-RPC Method | Core API Replacement |
49
+ | ---------------------------- | ------------------------------------------------- |
50
+ | `getCoins` | `listCoins` |
51
+ | `getAllCoins` | `listOwnedObjects` with `type: '0x2::coin::Coin'` |
52
+ | `getAllBalances` | `listBalances` |
53
+ | `getOwnedObjects` | `listOwnedObjects` |
54
+ | `multiGetObjects` | `getObjects` |
55
+ | `getDynamicFields` | `listDynamicFields` |
56
+ | `getDynamicFieldObject` | `getDynamicField` |
57
+ | `devInspectTransactionBlock` | `simulateTransaction` |
58
+ | `dryRunTransactionBlock` | `simulateTransaction` |
59
+ | `getNormalizedMoveFunction` | `getMoveFunction` |
60
+ | `getMoveFunctionArgTypes` | `getMoveFunction` |
61
+
62
+ ### Example: Migrating getOwnedObjects
63
+
64
+ ```diff
65
+ - const { data } = await jsonRpcClient.getOwnedObjects({
66
+ - owner: '0xabc...',
67
+ - options: { showContent: true },
68
+ - });
69
+ + const { objects } = await grpcClient.listOwnedObjects({
70
+ + owner: '0xabc...',
71
+ + include: { content: true },
72
+ + });
73
+ ```
74
+
75
+ ## Methods Replaced by gRPC Services
76
+
77
+ These JSON-RPC methods can be replaced by calling gRPC service clients directly:
78
+
79
+ | JSON-RPC Method | gRPC Service Replacement |
80
+ | ----------------------------------- | --------------------------------- |
81
+ | `getCheckpoint` | `ledgerService.getCheckpoint` |
82
+ | `getCheckpoints` | `ledgerService.listCheckpoints` |
83
+ | `getLatestCheckpointSequenceNumber` | `ledgerService.getCheckpoint` |
84
+ | `getEpochs` | `ledgerService.listEpochs` |
85
+ | `getCurrentEpoch` | `ledgerService.getEpoch` |
86
+ | `getLatestSuiSystemState` | `ledgerService.getSystemState` |
87
+ | `getCommitteeInfo` | `ledgerService.getCommittee` |
88
+ | `getValidatorsApy` | `ledgerService.getValidators` |
89
+ | `getProtocolConfig` | `ledgerService.getProtocolConfig` |
90
+ | `getNormalizedMoveModule` | `movePackageService.getModule` |
91
+ | `getNormalizedMoveModulesByPackage` | `movePackageService.getPackage` |
92
+ | `getNormalizedMoveStruct` | `movePackageService.getStruct` |
93
+ | `resolveNameServiceAddress` | `nameService.lookupName` |
94
+ | `resolveNameServiceNames` | `nameService.reverseLookupName` |
95
+
96
+ ### Example: Using gRPC Service Clients
97
+
98
+ ```typescript
99
+ const client = new SuiGrpcClient({
100
+ baseUrl: 'https://fullnode.mainnet.sui.io:443',
101
+ network: 'mainnet',
102
+ });
103
+
104
+ // Get checkpoint information
105
+ const { response } = await client.ledgerService.getCheckpoint({
106
+ sequenceNumber: 12345n,
107
+ });
108
+
109
+ // Get current epoch
110
+ const { response: epoch } = await client.ledgerService.getEpoch({});
111
+
112
+ // Get Move module information
113
+ const { response: module } = await client.movePackageService.getModule({
114
+ packageId: '0x2',
115
+ moduleName: 'coin',
116
+ });
117
+
118
+ // Resolve SuiNS name
119
+ const { response: address } = await client.nameService.lookupName({
120
+ name: 'example.sui',
121
+ });
122
+ ```
123
+
124
+ ## Methods Requiring GraphQL
125
+
126
+ Some JSON-RPC methods don't have gRPC equivalents and require using `SuiGraphQLClient` instead:
127
+
128
+ | JSON-RPC Method | GraphQL Alternative |
129
+ | --------------------------- | ---------------------------------- |
130
+ | `queryTransactionBlocks` | `transactions` query |
131
+ | `multiGetTransactionBlocks` | `multiGetTransactionEffects` query |
132
+ | `queryEvents` | `events` query |
133
+ | `getCoinMetadata` | `coinMetadata` query |
134
+ | `getTotalSupply` | `coinMetadata` query |
135
+ | `getStakes` | `address.stakedSuis` query |
136
+ | `getStakesByIds` | `multiGetObjects` query |
137
+ | `tryGetPastObject` | Historical object queries |
138
+ | `getNetworkMetrics` | Use indexer |
139
+ | `getAddressMetrics` | Use indexer |
140
+ | `getMoveCallMetrics` | Use indexer |
141
+
142
+ ### Setting Up GraphQL Client
143
+
144
+ ```typescript
145
+ const graphqlClient = new SuiGraphQLClient({
146
+ url: 'https://sui-mainnet.mystenlabs.com/graphql',
147
+ network: 'mainnet',
148
+ });
149
+ ```
150
+
151
+ ### Querying Transactions
152
+
153
+ Replace `queryTransactionBlocks` with a GraphQL query:
154
+
155
+ ```typescript
156
+ const result = await graphqlClient.query({
157
+ query: `
158
+ query QueryTransactions($sender: SuiAddress, $first: Int, $after: String) {
159
+ transactions(
160
+ first: $first
161
+ after: $after
162
+ filter: { sentAddress: $sender }
163
+ ) {
164
+ pageInfo {
165
+ hasNextPage
166
+ endCursor
167
+ }
168
+ nodes {
169
+ digest
170
+ effects {
171
+ status
172
+ epoch { epochId }
173
+ }
174
+ }
175
+ }
176
+ }
177
+ `,
178
+ variables: {
179
+ sender: '0xabc...',
180
+ first: 10,
181
+ },
182
+ });
183
+ ```
184
+
185
+ **Available transaction filters:**
186
+
187
+ - `sentAddress` - Filter by sender address
188
+ - `affectedAddress` - Filter by any address involved in the transaction
189
+ - `affectedObject` - Filter by object ID that was affected
190
+ - `function` - Filter by Move function called (e.g., `0x2::coin::transfer`)
191
+ - `kind` - Filter by transaction kind (`SYSTEM` or `PROGRAMMABLE`)
192
+ - `atCheckpoint` / `beforeCheckpoint` / `afterCheckpoint` - Filter by checkpoint
193
+
194
+ ### Querying Events
195
+
196
+ Replace `queryEvents` with a GraphQL query:
197
+
198
+ ```typescript
199
+ const result = await graphqlClient.query({
200
+ query: `
201
+ query QueryEvents($type: String, $first: Int, $after: String) {
202
+ events(
203
+ first: $first
204
+ after: $after
205
+ filter: { type: $type }
206
+ ) {
207
+ pageInfo {
208
+ hasNextPage
209
+ endCursor
210
+ }
211
+ nodes {
212
+ transactionModule {
213
+ package { address }
214
+ name
215
+ }
216
+ sender { address }
217
+ contents {
218
+ type { repr }
219
+ bcs
220
+ }
221
+ }
222
+ }
223
+ }
224
+ `,
225
+ variables: {
226
+ type: '0x2::coin::CoinCreated',
227
+ first: 10,
228
+ },
229
+ });
230
+ ```
231
+
232
+ **Available event filters:**
233
+
234
+ - `type` - Filter by event type (package, package::module, or full type)
235
+ - `module` - Filter by emitting module
236
+ - `sender` - Filter by transaction sender
237
+ - `atCheckpoint` / `beforeCheckpoint` / `afterCheckpoint` - Filter by checkpoint
238
+
239
+ ### Fetching Multiple Transactions
240
+
241
+ Replace `multiGetTransactionBlocks` with a GraphQL query:
242
+
243
+ ```typescript
244
+ const result = await graphqlClient.query({
245
+ query: `
246
+ query MultiGetTransactions($digests: [String!]!) {
247
+ multiGetTransactionEffects(keys: $digests) {
248
+ transaction {
249
+ digest
250
+ transactionBcs
251
+ }
252
+ status
253
+ epoch { epochId }
254
+ }
255
+ }
256
+ `,
257
+ variables: {
258
+ digests: ['digest1', 'digest2', 'digest3'],
259
+ },
260
+ });
261
+ ```
262
+
263
+ ### Querying Historical Objects
264
+
265
+ Replace `tryGetPastObject` with a GraphQL query specifying a version:
266
+
267
+ ```typescript
268
+ const result = await graphqlClient.query({
269
+ query: `
270
+ query GetObjectAtVersion($id: SuiAddress!, $version: UInt53!) {
271
+ object(address: $id, version: $version) {
272
+ address
273
+ version
274
+ digest
275
+ asMoveObject {
276
+ contents {
277
+ type { repr }
278
+ bcs
279
+ }
280
+ }
281
+ }
282
+ }
283
+ `,
284
+ variables: {
285
+ id: '0x123...',
286
+ version: 42,
287
+ },
288
+ });
289
+ ```
290
+
291
+ ### Querying Coin Metadata
292
+
293
+ Replace `getCoinMetadata` and `getTotalSupply` with a GraphQL query:
294
+
295
+ ```typescript
296
+ const result = await graphqlClient.query({
297
+ query: `
298
+ query GetCoinMetadata($coinType: String!) {
299
+ coinMetadata(coinType: $coinType) {
300
+ name
301
+ symbol
302
+ description
303
+ decimals
304
+ iconUrl
305
+ supply
306
+ }
307
+ }
308
+ `,
309
+ variables: {
310
+ coinType: '0x2::sui::SUI',
311
+ },
312
+ });
313
+ ```
314
+
315
+ ### Querying Staked SUI
316
+
317
+ Replace `getStakes` with a GraphQL query:
318
+
319
+ ```typescript
320
+ const result = await graphqlClient.query({
321
+ query: `
322
+ query GetStakes($owner: SuiAddress!) {
323
+ address(address: $owner) {
324
+ stakedSuis {
325
+ nodes {
326
+ principal
327
+ stakeActivationEpoch
328
+ estimatedReward
329
+ contents {
330
+ bcs
331
+ }
332
+ }
333
+ }
334
+ }
335
+ }
336
+ `,
337
+ variables: {
338
+ owner: '0xabc...',
339
+ },
340
+ });
341
+ ```
342
+
343
+ ## Response Format Differences
344
+
345
+ The gRPC client uses the core API response format, which differs from JSON-RPC responses. See the
346
+ [@mysten/sui migration guide](/sui/migrations/sui-2.0/sui#transaction-executors-now-accept-any-client)
347
+ for details on the new response format.
348
+
349
+ Key differences:
350
+
351
+ ```diff
352
+ // Transaction result access
353
+ - const status = result.effects?.status?.status;
354
+ + const tx = result.Transaction ?? result.FailedTransaction;
355
+ + const status = tx.effects.status.success;
356
+
357
+ // Include options
358
+ - { showEffects: true, showEvents: true }
359
+ + { effects: true, events: true }
360
+ ```
361
+
362
+ ## Client Extensions
363
+
364
+ Client extensions work the same way with both clients:
365
+
366
+ ```typescript
367
+ const client = new SuiGrpcClient({
368
+ baseUrl: 'https://fullnode.mainnet.sui.io:443',
369
+ network: 'mainnet',
370
+ }).$extend(deepbook({ address: myAddress }), suins());
371
+
372
+ // Use extended functionality
373
+ await client.deepbook.checkManagerBalance(manager, asset);
374
+ await client.suins.getName('0xabc...');
375
+ ```
376
+
377
+ ## See Also
378
+
379
+ - [SuiGrpcClient Documentation](/sui/clients/grpc) - Full gRPC client documentation
380
+ - [SuiGraphQLClient Documentation](/sui/clients/graphql) - GraphQL client documentation
381
+ - [Core API](/sui/clients/core) - Transport-agnostic API methods
382
+ - [gRPC Overview](https://docs.sui.io/concepts/data-access/grpc-overview) - Sui gRPC API
383
+ documentation
@@ -0,0 +1,120 @@
1
+ # @mysten/kiosk
2
+
3
+ > Migrate @mysten/kiosk to 2.0
4
+
5
+ This package now exports a client extension that integrates with Sui clients.
6
+
7
+ > **Note:** The Kiosk SDK requires `SuiJsonRpcClient` or `SuiGraphQLClient`. It does not work with
8
+ > `SuiGrpcClient` because it uses event queries that are not available in gRPC.
9
+
10
+ ```diff
11
+ - import { SuiClient, getFullnodeUrl } from '@mysten/sui/client';
12
+ - import { KioskClient, Network } from '@mysten/kiosk';
13
+ + import { SuiJsonRpcClient, getJsonRpcFullnodeUrl } from '@mysten/sui/jsonRpc'; // or SuiGraphQLClient
14
+ + import { kiosk } from '@mysten/kiosk';
15
+
16
+ - const suiClient = new SuiClient({ url: getFullnodeUrl('mainnet') });
17
+ - const kioskClient = new KioskClient({
18
+ - client: suiClient,
19
+ - network: Network.MAINNET,
20
+ - });
21
+ + const client = new SuiJsonRpcClient({
22
+ + url: getJsonRpcFullnodeUrl('mainnet'),
23
+ + network: 'mainnet',
24
+ + }).$extend(kiosk());
25
+
26
+ - const ownedKiosks = await kioskClient.getOwnedKiosks({ address: myAddress });
27
+ + const ownedKiosks = await client.kiosk.getOwnedKiosks({ address: myAddress });
28
+ ```
29
+
30
+ ## Removed: transactionBlock Parameter
31
+
32
+ The deprecated `transactionBlock` parameter has been removed from `KioskTransaction`,
33
+ `TransferPolicyTransaction`, and rule resolving functions. Use `transaction` instead:
34
+
35
+ ```diff
36
+ const kioskTx = new KioskTransaction({
37
+ - transactionBlock: tx,
38
+ + transaction: tx,
39
+ kioskClient,
40
+ cap,
41
+ });
42
+
43
+ const tpTx = new TransferPolicyTransaction({
44
+ - transactionBlock: tx,
45
+ + transaction: tx,
46
+ kioskClient,
47
+ cap,
48
+ });
49
+ ```
50
+
51
+ ## Removed: Low-Level Helper Functions
52
+
53
+ The low-level helper functions have been removed in favor of the `KioskTransaction` and
54
+ `TransferPolicyTransaction` builder classes.
55
+
56
+ ### Kiosk Functions
57
+
58
+ | Removed Function | Use Instead |
59
+ | ------------------- | ------------------------ |
60
+ | `createKiosk` | `kioskTx.create()` |
61
+ | `shareKiosk` | `kioskTx.share()` |
62
+ | `place` | `kioskTx.place()` |
63
+ | `lock` | `kioskTx.lock()` |
64
+ | `take` | `kioskTx.take()` |
65
+ | `list` | `kioskTx.list()` |
66
+ | `delist` | `kioskTx.delist()` |
67
+ | `placeAndList` | `kioskTx.placeAndList()` |
68
+ | `purchase` | `kioskTx.purchase()` |
69
+ | `withdrawFromKiosk` | `kioskTx.withdraw()` |
70
+ | `borrowValue` | `kioskTx.borrow()` |
71
+ | `returnValue` | `kioskTx.return()` |
72
+
73
+ ### Transfer Policy Functions
74
+
75
+ | Removed Function | Use Instead |
76
+ | ------------------------------------ | ------------------------------------------------------- |
77
+ | `createTransferPolicyWithoutSharing` | `tpTx.create()` |
78
+ | `shareTransferPolicy` | `tpTx.shareAndTransferCap()` |
79
+ | `confirmRequest` | Handled automatically by `kioskTx.purchaseAndResolve()` |
80
+ | `removeTransferPolicyRule` | `tpTx.removeRule()` |
81
+
82
+ ### Personal Kiosk Functions
83
+
84
+ | Removed Function | Use Instead |
85
+ | ----------------------- | --------------------------------------------- |
86
+ | `convertToPersonalTx` | `kioskTx.convertToPersonal()` |
87
+ | `transferPersonalCapTx` | Handled automatically by `kioskTx.finalize()` |
88
+
89
+ ### Rule Attachment Functions
90
+
91
+ | Removed Function | Use Instead |
92
+ | --------------------------- | ----------------------------- |
93
+ | `attachKioskLockRuleTx` | `tpTx.addLockRule()` |
94
+ | `attachRoyaltyRuleTx` | `tpTx.addRoyaltyRule()` |
95
+ | `attachPersonalKioskRuleTx` | `tpTx.addPersonalKioskRule()` |
96
+ | `attachFloorPriceRuleTx` | `tpTx.addFloorPriceRule()` |
97
+
98
+ ## Migration Example
99
+
100
+ ```diff
101
+ - import { createKiosk, shareKiosk, placeAndList } from '@mysten/kiosk';
102
+ + import { kiosk, KioskTransaction } from '@mysten/kiosk';
103
+ + import { SuiJsonRpcClient, getJsonRpcFullnodeUrl } from '@mysten/sui/jsonRpc';
104
+
105
+ - const [kiosk, cap] = createKiosk(tx);
106
+ - shareKiosk(tx, kiosk);
107
+ - placeAndList(tx, itemType, kiosk, cap, item, price);
108
+
109
+ + const client = new SuiJsonRpcClient({
110
+ + url: getJsonRpcFullnodeUrl('mainnet'),
111
+ + network: 'mainnet',
112
+ + }).$extend(kiosk());
113
+ +
114
+ + const kioskTx = new KioskTransaction({ transaction: tx, kioskClient: client.kiosk });
115
+ + kioskTx
116
+ + .create()
117
+ + .placeAndList({ itemType, item, price })
118
+ + .shareAndTransferCap(address)
119
+ + .finalize();
120
+ ```
@@ -0,0 +1,90 @@
1
+ # SDK Maintainers
2
+
3
+ > Migration guide for SDK maintainers and library authors
4
+
5
+ # Upgrading SDKs to @mysten/sui@2.0.0
6
+
7
+ This guide covers the key breaking changes for SDK maintainers building on top of `@mysten/sui`.
8
+
9
+ For comprehensive SDK development patterns, see the [Building SDKs guide](/sui/sdk-building).
10
+
11
+ ## Use `ClientWithCoreApi`
12
+
13
+ Accept `ClientWithCoreApi` instead of `SuiClient` to support all 3 Sui clients (JSON-RPC, GraphQL,
14
+ gRPC):
15
+
16
+ ```diff
17
+ - import { SuiClient } from '@mysten/sui/client';
18
+ + import type { ClientWithCoreApi } from '@mysten/sui/client';
19
+
20
+ - client: SuiClient;
21
+ + client: ClientWithCoreApi;
22
+ }
23
+ ```
24
+
25
+ ## Access Data via `client.core` methods
26
+
27
+ All data access methods are namespaced under `client.core`:
28
+
29
+ ```diff
30
+ - const result = await this.client.getObject({ objectId });
31
+ + const result = await this.client.core.getObject({ objectId });
32
+
33
+ - const result = await this.client.getOwnedObjects({ owner });
34
+ + const result = await this.client.core.listOwnedObjects({ owner });
35
+ ```
36
+
37
+ | v1.x Method | v2.0 Method |
38
+ | -------------------------------- | --------------------------------- |
39
+ | `client.getObject()` | `client.core.getObject()` |
40
+ | `client.getOwnedObjects()` | `client.core.listOwnedObjects()` |
41
+ | `client.getDynamicFieldObject()` | `client.core.getDynamicField()` |
42
+ | `client.getDynamicFields()` | `client.core.listDynamicFields()` |
43
+ | `client.multiGetObjects()` | `client.core.getObjects()` |
44
+
45
+ See the [Core API documentation](/sui/clients/core) for all available methods.
46
+
47
+ ## Use Peer Dependencies
48
+
49
+ Declare `@mysten/*` packages as peer dependencies:
50
+
51
+ ```json
52
+ {
53
+ "peerDependencies": {
54
+ "@mysten/sui": "^2.0.0"
55
+ },
56
+ "devDependencies": {
57
+ "@mysten/sui": "^2.0.0"
58
+ }
59
+ }
60
+ ```
61
+
62
+ ## Client Extensions
63
+
64
+ v2.0 introduces client extensions that let users add your SDK to any Sui client:
65
+
66
+ ```typescript
67
+
68
+ return {
69
+ name: 'mySDK',
70
+ register: (client: ClientWithCoreApi) => {
71
+ return new MySDKClient({ client });
72
+ },
73
+ };
74
+ }
75
+
76
+ // Users can then extend any client
77
+ const client = new SuiGrpcClient({ ... }).$extend(mySDK());
78
+ await client.mySDK.doSomething();
79
+ ```
80
+
81
+ See the [Building SDKs guide](/sui/sdk-building#client-extensions) for the complete extension
82
+ pattern.
83
+
84
+ ## Code Generation
85
+
86
+ Use **[@mysten/codegen](/codegen)** to generate type-safe TypeScript bindings from your Move
87
+ packages. See the [codegen documentation](/codegen) for setup instructions.
88
+
89
+ For complete SDK development patterns including client extensions, transaction thunks, and best
90
+ practices, see the [Building SDKs guide](/sui/sdk-building).
@@ -0,0 +1,14 @@
1
+ # @mysten/seal
2
+
3
+ > Migrate @mysten/seal to 2.0
4
+
5
+ The deprecated `SealClient.asClientExtension()` static method has been removed. Use the `seal()`
6
+ registration function instead:
7
+
8
+ ```diff
9
+ - import { SealClient } from '@mysten/seal';
10
+ + import { seal } from '@mysten/seal';
11
+
12
+ - const client = suiClient.$extend(SealClient.asClientExtension());
13
+ + const client = suiClient.$extend(seal());
14
+ ```