@mysten/sui 2.21.0 → 2.22.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 +7 -0
- package/dist/bcs/bcs.d.mts +6 -6
- package/dist/bcs/index.d.mts +20 -20
- package/dist/cryptography/signature.d.mts +6 -6
- package/dist/grpc/client.d.mts +46 -6
- package/dist/grpc/client.d.mts.map +1 -1
- package/dist/grpc/client.mjs.map +1 -1
- package/dist/grpc/core.d.mts.map +1 -1
- package/dist/grpc/core.mjs +33 -51
- package/dist/grpc/core.mjs.map +1 -1
- package/dist/grpc/index.d.mts +2 -2
- package/dist/grpc/proto/sui/rpc/v2/effects.d.mts +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/object.d.mts +1 -1
- 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.d.mts +1 -1
- package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.d.mts +1 -1
- package/dist/grpc/proto/types.d.mts +2 -2
- 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/dist/zklogin/bcs.d.mts.map +1 -1
- package/package.json +1 -1
- package/src/grpc/client.ts +92 -20
- package/src/grpc/core.ts +72 -91
- package/src/grpc/index.ts +14 -1
- package/src/version.ts +1 -1
package/dist/zklogin/bcs.d.mts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _mysten_bcs1118 from "@mysten/bcs";
|
|
2
2
|
import { InferBcsInput } from "@mysten/bcs";
|
|
3
3
|
|
|
4
4
|
//#region src/zklogin/bcs.d.ts
|
|
5
|
-
declare const zkLoginSignature:
|
|
6
|
-
inputs:
|
|
7
|
-
proofPoints:
|
|
8
|
-
a:
|
|
5
|
+
declare const zkLoginSignature: _mysten_bcs1118.BcsStruct<{
|
|
6
|
+
inputs: _mysten_bcs1118.BcsStruct<{
|
|
7
|
+
proofPoints: _mysten_bcs1118.BcsStruct<{
|
|
8
|
+
a: _mysten_bcs1118.BcsType<string[], Iterable<string> & {
|
|
9
9
|
length: number;
|
|
10
10
|
}, string>;
|
|
11
|
-
b:
|
|
11
|
+
b: _mysten_bcs1118.BcsType<string[][], Iterable<Iterable<string> & {
|
|
12
12
|
length: number;
|
|
13
13
|
}> & {
|
|
14
14
|
length: number;
|
|
15
15
|
}, string>;
|
|
16
|
-
c:
|
|
16
|
+
c: _mysten_bcs1118.BcsType<string[], Iterable<string> & {
|
|
17
17
|
length: number;
|
|
18
18
|
}, string>;
|
|
19
19
|
}, string>;
|
|
20
|
-
issBase64Details:
|
|
21
|
-
value:
|
|
22
|
-
indexMod4:
|
|
20
|
+
issBase64Details: _mysten_bcs1118.BcsStruct<{
|
|
21
|
+
value: _mysten_bcs1118.BcsType<string, string, "string">;
|
|
22
|
+
indexMod4: _mysten_bcs1118.BcsType<number, number, "u8">;
|
|
23
23
|
}, string>;
|
|
24
|
-
headerBase64:
|
|
25
|
-
addressSeed:
|
|
24
|
+
headerBase64: _mysten_bcs1118.BcsType<string, string, "string">;
|
|
25
|
+
addressSeed: _mysten_bcs1118.BcsType<string, string, "string">;
|
|
26
26
|
}, string>;
|
|
27
|
-
maxEpoch:
|
|
28
|
-
userSignature:
|
|
27
|
+
maxEpoch: _mysten_bcs1118.BcsType<string, string | number | bigint, "u64">;
|
|
28
|
+
userSignature: _mysten_bcs1118.BcsType<Uint8Array<ArrayBufferLike>, Iterable<number>, "vector<u8>">;
|
|
29
29
|
}, string>;
|
|
30
30
|
type ZkLoginSignature = InferBcsInput<typeof zkLoginSignature>;
|
|
31
31
|
type ZkLoginSignatureInputs = ZkLoginSignature['inputs'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bcs.d.mts","names":[],"sources":["../../src/zklogin/bcs.ts"],"mappings":";;;;cAMa,gBAAA,
|
|
1
|
+
{"version":3,"file":"bcs.d.mts","names":[],"sources":["../../src/zklogin/bcs.ts"],"mappings":";;;;cAMa,gBAAA,kBAAgB,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;KAkBjB,gBAAA,GAAmB,aAAA,QAAqB,gBAAA;AAAA,KACxC,sBAAA,GAAyB,gBAAA"}
|
package/package.json
CHANGED
package/src/grpc/client.ts
CHANGED
|
@@ -57,6 +57,78 @@ export interface ListDynamicFieldsWithValueResponse<Include extends DynamicField
|
|
|
57
57
|
dynamicFields: DynamicFieldEntryWithValue<Include>[];
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
export interface GrpcTransactionInclude extends SuiClientTypes.TransactionInclude {
|
|
61
|
+
/** Include the parsed protobuf JSON value for the gRPC transaction response. */
|
|
62
|
+
protoJson?: boolean;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface GrpcSimulateTransactionInclude extends SuiClientTypes.SimulateTransactionInclude {
|
|
66
|
+
/** Include the parsed protobuf JSON value for the gRPC simulation response. */
|
|
67
|
+
protoJson?: boolean;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export type GrpcTransactionProtoJson = ReturnType<
|
|
71
|
+
typeof import('./proto/sui/rpc/v2/executed_transaction.js').ExecutedTransaction.toJson
|
|
72
|
+
>;
|
|
73
|
+
|
|
74
|
+
export type GrpcSimulateTransactionProtoJson = ReturnType<
|
|
75
|
+
typeof import('./proto/sui/rpc/v2/transaction_execution_service.js').SimulateTransactionResponse.toJson
|
|
76
|
+
>;
|
|
77
|
+
|
|
78
|
+
type ProtoJson<Include extends { protoJson?: boolean }, Json> = Include['protoJson'] extends true
|
|
79
|
+
? Json
|
|
80
|
+
: undefined;
|
|
81
|
+
|
|
82
|
+
export type GrpcTransactionResult<Include extends GrpcTransactionInclude = {}> =
|
|
83
|
+
SuiClientTypes.TransactionResult<Include> & {
|
|
84
|
+
protoJson: ProtoJson<Include, GrpcTransactionProtoJson>;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export type GrpcSimulateTransactionResult<Include extends GrpcSimulateTransactionInclude = {}> =
|
|
88
|
+
SuiClientTypes.SimulateTransactionResult<Include> & {
|
|
89
|
+
protoJson: ProtoJson<Include, GrpcSimulateTransactionProtoJson>;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export interface GrpcGetTransactionOptions<
|
|
93
|
+
Include extends GrpcTransactionInclude = {},
|
|
94
|
+
> extends SuiClientTypes.GetTransactionOptions<Include> {
|
|
95
|
+
include?: Include & GrpcTransactionInclude;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface GrpcWaitForTransactionByDigest<
|
|
99
|
+
Include extends GrpcTransactionInclude = {},
|
|
100
|
+
> extends SuiClientTypes.WaitForTransactionByDigest<Include> {
|
|
101
|
+
include?: Include & GrpcTransactionInclude;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface GrpcWaitForTransactionByResult<
|
|
105
|
+
Include extends GrpcTransactionInclude = {},
|
|
106
|
+
> extends SuiClientTypes.WaitForTransactionByResult<Include> {
|
|
107
|
+
include?: Include & GrpcTransactionInclude;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export type GrpcWaitForTransactionOptions<Include extends GrpcTransactionInclude = {}> =
|
|
111
|
+
| GrpcWaitForTransactionByDigest<Include>
|
|
112
|
+
| GrpcWaitForTransactionByResult<Include>;
|
|
113
|
+
|
|
114
|
+
export interface GrpcExecuteTransactionOptions<
|
|
115
|
+
Include extends GrpcTransactionInclude = {},
|
|
116
|
+
> extends SuiClientTypes.ExecuteTransactionOptions<Include> {
|
|
117
|
+
include?: Include & GrpcTransactionInclude;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface GrpcSignAndExecuteTransactionOptions<
|
|
121
|
+
Include extends GrpcTransactionInclude = {},
|
|
122
|
+
> extends SuiClientTypes.SignAndExecuteTransactionOptions<Include> {
|
|
123
|
+
include?: Include & GrpcTransactionInclude;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface GrpcSimulateTransactionOptions<
|
|
127
|
+
Include extends GrpcSimulateTransactionInclude = {},
|
|
128
|
+
> extends SuiClientTypes.SimulateTransactionOptions<Include> {
|
|
129
|
+
include?: Include & GrpcSimulateTransactionInclude;
|
|
130
|
+
}
|
|
131
|
+
|
|
60
132
|
export class SuiGrpcClient extends BaseClient implements SuiClientTypes.TransportMethods {
|
|
61
133
|
core: GrpcCoreClient;
|
|
62
134
|
get mvr(): SuiClientTypes.MvrMethods {
|
|
@@ -135,34 +207,34 @@ export class SuiGrpcClient extends BaseClient implements SuiClientTypes.Transpor
|
|
|
135
207
|
return this.core.getCoinMetadata(input);
|
|
136
208
|
}
|
|
137
209
|
|
|
138
|
-
getTransaction<Include extends
|
|
139
|
-
input:
|
|
140
|
-
): Promise<
|
|
141
|
-
return this.core.getTransaction(input)
|
|
210
|
+
getTransaction<Include extends GrpcTransactionInclude = {}>(
|
|
211
|
+
input: GrpcGetTransactionOptions<Include>,
|
|
212
|
+
): Promise<GrpcTransactionResult<Include>> {
|
|
213
|
+
return this.core.getTransaction(input) as Promise<GrpcTransactionResult<Include>>;
|
|
142
214
|
}
|
|
143
215
|
|
|
144
|
-
executeTransaction<Include extends
|
|
145
|
-
input:
|
|
146
|
-
): Promise<
|
|
147
|
-
return this.core.executeTransaction(input)
|
|
216
|
+
executeTransaction<Include extends GrpcTransactionInclude = {}>(
|
|
217
|
+
input: GrpcExecuteTransactionOptions<Include>,
|
|
218
|
+
): Promise<GrpcTransactionResult<Include>> {
|
|
219
|
+
return this.core.executeTransaction(input) as Promise<GrpcTransactionResult<Include>>;
|
|
148
220
|
}
|
|
149
221
|
|
|
150
|
-
signAndExecuteTransaction<Include extends
|
|
151
|
-
input:
|
|
152
|
-
): Promise<
|
|
153
|
-
return this.core.signAndExecuteTransaction(input)
|
|
222
|
+
signAndExecuteTransaction<Include extends GrpcTransactionInclude = {}>(
|
|
223
|
+
input: GrpcSignAndExecuteTransactionOptions<Include>,
|
|
224
|
+
): Promise<GrpcTransactionResult<Include>> {
|
|
225
|
+
return this.core.signAndExecuteTransaction(input) as Promise<GrpcTransactionResult<Include>>;
|
|
154
226
|
}
|
|
155
227
|
|
|
156
|
-
waitForTransaction<Include extends
|
|
157
|
-
input:
|
|
158
|
-
): Promise<
|
|
159
|
-
return this.core.waitForTransaction(input)
|
|
228
|
+
waitForTransaction<Include extends GrpcTransactionInclude = {}>(
|
|
229
|
+
input: GrpcWaitForTransactionOptions<Include>,
|
|
230
|
+
): Promise<GrpcTransactionResult<Include>> {
|
|
231
|
+
return this.core.waitForTransaction(input) as Promise<GrpcTransactionResult<Include>>;
|
|
160
232
|
}
|
|
161
233
|
|
|
162
|
-
simulateTransaction<Include extends
|
|
163
|
-
input:
|
|
164
|
-
): Promise<
|
|
165
|
-
return this.core.simulateTransaction(input)
|
|
234
|
+
simulateTransaction<Include extends GrpcSimulateTransactionInclude = {}>(
|
|
235
|
+
input: GrpcSimulateTransactionOptions<Include>,
|
|
236
|
+
): Promise<GrpcSimulateTransactionResult<Include>> {
|
|
237
|
+
return this.core.simulateTransaction(input) as Promise<GrpcSimulateTransactionResult<Include>>;
|
|
166
238
|
}
|
|
167
239
|
|
|
168
240
|
getReferenceGasPrice(): Promise<SuiClientTypes.GetReferenceGasPriceResponse> {
|
package/src/grpc/core.ts
CHANGED
|
@@ -8,7 +8,6 @@ import type { SuiGrpcClient } from './client.js';
|
|
|
8
8
|
import type { Owner } from './proto/sui/rpc/v2/owner.js';
|
|
9
9
|
import { Owner_OwnerKind } from './proto/sui/rpc/v2/owner.js';
|
|
10
10
|
import { chunk, fromBase64, toBase64 } from '@mysten/utils';
|
|
11
|
-
import type { ExecutedTransaction } from './proto/sui/rpc/v2/executed_transaction.js';
|
|
12
11
|
import type { TransactionEffects } from './proto/sui/rpc/v2/effects.js';
|
|
13
12
|
import {
|
|
14
13
|
UnchangedConsensusObject_UnchangedConsensusObjectKind,
|
|
@@ -45,12 +44,16 @@ import {
|
|
|
45
44
|
grpcTransactionToTransactionData,
|
|
46
45
|
} from '../client/transaction-resolver.js';
|
|
47
46
|
import { Value } from './proto/google/protobuf/struct.js';
|
|
48
|
-
import
|
|
49
|
-
import {
|
|
47
|
+
import { ExecutedTransaction } from './proto/sui/rpc/v2/executed_transaction.js';
|
|
48
|
+
import {
|
|
49
|
+
SimulateTransactionRequest_TransactionChecks,
|
|
50
|
+
SimulateTransactionResponse,
|
|
51
|
+
} from './proto/sui/rpc/v2/transaction_execution_service.js';
|
|
50
52
|
|
|
51
53
|
export interface GrpcCoreClientOptions extends CoreClientOptions {
|
|
52
54
|
client: SuiGrpcClient;
|
|
53
55
|
}
|
|
56
|
+
|
|
54
57
|
export class GrpcCoreClient extends CoreClient {
|
|
55
58
|
#client: SuiGrpcClient;
|
|
56
59
|
constructor({ client, ...options }: GrpcCoreClientOptions) {
|
|
@@ -331,37 +334,11 @@ export class GrpcCoreClient extends CoreClient {
|
|
|
331
334
|
async getTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(
|
|
332
335
|
options: SuiClientTypes.GetTransactionOptions<Include>,
|
|
333
336
|
): Promise<SuiClientTypes.TransactionResult<Include>> {
|
|
334
|
-
const paths = ['digest', 'transaction.digest', 'signatures', 'effects.status'];
|
|
335
|
-
if (options.include?.transaction) {
|
|
336
|
-
paths.push(
|
|
337
|
-
'transaction.sender',
|
|
338
|
-
'transaction.gas_payment',
|
|
339
|
-
'transaction.expiration',
|
|
340
|
-
'transaction.kind',
|
|
341
|
-
);
|
|
342
|
-
}
|
|
343
|
-
if (options.include?.bcs) {
|
|
344
|
-
paths.push('transaction.bcs');
|
|
345
|
-
}
|
|
346
|
-
if (options.include?.balanceChanges) {
|
|
347
|
-
paths.push('balance_changes');
|
|
348
|
-
}
|
|
349
|
-
if (options.include?.effects) {
|
|
350
|
-
paths.push('effects');
|
|
351
|
-
}
|
|
352
|
-
if (options.include?.events) {
|
|
353
|
-
paths.push('events');
|
|
354
|
-
}
|
|
355
|
-
if (options.include?.objectTypes) {
|
|
356
|
-
paths.push('effects.changed_objects.object_type');
|
|
357
|
-
paths.push('effects.changed_objects.object_id');
|
|
358
|
-
}
|
|
359
|
-
|
|
360
337
|
const { response } = await this.#client.ledgerService.getTransaction(
|
|
361
338
|
{
|
|
362
339
|
digest: options.digest,
|
|
363
340
|
readMask: {
|
|
364
|
-
paths,
|
|
341
|
+
paths: transactionReadMaskPaths(options.include),
|
|
365
342
|
},
|
|
366
343
|
},
|
|
367
344
|
{ abort: options.signal },
|
|
@@ -371,37 +348,15 @@ export class GrpcCoreClient extends CoreClient {
|
|
|
371
348
|
throw new Error(`Transaction ${options.digest} not found`);
|
|
372
349
|
}
|
|
373
350
|
|
|
374
|
-
return
|
|
351
|
+
return withProtoJson(
|
|
352
|
+
parseGrpcTransactionResponse(response.transaction, { include: options.include }),
|
|
353
|
+
options.include,
|
|
354
|
+
() => ExecutedTransaction.toJson(response.transaction!),
|
|
355
|
+
);
|
|
375
356
|
}
|
|
376
357
|
async executeTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(
|
|
377
358
|
options: SuiClientTypes.ExecuteTransactionOptions<Include>,
|
|
378
359
|
): Promise<SuiClientTypes.TransactionResult<Include>> {
|
|
379
|
-
const paths = ['digest', 'transaction.digest', 'signatures', 'effects.status'];
|
|
380
|
-
if (options.include?.transaction) {
|
|
381
|
-
paths.push(
|
|
382
|
-
'transaction.sender',
|
|
383
|
-
'transaction.gas_payment',
|
|
384
|
-
'transaction.expiration',
|
|
385
|
-
'transaction.kind',
|
|
386
|
-
);
|
|
387
|
-
}
|
|
388
|
-
if (options.include?.bcs) {
|
|
389
|
-
paths.push('transaction.bcs');
|
|
390
|
-
}
|
|
391
|
-
if (options.include?.balanceChanges) {
|
|
392
|
-
paths.push('balance_changes');
|
|
393
|
-
}
|
|
394
|
-
if (options.include?.effects) {
|
|
395
|
-
paths.push('effects');
|
|
396
|
-
}
|
|
397
|
-
if (options.include?.events) {
|
|
398
|
-
paths.push('events');
|
|
399
|
-
}
|
|
400
|
-
if (options.include?.objectTypes) {
|
|
401
|
-
paths.push('effects.changed_objects.object_type');
|
|
402
|
-
paths.push('effects.changed_objects.object_id');
|
|
403
|
-
}
|
|
404
|
-
|
|
405
360
|
const { response } = await this.#client.transactionExecutionService.executeTransaction(
|
|
406
361
|
{
|
|
407
362
|
transaction: {
|
|
@@ -418,48 +373,22 @@ export class GrpcCoreClient extends CoreClient {
|
|
|
418
373
|
},
|
|
419
374
|
})),
|
|
420
375
|
readMask: {
|
|
421
|
-
paths,
|
|
376
|
+
paths: transactionReadMaskPaths(options.include),
|
|
422
377
|
},
|
|
423
378
|
},
|
|
424
379
|
{ abort: options.signal },
|
|
425
380
|
);
|
|
426
381
|
|
|
427
|
-
return
|
|
382
|
+
return withProtoJson(
|
|
383
|
+
parseGrpcTransactionResponse(response.transaction!, { include: options.include }),
|
|
384
|
+
options.include,
|
|
385
|
+
() => ExecutedTransaction.toJson(response.transaction!),
|
|
386
|
+
);
|
|
428
387
|
}
|
|
429
388
|
async simulateTransaction<Include extends SuiClientTypes.SimulateTransactionInclude = {}>(
|
|
430
389
|
options: SuiClientTypes.SimulateTransactionOptions<Include>,
|
|
431
390
|
): Promise<SuiClientTypes.SimulateTransactionResult<Include>> {
|
|
432
|
-
const paths =
|
|
433
|
-
'transaction.digest',
|
|
434
|
-
'transaction.transaction.digest',
|
|
435
|
-
'transaction.signatures',
|
|
436
|
-
'transaction.effects.status',
|
|
437
|
-
];
|
|
438
|
-
if (options.include?.transaction) {
|
|
439
|
-
paths.push(
|
|
440
|
-
'transaction.transaction.sender',
|
|
441
|
-
'transaction.transaction.gas_payment',
|
|
442
|
-
'transaction.transaction.expiration',
|
|
443
|
-
'transaction.transaction.kind',
|
|
444
|
-
);
|
|
445
|
-
}
|
|
446
|
-
if (options.include?.bcs) {
|
|
447
|
-
paths.push('transaction.transaction.bcs');
|
|
448
|
-
}
|
|
449
|
-
if (options.include?.balanceChanges) {
|
|
450
|
-
paths.push('transaction.balance_changes');
|
|
451
|
-
}
|
|
452
|
-
if (options.include?.effects) {
|
|
453
|
-
paths.push('transaction.effects');
|
|
454
|
-
}
|
|
455
|
-
if (options.include?.events) {
|
|
456
|
-
paths.push('transaction.events');
|
|
457
|
-
}
|
|
458
|
-
if (options.include?.objectTypes) {
|
|
459
|
-
// Use effects.changed_objects to match JSON-RPC behavior (which uses objectChanges)
|
|
460
|
-
paths.push('transaction.effects.changed_objects.object_type');
|
|
461
|
-
paths.push('transaction.effects.changed_objects.object_id');
|
|
462
|
-
}
|
|
391
|
+
const paths = transactionReadMaskPaths(options.include, 'transaction.');
|
|
463
392
|
if (options.include?.commandResults) {
|
|
464
393
|
paths.push('command_outputs');
|
|
465
394
|
}
|
|
@@ -490,7 +419,11 @@ export class GrpcCoreClient extends CoreClient {
|
|
|
490
419
|
{ abort: options.signal },
|
|
491
420
|
);
|
|
492
421
|
|
|
493
|
-
return
|
|
422
|
+
return withProtoJson(
|
|
423
|
+
parseGrpcSimulateTransactionResponse(response, { include: options.include }),
|
|
424
|
+
options.include,
|
|
425
|
+
() => SimulateTransactionResponse.toJson(response),
|
|
426
|
+
);
|
|
494
427
|
}
|
|
495
428
|
async getReferenceGasPrice(
|
|
496
429
|
options?: SuiClientTypes.GetReferenceGasPriceOptions,
|
|
@@ -843,6 +776,54 @@ export class GrpcCoreClient extends CoreClient {
|
|
|
843
776
|
}
|
|
844
777
|
}
|
|
845
778
|
|
|
779
|
+
function transactionReadMaskPaths(
|
|
780
|
+
include: SuiClientTypes.TransactionInclude | undefined,
|
|
781
|
+
prefix = '',
|
|
782
|
+
) {
|
|
783
|
+
const paths = ['digest', 'transaction.digest', 'signatures', 'effects.status'];
|
|
784
|
+
if (include?.transaction) {
|
|
785
|
+
paths.push(
|
|
786
|
+
'transaction.sender',
|
|
787
|
+
'transaction.gas_payment',
|
|
788
|
+
'transaction.expiration',
|
|
789
|
+
'transaction.kind',
|
|
790
|
+
);
|
|
791
|
+
}
|
|
792
|
+
if (include?.bcs) {
|
|
793
|
+
paths.push('transaction.bcs');
|
|
794
|
+
}
|
|
795
|
+
if (include?.balanceChanges) {
|
|
796
|
+
paths.push('balance_changes');
|
|
797
|
+
}
|
|
798
|
+
if (include?.effects) {
|
|
799
|
+
paths.push('effects');
|
|
800
|
+
}
|
|
801
|
+
if (include?.events) {
|
|
802
|
+
paths.push('events');
|
|
803
|
+
}
|
|
804
|
+
if (include?.objectTypes) {
|
|
805
|
+
paths.push('effects.changed_objects.object_type');
|
|
806
|
+
paths.push('effects.changed_objects.object_id');
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
return prefix ? paths.map((path) => prefix + path) : paths;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
function withProtoJson<Result>(
|
|
813
|
+
result: Result,
|
|
814
|
+
include: ({ protoJson?: boolean } & object) | undefined,
|
|
815
|
+
getProtoJson: () => unknown,
|
|
816
|
+
): Result {
|
|
817
|
+
if (!include?.protoJson) {
|
|
818
|
+
return result;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
return {
|
|
822
|
+
...result,
|
|
823
|
+
protoJson: getProtoJson(),
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
|
|
846
827
|
function mapDisplayProto(
|
|
847
828
|
include: boolean | undefined,
|
|
848
829
|
display: { output?: Value; errors?: Value } | undefined,
|
package/src/grpc/index.ts
CHANGED
|
@@ -7,7 +7,20 @@ export {
|
|
|
7
7
|
parseGrpcSimulateTransactionResponse,
|
|
8
8
|
parseGrpcTransactionResponse,
|
|
9
9
|
} from './core.js';
|
|
10
|
-
export type {
|
|
10
|
+
export type {
|
|
11
|
+
GrpcExecuteTransactionOptions,
|
|
12
|
+
GrpcGetTransactionOptions,
|
|
13
|
+
GrpcSignAndExecuteTransactionOptions,
|
|
14
|
+
GrpcSimulateTransactionInclude,
|
|
15
|
+
GrpcSimulateTransactionOptions,
|
|
16
|
+
GrpcSimulateTransactionProtoJson,
|
|
17
|
+
GrpcSimulateTransactionResult,
|
|
18
|
+
GrpcTransactionInclude,
|
|
19
|
+
GrpcTransactionProtoJson,
|
|
20
|
+
GrpcTransactionResult,
|
|
21
|
+
GrpcWaitForTransactionOptions,
|
|
22
|
+
SuiGrpcClientOptions,
|
|
23
|
+
} from './client.js';
|
|
11
24
|
export type { GrpcCoreClientOptions } from './core.js';
|
|
12
25
|
|
|
13
26
|
// Re-export transports and types so users can configure custom transports
|
package/src/version.ts
CHANGED