@apibara/starknet 2.1.0-beta.4 → 2.1.0-beta.41

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/src/proto/data.ts CHANGED
@@ -224,6 +224,51 @@ export function dataAvailabilityModeToJSON(object: DataAvailabilityMode): string
224
224
  }
225
225
  }
226
226
 
227
+ export enum CallType {
228
+ UNSPECIFIED = 0,
229
+ LIBRARY_CALL = 1,
230
+ CALL = 2,
231
+ DELEGATE = 3,
232
+ UNRECOGNIZED = -1,
233
+ }
234
+
235
+ export function callTypeFromJSON(object: any): CallType {
236
+ switch (object) {
237
+ case 0:
238
+ case "CALL_TYPE_UNSPECIFIED":
239
+ return CallType.UNSPECIFIED;
240
+ case 1:
241
+ case "CALL_TYPE_LIBRARY_CALL":
242
+ return CallType.LIBRARY_CALL;
243
+ case 2:
244
+ case "CALL_TYPE_CALL":
245
+ return CallType.CALL;
246
+ case 3:
247
+ case "CALL_TYPE_DELEGATE":
248
+ return CallType.DELEGATE;
249
+ case -1:
250
+ case "UNRECOGNIZED":
251
+ default:
252
+ return CallType.UNRECOGNIZED;
253
+ }
254
+ }
255
+
256
+ export function callTypeToJSON(object: CallType): string {
257
+ switch (object) {
258
+ case CallType.UNSPECIFIED:
259
+ return "CALL_TYPE_UNSPECIFIED";
260
+ case CallType.LIBRARY_CALL:
261
+ return "CALL_TYPE_LIBRARY_CALL";
262
+ case CallType.CALL:
263
+ return "CALL_TYPE_CALL";
264
+ case CallType.DELEGATE:
265
+ return "CALL_TYPE_DELEGATE";
266
+ case CallType.UNRECOGNIZED:
267
+ default:
268
+ return "UNRECOGNIZED";
269
+ }
270
+ }
271
+
227
272
  /** Requested data, grouped by block. */
228
273
  export interface Block {
229
274
  /** The header. */
@@ -255,7 +300,11 @@ export interface Block {
255
300
  | readonly ContractChange[]
256
301
  | undefined;
257
302
  /** List of nonce updates. */
258
- readonly nonceUpdates?: readonly NonceUpdate[] | undefined;
303
+ readonly nonceUpdates?:
304
+ | readonly NonceUpdate[]
305
+ | undefined;
306
+ /** List of transaction traces. */
307
+ readonly traces?: readonly TransactionTrace[] | undefined;
259
308
  }
260
309
 
261
310
  /** Block header. */
@@ -745,6 +794,67 @@ export interface NonceUpdate {
745
794
  readonly nonce?: FieldElement | undefined;
746
795
  }
747
796
 
797
+ export interface TransactionTrace {
798
+ readonly filterIds?:
799
+ | readonly number[]
800
+ | undefined;
801
+ /** Index of the transaction in the block. */
802
+ readonly transactionIndex?:
803
+ | number
804
+ | undefined;
805
+ /** Transaction hash. */
806
+ readonly transactionHash?: FieldElement | undefined;
807
+ readonly traceRoot?:
808
+ | { readonly $case: "invoke"; readonly invoke: InvokeTransactionTrace }
809
+ | { readonly $case: "declare"; readonly declare: DeclareTransactionTrace }
810
+ | { readonly $case: "deployAccount"; readonly deployAccount: DeployAccountTransactionTrace }
811
+ | { readonly $case: "l1Handler"; readonly l1Handler: L1HandlerTransactionTrace }
812
+ | undefined;
813
+ }
814
+
815
+ export interface InvokeTransactionTrace {
816
+ readonly validateInvocation?: FunctionInvocation | undefined;
817
+ readonly executeInvocation?: { readonly $case: "success"; readonly success: FunctionInvocation } | {
818
+ readonly $case: "reverted";
819
+ readonly reverted: ExecutionReverted;
820
+ } | undefined;
821
+ readonly feeTransferInvocation?: FunctionInvocation | undefined;
822
+ }
823
+
824
+ export interface DeclareTransactionTrace {
825
+ readonly validateInvocation?: FunctionInvocation | undefined;
826
+ readonly feeTransferInvocation?: FunctionInvocation | undefined;
827
+ }
828
+
829
+ export interface DeployAccountTransactionTrace {
830
+ readonly validateInvocation?: FunctionInvocation | undefined;
831
+ readonly constructorInvocation?: FunctionInvocation | undefined;
832
+ readonly feeTransferInvocation?: FunctionInvocation | undefined;
833
+ }
834
+
835
+ export interface L1HandlerTransactionTrace {
836
+ readonly functionInvocation?: FunctionInvocation | undefined;
837
+ }
838
+
839
+ export interface FunctionInvocation {
840
+ readonly contractAddress?: FieldElement | undefined;
841
+ readonly entryPointSelector?: FieldElement | undefined;
842
+ readonly calldata?: readonly FieldElement[] | undefined;
843
+ readonly callerAddress?: FieldElement | undefined;
844
+ readonly classHash?: FieldElement | undefined;
845
+ readonly callType?: CallType | undefined;
846
+ readonly result?: readonly FieldElement[] | undefined;
847
+ readonly calls?: readonly FunctionInvocation[] | undefined;
848
+ readonly events?: readonly number[] | undefined;
849
+ readonly messages?: readonly number[] | undefined;
850
+ }
851
+
852
+ export interface FunctionCall {
853
+ readonly contractAddress?: FieldElement | undefined;
854
+ readonly entryPointSelector?: FieldElement | undefined;
855
+ readonly calldata?: readonly FieldElement[] | undefined;
856
+ }
857
+
748
858
  function createBaseBlock(): Block {
749
859
  return {
750
860
  header: undefined,
@@ -755,6 +865,7 @@ function createBaseBlock(): Block {
755
865
  storageDiffs: [],
756
866
  contractChanges: [],
757
867
  nonceUpdates: [],
868
+ traces: [],
758
869
  };
759
870
  }
760
871
 
@@ -798,6 +909,11 @@ export const Block = {
798
909
  NonceUpdate.encode(v!, writer.uint32(66).fork()).ldelim();
799
910
  }
800
911
  }
912
+ if (message.traces !== undefined && message.traces.length !== 0) {
913
+ for (const v of message.traces) {
914
+ TransactionTrace.encode(v!, writer.uint32(74).fork()).ldelim();
915
+ }
916
+ }
801
917
  return writer;
802
918
  },
