@mysten/sui 2.9.0 → 2.10.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 +19 -0
- package/dist/bcs/bcs.d.mts +6 -6
- package/dist/client/core-resolver.mjs +5 -0
- package/dist/client/core-resolver.mjs.map +1 -1
- package/dist/client/core.d.mts +1 -0
- package/dist/client/core.d.mts.map +1 -1
- package/dist/client/core.mjs +17 -4
- package/dist/client/core.mjs.map +1 -1
- package/dist/client/types.d.mts +16 -0
- package/dist/client/types.d.mts.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 +13 -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 +18 -1
- package/dist/graphql/generated/queries.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 +12 -0
- 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/move_package_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 +1 -0
- package/dist/jsonRpc/core.d.mts.map +1 -1
- package/dist/jsonRpc/core.mjs +19 -0
- package/dist/jsonRpc/core.mjs.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/dist/zklogin/bcs.d.mts +14 -14
- package/dist/zklogin/bcs.d.mts.map +1 -1
- package/package.json +1 -1
- package/src/client/core-resolver.ts +15 -0
- package/src/client/core.ts +34 -4
- package/src/client/types.ts +20 -0
- package/src/graphql/core.ts +27 -0
- package/src/graphql/generated/queries.ts +22 -0
- package/src/graphql/queries/getProtocolConfig.graphql +18 -0
- package/src/grpc/core.ts +27 -0
- package/src/jsonRpc/core.ts +34 -0
- package/src/version.ts +1 -1
package/src/jsonRpc/core.ts
CHANGED
|
@@ -457,6 +457,40 @@ export class JSONRpcCoreClient extends CoreClient {
|
|
|
457
457
|
};
|
|
458
458
|
}
|
|
459
459
|
|
|
460
|
+
async getProtocolConfig(
|
|
461
|
+
options?: SuiClientTypes.GetProtocolConfigOptions,
|
|
462
|
+
): Promise<SuiClientTypes.GetProtocolConfigResponse> {
|
|
463
|
+
const result = await this.#jsonRpcClient.getProtocolConfig({ signal: options?.signal });
|
|
464
|
+
|
|
465
|
+
const attributes: Record<string, string | null> = {};
|
|
466
|
+
for (const [key, value] of Object.entries(result.attributes)) {
|
|
467
|
+
if (value === null) {
|
|
468
|
+
attributes[key] = null;
|
|
469
|
+
} else if ('u16' in value) {
|
|
470
|
+
attributes[key] = value.u16;
|
|
471
|
+
} else if ('u32' in value) {
|
|
472
|
+
attributes[key] = value.u32;
|
|
473
|
+
} else if ('u64' in value) {
|
|
474
|
+
attributes[key] = value.u64;
|
|
475
|
+
} else if ('f64' in value) {
|
|
476
|
+
attributes[key] = value.f64;
|
|
477
|
+
} else if ('bool' in value) {
|
|
478
|
+
attributes[key] = value.bool;
|
|
479
|
+
} else {
|
|
480
|
+
const entries = Object.entries(value);
|
|
481
|
+
attributes[key] = entries.length === 1 ? String(entries[0][1]) : JSON.stringify(value);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
return {
|
|
486
|
+
protocolConfig: {
|
|
487
|
+
protocolVersion: result.protocolVersion,
|
|
488
|
+
featureFlags: { ...result.featureFlags },
|
|
489
|
+
attributes,
|
|
490
|
+
},
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
|
|
460
494
|
async getCurrentSystemState(
|
|
461
495
|
options?: SuiClientTypes.GetCurrentSystemStateOptions,
|
|
462
496
|
): Promise<SuiClientTypes.GetCurrentSystemStateResponse> {
|
package/src/version.ts
CHANGED