@mysten/sui 2.23.1 → 2.24.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.
- package/CHANGELOG.md +16 -0
- package/README.md +9 -9
- package/dist/bcs/index.d.mts +36 -36
- package/dist/client/core.d.mts +1 -0
- package/dist/client/core.d.mts.map +1 -1
- package/dist/client/core.mjs.map +1 -1
- package/dist/client/types.d.mts +7 -0
- package/dist/client/types.d.mts.map +1 -1
- package/dist/cryptography/signature.d.mts +6 -6
- package/dist/graphql/client.d.mts +1 -0
- package/dist/graphql/client.d.mts.map +1 -1
- package/dist/graphql/client.mjs +3 -0
- package/dist/graphql/client.mjs.map +1 -1
- package/dist/graphql/core.d.mts +1 -0
- package/dist/graphql/core.d.mts.map +1 -1
- package/dist/graphql/core.mjs +10 -1
- package/dist/graphql/core.mjs.map +1 -1
- package/dist/graphql/generated/queries.d.mts.map +1 -1
- package/dist/graphql/generated/queries.mjs +8 -1
- package/dist/graphql/generated/queries.mjs.map +1 -1
- package/dist/grpc/client.d.mts +1 -0
- package/dist/grpc/client.d.mts.map +1 -1
- package/dist/grpc/client.mjs +3 -0
- package/dist/grpc/client.mjs.map +1 -1
- package/dist/grpc/core.d.mts +1 -0
- package/dist/grpc/core.d.mts.map +1 -1
- package/dist/grpc/core.mjs +32 -12
- package/dist/grpc/core.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/ledger_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/name_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/state_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.client.d.mts +4 -4
- package/dist/jsonRpc/core.d.mts +6 -0
- package/dist/jsonRpc/core.d.mts.map +1 -1
- package/dist/jsonRpc/core.mjs +15 -4
- package/dist/jsonRpc/core.mjs.map +1 -1
- package/dist/transactions/Transaction.d.mts +3 -3
- package/dist/transactions/data/v1.d.mts +220 -220
- package/dist/transactions/data/v1.d.mts.map +1 -1
- package/dist/transactions/data/v2.d.mts +16 -16
- package/dist/transactions/data/v2.d.mts.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/docs/clients/core.md +31 -10
- package/docs/clients/graphql.md +43 -8
- package/docs/clients/grpc.md +91 -9
- package/docs/clients/index.md +86 -39
- package/docs/clients/json-rpc.md +30 -26
- package/docs/executors.md +28 -13
- package/docs/index.md +1 -1
- package/docs/llms-index.md +17 -17
- package/docs/migrations/sui-2.0/dapp-kit.md +3 -3
- package/docs/migrations/sui-2.0/deepbook-v3.md +2 -2
- package/docs/migrations/sui-2.0/index.md +46 -25
- package/docs/migrations/sui-2.0/json-rpc-migration.md +460 -284
- package/docs/migrations/sui-2.0/kiosk.md +10 -9
- package/docs/migrations/sui-2.0/sdk-maintainers.md +17 -11
- package/docs/migrations/sui-2.0/sui.md +47 -29
- package/docs/migrations/sui-2.0/suins.md +2 -2
- package/docs/migrations/sui-2.0/walrus.md +3 -3
- package/docs/migrations/sui-2.0/zksend.md +9 -8
- package/docs/sdk-building.md +7 -5
- package/package.json +1 -1
- package/src/client/core.ts +4 -0
- package/src/client/types.ts +11 -0
- package/src/graphql/client.ts +6 -0
- package/src/graphql/core.ts +15 -0
- package/src/graphql/generated/queries.ts +14 -0
- package/src/graphql/queries/nameService.graphql +6 -0
- package/src/grpc/client.ts +6 -0
- package/src/grpc/core.ts +51 -12
- package/src/jsonRpc/core.ts +50 -14
- package/src/version.ts +1 -1
package/src/jsonRpc/core.ts
CHANGED
|
@@ -802,6 +802,18 @@ export class JSONRpcCoreClient extends CoreClient {
|
|
|
802
802
|
};
|
|
803
803
|
}
|
|
804
804
|
|
|
805
|
+
/**
|
|
806
|
+
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
807
|
+
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
808
|
+
*/
|
|
809
|
+
async resolveNameServiceAddress(
|
|
810
|
+
options: SuiClientTypes.ResolveNameServiceAddressOptions,
|
|
811
|
+
): Promise<SuiClientTypes.ResolveNameServiceAddressResponse> {
|
|
812
|
+
return {
|
|
813
|
+
address: await this.#jsonRpcClient.resolveNameServiceAddress(options),
|
|
814
|
+
};
|
|
815
|
+
}
|
|
816
|
+
|
|
805
817
|
/**
|
|
806
818
|
* @deprecated JSON-RPC APIs are deprecated in the Sui TypeScript SDK. Use `SuiGrpcClient`
|
|
807
819
|
* from `@mysten/sui/grpc` or `SuiGraphQLClient` from `@mysten/sui/graphql` instead.
|
|
@@ -1182,7 +1194,7 @@ function parseTransaction<Include extends SuiClientTypes.TransactionInclude = {}
|
|
|
1182
1194
|
};
|
|
1183
1195
|
}
|
|
1184
1196
|
|
|
1185
|
-
function parseTransactionEffectsJson({
|
|
1197
|
+
export function parseTransactionEffectsJson({
|
|
1186
1198
|
bytes,
|
|
1187
1199
|
effects,
|
|
1188
1200
|
objectChanges,
|
|
@@ -1302,6 +1314,28 @@ function parseTransactionEffectsJson({
|
|
|
1302
1314
|
}
|
|
1303
1315
|
});
|
|
1304
1316
|
|
|
1317
|
+
// When the transaction has no gas object (system transactions, or gas paid
|
|
1318
|
+
// from an address balance), the RPC substitutes a placeholder ref with the
|
|
1319
|
+
// 0x0 object id rather than omitting the field.
|
|
1320
|
+
const hasGasObject =
|
|
1321
|
+
normalizeSuiAddress(effects.gasObject.reference.objectId) !== normalizeSuiAddress('0x0');
|
|
1322
|
+
|
|
1323
|
+
let lamportVersion: string | null = null;
|
|
1324
|
+
if (hasGasObject) {
|
|
1325
|
+
lamportVersion = effects.gasObject.reference.version;
|
|
1326
|
+
} else {
|
|
1327
|
+
// Written objects are all assigned the lamport version, so recover it
|
|
1328
|
+
// from the changed objects when the gas object can't provide it.
|
|
1329
|
+
for (const change of changedObjects) {
|
|
1330
|
+
if (
|
|
1331
|
+
change.outputVersion &&
|
|
1332
|
+
(lamportVersion === null || BigInt(change.outputVersion) > BigInt(lamportVersion))
|
|
1333
|
+
) {
|
|
1334
|
+
lamportVersion = change.outputVersion;
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1305
1339
|
return {
|
|
1306
1340
|
objectTypes,
|
|
1307
1341
|
effects: {
|
|
@@ -1310,21 +1344,23 @@ function parseTransactionEffectsJson({
|
|
|
1310
1344
|
status: parseJsonRpcExecutionStatus(effects.status, effects.abortError),
|
|
1311
1345
|
gasUsed: effects.gasUsed,
|
|
1312
1346
|
transactionDigest: effects.transactionDigest,
|
|
1313
|
-
gasObject:
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1347
|
+
gasObject: hasGasObject
|
|
1348
|
+
? {
|
|
1349
|
+
objectId: effects.gasObject.reference.objectId,
|
|
1350
|
+
inputState: 'Exists',
|
|
1351
|
+
inputVersion: null,
|
|
1352
|
+
inputDigest: null,
|
|
1353
|
+
inputOwner: null,
|
|
1354
|
+
outputState: 'ObjectWrite',
|
|
1355
|
+
outputVersion: effects.gasObject.reference.version,
|
|
1356
|
+
outputDigest: effects.gasObject.reference.digest,
|
|
1357
|
+
outputOwner: parseOwner(effects.gasObject.owner),
|
|
1358
|
+
idOperation: 'None',
|
|
1359
|
+
}
|
|
1360
|
+
: null,
|
|
1325
1361
|
eventsDigest: effects.eventsDigest ?? null,
|
|
1326
1362
|
dependencies: effects.dependencies ?? [],
|
|
1327
|
-
lamportVersion
|
|
1363
|
+
lamportVersion,
|
|
1328
1364
|
changedObjects,
|
|
1329
1365
|
unchangedConsensusObjects,
|
|
1330
1366
|
auxiliaryDataDigest: null,
|
package/src/version.ts
CHANGED