803
919
 
@@ -864,6 +980,13 @@ export const Block = {
864
980
 
865
981
  message.nonceUpdates!.push(NonceUpdate.decode(reader, reader.uint32()));
866
982
  continue;
983
+ case 9:
984
+ if (tag !== 74) {
985
+ break;
986
+ }
987
+
988
+ message.traces!.push(TransactionTrace.decode(reader, reader.uint32()));
989
+ continue;
867
990
  }
868
991
  if ((tag & 7) === 4 || tag === 0) {
869
992
  break;
@@ -895,6 +1018,9 @@ export const Block = {
895
1018
  nonceUpdates: globalThis.Array.isArray(object?.nonceUpdates)
896
1019
  ? object.nonceUpdates.map((e: any) => NonceUpdate.fromJSON(e))
897
1020
  : [],
1021
+ traces: globalThis.Array.isArray(object?.traces)
1022
+ ? object.traces.map((e: any) => TransactionTrace.fromJSON(e))
1023
+ : [],
898
1024
  };
899
1025
  },
900
1026
 
@@ -924,6 +1050,9 @@ export const Block = {
924
1050
  if (message.nonceUpdates?.length) {
925
1051
  obj.nonceUpdates = message.nonceUpdates.map((e) => NonceUpdate.toJSON(e));
926
1052
  }
1053
+ if (message.traces?.length) {
1054
+ obj.traces = message.traces.map((e) => TransactionTrace.toJSON(e));
1055
+ }
927
1056
  return obj;
928
1057
  },
929
1058
 
@@ -942,6 +1071,7 @@ export const Block = {
942
1071
  message.storageDiffs = object.storageDiffs?.map((e) => StorageDiff.fromPartial(e)) || [];
943
1072
  message.contractChanges = object.contractChanges?.map((e) => ContractChange.fromPartial(e)) || [];
944
1073
  message.nonceUpdates = object.nonceUpdates?.map((e) => NonceUpdate.fromPartial(e)) || [];
1074
+ message.traces = object.traces?.map((e) => TransactionTrace.fromPartial(e)) || [];
945
1075
  return message;
946
1076
  },
947
1077
  };
@@ -6069,6 +6199,956 @@ export const NonceUpdate = {
6069
6199
  },
6070
6200
  };
6071
6201
 
