@mysten/sui 2.26.2 → 2.27.1
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 +13 -0
- package/dist/bcs/index.d.mts +36 -36
- package/dist/client/types.d.mts +10 -0
- package/dist/client/types.d.mts.map +1 -1
- package/dist/client/utils.mjs +67 -2
- package/dist/client/utils.mjs.map +1 -1
- package/dist/cryptography/signature.d.mts +14 -14
- package/dist/graphql/core.d.mts.map +1 -1
- package/dist/graphql/core.mjs +5 -1
- package/dist/graphql/core.mjs.map +1 -1
- package/dist/graphql/generated/queries.mjs +20 -0
- package/dist/graphql/generated/queries.mjs.map +1 -1
- package/dist/grpc/core.d.mts.map +1 -1
- package/dist/grpc/core.mjs +6 -2
- package/dist/grpc/core.mjs.map +1 -1
- package/dist/grpc/proto/sui/forking/v1alpha/forking_service.client.d.mts +4 -4
- 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/jsonRpc/core.d.mts.map +1 -1
- package/dist/jsonRpc/core.mjs +4 -0
- package/dist/jsonRpc/core.mjs.map +1 -1
- package/dist/transactions/Transaction.d.mts +9 -9
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/dist/zklogin/bcs.d.mts +14 -14
- package/package.json +1 -1
- package/src/client/types.ts +10 -0
- package/src/client/utils.ts +99 -2
- package/src/graphql/core.ts +8 -1
- package/src/graphql/generated/queries.ts +26 -6
- package/src/graphql/queries/transactions.graphql +4 -0
- package/src/grpc/core.ts +14 -2
- package/src/jsonRpc/core.ts +4 -0
- package/src/version.ts +1 -1
package/src/client/utils.ts
CHANGED
|
@@ -478,11 +478,108 @@ export function parseTransactionEffectsBcs(effects: Uint8Array): SuiClientTypes.
|
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
480
|
|
|
481
|
-
function parseTransactionEffectsV1(
|
|
481
|
+
function parseTransactionEffectsV1({
|
|
482
|
+
bytes,
|
|
483
|
+
effects,
|
|
484
|
+
}: {
|
|
482
485
|
bytes: Uint8Array;
|
|
483
486
|
effects: NonNullable<(typeof bcs.TransactionEffects.$inferType)['V1']>;
|
|
484
487
|
}): SuiClientTypes.TransactionEffects {
|
|
485
|
-
|
|
488
|
+
const modifiedAtVersions = new Map(effects.modifiedAtVersions);
|
|
489
|
+
const sharedObjects = new Map(effects.sharedObjects.map((object) => [object.objectId, object]));
|
|
490
|
+
const mapChangedObject = (
|
|
491
|
+
reference: (typeof effects.deleted)[number],
|
|
492
|
+
change: Pick<
|
|
493
|
+
SuiClientTypes.ChangedObject,
|
|
494
|
+
'inputState' | 'outputState' | 'outputOwner' | 'idOperation'
|
|
495
|
+
>,
|
|
496
|
+
): SuiClientTypes.ChangedObject => {
|
|
497
|
+
const sharedInput = sharedObjects.get(reference.objectId);
|
|
498
|
+
return {
|
|
499
|
+
objectId: reference.objectId,
|
|
500
|
+
inputState: change.inputState,
|
|
501
|
+
inputVersion:
|
|
502
|
+
change.inputState === 'Exists'
|
|
503
|
+
? (sharedInput?.version ?? modifiedAtVersions.get(reference.objectId) ?? null)
|
|
504
|
+
: null,
|
|
505
|
+
inputDigest: change.inputState === 'Exists' ? (sharedInput?.digest ?? null) : null,
|
|
506
|
+
inputOwner: null,
|
|
507
|
+
outputState: change.outputState,
|
|
508
|
+
outputVersion: change.outputState === 'DoesNotExist' ? null : reference.version,
|
|
509
|
+
outputDigest: change.outputState === 'DoesNotExist' ? null : reference.digest,
|
|
510
|
+
outputOwner: change.outputOwner,
|
|
511
|
+
idOperation: change.idOperation,
|
|
512
|
+
};
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
const written = (
|
|
516
|
+
changes: typeof effects.created,
|
|
517
|
+
inputState: 'DoesNotExist' | 'Exists',
|
|
518
|
+
idOperation: 'Created' | 'None',
|
|
519
|
+
): SuiClientTypes.ChangedObject[] =>
|
|
520
|
+
changes.map(([reference, owner]) =>
|
|
521
|
+
mapChangedObject(reference, {
|
|
522
|
+
inputState,
|
|
523
|
+
outputState: 'ObjectWrite',
|
|
524
|
+
outputOwner: owner,
|
|
525
|
+
idOperation,
|
|
526
|
+
}),
|
|
527
|
+
);
|
|
528
|
+
|
|
529
|
+
const removed = (
|
|
530
|
+
changes: typeof effects.deleted,
|
|
531
|
+
inputState: 'DoesNotExist' | 'Exists',
|
|
532
|
+
idOperation: 'Deleted' | 'None',
|
|
533
|
+
): SuiClientTypes.ChangedObject[] =>
|
|
534
|
+
changes.map((reference) =>
|
|
535
|
+
mapChangedObject(reference, {
|
|
536
|
+
inputState,
|
|
537
|
+
outputState: 'DoesNotExist',
|
|
538
|
+
outputOwner: null,
|
|
539
|
+
idOperation,
|
|
540
|
+
}),
|
|
541
|
+
);
|
|
542
|
+
|
|
543
|
+
const changedObjects = [
|
|
544
|
+
...written(effects.created, 'DoesNotExist', 'Created'),
|
|
545
|
+
...written(effects.mutated, 'Exists', 'None'),
|
|
546
|
+
...written(effects.unwrapped, 'DoesNotExist', 'None'),
|
|
547
|
+
...removed(effects.deleted, 'Exists', 'Deleted'),
|
|
548
|
+
...removed(effects.unwrappedThenDeleted, 'DoesNotExist', 'Deleted'),
|
|
549
|
+
...removed(effects.wrapped, 'Exists', 'None'),
|
|
550
|
+
];
|
|
551
|
+
const gasObjectId = effects.gasObject[0].objectId;
|
|
552
|
+
const gasObject = changedObjects.find((object) => object.objectId === gasObjectId) ?? null;
|
|
553
|
+
const changedObjectIds = new Set(changedObjects.map((object) => object.objectId));
|
|
554
|
+
const lamportVersion = effects.modifiedAtVersions.reduce(
|
|
555
|
+
(max, [, version]) => (BigInt(version) > max ? BigInt(version) : max),
|
|
556
|
+
0n,
|
|
557
|
+
);
|
|
558
|
+
|
|
559
|
+
return {
|
|
560
|
+
bcs: bytes,
|
|
561
|
+
version: 1,
|
|
562
|
+
status:
|
|
563
|
+
effects.status.$kind === 'Success'
|
|
564
|
+
? { success: true, error: null }
|
|
565
|
+
: { success: false, error: parseBcsExecutionError(effects.status.Failure) },
|
|
566
|
+
gasUsed: effects.gasUsed,
|
|
567
|
+
transactionDigest: effects.transactionDigest,
|
|
568
|
+
gasObject,
|
|
569
|
+
eventsDigest: effects.eventsDigest,
|
|
570
|
+
dependencies: effects.dependencies,
|
|
571
|
+
lamportVersion: (lamportVersion + 1n).toString(),
|
|
572
|
+
changedObjects,
|
|
573
|
+
unchangedConsensusObjects: effects.sharedObjects
|
|
574
|
+
.filter((object) => !changedObjectIds.has(object.objectId))
|
|
575
|
+
.map((object) => ({
|
|
576
|
+
kind: 'ReadOnlyRoot',
|
|
577
|
+
objectId: object.objectId,
|
|
578
|
+
version: object.version,
|
|
579
|
+
digest: object.digest,
|
|
580
|
+
})),
|
|
581
|
+
auxiliaryDataDigest: null,
|
|
582
|
+
};
|
|
486
583
|
}
|
|
487
584
|
|
|
488
585
|
function parseTransactionEffectsV2({
|
package/src/graphql/core.ts
CHANGED
|
@@ -65,6 +65,8 @@ import {
|
|
|
65
65
|
validateTransactionQuery,
|
|
66
66
|
} from '../client/query-filters.js';
|
|
67
67
|
|
|
68
|
+
const GRAPHQL_OBJECT_BATCH_SIZE = 40;
|
|
69
|
+
|
|
68
70
|
export class GraphQLCoreClient extends CoreClient {
|
|
69
71
|
#graphqlClient: SuiGraphQLClient;
|
|
70
72
|
|
|
@@ -104,7 +106,7 @@ export class GraphQLCoreClient extends CoreClient {
|
|
|
104
106
|
async getObjects<Include extends SuiClientTypes.ObjectInclude = {}>(
|
|
105
107
|
options: SuiClientTypes.GetObjectsOptions<Include>,
|
|
106
108
|
): Promise<SuiClientTypes.GetObjectsResponse<Include>> {
|
|
107
|
-
const batches = chunk(options.objectIds,
|
|
109
|
+
const batches = chunk(options.objectIds, GRAPHQL_OBJECT_BATCH_SIZE);
|
|
108
110
|
const results: SuiClientTypes.GetObjectsResponse<Include>['objects'] = [];
|
|
109
111
|
|
|
110
112
|
for (const batch of batches) {
|
|
@@ -1122,6 +1124,9 @@ function parseTransaction<Include extends SuiClientTypes.TransactionInclude = {}
|
|
|
1122
1124
|
|
|
1123
1125
|
const bcsBytes =
|
|
1124
1126
|
include?.bcs && transaction.transactionBcs ? fromBase64(transaction.transactionBcs) : undefined;
|
|
1127
|
+
const timestampMs = transaction.effects?.timestamp
|
|
1128
|
+
? Date.parse(transaction.effects.timestamp)
|
|
1129
|
+
: null;
|
|
1125
1130
|
|
|
1126
1131
|
const result: SuiClientTypes.Transaction<Include> = {
|
|
1127
1132
|
digest: transaction.digest!,
|
|
@@ -1130,6 +1135,8 @@ function parseTransaction<Include extends SuiClientTypes.TransactionInclude = {}
|
|
|
1130
1135
|
? parseTransactionEffectsBcs(fromBase64(transaction.effects?.effectsBcs!))
|
|
1131
1136
|
: undefined) as SuiClientTypes.Transaction<Include>['effects'],
|
|
1132
1137
|
epoch: transaction.effects?.epoch?.epochId?.toString() ?? null,
|
|
1138
|
+
timestampMs: timestampMs !== null && !Number.isNaN(timestampMs) ? timestampMs : null,
|
|
1139
|
+
checkpoint: transaction.effects?.checkpoint?.sequenceNumber?.toString() ?? null,
|
|
1133
1140
|
objectTypes: (include?.objectTypes
|
|
1134
1141
|
? objectTypes
|
|
1135
1142
|
: undefined) as SuiClientTypes.Transaction<Include>['objectTypes'],
|
|
@@ -380,7 +380,7 @@ export type SimulateTransactionQueryVariables = Exact<{
|
|
|
380
380
|
}>;
|
|
381
381
|
|
|
382
382
|
|
|
383
|
-
export type SimulateTransactionQuery = { simulateTransaction: { effects: { transaction: { digest: string, transactionJson?: unknown, transactionBcs?: string | null, signatures: Array<{ signatureBytes: string | null }>, effects: { status: ExecutionStatus | null, effectsBcs?: string | null, effectsJson?: unknown, balanceChangesJson?: unknown, executionError: { message: string, abortCode: string | null, identifier: string | null, constant: string | null, sourceLineNumber: number | null, instructionOffset: number | null, module: { name: string, package: { address: string } | null } | null, function: { name: string } | null } | null, epoch: { epochId: number } | null, objectChanges?: { nodes: Array<{ address: string, outputState: { asMoveObject: { contents: { type: { repr: string } | null } | null } | null } | null }> } | null, events?: { pageInfo: { hasNextPage: boolean }, nodes: Array<{ transactionModule: { name: string, package: { address: string } | null } | null, sender: { address: string } | null, contents: { bcs: string | null, json: unknown, type: { repr: string } | null } | null }> } | null } | null } | null } | null, outputs?: Array<{ returnValues: Array<{ value: { bcs: string | null } | null }> | null, mutatedReferences: Array<{ value: { bcs: string | null } | null }> | null }> | null } };
|
|
383
|
+
export type SimulateTransactionQuery = { simulateTransaction: { effects: { transaction: { digest: string, transactionJson?: unknown, transactionBcs?: string | null, signatures: Array<{ signatureBytes: string | null }>, effects: { status: ExecutionStatus | null, timestamp: string | null, effectsBcs?: string | null, effectsJson?: unknown, balanceChangesJson?: unknown, checkpoint: { sequenceNumber: number } | null, executionError: { message: string, abortCode: string | null, identifier: string | null, constant: string | null, sourceLineNumber: number | null, instructionOffset: number | null, module: { name: string, package: { address: string } | null } | null, function: { name: string } | null } | null, epoch: { epochId: number } | null, objectChanges?: { nodes: Array<{ address: string, outputState: { asMoveObject: { contents: { type: { repr: string } | null } | null } | null } | null }> } | null, events?: { pageInfo: { hasNextPage: boolean }, nodes: Array<{ transactionModule: { name: string, package: { address: string } | null } | null, sender: { address: string } | null, contents: { bcs: string | null, json: unknown, type: { repr: string } | null } | null }> } | null } | null } | null } | null, outputs?: Array<{ returnValues: Array<{ value: { bcs: string | null } | null }> | null, mutatedReferences: Array<{ value: { bcs: string | null } | null }> | null }> | null } };
|
|
384
384
|
|
|
385
385
|
export type ExecuteTransactionMutationVariables = Exact<{
|
|
386
386
|
transactionDataBcs: string;
|
|
@@ -394,7 +394,7 @@ export type ExecuteTransactionMutationVariables = Exact<{
|
|
|
394
394
|
}>;
|
|
395
395
|
|
|
396
396
|
|
|
397
|
-
export type ExecuteTransactionMutation = { executeTransaction: { effects: { transaction: { digest: string, transactionJson?: unknown, transactionBcs?: string | null, signatures: Array<{ signatureBytes: string | null }>, effects: { status: ExecutionStatus | null, effectsBcs?: string | null, effectsJson?: unknown, balanceChangesJson?: unknown, executionError: { message: string, abortCode: string | null, identifier: string | null, constant: string | null, sourceLineNumber: number | null, instructionOffset: number | null, module: { name: string, package: { address: string } | null } | null, function: { name: string } | null } | null, epoch: { epochId: number } | null, objectChanges?: { nodes: Array<{ address: string, outputState: { asMoveObject: { contents: { type: { repr: string } | null } | null } | null } | null }> } | null, events?: { pageInfo: { hasNextPage: boolean }, nodes: Array<{ transactionModule: { name: string, package: { address: string } | null } | null, sender: { address: string } | null, contents: { bcs: string | null, json: unknown, type: { repr: string } | null } | null }> } | null } | null } | null } | null } };
|
|
397
|
+
export type ExecuteTransactionMutation = { executeTransaction: { effects: { transaction: { digest: string, transactionJson?: unknown, transactionBcs?: string | null, signatures: Array<{ signatureBytes: string | null }>, effects: { status: ExecutionStatus | null, timestamp: string | null, effectsBcs?: string | null, effectsJson?: unknown, balanceChangesJson?: unknown, checkpoint: { sequenceNumber: number } | null, executionError: { message: string, abortCode: string | null, identifier: string | null, constant: string | null, sourceLineNumber: number | null, instructionOffset: number | null, module: { name: string, package: { address: string } | null } | null, function: { name: string } | null } | null, epoch: { epochId: number } | null, objectChanges?: { nodes: Array<{ address: string, outputState: { asMoveObject: { contents: { type: { repr: string } | null } | null } | null } | null }> } | null, events?: { pageInfo: { hasNextPage: boolean }, nodes: Array<{ transactionModule: { name: string, package: { address: string } | null } | null, sender: { address: string } | null, contents: { bcs: string | null, json: unknown, type: { repr: string } | null } | null }> } | null } | null } | null } | null } };
|
|
398
398
|
|
|
399
399
|
export type GetTransactionBlockQueryVariables = Exact<{
|
|
400
400
|
digest: string;
|
|
@@ -407,7 +407,7 @@ export type GetTransactionBlockQueryVariables = Exact<{
|
|
|
407
407
|
}>;
|
|
408
408
|
|
|
409
409
|
|
|
410
|
-
export type GetTransactionBlockQuery = { transaction: { digest: string, transactionJson?: unknown, transactionBcs?: string | null, signatures: Array<{ signatureBytes: string | null }>, effects: { status: ExecutionStatus | null, effectsBcs?: string | null, effectsJson?: unknown, balanceChangesJson?: unknown, executionError: { message: string, abortCode: string | null, identifier: string | null, constant: string | null, sourceLineNumber: number | null, instructionOffset: number | null, module: { name: string, package: { address: string } | null } | null, function: { name: string } | null } | null, epoch: { epochId: number } | null, objectChanges?: { nodes: Array<{ address: string, outputState: { asMoveObject: { contents: { type: { repr: string } | null } | null } | null } | null }> } | null, events?: { pageInfo: { hasNextPage: boolean }, nodes: Array<{ transactionModule: { name: string, package: { address: string } | null } | null, sender: { address: string } | null, contents: { bcs: string | null, json: unknown, type: { repr: string } | null } | null }> } | null } | null } | null };
|
|
410
|
+
export type GetTransactionBlockQuery = { transaction: { digest: string, transactionJson?: unknown, transactionBcs?: string | null, signatures: Array<{ signatureBytes: string | null }>, effects: { status: ExecutionStatus | null, timestamp: string | null, effectsBcs?: string | null, effectsJson?: unknown, balanceChangesJson?: unknown, checkpoint: { sequenceNumber: number } | null, executionError: { message: string, abortCode: string | null, identifier: string | null, constant: string | null, sourceLineNumber: number | null, instructionOffset: number | null, module: { name: string, package: { address: string } | null } | null, function: { name: string } | null } | null, epoch: { epochId: number } | null, objectChanges?: { nodes: Array<{ address: string, outputState: { asMoveObject: { contents: { type: { repr: string } | null } | null } | null } | null }> } | null, events?: { pageInfo: { hasNextPage: boolean }, nodes: Array<{ transactionModule: { name: string, package: { address: string } | null } | null, sender: { address: string } | null, contents: { bcs: string | null, json: unknown, type: { repr: string } | null } | null }> } | null } | null } | null };
|
|
411
411
|
|
|
412
412
|
export type ListTransactionsQueryVariables = Exact<{
|
|
413
413
|
filter?: TransactionFilter | null | undefined;
|
|
@@ -424,9 +424,9 @@ export type ListTransactionsQueryVariables = Exact<{
|
|
|
424
424
|
}>;
|
|
425
425
|
|
|
426
426
|
|
|
427
|
-
export type ListTransactionsQuery = { transactions: { pageInfo: { hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null, endCursor: string | null }, nodes: Array<{ digest: string, transactionJson?: unknown, transactionBcs?: string | null, signatures: Array<{ signatureBytes: string | null }>, effects: { status: ExecutionStatus | null, effectsBcs?: string | null, effectsJson?: unknown, balanceChangesJson?: unknown, executionError: { message: string, abortCode: string | null, identifier: string | null, constant: string | null, sourceLineNumber: number | null, instructionOffset: number | null, module: { name: string, package: { address: string } | null } | null, function: { name: string } | null } | null, epoch: { epochId: number } | null, objectChanges?: { nodes: Array<{ address: string, outputState: { asMoveObject: { contents: { type: { repr: string } | null } | null } | null } | null }> } | null, events?: { pageInfo: { hasNextPage: boolean }, nodes: Array<{ transactionModule: { name: string, package: { address: string } | null } | null, sender: { address: string } | null, contents: { bcs: string | null, json: unknown, type: { repr: string } | null } | null }> } | null } | null }> } | null };
|
|
427
|
+
export type ListTransactionsQuery = { transactions: { pageInfo: { hasNextPage: boolean, hasPreviousPage: boolean, startCursor: string | null, endCursor: string | null }, nodes: Array<{ digest: string, transactionJson?: unknown, transactionBcs?: string | null, signatures: Array<{ signatureBytes: string | null }>, effects: { status: ExecutionStatus | null, timestamp: string | null, effectsBcs?: string | null, effectsJson?: unknown, balanceChangesJson?: unknown, checkpoint: { sequenceNumber: number } | null, executionError: { message: string, abortCode: string | null, identifier: string | null, constant: string | null, sourceLineNumber: number | null, instructionOffset: number | null, module: { name: string, package: { address: string } | null } | null, function: { name: string } | null } | null, epoch: { epochId: number } | null, objectChanges?: { nodes: Array<{ address: string, outputState: { asMoveObject: { contents: { type: { repr: string } | null } | null } | null } | null }> } | null, events?: { pageInfo: { hasNextPage: boolean }, nodes: Array<{ transactionModule: { name: string, package: { address: string } | null } | null, sender: { address: string } | null, contents: { bcs: string | null, json: unknown, type: { repr: string } | null } | null }> } | null } | null }> } | null };
|
|
428
428
|
|
|
429
|
-
export type Transaction_FieldsFragment = { digest: string, transactionJson?: unknown, transactionBcs?: string | null, signatures: Array<{ signatureBytes: string | null }>, effects: { status: ExecutionStatus | null, effectsBcs?: string | null, effectsJson?: unknown, balanceChangesJson?: unknown, executionError: { message: string, abortCode: string | null, identifier: string | null, constant: string | null, sourceLineNumber: number | null, instructionOffset: number | null, module: { name: string, package: { address: string } | null } | null, function: { name: string } | null } | null, epoch: { epochId: number } | null, objectChanges?: { nodes: Array<{ address: string, outputState: { asMoveObject: { contents: { type: { repr: string } | null } | null } | null } | null }> } | null, events?: { pageInfo: { hasNextPage: boolean }, nodes: Array<{ transactionModule: { name: string, package: { address: string } | null } | null, sender: { address: string } | null, contents: { bcs: string | null, json: unknown, type: { repr: string } | null } | null }> } | null } | null };
|
|
429
|
+
export type Transaction_FieldsFragment = { digest: string, transactionJson?: unknown, transactionBcs?: string | null, signatures: Array<{ signatureBytes: string | null }>, effects: { status: ExecutionStatus | null, timestamp: string | null, effectsBcs?: string | null, effectsJson?: unknown, balanceChangesJson?: unknown, checkpoint: { sequenceNumber: number } | null, executionError: { message: string, abortCode: string | null, identifier: string | null, constant: string | null, sourceLineNumber: number | null, instructionOffset: number | null, module: { name: string, package: { address: string } | null } | null, function: { name: string } | null } | null, epoch: { epochId: number } | null, objectChanges?: { nodes: Array<{ address: string, outputState: { asMoveObject: { contents: { type: { repr: string } | null } | null } | null } | null }> } | null, events?: { pageInfo: { hasNextPage: boolean }, nodes: Array<{ transactionModule: { name: string, package: { address: string } | null } | null, sender: { address: string } | null, contents: { bcs: string | null, json: unknown, type: { repr: string } | null } | null }> } | null } | null };
|
|
430
430
|
|
|
431
431
|
export type ResolveTransactionQueryVariables = Exact<{
|
|
432
432
|
transaction: unknown;
|
|
@@ -596,6 +596,10 @@ export const Transaction_FieldsFragmentDoc = new TypedDocumentString(`
|
|
|
596
596
|
}
|
|
597
597
|
effects {
|
|
598
598
|
status
|
|
599
|
+
timestamp
|
|
600
|
+
checkpoint {
|
|
601
|
+
sequenceNumber
|
|
602
|
+
}
|
|
599
603
|
executionError {
|
|
600
604
|
message
|
|
601
605
|
abortCode
|
|
@@ -1068,6 +1072,10 @@ export const SimulateTransactionDocument = new TypedDocumentString(`
|
|
|
1068
1072
|
}
|
|
1069
1073
|
effects {
|
|
1070
1074
|
status
|
|
1075
|
+
timestamp
|
|
1076
|
+
checkpoint {
|
|
1077
|
+
sequenceNumber
|
|
1078
|
+
}
|
|
1071
1079
|
executionError {
|
|
1072
1080
|
message
|
|
1073
1081
|
abortCode
|
|
@@ -1152,6 +1160,10 @@ export const ExecuteTransactionDocument = new TypedDocumentString(`
|
|
|
1152
1160
|
}
|
|
1153
1161
|
effects {
|
|
1154
1162
|
status
|
|
1163
|
+
timestamp
|
|
1164
|
+
checkpoint {
|
|
1165
|
+
sequenceNumber
|
|
1166
|
+
}
|
|
1155
1167
|
executionError {
|
|
1156
1168
|
message
|
|
1157
1169
|
abortCode
|
|
@@ -1229,6 +1241,10 @@ export const GetTransactionBlockDocument = new TypedDocumentString(`
|
|
|
1229
1241
|
}
|
|
1230
1242
|
effects {
|
|
1231
1243
|
status
|
|
1244
|
+
timestamp
|
|
1245
|
+
checkpoint {
|
|
1246
|
+
sequenceNumber
|
|
1247
|
+
}
|
|
1232
1248
|
executionError {
|
|
1233
1249
|
message
|
|
1234
1250
|
abortCode
|
|
@@ -1320,6 +1336,10 @@ export const ListTransactionsDocument = new TypedDocumentString(`
|
|
|
1320
1336
|
}
|
|
1321
1337
|
effects {
|
|
1322
1338
|
status
|
|
1339
|
+
timestamp
|
|
1340
|
+
checkpoint {
|
|
1341
|
+
sequenceNumber
|
|
1342
|
+
}
|
|
1323
1343
|
executionError {
|
|
1324
1344
|
message
|
|
1325
1345
|
abortCode
|
|
@@ -1431,4 +1451,4 @@ export const VerifyZkLoginSignatureDocument = new TypedDocumentString(`
|
|
|
1431
1451
|
success
|
|
1432
1452
|
}
|
|
1433
1453
|
}
|
|
1434
|
-
`) as unknown as TypedDocumentString<VerifyZkLoginSignatureQuery, VerifyZkLoginSignatureQueryVariables>;
|
|
1454
|
+
`) as unknown as TypedDocumentString<VerifyZkLoginSignatureQuery, VerifyZkLoginSignatureQueryVariables>;
|
package/src/grpc/core.ts
CHANGED
|
@@ -1040,7 +1040,14 @@ function transactionReadMaskPaths(
|
|
|
1040
1040
|
include: SuiClientTypes.TransactionInclude | undefined,
|
|
1041
1041
|
prefix = '',
|
|
1042
1042
|
): string[] {
|
|
1043
|
-
const paths = [
|
|
1043
|
+
const paths = [
|
|
1044
|
+
'digest',
|
|
1045
|
+
'transaction.digest',
|
|
1046
|
+
'signatures',
|
|
1047
|
+
'effects.status',
|
|
1048
|
+
'timestamp',
|
|
1049
|
+
'checkpoint',
|
|
1050
|
+
];
|
|
1044
1051
|
|
|
1045
1052
|
if (include?.transaction) {
|
|
1046
1053
|
paths.push(
|
|
@@ -1442,7 +1449,7 @@ export function parseTransactionEffects({
|
|
|
1442
1449
|
return {
|
|
1443
1450
|
bcs: effects.bcs?.value!,
|
|
1444
1451
|
|
|
1445
|
-
version: 2,
|
|
1452
|
+
version: effects.version ?? 2,
|
|
1446
1453
|
status: effects.status?.success
|
|
1447
1454
|
? {
|
|
1448
1455
|
success: true,
|
|
@@ -1555,6 +1562,11 @@ export function parseGrpcTransactionResponse<
|
|
|
1555
1562
|
const result: SuiClientTypes.Transaction<Include> = {
|
|
1556
1563
|
digest: transaction.digest!,
|
|
1557
1564
|
epoch: transaction.effects?.epoch?.toString() ?? null,
|
|
1565
|
+
timestampMs: transaction.timestamp
|
|
1566
|
+
? Number(transaction.timestamp.seconds) * 1000 +
|
|
1567
|
+
Math.floor(transaction.timestamp.nanos / 1_000_000)
|
|
1568
|
+
: null,
|
|
1569
|
+
checkpoint: transaction.checkpoint?.toString() ?? null,
|
|
1558
1570
|
status,
|
|
1559
1571
|
effects: effects as SuiClientTypes.Transaction<Include>['effects'],
|
|
1560
1572
|
objectTypes: (include?.objectTypes
|
package/src/jsonRpc/core.ts
CHANGED
|
@@ -530,6 +530,8 @@ export class JSONRpcCoreClient extends CoreClient {
|
|
|
530
530
|
const transactionData: SuiClientTypes.Transaction<Include> = {
|
|
531
531
|
digest: TransactionDataBuilder.getDigestFromBytes(transactionBytes),
|
|
532
532
|
epoch: null,
|
|
533
|
+
timestampMs: null,
|
|
534
|
+
checkpoint: null,
|
|
533
535
|
status: effects.status,
|
|
534
536
|
effects: (options.include?.effects
|
|
535
537
|
? effects
|
|
@@ -1228,6 +1230,8 @@ function parseTransaction<Include extends SuiClientTypes.TransactionInclude = {}
|
|
|
1228
1230
|
const result: SuiClientTypes.Transaction<Include> = {
|
|
1229
1231
|
digest: transaction.digest,
|
|
1230
1232
|
epoch: transaction.effects?.executedEpoch ?? null,
|
|
1233
|
+
timestampMs: transaction.timestampMs == null ? null : Number(transaction.timestampMs),
|
|
1234
|
+
checkpoint: transaction.checkpoint ?? null,
|
|
1231
1235
|
status,
|
|
1232
1236
|
effects: (include?.effects && effectsBytes
|
|
1233
1237
|
? parseTransactionEffectsBcs(effectsBytes)
|
package/src/version.ts
CHANGED