6202
+ function createBaseTransactionTrace(): TransactionTrace {
6203
+ return { filterIds: [], transactionIndex: 0, transactionHash: undefined, traceRoot: undefined };
6204
+ }
6205
+
6206
+ export const TransactionTrace = {
6207
+ encode(message: TransactionTrace, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
6208
+ if (message.filterIds !== undefined && message.filterIds.length !== 0) {
6209
+ writer.uint32(10).fork();
6210
+ for (const v of message.filterIds) {
6211
+ writer.uint32(v);
6212
+ }
6213
+ writer.ldelim();
6214
+ }
6215
+ if (message.transactionIndex !== undefined && message.transactionIndex !== 0) {
6216
+ writer.uint32(16).uint32(message.transactionIndex);
6217
+ }
6218
+ if (message.transactionHash !== undefined) {
6219
+ FieldElement.encode(message.transactionHash, writer.uint32(26).fork()).ldelim();
6220
+ }
6221
+ switch (message.traceRoot?.$case) {
6222
+ case "invoke":
6223
+ InvokeTransactionTrace.encode(message.traceRoot.invoke, writer.uint32(34).fork()).ldelim();
6224
+ break;
6225
+ case "declare":
6226
+ DeclareTransactionTrace.encode(message.traceRoot.declare, writer.uint32(42).fork()).ldelim();
6227
+ break;
6228
+ case "deployAccount":
6229
+ DeployAccountTransactionTrace.encode(message.traceRoot.deployAccount, writer.uint32(50).fork()).ldelim();
6230
+ break;
6231
+ case "l1Handler":
6232
+ L1HandlerTransactionTrace.encode(message.traceRoot.l1Handler, writer.uint32(58).fork()).ldelim();
6233
+ break;
6234
+ }
6235
+ return writer;
6236
+ },
6237
+
6238
+ decode(input: _m0.Reader | Uint8Array, length?: number): TransactionTrace {
6239
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
6240
+ let end = length === undefined ? reader.len : reader.pos + length;
6241
+ const message = createBaseTransactionTrace() as any;
6242
+ while (reader.pos < end) {
6243
+ const tag = reader.uint32();
6244
+ switch (tag >>> 3) {
6245
+ case 1:
6246
+ if (tag === 8) {
6247
+ message.filterIds!.push(reader.uint32());
6248
+
6249
+ continue;
6250
+ }
6251
+
6252
+ if (tag === 10) {
6253
+ const end2 = reader.uint32() + reader.pos;
6254
+ while (reader.pos < end2) {
6255
+ message.filterIds!.push(reader.uint32());
6256
+ }
6257
+
6258
+ continue;
6259
+ }
6260
+
6261
+ break;
6262
+ case 2:
6263
+ if (tag !== 16) {
6264
+ break;
6265
+ }
6266
+
6267
+ message.transactionIndex = reader.uint32();
6268
+ continue;
6269
+ case 3:
6270
+ if (tag !== 26) {
6271
+ break;
6272
+ }
6273
+
6274
+ message.transactionHash = FieldElement.decode(reader, reader.uint32());
6275
+ continue;
6276
+ case 4:
6277
+ if (tag !== 34) {
6278
+ break;
6279
+ }
6280
+
6281
+ message.traceRoot = { $case: "invoke", invoke: InvokeTransactionTrace.decode(reader, reader.uint32()) };
6282
+ continue;
6283
+ case 5:
6284
+ if (tag !== 42) {
6285
+ break;
6286
+ }
6287
+
6288
+ message.traceRoot = { $case: "declare", declare: DeclareTransactionTrace.decode(reader, reader.uint32()) };
6289
+ continue;
6290
+ case 6:
6291
+ if (tag !== 50) {
6292
+ break;
6293
+ }
6294
+
6295
+ message.traceRoot = {
6296
+ $case: "deployAccount",
6297
+ deployAccount: DeployAccountTransactionTrace.decode(reader, reader.uint32()),
6298
+ };
6299
+ continue;
6300
+ case 7:
6301
+ if (tag !== 58) {
6302
+ break;
6303
+ }
6304
+
6305
+ message.traceRoot = {
6306
+ $case: "l1Handler",
6307
+ l1Handler: L1HandlerTransactionTrace.decode(reader, reader.uint32()),
6308
+ };
6309
+ continue;
6310
+ }
6311
+ if ((tag & 7) === 4 || tag === 0) {
6312
+ break;
6313
+ }
6314
+ reader.skipType(tag & 7);
6315
+ }
6316
+ return message;
6317
+ },
6318
+
6319
+ fromJSON(object: any): TransactionTrace {
6320
+ return {
6321
+ filterIds: globalThis.Array.isArray(object?.filterIds)
6322
+ ? object.filterIds.map((e: any) => globalThis.Number(e))
6323
+ : [],
6324
+ transactionIndex: isSet(object.transactionIndex) ? globalThis.Number(object.transactionIndex) : 0,
6325
+ transactionHash: isSet(object.transactionHash) ? FieldElement.fromJSON(object.transactionHash) : undefined,
6326
+ traceRoot: isSet(object.invoke)
6327
+ ? { $case: "invoke", invoke: InvokeTransactionTrace.fromJSON(object.invoke) }
6328
+ : isSet(object.declare)
6329
+ ? { $case: "declare", declare: DeclareTransactionTrace.fromJSON(object.declare) }
6330
+ : isSet(object.deployAccount)
6331
+ ? { $case: "deployAccount", deployAccount: DeployAccountTransactionTrace.fromJSON(object.deployAccount) }
6332
+ : isSet(object.l1Handler)
6333
+ ? { $case: "l1Handler", l1Handler: L1HandlerTransactionTrace.fromJSON(object.l1Handler) }
6334
+ : undefined,
6335
+ };
6336
+ },
6337
+
6338
+ toJSON(message: TransactionTrace): unknown {
6339
+ const obj: any = {};
6340
+ if (message.filterIds?.length) {
6341
+ obj.filterIds = message.filterIds.map((e) => Math.round(e));
6342
+ }
6343
+ if (message.transactionIndex !== undefined && message.transactionIndex !== 0) {
6344
+ obj.transactionIndex = Math.round(message.transactionIndex);
6345
+ }
6346
+ if (message.transactionHash !== undefined) {
6347
+ obj.transactionHash = FieldElement.toJSON(message.transactionHash);
6348
+ }
6349
+ if (message.traceRoot?.$case === "invoke") {
6350
+ obj.invoke = InvokeTransactionTrace.toJSON(message.traceRoot.invoke);
6351
+ }
6352
+ if (message.traceRoot?.$case === "declare") {
6353
+ obj.declare = DeclareTransactionTrace.toJSON(message.traceRoot.declare);
6354
+ }
6355
+ if (message.traceRoot?.$case === "deployAccount") {
6356
+ obj.deployAccount = DeployAccountTransactionTrace.toJSON(message.traceRoot.deployAccount);
6357
+ }
6358
+ if (message.traceRoot?.$case === "l1Handler") {
6359
+ obj.l1Handler = L1HandlerTransactionTrace.toJSON(message.traceRoot.l1Handler);
6360
+ }
6361
+ return obj;
6362
+ },
6363
+
6364
+ create(base?: DeepPartial<TransactionTrace>): TransactionTrace {
6365
+ return TransactionTrace.fromPartial(base ?? {});
6366
+ },
6367
+ fromPartial(object: DeepPartial<TransactionTrace>): TransactionTrace {
6368
+ const message = createBaseTransactionTrace() as any;
6369
+ message.filterIds = object.filterIds?.map((e) => e) || [];
6370
+ message.transactionIndex = object.transactionIndex ?? 0;
6371
+ message.transactionHash = (object.transactionHash !== undefined && object.transactionHash !== null)
6372
+ ? FieldElement.fromPartial(object.transactionHash)
6373
+ : undefined;
6374
+ if (
6375
+ object.traceRoot?.$case === "invoke" &&
6376
+ object.traceRoot?.invoke !== undefined &&
6377
+ object.traceRoot?.invoke !== null
6378
+ ) {
6379
+ message.traceRoot = { $case: "invoke", invoke: InvokeTransactionTrace.fromPartial(object.traceRoot.invoke) };
6380
+ }
6381
+ if (
6382
+ object.traceRoot?.$case === "declare" &&
6383
+ object.traceRoot?.declare !== undefined &&
6384
+ object.traceRoot?.declare !== null
6385
+ ) {
6386
+ message.traceRoot = { $case: "declare", declare: DeclareTransactionTrace.fromPartial(object.traceRoot.declare) };
6387
+ }
6388
+ if (
6389
+ object.traceRoot?.$case === "deployAccount" &&
6390
+ object.traceRoot?.deployAccount !== undefined &&
6391
+ object.traceRoot?.deployAccount !== null
6392
+ ) {
6393
+ message.traceRoot = {
6394
+ $case: "deployAccount",
6395
+ deployAccount: DeployAccountTransactionTrace.fromPartial(object.traceRoot.deployAccount),
6396
+ };
6397
+ }
6398
+ if (
6399
+ object.traceRoot?.$case === "l1Handler" &&
6400
+ object.traceRoot?.l1Handler !== undefined &&
6401
+ object.traceRoot?.l1Handler !== null
6402
+ ) {
6403
+ message.traceRoot = {
6404
+ $case: "l1Handler",
6405
+ l1Handler: L1HandlerTransactionTrace.fromPartial(object.traceRoot.l1Handler),
6406
+ };
6407
+ }
6408
+ return message;
6409
+ },
6410
+ };
6411
+
6412
+ function createBaseInvokeTransactionTrace(): InvokeTransactionTrace {
6413
+ return { validateInvocation: undefined, executeInvocation: undefined, feeTransferInvocation: undefined };
6414
+ }
6415
+
6416
+ export const InvokeTransactionTrace = {
6417
+ encode(message: InvokeTransactionTrace, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
6418
+ if (message.validateInvocation !== undefined) {
6419
+ FunctionInvocation.encode(message.validateInvocation, writer.uint32(10).fork()).ldelim();
6420
+ }
6421
+ switch (message.executeInvocation?.$case) {
6422
+ case "success":
6423
+ FunctionInvocation.encode(message.executeInvocation.success, writer.uint32(18).fork()).ldelim();
6424
+ break;
6425
+ case "reverted":
6426
+ ExecutionReverted.encode(message.executeInvocation.reverted, writer.uint32(26).fork()).ldelim();
6427
+ break;
6428
+ }
6429
+ if (message.feeTransferInvocation !== undefined) {
6430
+ FunctionInvocation.encode(message.feeTransferInvocation, writer.uint32(34).fork()).ldelim();
6431
+ }
6432
+ return writer;
6433
+ },
6434
+
6435
+ decode(input: _m0.Reader | Uint8Array, length?: number): InvokeTransactionTrace {
6436
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
6437
+ let end = length === undefined ? reader.len : reader.pos + length;
6438
+ const message = createBaseInvokeTransactionTrace() as any;
6439
+ while (reader.pos < end) {
6440
+ const tag = reader.uint32();
6441
+ switch (tag >>> 3) {
6442
+ case 1:
6443
+ if (tag !== 10) {
6444
+ break;
6445
+ }
6446
+
6447
+ message.validateInvocation = FunctionInvocation.decode(reader, reader.uint32());
6448
+ continue;
6449
+ case 2:
6450
+ if (tag !== 18) {
6451
+ break;
6452
+ }
6453
+
6454
+ message.executeInvocation = { $case: "success", success: FunctionInvocation.decode(reader, reader.uint32()) };
6455
+ continue;
6456
+ case 3:
6457
+ if (tag !== 26) {
6458
+ break;
6459
+ }
6460
+
6461
+ message.executeInvocation = {
6462
+ $case: "reverted",
6463
+ reverted: ExecutionReverted.decode(reader, reader.uint32()),
6464
+ };
6465
+ continue;
6466
+ case 4:
6467
+ if (tag !== 34) {
6468
+ break;
6469
+ }
6470
+
6471
+ message.feeTransferInvocation = FunctionInvocation.decode(reader, reader.uint32());
6472
+ continue;
6473
+ }
6474
+ if ((tag & 7) === 4 || tag === 0) {
6475
+ break;
6476
+ }
6477
+ reader.skipType(tag & 7);
6478
+ }
6479
+ return message;
6480
+ },
6481
+
6482
+ fromJSON(object: any): InvokeTransactionTrace {
6483
+ return {
6484
+ validateInvocation: isSet(object.validateInvocation)
6485
+ ? FunctionInvocation.fromJSON(object.validateInvocation)
6486
+ : undefined,
6487
+ executeInvocation: isSet(object.success)
6488
+ ? { $case: "success", success: FunctionInvocation.fromJSON(object.success) }
6489
+ : isSet(object.reverted)
6490
+ ? { $case: "reverted", reverted: ExecutionReverted.fromJSON(object.reverted) }
6491
+ : undefined,
6492
+ feeTransferInvocation: isSet(object.feeTransferInvocation)
6493
+ ? FunctionInvocation.fromJSON(object.feeTransferInvocation)
6494
+ : undefined,
6495
+ };
6496
+ },
6497
+
6498
+ toJSON(message: InvokeTransactionTrace): unknown {
6499
+ const obj: any = {};
6500
+ if (message.validateInvocation !== undefined) {
6501
+ obj.validateInvocation = FunctionInvocation.toJSON(message.validateInvocation);
6502
+ }
6503
+ if (message.executeInvocation?.$case === "success") {
6504
+ obj.success = FunctionInvocation.toJSON(message.executeInvocation.success);
6505
+ }
6506
+ if (message.executeInvocation?.$case === "reverted") {
6507
+ obj.reverted = ExecutionReverted.toJSON(message.executeInvocation.reverted);
6508
+ }
6509
+ if (message.feeTransferInvocation !== undefined) {
6510
+ obj.feeTransferInvocation = FunctionInvocation.toJSON(message.feeTransferInvocation);
6511
+ }
6512
+ return obj;
6513
+ },
6514
+
6515
+ create(base?: DeepPartial<InvokeTransactionTrace>): InvokeTransactionTrace {
6516
+ return InvokeTransactionTrace.fromPartial(base ?? {});
6517
+ },
6518
+ fromPartial(object: DeepPartial<InvokeTransactionTrace>): InvokeTransactionTrace {
6519
+ const message = createBaseInvokeTransactionTrace() as any;
6520
+ message.validateInvocation = (object.validateInvocation !== undefined && object.validateInvocation !== null)
6521
+ ? FunctionInvocation.fromPartial(object.validateInvocation)
6522
+ : undefined;
6523
+ if (
6524
+ object.executeInvocation?.$case === "success" &&
6525
+ object.executeInvocation?.success !== undefined &&
6526
+ object.executeInvocation?.success !== null
6527
+ ) {
6528
+ message.executeInvocation = {
6529
+ $case: "success",
6530
+ success: FunctionInvocation.fromPartial(object.executeInvocation.success),
6531
+ };
6532
+ }
6533
+ if (
6534
+ object.executeInvocation?.$case === "reverted" &&
6535
+ object.executeInvocation?.reverted !== undefined &&
6536
+ object.executeInvocation?.reverted !== null
6537
+ ) {
6538
+ message.executeInvocation = {
6539
+ $case: "reverted",
6540
+ reverted: ExecutionReverted.fromPartial(object.executeInvocation.reverted),
6541
+ };
6542
+ }
6543
+ message.feeTransferInvocation =
6544
+ (object.feeTransferInvocation !== undefined && object.feeTransferInvocation !== null)
6545
+ ? FunctionInvocation.fromPartial(object.feeTransferInvocation)
6546
+ : undefined;
6547
+ return message;
6548
+ },
6549
+ };
6550
+
6551
+ function createBaseDeclareTransactionTrace(): DeclareTransactionTrace {
6552
+ return { validateInvocation: undefined, feeTransferInvocation: undefined };
6553
+ }
6554
+
6555
+ export const DeclareTransactionTrace = {
6556
+ encode(message: DeclareTransactionTrace, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
6557
+ if (message.validateInvocation !== undefined) {
6558
+ FunctionInvocation.encode(message.validateInvocation, writer.uint32(10).fork()).ldelim();
6559
+ }
6560
+ if (message.feeTransferInvocation !== undefined) {
6561
+ FunctionInvocation.encode(message.feeTransferInvocation, writer.uint32(18).fork()).ldelim();
6562
+ }
6563
+ return writer;
6564
+ },
6565
+
6566
+ decode(input: _m0.Reader | Uint8Array, length?: number): DeclareTransactionTrace {
6567
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
6568
+ let end = length === undefined ? reader.len : reader.pos + length;
6569
+ const message = createBaseDeclareTransactionTrace() as any;
6570
+ while (reader.pos < end) {
6571
+ const tag = reader.uint32();
6572
+ switch (tag >>> 3) {
6573
+ case 1:
6574
+ if (tag !== 10) {
6575
+ break;
6576
+ }
6577
+
6578
+ message.validateInvocation = FunctionInvocation.decode(reader, reader.uint32());
6579
+ continue;
6580
+ case 2:
6581
+ if (tag !== 18) {
6582
+ break;
6583
+ }
6584
+
6585
+ message.feeTransferInvocation = FunctionInvocation.decode(reader, reader.uint32());
6586
+ continue;
6587
+ }
6588
+ if ((tag & 7) === 4 || tag === 0) {
6589
+ break;
6590
+ }
6591
+ reader.skipType(tag & 7);
6592
+ }
6593
+ return message;
6594
+ },
6595
+
6596
+ fromJSON(object: any): DeclareTransactionTrace {
6597
+ return {
6598
+ validateInvocation: isSet(object.validateInvocation)
6599
+ ? FunctionInvocation.fromJSON(object.validateInvocation)
6600
+ : undefined,
6601
+ feeTransferInvocation: isSet(object.feeTransferInvocation)
6602
+ ? FunctionInvocation.fromJSON(object.feeTransferInvocation)
6603
+ : undefined,
6604
+ };
6605
+ },
6606
+
6607
+ toJSON(message: DeclareTransactionTrace): unknown {
6608
+ const obj: any = {};
6609
+ if (message.validateInvocation !== undefined) {
6610
+ obj.validateInvocation = FunctionInvocation.toJSON(message.validateInvocation);
6611
+ }
6612
+ if (message.feeTransferInvocation !== undefined) {
6613
+ obj.feeTransferInvocation = FunctionInvocation.toJSON(message.feeTransferInvocation);
6614
+ }
6615
+ return obj;
6616
+ },
6617
+
6618
+ create(base?: DeepPartial<DeclareTransactionTrace>): DeclareTransactionTrace {
6619
+ return DeclareTransactionTrace.fromPartial(base ?? {});
6620
+ },
6621
+ fromPartial(object: DeepPartial<DeclareTransactionTrace>): DeclareTransactionTrace {
6622
+ const message = createBaseDeclareTransactionTrace() as any;
6623
+ message.validateInvocation = (object.validateInvocation !== undefined && object.validateInvocation !== null)
6624
+ ? FunctionInvocation.fromPartial(object.validateInvocation)
6625
+ : undefined;
6626
+ message.feeTransferInvocation =
6627
+ (object.feeTransferInvocation !== undefined && object.feeTransferInvocation !== null)
6628
+ ? FunctionInvocation.fromPartial(object.feeTransferInvocation)
6629
+ : undefined;
6630
+ return message;
6631
+ },
6632
+ };
6633
+
6634
+ function createBaseDeployAccountTransactionTrace(): DeployAccountTransactionTrace {
6635
+ return { validateInvocation: undefined, constructorInvocation: undefined, feeTransferInvocation: undefined };
6636
+ }
6637
+
6638
+ export const DeployAccountTransactionTrace = {
6639
+ encode(message: DeployAccountTransactionTrace, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
6640
+ if (message.validateInvocation !== undefined) {
6641
+ FunctionInvocation.encode(message.validateInvocation, writer.uint32(10).fork()).ldelim();
6642
+ }
6643
+ if (message.constructorInvocation !== undefined) {
6644
+ FunctionInvocation.encode(message.constructorInvocation, writer.uint32(18).fork()).ldelim();
6645
+ }
6646
+ if (message.feeTransferInvocation !== undefined) {
6647
+ FunctionInvocation.encode(message.feeTransferInvocation, writer.uint32(26).fork()).ldelim();
6648
+ }
6649
+ return writer;
6650
+ },
6651
+
6652
+ decode(input: _m0.Reader | Uint8Array, length?: number): DeployAccountTransactionTrace {
6653
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
6654
+ let end = length === undefined ? reader.len : reader.pos + length;
6655
+ const message = createBaseDeployAccountTransactionTrace() as any;
6656
+ while (reader.pos < end) {
6657
+ const tag = reader.uint32();
6658
+ switch (tag >>> 3) {
6659
+ case 1:
6660
+ if (tag !== 10) {
6661
+ break;
6662
+ }
6663
+
6664
+ message.validateInvocation = FunctionInvocation.decode(reader, reader.uint32());
6665
+ continue;
6666
+ case 2:
6667
+ if (tag !== 18) {
6668
+ break;
6669
+ }
6670
+
6671
+ message.constructorInvocation = FunctionInvocation.decode(reader, reader.uint32());
6672
+ continue;
6673
+ case 3:
6674
+ if (tag !== 26) {
6675
+ break;
6676
+ }
6677
+
6678
+ message.feeTransferInvocation = FunctionInvocation.decode(reader, reader.uint32());
6679
+ continue;
6680
+ }
6681
+ if ((tag & 7) === 4 || tag === 0) {
6682
+ break;
6683
+ }
6684
+ reader.skipType(tag & 7);
6685
+ }
6686
+ return message;
6687
+ },
6688
+
6689
+ fromJSON(object: any): DeployAccountTransactionTrace {
6690
+ return {
6691
+ validateInvocation: isSet(object.validateInvocation)
6692
+ ? FunctionInvocation.fromJSON(object.validateInvocation)
6693
+ : undefined,
6694
+ constructorInvocation: isSet(object.constructorInvocation)
6695
+ ? FunctionInvocation.fromJSON(object.constructorInvocation)
6696
+ : undefined,
6697
+ feeTransferInvocation: isSet(object.feeTransferInvocation)
6698
+ ? FunctionInvocation.fromJSON(object.feeTransferInvocation)
6699
+ : undefined,
6700
+ };
6701
+ },
6702
+
6703
+ toJSON(message: DeployAccountTransactionTrace): unknown {
6704
+ const obj: any = {};
6705
+ if (message.validateInvocation !== undefined) {
6706
+ obj.validateInvocation = FunctionInvocation.toJSON(message.validateInvocation);
6707
+ }
6708
+ if (message.constructorInvocation !== undefined) {
6709
+ obj.constructorInvocation = FunctionInvocation.toJSON(message.constructorInvocation);
6710
+ }
6711
+ if (message.feeTransferInvocation !== undefined) {
6712
+ obj.feeTransferInvocation = FunctionInvocation.toJSON(message.feeTransferInvocation);
6713
+ }
6714
+ return obj;
6715
+ },
6716
+
6717
+ create(base?: DeepPartial<DeployAccountTransactionTrace>): DeployAccountTransactionTrace {
6718
+ return DeployAccountTransactionTrace.fromPartial(base ?? {});
6719
+ },
6720
+ fromPartial(object: DeepPartial<DeployAccountTransactionTrace>): DeployAccountTransactionTrace {
6721
+ const message = createBaseDeployAccountTransactionTrace() as any;
6722
+ message.validateInvocation = (object.validateInvocation !== undefined && object.validateInvocation !== null)
6723
+ ? FunctionInvocation.fromPartial(object.validateInvocation)
6724
+ : undefined;
6725
+ message.constructorInvocation =
6726
+ (object.constructorInvocation !== undefined && object.constructorInvocation !== null)
6727
+ ? FunctionInvocation.fromPartial(object.constructorInvocation)
6728
+ : undefined;
6729
+ message.feeTransferInvocation =
6730
+ (object.feeTransferInvocation !== undefined && object.feeTransferInvocation !== null)
6731
+ ? FunctionInvocation.fromPartial(object.feeTransferInvocation)
6732
+ : undefined;
6733
+ return message;
6734
+ },
6735
+ };
6736
+
6737
+ function createBaseL1HandlerTransactionTrace(): L1HandlerTransactionTrace {
6738
+ return { functionInvocation: undefined };
6739
+ }
6740
+
6741
+ export const L1HandlerTransactionTrace = {
6742
+ encode(message: L1HandlerTransactionTrace, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
6743
+ if (message.functionInvocation !== undefined) {
6744
+ FunctionInvocation.encode(message.functionInvocation, writer.uint32(18).fork()).ldelim();
6745
+ }
6746
+ return writer;
6747
+ },
6748
+
6749
+ decode(input: _m0.Reader | Uint8Array, length?: number): L1HandlerTransactionTrace {
6750
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
6751
+ let end = length === undefined ? reader.len : reader.pos + length;
6752
+ const message = createBaseL1HandlerTransactionTrace() as any;
6753
+ while (reader.pos < end) {
6754
+ const tag = reader.uint32();
6755
+ switch (tag >>> 3) {
6756
+ case 2:
6757
+ if (tag !== 18) {
6758
+ break;
6759
+ }
6760
+
6761
+ message.functionInvocation = FunctionInvocation.decode(reader, reader.uint32());
6762
+ continue;
6763
+ }
6764
+ if ((tag & 7) === 4 || tag === 0) {
6765
+ break;
6766
+ }
6767
+ reader.skipType(tag & 7);
6768
+ }
6769
+ return message;
6770
+ },
6771
+
6772
+ fromJSON(object: any): L1HandlerTransactionTrace {
6773
+ return {
6774
+ functionInvocation: isSet(object.functionInvocation)
6775
+ ? FunctionInvocation.fromJSON(object.functionInvocation)
6776
+ : undefined,
6777
+ };
6778
+ },
6779
+
6780
+ toJSON(message: L1HandlerTransactionTrace): unknown {
6781
+ const obj: any = {};
6782
+ if (message.functionInvocation !== undefined) {
6783
+ obj.functionInvocation = FunctionInvocation.toJSON(message.functionInvocation);
6784
+ }
6785
+ return obj;
6786
+ },
6787
+
6788
+ create(base?: DeepPartial<L1HandlerTransactionTrace>): L1HandlerTransactionTrace {
6789
+ return L1HandlerTransactionTrace.fromPartial(base ?? {});
6790
+ },
6791
+ fromPartial(object: DeepPartial<L1HandlerTransactionTrace>): L1HandlerTransactionTrace {
6792
+ const message = createBaseL1HandlerTransactionTrace() as any;
6793
+ message.functionInvocation = (object.functionInvocation !== undefined && object.functionInvocation !== null)
6794
+ ? FunctionInvocation.fromPartial(object.functionInvocation)
6795
+ : undefined;
6796
+ return message;
6797
+ },
6798
+ };
6799
+
6800
+ function createBaseFunctionInvocation(): FunctionInvocation {
6801
+ return {
6802
+ contractAddress: undefined,
6803
+ entryPointSelector: undefined,
6804
+ calldata: [],
6805
+ callerAddress: undefined,
6806
+ classHash: undefined,
6807
+ callType: 0,
6808
+ result: [],
6809
+ calls: [],
6810
+ events: [],
6811
+ messages: [],
6812
+ };
6813
+ }
6814
+
6815
+ export const FunctionInvocation = {
6816
+ encode(message: FunctionInvocation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
6817
+ if (message.contractAddress !== undefined) {
6818
+ FieldElement.encode(message.contractAddress, writer.uint32(10).fork()).ldelim();
6819
+ }
6820
+ if (message.entryPointSelector !== undefined) {
6821
+ FieldElement.encode(message.entryPointSelector, writer.uint32(18).fork()).ldelim();
6822
+ }
6823
+ if (message.calldata !== undefined && message.calldata.length !== 0) {
6824
+ for (const v of message.calldata) {
6825
+ FieldElement.encode(v!, writer.uint32(26).fork()).ldelim();
6826
+ }
6827
+ }
6828
+ if (message.callerAddress !== undefined) {
6829
+ FieldElement.encode(message.callerAddress, writer.uint32(34).fork()).ldelim();
6830
+ }
6831
+ if (message.classHash !== undefined) {
6832
+ FieldElement.encode(message.classHash, writer.uint32(42).fork()).ldelim();
6833
+ }
6834
+ if (message.callType !== undefined && message.callType !== 0) {
6835
+ writer.uint32(48).int32(message.callType);
6836
+ }
6837
+ if (message.result !== undefined && message.result.length !== 0) {
6838
+ for (const v of message.result) {
6839
+ FieldElement.encode(v!, writer.uint32(58).fork()).ldelim();
6840
+ }
6841
+ }
6842
+ if (message.calls !== undefined && message.calls.length !== 0) {
6843
+ for (const v of message.calls) {
6844
+ FunctionInvocation.encode(v!, writer.uint32(66).fork()).ldelim();
6845
+ }
6846
+ }
6847
+ if (message.events !== undefined && message.events.length !== 0) {
6848
+ writer.uint32(74).fork();
6849
+ for (const v of message.events) {
6850
+ writer.uint32(v);
6851
+ }
6852
+ writer.ldelim();
6853
+ }
6854
+ if (message.messages !== undefined && message.messages.length !== 0) {
6855
+ writer.uint32(82).fork();
6856
+ for (const v of message.messages) {
6857
+ writer.uint32(v);
6858
+ }
6859
+ writer.ldelim();
6860
+ }
6861
+ return writer;
6862
+ },
6863
+
6864
+ decode(input: _m0.Reader | Uint8Array, length?: number): FunctionInvocation {
6865
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
6866
+ let end = length === undefined ? reader.len : reader.pos + length;
6867
+ const message = createBaseFunctionInvocation() as any;
6868
+ while (reader.pos < end) {
6869
+ const tag = reader.uint32();
6870
+ switch (tag >>> 3) {
6871
+ case 1:
6872
+ if (tag !== 10) {
6873
+ break;
6874
+ }
6875
+
6876
+ message.contractAddress = FieldElement.decode(reader, reader.uint32());
6877
+ continue;
6878
+ case 2:
6879
+ if (tag !== 18) {
6880
+ break;
6881
+ }
6882
+
6883
+ message.entryPointSelector = FieldElement.decode(reader, reader.uint32());
6884
+ continue;
6885
+ case 3:
6886
+ if (tag !== 26) {
6887
+ break;
6888
+ }
6889
+
6890
+ message.calldata!.push(FieldElement.decode(reader, reader.uint32()));
6891
+ continue;
6892
+ case 4:
6893
+ if (tag !== 34) {
6894
+ break;
6895
+ }
6896
+
6897
+ message.callerAddress = FieldElement.decode(reader, reader.uint32());
6898
+ continue;
6899
+ case 5:
6900
+ if (tag !== 42) {
6901
+ break;
6902
+ }
6903
+
6904
+ message.classHash = FieldElement.decode(reader, reader.uint32());
6905
+ continue;
6906
+ case 6:
6907
+ if (tag !== 48) {
6908
+ break;
6909
+ }
6910
+
6911
+ message.callType = reader.int32() as any;
6912
+ continue;
6913
+ case 7:
6914
+ if (tag !== 58) {
6915
+ break;
6916
+ }
6917
+
6918
+ message.result!.push(FieldElement.decode(reader, reader.uint32()));
6919
+ continue;
6920
+ case 8:
6921
+ if (tag !== 66) {
6922
+ break;
6923
+ }
6924
+
6925
+ message.calls!.push(FunctionInvocation.decode(reader, reader.uint32()));
6926
+ continue;
6927
+ case 9:
6928
+ if (tag === 72) {
6929
+ message.events!.push(reader.uint32());
6930
+
6931
+ continue;
6932
+ }
6933
+
6934
+ if (tag === 74) {
6935
+ const end2 = reader.uint32() + reader.pos;
6936
+ while (reader.pos < end2) {
6937
+ message.events!.push(reader.uint32());
6938
+ }
6939
+
6940
+ continue;
6941
+ }
6942
+
6943
+ break;
6944
+ case 10:
6945
+ if (tag === 80) {
6946
+ message.messages!.push(reader.uint32());
6947
+
6948
+ continue;
6949
+ }
6950
+
6951
+ if (tag === 82) {
6952
+ const end2 = reader.uint32() + reader.pos;
6953
+ while (reader.pos < end2) {
6954
+ message.messages!.push(reader.uint32());
6955
+ }
6956
+
6957
+ continue;
6958
+ }
6959
+
6960
+ break;
6961
+ }
6962
+ if ((tag & 7) === 4 || tag === 0) {
6963
+ break;
6964
+ }
6965
+ reader.skipType(tag & 7);
6966
+ }
6967
+ return message;
6968
+ },
6969
+
6970
+ fromJSON(object: any): FunctionInvocation {
6971
+ return {
6972
+ contractAddress: isSet(object.contractAddress) ? FieldElement.fromJSON(object.contractAddress) : undefined,
6973
+ entryPointSelector: isSet(object.entryPointSelector)
6974
+ ? FieldElement.fromJSON(object.entryPointSelector)
6975
+ : undefined,
6976
+ calldata: globalThis.Array.isArray(object?.calldata)
6977
+ ? object.calldata.map((e: any) => FieldElement.fromJSON(e))
6978
+ : [],
6979
+ callerAddress: isSet(object.callerAddress) ? FieldElement.fromJSON(object.callerAddress) : undefined,
6980
+ classHash: isSet(object.classHash) ? FieldElement.fromJSON(object.classHash) : undefined,
6981
+ callType: isSet(object.callType) ? callTypeFromJSON(object.callType) : 0,
6982
+ result: globalThis.Array.isArray(object?.result) ? object.result.map((e: any) => FieldElement.fromJSON(e)) : [],
6983
+ calls: globalThis.Array.isArray(object?.calls)
6984
+ ? object.calls.map((e: any) => FunctionInvocation.fromJSON(e))
6985
+ : [],
6986
+ events: globalThis.Array.isArray(object?.events) ? object.events.map((e: any) => globalThis.Number(e)) : [],
6987
+ messages: globalThis.Array.isArray(object?.messages) ? object.messages.map((e: any) => globalThis.Number(e)) : [],
6988
+ };
6989
+ },
6990
+
6991
+ toJSON(message: FunctionInvocation): unknown {
6992
+ const obj: any = {};
6993
+ if (message.contractAddress !== undefined) {
6994
+ obj.contractAddress = FieldElement.toJSON(message.contractAddress);
6995
+ }
6996
+ if (message.entryPointSelector !== undefined) {
6997
+ obj.entryPointSelector = FieldElement.toJSON(message.entryPointSelector);
6998
+ }
6999
+ if (message.calldata?.length) {
7000
+ obj.calldata = message.calldata.map((e) => FieldElement.toJSON(e));
7001
+ }
7002
+ if (message.callerAddress !== undefined) {
7003
+ obj.callerAddress = FieldElement.toJSON(message.callerAddress);
7004
+ }
7005
+ if (message.classHash !== undefined) {
7006
+ obj.classHash = FieldElement.toJSON(message.classHash);
7007
+ }
7008
+ if (message.callType !== undefined && message.callType !== 0) {
7009
+ obj.callType = callTypeToJSON(message.callType);
7010
+ }
7011
+ if (message.result?.length) {
7012
+ obj.result = message.result.map((e) => FieldElement.toJSON(e));
7013
+ }
7014
+ if (message.calls?.length) {
7015
+ obj.calls = message.calls.map((e) => FunctionInvocation.toJSON(e));
7016
+ }
7017
+ if (message.events?.length) {
7018
+ obj.events = message.events.map((e) => Math.round(e));
7019
+ }
7020
+ if (message.messages?.length) {
7021
+ obj.messages = message.messages.map((e) => Math.round(e));
7022
+ }
7023
+ return obj;
7024
+ },
7025
+
7026
+ create(base?: DeepPartial<FunctionInvocation>): FunctionInvocation {
7027
+ return FunctionInvocation.fromPartial(base ?? {});
7028
+ },
7029
+ fromPartial(object: DeepPartial<FunctionInvocation>): FunctionInvocation {
7030
+ const message = createBaseFunctionInvocation() as any;
7031
+ message.contractAddress = (object.contractAddress !== undefined && object.contractAddress !== null)
7032
+ ? FieldElement.fromPartial(object.contractAddress)
7033
+ : undefined;
7034
+ message.entryPointSelector = (object.entryPointSelector !== undefined && object.entryPointSelector !== null)
7035
+ ? FieldElement.fromPartial(object.entryPointSelector)
7036
+ : undefined;
7037
+ message.calldata = object.calldata?.map((e) => FieldElement.fromPartial(e)) || [];
7038
+ message.callerAddress = (object.callerAddress !== undefined && object.callerAddress !== null)
7039
+ ? FieldElement.fromPartial(object.callerAddress)
7040
+ : undefined;
7041
+ message.classHash = (object.classHash !== undefined && object.classHash !== null)
7042
+ ? FieldElement.fromPartial(object.classHash)
7043
+ : undefined;
7044
+ message.callType = object.callType ?? 0;
7045
+ message.result = object.result?.map((e) => FieldElement.fromPartial(e)) || [];
7046
+ message.calls = object.calls?.map((e) => FunctionInvocation.fromPartial(e)) || [];
7047
+ message.events = object.events?.map((e) => e) || [];
7048
+ message.messages = object.messages?.map((e) => e) || [];
7049
+ return message;
7050
+ },
7051
+ };
7052
+
7053
+ function createBaseFunctionCall(): FunctionCall {
7054
+ return { contractAddress: undefined, entryPointSelector: undefined, calldata: [] };
7055
+ }
7056
+
7057
+ export const FunctionCall = {
7058
+ encode(message: FunctionCall, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
7059
+ if (message.contractAddress !== undefined) {
7060
+ FieldElement.encode(message.contractAddress, writer.uint32(10).fork()).ldelim();
7061
+ }
7062
+ if (message.entryPointSelector !== undefined) {
7063
+ FieldElement.encode(message.entryPointSelector, writer.uint32(18).fork()).ldelim();
7064
+ }
7065
+ if (message.calldata !== undefined && message.calldata.length !== 0) {
7066
+ for (const v of message.calldata) {
7067
+ FieldElement.encode(v!, writer.uint32(26).fork()).ldelim();
7068
+ }
7069
+ }
7070
+ return writer;
7071
+ },
7072
+
7073
+ decode(input: _m0.Reader | Uint8Array, length?: number): FunctionCall {
7074
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
7075
+ let end = length === undefined ? reader.len : reader.pos + length;
7076
+ const message = createBaseFunctionCall() as any;
7077
+ while (reader.pos < end) {
7078
+ const tag = reader.uint32();
7079
+ switch (tag >>> 3) {
7080
+ case 1:
7081
+ if (tag !== 10) {
7082
+ break;
7083
+ }
7084
+
7085
+ message.contractAddress = FieldElement.decode(reader, reader.uint32());
7086
+ continue;
7087
+ case 2:
7088
+ if (tag !== 18) {
7089
+ break;
7090
+ }
7091
+
7092
+ message.entryPointSelector = FieldElement.decode(reader, reader.uint32());
7093
+ continue;
7094
+ case 3:
7095
+ if (tag !== 26) {
7096
+ break;
7097
+ }
7098
+
7099
+ message.calldata!.push(FieldElement.decode(reader, reader.uint32()));
7100
+ continue;
7101
+ }
7102
+ if ((tag & 7) === 4 || tag === 0) {
7103
+ break;
7104
+ }
7105
+ reader.skipType(tag & 7);
7106
+ }
7107
+ return message;
7108
+ },
7109
+
7110
+ fromJSON(object: any): FunctionCall {
7111
+ return {
7112
+ contractAddress: isSet(object.contractAddress) ? FieldElement.fromJSON(object.contractAddress) : undefined,
7113
+ entryPointSelector: isSet(object.entryPointSelector)
7114
+ ? FieldElement.fromJSON(object.entryPointSelector)
7115
+ : undefined,
7116
+ calldata: globalThis.Array.isArray(object?.calldata)
7117
+ ? object.calldata.map((e: any) => FieldElement.fromJSON(e))
7118
+ : [],
7119
+ };
7120
+ },
7121
+
7122
+ toJSON(message: FunctionCall): unknown {
7123
+ const obj: any = {};
7124
+ if (message.contractAddress !== undefined) {
7125
+ obj.contractAddress = FieldElement.toJSON(message.contractAddress);
7126
+ }
7127
+ if (message.entryPointSelector !== undefined) {
7128
+ obj.entryPointSelector = FieldElement.toJSON(message.entryPointSelector);
7129
+ }
7130
+ if (message.calldata?.length) {
7131
+ obj.calldata = message.calldata.map((e) => FieldElement.toJSON(e));
7132
+ }
7133
+ return obj;
7134
+ },
7135
+
7136
+ create(base?: DeepPartial<FunctionCall>): FunctionCall {
7137
+ return FunctionCall.fromPartial(base ?? {});
7138
+ },
7139
+ fromPartial(object: DeepPartial<FunctionCall>): FunctionCall {
7140
+ const message = createBaseFunctionCall() as any;
7141
+ message.contractAddress = (object.contractAddress !== undefined && object.contractAddress !== null)
7142
+ ? FieldElement.fromPartial(object.contractAddress)
7143
+ : undefined;
7144
+ message.entryPointSelector = (object.entryPointSelector !== undefined && object.entryPointSelector !== null)
7145
+ ? FieldElement.fromPartial(object.entryPointSelector)
7146
+ : undefined;
7147
+ message.calldata = object.calldata?.map((e) => FieldElement.fromPartial(e)) || [];
7148
+ return message;
7149
+ },
7150
+ };
7151
+
6072
7152
  function bytesFromBase64(b64: string): Uint8Array {
6073
7153
  if ((globalThis as any).Buffer) {
6074
7154
  return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));