@apibara/evm 2.0.0-beta.3

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.
@@ -0,0 +1,2270 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v1.176.0
4
+ // protoc unknown
5
+ // source: data.proto
6
+
7
+ /* eslint-disable */
8
+ import Long from "long";
9
+ import _m0 from "protobufjs/minimal";
10
+ import { Address, B256, Bloom, U128, U256 } from "./common";
11
+ import { Timestamp } from "./google/protobuf/timestamp";
12
+
13
+ export const protobufPackage = "evm.v2";
14
+
15
+ /** EVM DNA definitions (data). */
16
+
17
+ export enum TransactionStatus {
18
+ UNSPECIFIED = 0,
19
+ SUCCEEDED = 1,
20
+ REVERTED = 2,
21
+ UNRECOGNIZED = -1,
22
+ }
23
+
24
+ export function transactionStatusFromJSON(object: any): TransactionStatus {
25
+ switch (object) {
26
+ case 0:
27
+ case "TRANSACTION_STATUS_UNSPECIFIED":
28
+ return TransactionStatus.UNSPECIFIED;
29
+ case 1:
30
+ case "TRANSACTION_STATUS_SUCCEEDED":
31
+ return TransactionStatus.SUCCEEDED;
32
+ case 2:
33
+ case "TRANSACTION_STATUS_REVERTED":
34
+ return TransactionStatus.REVERTED;
35
+ case -1:
36
+ case "UNRECOGNIZED":
37
+ default:
38
+ return TransactionStatus.UNRECOGNIZED;
39
+ }
40
+ }
41
+
42
+ export function transactionStatusToJSON(object: TransactionStatus): string {
43
+ switch (object) {
44
+ case TransactionStatus.UNSPECIFIED:
45
+ return "TRANSACTION_STATUS_UNSPECIFIED";
46
+ case TransactionStatus.SUCCEEDED:
47
+ return "TRANSACTION_STATUS_SUCCEEDED";
48
+ case TransactionStatus.REVERTED:
49
+ return "TRANSACTION_STATUS_REVERTED";
50
+ case TransactionStatus.UNRECOGNIZED:
51
+ default:
52
+ return "UNRECOGNIZED";
53
+ }
54
+ }
55
+
56
+ /** Requested data, grouped by block. */
57
+ export interface Block {
58
+ /** The header. */
59
+ readonly header?:
60
+ | BlockHeader
61
+ | undefined;
62
+ /** List of withdrawals. */
63
+ readonly withdrawals?:
64
+ | readonly Withdrawal[]
65
+ | undefined;
66
+ /** List of transactions. */
67
+ readonly transactions?:
68
+ | readonly Transaction[]
69
+ | undefined;
70
+ /** List of receipts. */
71
+ readonly receipts?:
72
+ | readonly TransactionReceipt[]
73
+ | undefined;
74
+ /** List of logs. */
75
+ readonly logs?: readonly Log[] | undefined;
76
+ }
77
+
78
+ /** Block header. */
79
+ export interface BlockHeader {
80
+ /** Block number. */
81
+ readonly blockNumber?:
82
+ | bigint
83
+ | undefined;
84
+ /** Hash of the block. */
85
+ readonly blockHash?:
86
+ | B256
87
+ | undefined;
88
+ /** Hash of the parent block. */
89
+ readonly parentBlockHash?:
90
+ | B256
91
+ | undefined;
92
+ /** Hash of the uncles. */
93
+ readonly unclesHash?:
94
+ | B256
95
+ | undefined;
96
+ /** Author of the block. */
97
+ readonly miner?:
98
+ | Address
99
+ | undefined;
100
+ /** State root hash. */
101
+ readonly stateRoot?:
102
+ | B256
103
+ | undefined;
104
+ /** Transactions root hash. */
105
+ readonly transactionsRoot?:
106
+ | B256
107
+ | undefined;
108
+ /** Receipts root hash. */
109
+ readonly receiptsRoot?:
110
+ | B256
111
+ | undefined;
112
+ /** Logs bloom. */
113
+ readonly logsBloom?:
114
+ | Bloom
115
+ | undefined;
116
+ /** Difficulty. */
117
+ readonly difficulty?:
118
+ | U256
119
+ | undefined;
120
+ /** Gas limit. */
121
+ readonly gasLimit?:
122
+ | U128
123
+ | undefined;
124
+ /** Gas used. */
125
+ readonly gasUsed?:
126
+ | U128
127
+ | undefined;
128
+ /** Timestamp. */
129
+ readonly timestamp?:
130
+ | Date
131
+ | undefined;
132
+ /** Extra data. */
133
+ readonly extraData?:
134
+ | Uint8Array
135
+ | undefined;
136
+ /** Mix hash. */
137
+ readonly mixHash?:
138
+ | B256
139
+ | undefined;
140
+ /** Nonce. */
141
+ readonly nonce?:
142
+ | bigint
143
+ | undefined;
144
+ /** Base fee per unit of gas. */
145
+ readonly baseFeePerGas?:
146
+ | U128
147
+ | undefined;
148
+ /** Withdrawals root hash. */
149
+ readonly withdrawalsRoot?:
150
+ | B256
151
+ | undefined;
152
+ /** Total difficulty. */
153
+ readonly totalDifficulty?:
154
+ | U256
155
+ | undefined;
156
+ /** Blob gas used. */
157
+ readonly blobGasUsed?:
158
+ | U128
159
+ | undefined;
160
+ /** Excess blob gas. */
161
+ readonly excessBlobGas?:
162
+ | U128
163
+ | undefined;
164
+ /** Parent beacon block root. */
165
+ readonly parentBeaconBlockRoot?: B256 | undefined;
166
+ }
167
+
168
+ /** A validator's withdrawal from the consensus layer. */
169
+ export interface Withdrawal {
170
+ readonly filterIds?:
171
+ | readonly number[]
172
+ | undefined;
173
+ /** Withdrawal index in the block. */
174
+ readonly withdrawalIndex?:
175
+ | number
176
+ | undefined;
177
+ /** Increasing index of the withdrawal. */
178
+ readonly index?:
179
+ | bigint
180
+ | undefined;
181
+ /** Index of the validator. */
182
+ readonly validatorIndex?:
183
+ | number
184
+ | undefined;
185
+ /** Target address of the withdrawal. */
186
+ readonly address?:
187
+ | Address
188
+ | undefined;
189
+ /** Value of the withdrawal, in gwei. */
190
+ readonly amount?: bigint | undefined;
191
+ }
192
+
193
+ export interface Transaction {
194
+ readonly filterIds?:
195
+ | readonly number[]
196
+ | undefined;
197
+ /** Transaction index in the block. */
198
+ readonly transactionIndex?:
199
+ | number
200
+ | undefined;
201
+ /** Transaction hash. */
202
+ readonly transactionHash?:
203
+ | B256
204
+ | undefined;
205
+ /** Nonce. */
206
+ readonly nonce?:
207
+ | bigint
208
+ | undefined;
209
+ /** Sender. */
210
+ readonly from?:
211
+ | Address
212
+ | undefined;
213
+ /** Recipient. */
214
+ readonly to?:
215
+ | Address
216
+ | undefined;
217
+ /** Amount of wei transferred. */
218
+ readonly value?:
219
+ | U256
220
+ | undefined;
221
+ /** Gas price. */
222
+ readonly gasPrice?:
223
+ | U128
224
+ | undefined;
225
+ /** Gas amount. */
226
+ readonly gas?:
227
+ | U128
228
+ | undefined;
229
+ /** Max base fee per gas the sender is willing to pay. */
230
+ readonly maxFeePerGas?:
231
+ | U128
232
+ | undefined;
233
+ /** Miner's tip. */
234
+ readonly maxPriorityFeePerGas?:
235
+ | U128
236
+ | undefined;
237
+ /** Data. */
238
+ readonly input?:
239
+ | Uint8Array
240
+ | undefined;
241
+ /** The signature's r,s,v,yParity values. */
242
+ readonly signature?:
243
+ | Signature
244
+ | undefined;
245
+ /** Chain ID. */
246
+ readonly chainId?:
247
+ | bigint
248
+ | undefined;
249
+ /** EIP-2930 access list. */
250
+ readonly accessList?:
251
+ | readonly AccessListItem[]
252
+ | undefined;
253
+ /** EIP-2718 transaction type. */
254
+ readonly transactionType?:
255
+ | bigint
256
+ | undefined;
257
+ /** EIP-4844 max gas fee per blob. */
258
+ readonly maxFeePerBlobGas?:
259
+ | U128
260
+ | undefined;
261
+ /** EIP-4844 blob hashes. */
262
+ readonly blobVersionedHashes?:
263
+ | readonly B256[]
264
+ | undefined;
265
+ /** The transaction status. */
266
+ readonly transactionStatus?: TransactionStatus | undefined;
267
+ }
268
+
269
+ export interface TransactionReceipt {
270
+ readonly filterIds?:
271
+ | readonly number[]
272
+ | undefined;
273
+ /** Index of the transaction in the block. */
274
+ readonly transactionIndex?:
275
+ | number
276
+ | undefined;
277
+ /** Transaction hash. */
278
+ readonly transactionHash?:
279
+ | B256
280
+ | undefined;
281
+ /** Cumulative gas used in the block after this transaction has been executed. */
282
+ readonly cumulativeGasUsed?:
283
+ | U128
284
+ | undefined;
285
+ /** Gas used by this transaction. */
286
+ readonly gasUsed?:
287
+ | U128
288
+ | undefined;
289
+ /** The price paid by the transaction. */
290
+ readonly effectiveGasPrice?:
291
+ | U128
292
+ | undefined;
293
+ /** Sender. */
294
+ readonly from?:
295
+ | Address
296
+ | undefined;
297
+ /** Recipient, if any. */
298
+ readonly to?:
299
+ | Address
300
+ | undefined;
301
+ /** Contract address created, if any. */
302
+ readonly contractAddress?:
303
+ | Address
304
+ | undefined;
305
+ /** Logs bloom. */
306
+ readonly logsBloom?:
307
+ | Bloom
308
+ | undefined;
309
+ /** EIP-2718 transaction type. */
310
+ readonly transactionType?:
311
+ | bigint
312
+ | undefined;
313
+ /** EIP-4844 blob gas used. */
314
+ readonly blobGasUsed?:
315
+ | U128
316
+ | undefined;
317
+ /** EIP-4844 blob gas paid by the transaction. */
318
+ readonly blobGasPrice?:
319
+ | U128
320
+ | undefined;
321
+ /** The transaction status. */
322
+ readonly transactionStatus?: TransactionStatus | undefined;
323
+ }
324
+
325
+ export interface Log {
326
+ readonly filterIds?:
327
+ | readonly number[]
328
+ | undefined;
329
+ /** Index of the log in the block. */
330
+ readonly logIndex?:
331
+ | number
332
+ | undefined;
333
+ /** Address of the contract that emitted the log. */
334
+ readonly address?:
335
+ | Address
336
+ | undefined;
337
+ /** Log topics. */
338
+ readonly topics?:
339
+ | readonly B256[]
340
+ | undefined;
341
+ /** Additional data. */
342
+ readonly data?:
343
+ | Uint8Array
344
+ | undefined;
345
+ /** Index of the transaction that emitted the log. */
346
+ readonly transactionIndex?:
347
+ | number
348
+ | undefined;
349
+ /** Hash of the transaction that emitted the log. */
350
+ readonly transactionHash?:
351
+ | B256
352
+ | undefined;
353
+ /** The transaction status. */
354
+ readonly transactionStatus?: TransactionStatus | undefined;
355
+ }
356
+
357
+ export interface Signature {
358
+ /** The signature's r value. */
359
+ readonly r?:
360
+ | U256
361
+ | undefined;
362
+ /** The signature's s value. */
363
+ readonly s?:
364
+ | U256
365
+ | undefined;
366
+ /** The signature's v value. */
367
+ readonly v?:
368
+ | U256
369
+ | undefined;
370
+ /** The signature's parity byte. */
371
+ readonly yParity?: boolean | undefined;
372
+ }
373
+
374
+ export interface AccessListItem {
375
+ /** Account address to be loaded at the start of the transaction. */
376
+ readonly address?:
377
+ | Address
378
+ | undefined;
379
+ /** Storage keys to be loaded at the start of the transaction. */
380
+ readonly storageKeys?: readonly B256[] | undefined;
381
+ }
382
+
383
+ function createBaseBlock(): Block {
384
+ return { header: undefined, withdrawals: [], transactions: [], receipts: [], logs: [] };
385
+ }
386
+
387
+ export const Block = {
388
+ encode(message: Block, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
389
+ if (message.header !== undefined) {
390
+ BlockHeader.encode(message.header, writer.uint32(10).fork()).ldelim();
391
+ }
392
+ if (message.withdrawals !== undefined && message.withdrawals.length !== 0) {
393
+ for (const v of message.withdrawals) {
394
+ Withdrawal.encode(v!, writer.uint32(18).fork()).ldelim();
395
+ }
396
+ }
397
+ if (message.transactions !== undefined && message.transactions.length !== 0) {
398
+ for (const v of message.transactions) {
399
+ Transaction.encode(v!, writer.uint32(26).fork()).ldelim();
400
+ }
401
+ }
402
+ if (message.receipts !== undefined && message.receipts.length !== 0) {
403
+ for (const v of message.receipts) {
404
+ TransactionReceipt.encode(v!, writer.uint32(34).fork()).ldelim();
405
+ }
406
+ }
407
+ if (message.logs !== undefined && message.logs.length !== 0) {
408
+ for (const v of message.logs) {
409
+ Log.encode(v!, writer.uint32(42).fork()).ldelim();
410
+ }
411
+ }
412
+ return writer;
413
+ },
414
+
415
+ decode(input: _m0.Reader | Uint8Array, length?: number): Block {
416
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
417
+ let end = length === undefined ? reader.len : reader.pos + length;
418
+ const message = createBaseBlock() as any;
419
+ while (reader.pos < end) {
420
+ const tag = reader.uint32();
421
+ switch (tag >>> 3) {
422
+ case 1:
423
+ if (tag !== 10) {
424
+ break;
425
+ }
426
+
427
+ message.header = BlockHeader.decode(reader, reader.uint32());
428
+ continue;
429
+ case 2:
430
+ if (tag !== 18) {
431
+ break;
432
+ }
433
+
434
+ message.withdrawals!.push(Withdrawal.decode(reader, reader.uint32()));
435
+ continue;
436
+ case 3:
437
+ if (tag !== 26) {
438
+ break;
439
+ }
440
+
441
+ message.transactions!.push(Transaction.decode(reader, reader.uint32()));
442
+ continue;
443
+ case 4:
444
+ if (tag !== 34) {
445
+ break;
446
+ }
447
+
448
+ message.receipts!.push(TransactionReceipt.decode(reader, reader.uint32()));
449
+ continue;
450
+ case 5:
451
+ if (tag !== 42) {
452
+ break;
453
+ }
454
+
455
+ message.logs!.push(Log.decode(reader, reader.uint32()));
456
+ continue;
457
+ }
458
+ if ((tag & 7) === 4 || tag === 0) {
459
+ break;
460
+ }
461
+ reader.skipType(tag & 7);
462
+ }
463
+ return message;
464
+ },
465
+
466
+ fromJSON(object: any): Block {
467
+ return {
468
+ header: isSet(object.header) ? BlockHeader.fromJSON(object.header) : undefined,
469
+ withdrawals: globalThis.Array.isArray(object?.withdrawals)
470
+ ? object.withdrawals.map((e: any) => Withdrawal.fromJSON(e))
471
+ : [],
472
+ transactions: globalThis.Array.isArray(object?.transactions)
473
+ ? object.transactions.map((e: any) => Transaction.fromJSON(e))
474
+ : [],
475
+ receipts: globalThis.Array.isArray(object?.receipts)
476
+ ? object.receipts.map((e: any) => TransactionReceipt.fromJSON(e))
477
+ : [],
478
+ logs: globalThis.Array.isArray(object?.logs) ? object.logs.map((e: any) => Log.fromJSON(e)) : [],
479
+ };
480
+ },
481
+
482
+ toJSON(message: Block): unknown {
483
+ const obj: any = {};
484
+ if (message.header !== undefined) {
485
+ obj.header = BlockHeader.toJSON(message.header);
486
+ }
487
+ if (message.withdrawals?.length) {
488
+ obj.withdrawals = message.withdrawals.map((e) => Withdrawal.toJSON(e));
489
+ }
490
+ if (message.transactions?.length) {
491
+ obj.transactions = message.transactions.map((e) => Transaction.toJSON(e));
492
+ }
493
+ if (message.receipts?.length) {
494
+ obj.receipts = message.receipts.map((e) => TransactionReceipt.toJSON(e));
495
+ }
496
+ if (message.logs?.length) {
497
+ obj.logs = message.logs.map((e) => Log.toJSON(e));
498
+ }
499
+ return obj;
500
+ },
501
+
502
+ create(base?: DeepPartial<Block>): Block {
503
+ return Block.fromPartial(base ?? {});
504
+ },
505
+ fromPartial(object: DeepPartial<Block>): Block {
506
+ const message = createBaseBlock() as any;
507
+ message.header = (object.header !== undefined && object.header !== null)
508
+ ? BlockHeader.fromPartial(object.header)
509
+ : undefined;
510
+ message.withdrawals = object.withdrawals?.map((e) => Withdrawal.fromPartial(e)) || [];
511
+ message.transactions = object.transactions?.map((e) => Transaction.fromPartial(e)) || [];
512
+ message.receipts = object.receipts?.map((e) => TransactionReceipt.fromPartial(e)) || [];
513
+ message.logs = object.logs?.map((e) => Log.fromPartial(e)) || [];
514
+ return message;
515
+ },
516
+ };
517
+
518
+ function createBaseBlockHeader(): BlockHeader {
519
+ return {
520
+ blockNumber: BigInt("0"),
521
+ blockHash: undefined,
522
+ parentBlockHash: undefined,
523
+ unclesHash: undefined,
524
+ miner: undefined,
525
+ stateRoot: undefined,
526
+ transactionsRoot: undefined,
527
+ receiptsRoot: undefined,
528
+ logsBloom: undefined,
529
+ difficulty: undefined,
530
+ gasLimit: undefined,
531
+ gasUsed: undefined,
532
+ timestamp: undefined,
533
+ extraData: new Uint8Array(0),
534
+ mixHash: undefined,
535
+ nonce: undefined,
536
+ baseFeePerGas: undefined,
537
+ withdrawalsRoot: undefined,
538
+ totalDifficulty: undefined,
539
+ blobGasUsed: undefined,
540
+ excessBlobGas: undefined,
541
+ parentBeaconBlockRoot: undefined,
542
+ };
543
+ }
544
+
545
+ export const BlockHeader = {
546
+ encode(message: BlockHeader, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
547
+ if (message.blockNumber !== undefined && message.blockNumber !== BigInt("0")) {
548
+ if (BigInt.asUintN(64, message.blockNumber) !== message.blockNumber) {
549
+ throw new globalThis.Error("value provided for field message.blockNumber of type uint64 too large");
550
+ }
551
+ writer.uint32(8).uint64(message.blockNumber.toString());
552
+ }
553
+ if (message.blockHash !== undefined) {
554
+ B256.encode(message.blockHash, writer.uint32(18).fork()).ldelim();
555
+ }
556
+ if (message.parentBlockHash !== undefined) {
557
+ B256.encode(message.parentBlockHash, writer.uint32(26).fork()).ldelim();
558
+ }
559
+ if (message.unclesHash !== undefined) {
560
+ B256.encode(message.unclesHash, writer.uint32(34).fork()).ldelim();
561
+ }
562
+ if (message.miner !== undefined) {
563
+ Address.encode(message.miner, writer.uint32(42).fork()).ldelim();
564
+ }
565
+ if (message.stateRoot !== undefined) {
566
+ B256.encode(message.stateRoot, writer.uint32(50).fork()).ldelim();
567
+ }
568
+ if (message.transactionsRoot !== undefined) {
569
+ B256.encode(message.transactionsRoot, writer.uint32(58).fork()).ldelim();
570
+ }
571
+ if (message.receiptsRoot !== undefined) {
572
+ B256.encode(message.receiptsRoot, writer.uint32(66).fork()).ldelim();
573
+ }
574
+ if (message.logsBloom !== undefined) {
575
+ Bloom.encode(message.logsBloom, writer.uint32(74).fork()).ldelim();
576
+ }
577
+ if (message.difficulty !== undefined) {
578
+ U256.encode(message.difficulty, writer.uint32(82).fork()).ldelim();
579
+ }
580
+ if (message.gasLimit !== undefined) {
581
+ U128.encode(message.gasLimit, writer.uint32(90).fork()).ldelim();
582
+ }
583
+ if (message.gasUsed !== undefined) {
584
+ U128.encode(message.gasUsed, writer.uint32(98).fork()).ldelim();
585
+ }
586
+ if (message.timestamp !== undefined) {
587
+ Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(106).fork()).ldelim();
588
+ }
589
+ if (message.extraData !== undefined && message.extraData.length !== 0) {
590
+ writer.uint32(114).bytes(message.extraData);
591
+ }
592
+ if (message.mixHash !== undefined) {
593
+ B256.encode(message.mixHash, writer.uint32(122).fork()).ldelim();
594
+ }
595
+ if (message.nonce !== undefined) {
596
+ if (BigInt.asUintN(64, message.nonce) !== message.nonce) {
597
+ throw new globalThis.Error("value provided for field message.nonce of type uint64 too large");
598
+ }
599
+ writer.uint32(128).uint64(message.nonce.toString());
600
+ }
601
+ if (message.baseFeePerGas !== undefined) {
602
+ U128.encode(message.baseFeePerGas, writer.uint32(138).fork()).ldelim();
603
+ }
604
+ if (message.withdrawalsRoot !== undefined) {
605
+ B256.encode(message.withdrawalsRoot, writer.uint32(146).fork()).ldelim();
606
+ }
607
+ if (message.totalDifficulty !== undefined) {
608
+ U256.encode(message.totalDifficulty, writer.uint32(154).fork()).ldelim();
609
+ }
610
+ if (message.blobGasUsed !== undefined) {
611
+ U128.encode(message.blobGasUsed, writer.uint32(162).fork()).ldelim();
612
+ }
613
+ if (message.excessBlobGas !== undefined) {
614
+ U128.encode(message.excessBlobGas, writer.uint32(170).fork()).ldelim();
615
+ }
616
+ if (message.parentBeaconBlockRoot !== undefined) {
617
+ B256.encode(message.parentBeaconBlockRoot, writer.uint32(178).fork()).ldelim();
618
+ }
619
+ return writer;
620
+ },
621
+
622
+ decode(input: _m0.Reader | Uint8Array, length?: number): BlockHeader {
623
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
624
+ let end = length === undefined ? reader.len : reader.pos + length;
625
+ const message = createBaseBlockHeader() as any;
626
+ while (reader.pos < end) {
627
+ const tag = reader.uint32();
628
+ switch (tag >>> 3) {
629
+ case 1:
630
+ if (tag !== 8) {
631
+ break;
632
+ }
633
+
634
+ message.blockNumber = longToBigint(reader.uint64() as Long);
635
+ continue;
636
+ case 2:
637
+ if (tag !== 18) {
638
+ break;
639
+ }
640
+
641
+ message.blockHash = B256.decode(reader, reader.uint32());
642
+ continue;
643
+ case 3:
644
+ if (tag !== 26) {
645
+ break;
646
+ }
647
+
648
+ message.parentBlockHash = B256.decode(reader, reader.uint32());
649
+ continue;
650
+ case 4:
651
+ if (tag !== 34) {
652
+ break;
653
+ }
654
+
655
+ message.unclesHash = B256.decode(reader, reader.uint32());
656
+ continue;
657
+ case 5:
658
+ if (tag !== 42) {
659
+ break;
660
+ }
661
+
662
+ message.miner = Address.decode(reader, reader.uint32());
663
+ continue;
664
+ case 6:
665
+ if (tag !== 50) {
666
+ break;
667
+ }
668
+
669
+ message.stateRoot = B256.decode(reader, reader.uint32());
670
+ continue;
671
+ case 7:
672
+ if (tag !== 58) {
673
+ break;
674
+ }
675
+
676
+ message.transactionsRoot = B256.decode(reader, reader.uint32());
677
+ continue;
678
+ case 8:
679
+ if (tag !== 66) {
680
+ break;
681
+ }
682
+
683
+ message.receiptsRoot = B256.decode(reader, reader.uint32());
684
+ continue;
685
+ case 9:
686
+ if (tag !== 74) {
687
+ break;
688
+ }
689
+
690
+ message.logsBloom = Bloom.decode(reader, reader.uint32());
691
+ continue;
692
+ case 10:
693
+ if (tag !== 82) {
694
+ break;
695
+ }
696
+
697
+ message.difficulty = U256.decode(reader, reader.uint32());
698
+ continue;
699
+ case 11:
700
+ if (tag !== 90) {
701
+ break;
702
+ }
703
+
704
+ message.gasLimit = U128.decode(reader, reader.uint32());
705
+ continue;
706
+ case 12:
707
+ if (tag !== 98) {
708
+ break;
709
+ }
710
+
711
+ message.gasUsed = U128.decode(reader, reader.uint32());
712
+ continue;
713
+ case 13:
714
+ if (tag !== 106) {
715
+ break;
716
+ }
717
+
718
+ message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
719
+ continue;
720
+ case 14:
721
+ if (tag !== 114) {
722
+ break;
723
+ }
724
+
725
+ message.extraData = reader.bytes();
726
+ continue;
727
+ case 15:
728
+ if (tag !== 122) {
729
+ break;
730
+ }
731
+
732
+ message.mixHash = B256.decode(reader, reader.uint32());
733
+ continue;
734
+ case 16:
735
+ if (tag !== 128) {
736
+ break;
737
+ }
738
+
739
+ message.nonce = longToBigint(reader.uint64() as Long);
740
+ continue;
741
+ case 17:
742
+ if (tag !== 138) {
743
+ break;
744
+ }
745
+
746
+ message.baseFeePerGas = U128.decode(reader, reader.uint32());
747
+ continue;
748
+ case 18:
749
+ if (tag !== 146) {
750
+ break;
751
+ }
752
+
753
+ message.withdrawalsRoot = B256.decode(reader, reader.uint32());
754
+ continue;
755
+ case 19:
756
+ if (tag !== 154) {
757
+ break;
758
+ }
759
+
760
+ message.totalDifficulty = U256.decode(reader, reader.uint32());
761
+ continue;
762
+ case 20:
763
+ if (tag !== 162) {
764
+ break;
765
+ }
766
+
767
+ message.blobGasUsed = U128.decode(reader, reader.uint32());
768
+ continue;
769
+ case 21:
770
+ if (tag !== 170) {
771
+ break;
772
+ }
773
+
774
+ message.excessBlobGas = U128.decode(reader, reader.uint32());
775
+ continue;
776
+ case 22:
777
+ if (tag !== 178) {
778
+ break;
779
+ }
780
+
781
+ message.parentBeaconBlockRoot = B256.decode(reader, reader.uint32());
782
+ continue;
783
+ }
784
+ if ((tag & 7) === 4 || tag === 0) {
785
+ break;
786
+ }
787
+ reader.skipType(tag & 7);
788
+ }
789
+ return message;
790
+ },
791
+
792
+ fromJSON(object: any): BlockHeader {
793
+ return {
794
+ blockNumber: isSet(object.blockNumber) ? BigInt(object.blockNumber) : BigInt("0"),
795
+ blockHash: isSet(object.blockHash) ? B256.fromJSON(object.blockHash) : undefined,
796
+ parentBlockHash: isSet(object.parentBlockHash) ? B256.fromJSON(object.parentBlockHash) : undefined,
797
+ unclesHash: isSet(object.unclesHash) ? B256.fromJSON(object.unclesHash) : undefined,
798
+ miner: isSet(object.miner) ? Address.fromJSON(object.miner) : undefined,
799
+ stateRoot: isSet(object.stateRoot) ? B256.fromJSON(object.stateRoot) : undefined,
800
+ transactionsRoot: isSet(object.transactionsRoot) ? B256.fromJSON(object.transactionsRoot) : undefined,
801
+ receiptsRoot: isSet(object.receiptsRoot) ? B256.fromJSON(object.receiptsRoot) : undefined,
802
+ logsBloom: isSet(object.logsBloom) ? Bloom.fromJSON(object.logsBloom) : undefined,
803
+ difficulty: isSet(object.difficulty) ? U256.fromJSON(object.difficulty) : undefined,
804
+ gasLimit: isSet(object.gasLimit) ? U128.fromJSON(object.gasLimit) : undefined,
805
+ gasUsed: isSet(object.gasUsed) ? U128.fromJSON(object.gasUsed) : undefined,
806
+ timestamp: isSet(object.timestamp) ? fromJsonTimestamp(object.timestamp) : undefined,
807
+ extraData: isSet(object.extraData) ? bytesFromBase64(object.extraData) : new Uint8Array(0),
808
+ mixHash: isSet(object.mixHash) ? B256.fromJSON(object.mixHash) : undefined,
809
+ nonce: isSet(object.nonce) ? BigInt(object.nonce) : undefined,
810
+ baseFeePerGas: isSet(object.baseFeePerGas) ? U128.fromJSON(object.baseFeePerGas) : undefined,
811
+ withdrawalsRoot: isSet(object.withdrawalsRoot) ? B256.fromJSON(object.withdrawalsRoot) : undefined,
812
+ totalDifficulty: isSet(object.totalDifficulty) ? U256.fromJSON(object.totalDifficulty) : undefined,
813
+ blobGasUsed: isSet(object.blobGasUsed) ? U128.fromJSON(object.blobGasUsed) : undefined,
814
+ excessBlobGas: isSet(object.excessBlobGas) ? U128.fromJSON(object.excessBlobGas) : undefined,
815
+ parentBeaconBlockRoot: isSet(object.parentBeaconBlockRoot)
816
+ ? B256.fromJSON(object.parentBeaconBlockRoot)
817
+ : undefined,
818
+ };
819
+ },
820
+
821
+ toJSON(message: BlockHeader): unknown {
822
+ const obj: any = {};
823
+ if (message.blockNumber !== undefined && message.blockNumber !== BigInt("0")) {
824
+ obj.blockNumber = message.blockNumber.toString();
825
+ }
826
+ if (message.blockHash !== undefined) {
827
+ obj.blockHash = B256.toJSON(message.blockHash);
828
+ }
829
+ if (message.parentBlockHash !== undefined) {
830
+ obj.parentBlockHash = B256.toJSON(message.parentBlockHash);
831
+ }
832
+ if (message.unclesHash !== undefined) {
833
+ obj.unclesHash = B256.toJSON(message.unclesHash);
834
+ }
835
+ if (message.miner !== undefined) {
836
+ obj.miner = Address.toJSON(message.miner);
837
+ }
838
+ if (message.stateRoot !== undefined) {
839
+ obj.stateRoot = B256.toJSON(message.stateRoot);
840
+ }
841
+ if (message.transactionsRoot !== undefined) {
842
+ obj.transactionsRoot = B256.toJSON(message.transactionsRoot);
843
+ }
844
+ if (message.receiptsRoot !== undefined) {
845
+ obj.receiptsRoot = B256.toJSON(message.receiptsRoot);
846
+ }
847
+ if (message.logsBloom !== undefined) {
848
+ obj.logsBloom = Bloom.toJSON(message.logsBloom);
849
+ }
850
+ if (message.difficulty !== undefined) {
851
+ obj.difficulty = U256.toJSON(message.difficulty);
852
+ }
853
+ if (message.gasLimit !== undefined) {
854
+ obj.gasLimit = U128.toJSON(message.gasLimit);
855
+ }
856
+ if (message.gasUsed !== undefined) {
857
+ obj.gasUsed = U128.toJSON(message.gasUsed);
858
+ }
859
+ if (message.timestamp !== undefined) {
860
+ obj.timestamp = message.timestamp.toISOString();
861
+ }
862
+ if (message.extraData !== undefined && message.extraData.length !== 0) {
863
+ obj.extraData = base64FromBytes(message.extraData);
864
+ }
865
+ if (message.mixHash !== undefined) {
866
+ obj.mixHash = B256.toJSON(message.mixHash);
867
+ }
868
+ if (message.nonce !== undefined) {
869
+ obj.nonce = message.nonce.toString();
870
+ }
871
+ if (message.baseFeePerGas !== undefined) {
872
+ obj.baseFeePerGas = U128.toJSON(message.baseFeePerGas);
873
+ }
874
+ if (message.withdrawalsRoot !== undefined) {
875
+ obj.withdrawalsRoot = B256.toJSON(message.withdrawalsRoot);
876
+ }
877
+ if (message.totalDifficulty !== undefined) {
878
+ obj.totalDifficulty = U256.toJSON(message.totalDifficulty);
879
+ }
880
+ if (message.blobGasUsed !== undefined) {
881
+ obj.blobGasUsed = U128.toJSON(message.blobGasUsed);
882
+ }
883
+ if (message.excessBlobGas !== undefined) {
884
+ obj.excessBlobGas = U128.toJSON(message.excessBlobGas);
885
+ }
886
+ if (message.parentBeaconBlockRoot !== undefined) {
887
+ obj.parentBeaconBlockRoot = B256.toJSON(message.parentBeaconBlockRoot);
888
+ }
889
+ return obj;
890
+ },
891
+
892
+ create(base?: DeepPartial<BlockHeader>): BlockHeader {
893
+ return BlockHeader.fromPartial(base ?? {});
894
+ },
895
+ fromPartial(object: DeepPartial<BlockHeader>): BlockHeader {
896
+ const message = createBaseBlockHeader() as any;
897
+ message.blockNumber = object.blockNumber ?? BigInt("0");
898
+ message.blockHash = (object.blockHash !== undefined && object.blockHash !== null)
899
+ ? B256.fromPartial(object.blockHash)
900
+ : undefined;
901
+ message.parentBlockHash = (object.parentBlockHash !== undefined && object.parentBlockHash !== null)
902
+ ? B256.fromPartial(object.parentBlockHash)
903
+ : undefined;
904
+ message.unclesHash = (object.unclesHash !== undefined && object.unclesHash !== null)
905
+ ? B256.fromPartial(object.unclesHash)
906
+ : undefined;
907
+ message.miner = (object.miner !== undefined && object.miner !== null)
908
+ ? Address.fromPartial(object.miner)
909
+ : undefined;
910
+ message.stateRoot = (object.stateRoot !== undefined && object.stateRoot !== null)
911
+ ? B256.fromPartial(object.stateRoot)
912
+ : undefined;
913
+ message.transactionsRoot = (object.transactionsRoot !== undefined && object.transactionsRoot !== null)
914
+ ? B256.fromPartial(object.transactionsRoot)
915
+ : undefined;
916
+ message.receiptsRoot = (object.receiptsRoot !== undefined && object.receiptsRoot !== null)
917
+ ? B256.fromPartial(object.receiptsRoot)
918
+ : undefined;
919
+ message.logsBloom = (object.logsBloom !== undefined && object.logsBloom !== null)
920
+ ? Bloom.fromPartial(object.logsBloom)
921
+ : undefined;
922
+ message.difficulty = (object.difficulty !== undefined && object.difficulty !== null)
923
+ ? U256.fromPartial(object.difficulty)
924
+ : undefined;
925
+ message.gasLimit = (object.gasLimit !== undefined && object.gasLimit !== null)
926
+ ? U128.fromPartial(object.gasLimit)
927
+ : undefined;
928
+ message.gasUsed = (object.gasUsed !== undefined && object.gasUsed !== null)
929
+ ? U128.fromPartial(object.gasUsed)
930
+ : undefined;
931
+ message.timestamp = object.timestamp ?? undefined;
932
+ message.extraData = object.extraData ?? new Uint8Array(0);
933
+ message.mixHash = (object.mixHash !== undefined && object.mixHash !== null)
934
+ ? B256.fromPartial(object.mixHash)
935
+ : undefined;
936
+ message.nonce = object.nonce ?? undefined;
937
+ message.baseFeePerGas = (object.baseFeePerGas !== undefined && object.baseFeePerGas !== null)
938
+ ? U128.fromPartial(object.baseFeePerGas)
939
+ : undefined;
940
+ message.withdrawalsRoot = (object.withdrawalsRoot !== undefined && object.withdrawalsRoot !== null)
941
+ ? B256.fromPartial(object.withdrawalsRoot)
942
+ : undefined;
943
+ message.totalDifficulty = (object.totalDifficulty !== undefined && object.totalDifficulty !== null)
944
+ ? U256.fromPartial(object.totalDifficulty)
945
+ : undefined;
946
+ message.blobGasUsed = (object.blobGasUsed !== undefined && object.blobGasUsed !== null)
947
+ ? U128.fromPartial(object.blobGasUsed)
948
+ : undefined;
949
+ message.excessBlobGas = (object.excessBlobGas !== undefined && object.excessBlobGas !== null)
950
+ ? U128.fromPartial(object.excessBlobGas)
951
+ : undefined;
952
+ message.parentBeaconBlockRoot =
953
+ (object.parentBeaconBlockRoot !== undefined && object.parentBeaconBlockRoot !== null)
954
+ ? B256.fromPartial(object.parentBeaconBlockRoot)
955
+ : undefined;
956
+ return message;
957
+ },
958
+ };
959
+
960
+ function createBaseWithdrawal(): Withdrawal {
961
+ return {
962
+ filterIds: [],
963
+ withdrawalIndex: 0,
964
+ index: BigInt("0"),
965
+ validatorIndex: 0,
966
+ address: undefined,
967
+ amount: BigInt("0"),
968
+ };
969
+ }
970
+
971
+ export const Withdrawal = {
972
+ encode(message: Withdrawal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
973
+ if (message.filterIds !== undefined && message.filterIds.length !== 0) {
974
+ writer.uint32(10).fork();
975
+ for (const v of message.filterIds) {
976
+ writer.uint32(v);
977
+ }
978
+ writer.ldelim();
979
+ }
980
+ if (message.withdrawalIndex !== undefined && message.withdrawalIndex !== 0) {
981
+ writer.uint32(16).uint32(message.withdrawalIndex);
982
+ }
983
+ if (message.index !== undefined && message.index !== BigInt("0")) {
984
+ if (BigInt.asUintN(64, message.index) !== message.index) {
985
+ throw new globalThis.Error("value provided for field message.index of type uint64 too large");
986
+ }
987
+ writer.uint32(24).uint64(message.index.toString());
988
+ }
989
+ if (message.validatorIndex !== undefined && message.validatorIndex !== 0) {
990
+ writer.uint32(32).uint32(message.validatorIndex);
991
+ }
992
+ if (message.address !== undefined) {
993
+ Address.encode(message.address, writer.uint32(42).fork()).ldelim();
994
+ }
995
+ if (message.amount !== undefined && message.amount !== BigInt("0")) {
996
+ if (BigInt.asUintN(64, message.amount) !== message.amount) {
997
+ throw new globalThis.Error("value provided for field message.amount of type uint64 too large");
998
+ }
999
+ writer.uint32(48).uint64(message.amount.toString());
1000
+ }
1001
+ return writer;
1002
+ },
1003
+
1004
+ decode(input: _m0.Reader | Uint8Array, length?: number): Withdrawal {
1005
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1006
+ let end = length === undefined ? reader.len : reader.pos + length;
1007
+ const message = createBaseWithdrawal() as any;
1008
+ while (reader.pos < end) {
1009
+ const tag = reader.uint32();
1010
+ switch (tag >>> 3) {
1011
+ case 1:
1012
+ if (tag === 8) {
1013
+ message.filterIds!.push(reader.uint32());
1014
+
1015
+ continue;
1016
+ }
1017
+
1018
+ if (tag === 10) {
1019
+ const end2 = reader.uint32() + reader.pos;
1020
+ while (reader.pos < end2) {
1021
+ message.filterIds!.push(reader.uint32());
1022
+ }
1023
+
1024
+ continue;
1025
+ }
1026
+
1027
+ break;
1028
+ case 2:
1029
+ if (tag !== 16) {
1030
+ break;
1031
+ }
1032
+
1033
+ message.withdrawalIndex = reader.uint32();
1034
+ continue;
1035
+ case 3:
1036
+ if (tag !== 24) {
1037
+ break;
1038
+ }
1039
+
1040
+ message.index = longToBigint(reader.uint64() as Long);
1041
+ continue;
1042
+ case 4:
1043
+ if (tag !== 32) {
1044
+ break;
1045
+ }
1046
+
1047
+ message.validatorIndex = reader.uint32();
1048
+ continue;
1049
+ case 5:
1050
+ if (tag !== 42) {
1051
+ break;
1052
+ }
1053
+
1054
+ message.address = Address.decode(reader, reader.uint32());
1055
+ continue;
1056
+ case 6:
1057
+ if (tag !== 48) {
1058
+ break;
1059
+ }
1060
+
1061
+ message.amount = longToBigint(reader.uint64() as Long);
1062
+ continue;
1063
+ }
1064
+ if ((tag & 7) === 4 || tag === 0) {
1065
+ break;
1066
+ }
1067
+ reader.skipType(tag & 7);
1068
+ }
1069
+ return message;
1070
+ },
1071
+
1072
+ fromJSON(object: any): Withdrawal {
1073
+ return {
1074
+ filterIds: globalThis.Array.isArray(object?.filterIds)
1075
+ ? object.filterIds.map((e: any) => globalThis.Number(e))
1076
+ : [],
1077
+ withdrawalIndex: isSet(object.withdrawalIndex) ? globalThis.Number(object.withdrawalIndex) : 0,
1078
+ index: isSet(object.index) ? BigInt(object.index) : BigInt("0"),
1079
+ validatorIndex: isSet(object.validatorIndex) ? globalThis.Number(object.validatorIndex) : 0,
1080
+ address: isSet(object.address) ? Address.fromJSON(object.address) : undefined,
1081
+ amount: isSet(object.amount) ? BigInt(object.amount) : BigInt("0"),
1082
+ };
1083
+ },
1084
+
1085
+ toJSON(message: Withdrawal): unknown {
1086
+ const obj: any = {};
1087
+ if (message.filterIds?.length) {
1088
+ obj.filterIds = message.filterIds.map((e) => Math.round(e));
1089
+ }
1090
+ if (message.withdrawalIndex !== undefined && message.withdrawalIndex !== 0) {
1091
+ obj.withdrawalIndex = Math.round(message.withdrawalIndex);
1092
+ }
1093
+ if (message.index !== undefined && message.index !== BigInt("0")) {
1094
+ obj.index = message.index.toString();
1095
+ }
1096
+ if (message.validatorIndex !== undefined && message.validatorIndex !== 0) {
1097
+ obj.validatorIndex = Math.round(message.validatorIndex);
1098
+ }
1099
+ if (message.address !== undefined) {
1100
+ obj.address = Address.toJSON(message.address);
1101
+ }
1102
+ if (message.amount !== undefined && message.amount !== BigInt("0")) {
1103
+ obj.amount = message.amount.toString();
1104
+ }
1105
+ return obj;
1106
+ },
1107
+
1108
+ create(base?: DeepPartial<Withdrawal>): Withdrawal {
1109
+ return Withdrawal.fromPartial(base ?? {});
1110
+ },
1111
+ fromPartial(object: DeepPartial<Withdrawal>): Withdrawal {
1112
+ const message = createBaseWithdrawal() as any;
1113
+ message.filterIds = object.filterIds?.map((e) => e) || [];
1114
+ message.withdrawalIndex = object.withdrawalIndex ?? 0;
1115
+ message.index = object.index ?? BigInt("0");
1116
+ message.validatorIndex = object.validatorIndex ?? 0;
1117
+ message.address = (object.address !== undefined && object.address !== null)
1118
+ ? Address.fromPartial(object.address)
1119
+ : undefined;
1120
+ message.amount = object.amount ?? BigInt("0");
1121
+ return message;
1122
+ },
1123
+ };
1124
+
1125
+ function createBaseTransaction(): Transaction {
1126
+ return {
1127
+ filterIds: [],
1128
+ transactionIndex: 0,
1129
+ transactionHash: undefined,
1130
+ nonce: BigInt("0"),
1131
+ from: undefined,
1132
+ to: undefined,
1133
+ value: undefined,
1134
+ gasPrice: undefined,
1135
+ gas: undefined,
1136
+ maxFeePerGas: undefined,
1137
+ maxPriorityFeePerGas: undefined,
1138
+ input: new Uint8Array(0),
1139
+ signature: undefined,
1140
+ chainId: undefined,
1141
+ accessList: [],
1142
+ transactionType: BigInt("0"),
1143
+ maxFeePerBlobGas: undefined,
1144
+ blobVersionedHashes: [],
1145
+ transactionStatus: 0,
1146
+ };
1147
+ }
1148
+
1149
+ export const Transaction = {
1150
+ encode(message: Transaction, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1151
+ if (message.filterIds !== undefined && message.filterIds.length !== 0) {
1152
+ writer.uint32(10).fork();
1153
+ for (const v of message.filterIds) {
1154
+ writer.uint32(v);
1155
+ }
1156
+ writer.ldelim();
1157
+ }
1158
+ if (message.transactionIndex !== undefined && message.transactionIndex !== 0) {
1159
+ writer.uint32(16).uint32(message.transactionIndex);
1160
+ }
1161
+ if (message.transactionHash !== undefined) {
1162
+ B256.encode(message.transactionHash, writer.uint32(26).fork()).ldelim();
1163
+ }
1164
+ if (message.nonce !== undefined && message.nonce !== BigInt("0")) {
1165
+ if (BigInt.asUintN(64, message.nonce) !== message.nonce) {
1166
+ throw new globalThis.Error("value provided for field message.nonce of type uint64 too large");
1167
+ }
1168
+ writer.uint32(32).uint64(message.nonce.toString());
1169
+ }
1170
+ if (message.from !== undefined) {
1171
+ Address.encode(message.from, writer.uint32(42).fork()).ldelim();
1172
+ }
1173
+ if (message.to !== undefined) {
1174
+ Address.encode(message.to, writer.uint32(50).fork()).ldelim();
1175
+ }
1176
+ if (message.value !== undefined) {
1177
+ U256.encode(message.value, writer.uint32(58).fork()).ldelim();
1178
+ }
1179
+ if (message.gasPrice !== undefined) {
1180
+ U128.encode(message.gasPrice, writer.uint32(66).fork()).ldelim();
1181
+ }
1182
+ if (message.gas !== undefined) {
1183
+ U128.encode(message.gas, writer.uint32(74).fork()).ldelim();
1184
+ }
1185
+ if (message.maxFeePerGas !== undefined) {
1186
+ U128.encode(message.maxFeePerGas, writer.uint32(82).fork()).ldelim();
1187
+ }
1188
+ if (message.maxPriorityFeePerGas !== undefined) {
1189
+ U128.encode(message.maxPriorityFeePerGas, writer.uint32(90).fork()).ldelim();
1190
+ }
1191
+ if (message.input !== undefined && message.input.length !== 0) {
1192
+ writer.uint32(98).bytes(message.input);
1193
+ }
1194
+ if (message.signature !== undefined) {
1195
+ Signature.encode(message.signature, writer.uint32(106).fork()).ldelim();
1196
+ }
1197
+ if (message.chainId !== undefined) {
1198
+ if (BigInt.asUintN(64, message.chainId) !== message.chainId) {
1199
+ throw new globalThis.Error("value provided for field message.chainId of type uint64 too large");
1200
+ }
1201
+ writer.uint32(112).uint64(message.chainId.toString());
1202
+ }
1203
+ if (message.accessList !== undefined && message.accessList.length !== 0) {
1204
+ for (const v of message.accessList) {
1205
+ AccessListItem.encode(v!, writer.uint32(122).fork()).ldelim();
1206
+ }
1207
+ }
1208
+ if (message.transactionType !== undefined && message.transactionType !== BigInt("0")) {
1209
+ if (BigInt.asUintN(64, message.transactionType) !== message.transactionType) {
1210
+ throw new globalThis.Error("value provided for field message.transactionType of type uint64 too large");
1211
+ }
1212
+ writer.uint32(128).uint64(message.transactionType.toString());
1213
+ }
1214
+ if (message.maxFeePerBlobGas !== undefined) {
1215
+ U128.encode(message.maxFeePerBlobGas, writer.uint32(138).fork()).ldelim();
1216
+ }
1217
+ if (message.blobVersionedHashes !== undefined && message.blobVersionedHashes.length !== 0) {
1218
+ for (const v of message.blobVersionedHashes) {
1219
+ B256.encode(v!, writer.uint32(146).fork()).ldelim();
1220
+ }
1221
+ }
1222
+ if (message.transactionStatus !== undefined && message.transactionStatus !== 0) {
1223
+ writer.uint32(152).int32(message.transactionStatus);
1224
+ }
1225
+ return writer;
1226
+ },
1227
+
1228
+ decode(input: _m0.Reader | Uint8Array, length?: number): Transaction {
1229
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1230
+ let end = length === undefined ? reader.len : reader.pos + length;
1231
+ const message = createBaseTransaction() as any;
1232
+ while (reader.pos < end) {
1233
+ const tag = reader.uint32();
1234
+ switch (tag >>> 3) {
1235
+ case 1:
1236
+ if (tag === 8) {
1237
+ message.filterIds!.push(reader.uint32());
1238
+
1239
+ continue;
1240
+ }
1241
+
1242
+ if (tag === 10) {
1243
+ const end2 = reader.uint32() + reader.pos;
1244
+ while (reader.pos < end2) {
1245
+ message.filterIds!.push(reader.uint32());
1246
+ }
1247
+
1248
+ continue;
1249
+ }
1250
+
1251
+ break;
1252
+ case 2:
1253
+ if (tag !== 16) {
1254
+ break;
1255
+ }
1256
+
1257
+ message.transactionIndex = reader.uint32();
1258
+ continue;
1259
+ case 3:
1260
+ if (tag !== 26) {
1261
+ break;
1262
+ }
1263
+
1264
+ message.transactionHash = B256.decode(reader, reader.uint32());
1265
+ continue;
1266
+ case 4:
1267
+ if (tag !== 32) {
1268
+ break;
1269
+ }
1270
+
1271
+ message.nonce = longToBigint(reader.uint64() as Long);
1272
+ continue;
1273
+ case 5:
1274
+ if (tag !== 42) {
1275
+ break;
1276
+ }
1277
+
1278
+ message.from = Address.decode(reader, reader.uint32());
1279
+ continue;
1280
+ case 6:
1281
+ if (tag !== 50) {
1282
+ break;
1283
+ }
1284
+
1285
+ message.to = Address.decode(reader, reader.uint32());
1286
+ continue;
1287
+ case 7:
1288
+ if (tag !== 58) {
1289
+ break;
1290
+ }
1291
+
1292
+ message.value = U256.decode(reader, reader.uint32());
1293
+ continue;
1294
+ case 8:
1295
+ if (tag !== 66) {
1296
+ break;
1297
+ }
1298
+
1299
+ message.gasPrice = U128.decode(reader, reader.uint32());
1300
+ continue;
1301
+ case 9:
1302
+ if (tag !== 74) {
1303
+ break;
1304
+ }
1305
+
1306
+ message.gas = U128.decode(reader, reader.uint32());
1307
+ continue;
1308
+ case 10:
1309
+ if (tag !== 82) {
1310
+ break;
1311
+ }
1312
+
1313
+ message.maxFeePerGas = U128.decode(reader, reader.uint32());
1314
+ continue;
1315
+ case 11:
1316
+ if (tag !== 90) {
1317
+ break;
1318
+ }
1319
+
1320
+ message.maxPriorityFeePerGas = U128.decode(reader, reader.uint32());
1321
+ continue;
1322
+ case 12:
1323
+ if (tag !== 98) {
1324
+ break;
1325
+ }
1326
+
1327
+ message.input = reader.bytes();
1328
+ continue;
1329
+ case 13:
1330
+ if (tag !== 106) {
1331
+ break;
1332
+ }
1333
+
1334
+ message.signature = Signature.decode(reader, reader.uint32());
1335
+ continue;
1336
+ case 14:
1337
+ if (tag !== 112) {
1338
+ break;
1339
+ }
1340
+
1341
+ message.chainId = longToBigint(reader.uint64() as Long);
1342
+ continue;
1343
+ case 15:
1344
+ if (tag !== 122) {
1345
+ break;
1346
+ }
1347
+
1348
+ message.accessList!.push(AccessListItem.decode(reader, reader.uint32()));
1349
+ continue;
1350
+ case 16:
1351
+ if (tag !== 128) {
1352
+ break;
1353
+ }
1354
+
1355
+ message.transactionType = longToBigint(reader.uint64() as Long);
1356
+ continue;
1357
+ case 17:
1358
+ if (tag !== 138) {
1359
+ break;
1360
+ }
1361
+
1362
+ message.maxFeePerBlobGas = U128.decode(reader, reader.uint32());
1363
+ continue;
1364
+ case 18:
1365
+ if (tag !== 146) {
1366
+ break;
1367
+ }
1368
+
1369
+ message.blobVersionedHashes!.push(B256.decode(reader, reader.uint32()));
1370
+ continue;
1371
+ case 19:
1372
+ if (tag !== 152) {
1373
+ break;
1374
+ }
1375
+
1376
+ message.transactionStatus = reader.int32() as any;
1377
+ continue;
1378
+ }
1379
+ if ((tag & 7) === 4 || tag === 0) {
1380
+ break;
1381
+ }
1382
+ reader.skipType(tag & 7);
1383
+ }
1384
+ return message;
1385
+ },
1386
+
1387
+ fromJSON(object: any): Transaction {
1388
+ return {
1389
+ filterIds: globalThis.Array.isArray(object?.filterIds)
1390
+ ? object.filterIds.map((e: any) => globalThis.Number(e))
1391
+ : [],
1392
+ transactionIndex: isSet(object.transactionIndex) ? globalThis.Number(object.transactionIndex) : 0,
1393
+ transactionHash: isSet(object.transactionHash) ? B256.fromJSON(object.transactionHash) : undefined,
1394
+ nonce: isSet(object.nonce) ? BigInt(object.nonce) : BigInt("0"),
1395
+ from: isSet(object.from) ? Address.fromJSON(object.from) : undefined,
1396
+ to: isSet(object.to) ? Address.fromJSON(object.to) : undefined,
1397
+ value: isSet(object.value) ? U256.fromJSON(object.value) : undefined,
1398
+ gasPrice: isSet(object.gasPrice) ? U128.fromJSON(object.gasPrice) : undefined,
1399
+ gas: isSet(object.gas) ? U128.fromJSON(object.gas) : undefined,
1400
+ maxFeePerGas: isSet(object.maxFeePerGas) ? U128.fromJSON(object.maxFeePerGas) : undefined,
1401
+ maxPriorityFeePerGas: isSet(object.maxPriorityFeePerGas) ? U128.fromJSON(object.maxPriorityFeePerGas) : undefined,
1402
+ input: isSet(object.input) ? bytesFromBase64(object.input) : new Uint8Array(0),
1403
+ signature: isSet(object.signature) ? Signature.fromJSON(object.signature) : undefined,
1404
+ chainId: isSet(object.chainId) ? BigInt(object.chainId) : undefined,
1405
+ accessList: globalThis.Array.isArray(object?.accessList)
1406
+ ? object.accessList.map((e: any) => AccessListItem.fromJSON(e))
1407
+ : [],
1408
+ transactionType: isSet(object.transactionType) ? BigInt(object.transactionType) : BigInt("0"),
1409
+ maxFeePerBlobGas: isSet(object.maxFeePerBlobGas) ? U128.fromJSON(object.maxFeePerBlobGas) : undefined,
1410
+ blobVersionedHashes: globalThis.Array.isArray(object?.blobVersionedHashes)
1411
+ ? object.blobVersionedHashes.map((e: any) => B256.fromJSON(e))
1412
+ : [],
1413
+ transactionStatus: isSet(object.transactionStatus) ? transactionStatusFromJSON(object.transactionStatus) : 0,
1414
+ };
1415
+ },
1416
+
1417
+ toJSON(message: Transaction): unknown {
1418
+ const obj: any = {};
1419
+ if (message.filterIds?.length) {
1420
+ obj.filterIds = message.filterIds.map((e) => Math.round(e));
1421
+ }
1422
+ if (message.transactionIndex !== undefined && message.transactionIndex !== 0) {
1423
+ obj.transactionIndex = Math.round(message.transactionIndex);
1424
+ }
1425
+ if (message.transactionHash !== undefined) {
1426
+ obj.transactionHash = B256.toJSON(message.transactionHash);
1427
+ }
1428
+ if (message.nonce !== undefined && message.nonce !== BigInt("0")) {
1429
+ obj.nonce = message.nonce.toString();
1430
+ }
1431
+ if (message.from !== undefined) {
1432
+ obj.from = Address.toJSON(message.from);
1433
+ }
1434
+ if (message.to !== undefined) {
1435
+ obj.to = Address.toJSON(message.to);
1436
+ }
1437
+ if (message.value !== undefined) {
1438
+ obj.value = U256.toJSON(message.value);
1439
+ }
1440
+ if (message.gasPrice !== undefined) {
1441
+ obj.gasPrice = U128.toJSON(message.gasPrice);
1442
+ }
1443
+ if (message.gas !== undefined) {
1444
+ obj.gas = U128.toJSON(message.gas);
1445
+ }
1446
+ if (message.maxFeePerGas !== undefined) {
1447
+ obj.maxFeePerGas = U128.toJSON(message.maxFeePerGas);
1448
+ }
1449
+ if (message.maxPriorityFeePerGas !== undefined) {
1450
+ obj.maxPriorityFeePerGas = U128.toJSON(message.maxPriorityFeePerGas);
1451
+ }
1452
+ if (message.input !== undefined && message.input.length !== 0) {
1453
+ obj.input = base64FromBytes(message.input);
1454
+ }
1455
+ if (message.signature !== undefined) {
1456
+ obj.signature = Signature.toJSON(message.signature);
1457
+ }
1458
+ if (message.chainId !== undefined) {
1459
+ obj.chainId = message.chainId.toString();
1460
+ }
1461
+ if (message.accessList?.length) {
1462
+ obj.accessList = message.accessList.map((e) => AccessListItem.toJSON(e));
1463
+ }
1464
+ if (message.transactionType !== undefined && message.transactionType !== BigInt("0")) {
1465
+ obj.transactionType = message.transactionType.toString();
1466
+ }
1467
+ if (message.maxFeePerBlobGas !== undefined) {
1468
+ obj.maxFeePerBlobGas = U128.toJSON(message.maxFeePerBlobGas);
1469
+ }
1470
+ if (message.blobVersionedHashes?.length) {
1471
+ obj.blobVersionedHashes = message.blobVersionedHashes.map((e) => B256.toJSON(e));
1472
+ }
1473
+ if (message.transactionStatus !== undefined && message.transactionStatus !== 0) {
1474
+ obj.transactionStatus = transactionStatusToJSON(message.transactionStatus);
1475
+ }
1476
+ return obj;
1477
+ },
1478
+
1479
+ create(base?: DeepPartial<Transaction>): Transaction {
1480
+ return Transaction.fromPartial(base ?? {});
1481
+ },
1482
+ fromPartial(object: DeepPartial<Transaction>): Transaction {
1483
+ const message = createBaseTransaction() as any;
1484
+ message.filterIds = object.filterIds?.map((e) => e) || [];
1485
+ message.transactionIndex = object.transactionIndex ?? 0;
1486
+ message.transactionHash = (object.transactionHash !== undefined && object.transactionHash !== null)
1487
+ ? B256.fromPartial(object.transactionHash)
1488
+ : undefined;
1489
+ message.nonce = object.nonce ?? BigInt("0");
1490
+ message.from = (object.from !== undefined && object.from !== null) ? Address.fromPartial(object.from) : undefined;
1491
+ message.to = (object.to !== undefined && object.to !== null) ? Address.fromPartial(object.to) : undefined;
1492
+ message.value = (object.value !== undefined && object.value !== null) ? U256.fromPartial(object.value) : undefined;
1493
+ message.gasPrice = (object.gasPrice !== undefined && object.gasPrice !== null)
1494
+ ? U128.fromPartial(object.gasPrice)
1495
+ : undefined;
1496
+ message.gas = (object.gas !== undefined && object.gas !== null) ? U128.fromPartial(object.gas) : undefined;
1497
+ message.maxFeePerGas = (object.maxFeePerGas !== undefined && object.maxFeePerGas !== null)
1498
+ ? U128.fromPartial(object.maxFeePerGas)
1499
+ : undefined;
1500
+ message.maxPriorityFeePerGas = (object.maxPriorityFeePerGas !== undefined && object.maxPriorityFeePerGas !== null)
1501
+ ? U128.fromPartial(object.maxPriorityFeePerGas)
1502
+ : undefined;
1503
+ message.input = object.input ?? new Uint8Array(0);
1504
+ message.signature = (object.signature !== undefined && object.signature !== null)
1505
+ ? Signature.fromPartial(object.signature)
1506
+ : undefined;
1507
+ message.chainId = object.chainId ?? undefined;
1508
+ message.accessList = object.accessList?.map((e) => AccessListItem.fromPartial(e)) || [];
1509
+ message.transactionType = object.transactionType ?? BigInt("0");
1510
+ message.maxFeePerBlobGas = (object.maxFeePerBlobGas !== undefined && object.maxFeePerBlobGas !== null)
1511
+ ? U128.fromPartial(object.maxFeePerBlobGas)
1512
+ : undefined;
1513
+ message.blobVersionedHashes = object.blobVersionedHashes?.map((e) => B256.fromPartial(e)) || [];
1514
+ message.transactionStatus = object.transactionStatus ?? 0;
1515
+ return message;
1516
+ },
1517
+ };
1518
+
1519
+ function createBaseTransactionReceipt(): TransactionReceipt {
1520
+ return {
1521
+ filterIds: [],
1522
+ transactionIndex: 0,
1523
+ transactionHash: undefined,
1524
+ cumulativeGasUsed: undefined,
1525
+ gasUsed: undefined,
1526
+ effectiveGasPrice: undefined,
1527
+ from: undefined,
1528
+ to: undefined,
1529
+ contractAddress: undefined,
1530
+ logsBloom: undefined,
1531
+ transactionType: BigInt("0"),
1532
+ blobGasUsed: undefined,
1533
+ blobGasPrice: undefined,
1534
+ transactionStatus: 0,
1535
+ };
1536
+ }
1537
+
1538
+ export const TransactionReceipt = {
1539
+ encode(message: TransactionReceipt, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1540
+ if (message.filterIds !== undefined && message.filterIds.length !== 0) {
1541
+ writer.uint32(10).fork();
1542
+ for (const v of message.filterIds) {
1543
+ writer.uint32(v);
1544
+ }
1545
+ writer.ldelim();
1546
+ }
1547
+ if (message.transactionIndex !== undefined && message.transactionIndex !== 0) {
1548
+ writer.uint32(16).uint32(message.transactionIndex);
1549
+ }
1550
+ if (message.transactionHash !== undefined) {
1551
+ B256.encode(message.transactionHash, writer.uint32(26).fork()).ldelim();
1552
+ }
1553
+ if (message.cumulativeGasUsed !== undefined) {
1554
+ U128.encode(message.cumulativeGasUsed, writer.uint32(34).fork()).ldelim();
1555
+ }
1556
+ if (message.gasUsed !== undefined) {
1557
+ U128.encode(message.gasUsed, writer.uint32(42).fork()).ldelim();
1558
+ }
1559
+ if (message.effectiveGasPrice !== undefined) {
1560
+ U128.encode(message.effectiveGasPrice, writer.uint32(50).fork()).ldelim();
1561
+ }
1562
+ if (message.from !== undefined) {
1563
+ Address.encode(message.from, writer.uint32(58).fork()).ldelim();
1564
+ }
1565
+ if (message.to !== undefined) {
1566
+ Address.encode(message.to, writer.uint32(66).fork()).ldelim();
1567
+ }
1568
+ if (message.contractAddress !== undefined) {
1569
+ Address.encode(message.contractAddress, writer.uint32(74).fork()).ldelim();
1570
+ }
1571
+ if (message.logsBloom !== undefined) {
1572
+ Bloom.encode(message.logsBloom, writer.uint32(82).fork()).ldelim();
1573
+ }
1574
+ if (message.transactionType !== undefined && message.transactionType !== BigInt("0")) {
1575
+ if (BigInt.asUintN(64, message.transactionType) !== message.transactionType) {
1576
+ throw new globalThis.Error("value provided for field message.transactionType of type uint64 too large");
1577
+ }
1578
+ writer.uint32(88).uint64(message.transactionType.toString());
1579
+ }
1580
+ if (message.blobGasUsed !== undefined) {
1581
+ U128.encode(message.blobGasUsed, writer.uint32(98).fork()).ldelim();
1582
+ }
1583
+ if (message.blobGasPrice !== undefined) {
1584
+ U128.encode(message.blobGasPrice, writer.uint32(106).fork()).ldelim();
1585
+ }
1586
+ if (message.transactionStatus !== undefined && message.transactionStatus !== 0) {
1587
+ writer.uint32(112).int32(message.transactionStatus);
1588
+ }
1589
+ return writer;
1590
+ },
1591
+
1592
+ decode(input: _m0.Reader | Uint8Array, length?: number): TransactionReceipt {
1593
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1594
+ let end = length === undefined ? reader.len : reader.pos + length;
1595
+ const message = createBaseTransactionReceipt() as any;
1596
+ while (reader.pos < end) {
1597
+ const tag = reader.uint32();
1598
+ switch (tag >>> 3) {
1599
+ case 1:
1600
+ if (tag === 8) {
1601
+ message.filterIds!.push(reader.uint32());
1602
+
1603
+ continue;
1604
+ }
1605
+
1606
+ if (tag === 10) {
1607
+ const end2 = reader.uint32() + reader.pos;
1608
+ while (reader.pos < end2) {
1609
+ message.filterIds!.push(reader.uint32());
1610
+ }
1611
+
1612
+ continue;
1613
+ }
1614
+
1615
+ break;
1616
+ case 2:
1617
+ if (tag !== 16) {
1618
+ break;
1619
+ }
1620
+
1621
+ message.transactionIndex = reader.uint32();
1622
+ continue;
1623
+ case 3:
1624
+ if (tag !== 26) {
1625
+ break;
1626
+ }
1627
+
1628
+ message.transactionHash = B256.decode(reader, reader.uint32());
1629
+ continue;
1630
+ case 4:
1631
+ if (tag !== 34) {
1632
+ break;
1633
+ }
1634
+
1635
+ message.cumulativeGasUsed = U128.decode(reader, reader.uint32());
1636
+ continue;
1637
+ case 5:
1638
+ if (tag !== 42) {
1639
+ break;
1640
+ }
1641
+
1642
+ message.gasUsed = U128.decode(reader, reader.uint32());
1643
+ continue;
1644
+ case 6:
1645
+ if (tag !== 50) {
1646
+ break;
1647
+ }
1648
+
1649
+ message.effectiveGasPrice = U128.decode(reader, reader.uint32());
1650
+ continue;
1651
+ case 7:
1652
+ if (tag !== 58) {
1653
+ break;
1654
+ }
1655
+
1656
+ message.from = Address.decode(reader, reader.uint32());
1657
+ continue;
1658
+ case 8:
1659
+ if (tag !== 66) {
1660
+ break;
1661
+ }
1662
+
1663
+ message.to = Address.decode(reader, reader.uint32());
1664
+ continue;
1665
+ case 9:
1666
+ if (tag !== 74) {
1667
+ break;
1668
+ }
1669
+
1670
+ message.contractAddress = Address.decode(reader, reader.uint32());
1671
+ continue;
1672
+ case 10:
1673
+ if (tag !== 82) {
1674
+ break;
1675
+ }
1676
+
1677
+ message.logsBloom = Bloom.decode(reader, reader.uint32());
1678
+ continue;
1679
+ case 11:
1680
+ if (tag !== 88) {
1681
+ break;
1682
+ }
1683
+
1684
+ message.transactionType = longToBigint(reader.uint64() as Long);
1685
+ continue;
1686
+ case 12:
1687
+ if (tag !== 98) {
1688
+ break;
1689
+ }
1690
+
1691
+ message.blobGasUsed = U128.decode(reader, reader.uint32());
1692
+ continue;
1693
+ case 13:
1694
+ if (tag !== 106) {
1695
+ break;
1696
+ }
1697
+
1698
+ message.blobGasPrice = U128.decode(reader, reader.uint32());
1699
+ continue;
1700
+ case 14:
1701
+ if (tag !== 112) {
1702
+ break;
1703
+ }
1704
+
1705
+ message.transactionStatus = reader.int32() as any;
1706
+ continue;
1707
+ }
1708
+ if ((tag & 7) === 4 || tag === 0) {
1709
+ break;
1710
+ }
1711
+ reader.skipType(tag & 7);
1712
+ }
1713
+ return message;
1714
+ },
1715
+
1716
+ fromJSON(object: any): TransactionReceipt {
1717
+ return {
1718
+ filterIds: globalThis.Array.isArray(object?.filterIds)
1719
+ ? object.filterIds.map((e: any) => globalThis.Number(e))
1720
+ : [],
1721
+ transactionIndex: isSet(object.transactionIndex) ? globalThis.Number(object.transactionIndex) : 0,
1722
+ transactionHash: isSet(object.transactionHash) ? B256.fromJSON(object.transactionHash) : undefined,
1723
+ cumulativeGasUsed: isSet(object.cumulativeGasUsed) ? U128.fromJSON(object.cumulativeGasUsed) : undefined,
1724
+ gasUsed: isSet(object.gasUsed) ? U128.fromJSON(object.gasUsed) : undefined,
1725
+ effectiveGasPrice: isSet(object.effectiveGasPrice) ? U128.fromJSON(object.effectiveGasPrice) : undefined,
1726
+ from: isSet(object.from) ? Address.fromJSON(object.from) : undefined,
1727
+ to: isSet(object.to) ? Address.fromJSON(object.to) : undefined,
1728
+ contractAddress: isSet(object.contractAddress) ? Address.fromJSON(object.contractAddress) : undefined,
1729
+ logsBloom: isSet(object.logsBloom) ? Bloom.fromJSON(object.logsBloom) : undefined,
1730
+ transactionType: isSet(object.transactionType) ? BigInt(object.transactionType) : BigInt("0"),
1731
+ blobGasUsed: isSet(object.blobGasUsed) ? U128.fromJSON(object.blobGasUsed) : undefined,
1732
+ blobGasPrice: isSet(object.blobGasPrice) ? U128.fromJSON(object.blobGasPrice) : undefined,
1733
+ transactionStatus: isSet(object.transactionStatus) ? transactionStatusFromJSON(object.transactionStatus) : 0,
1734
+ };
1735
+ },
1736
+
1737
+ toJSON(message: TransactionReceipt): unknown {
1738
+ const obj: any = {};
1739
+ if (message.filterIds?.length) {
1740
+ obj.filterIds = message.filterIds.map((e) => Math.round(e));
1741
+ }
1742
+ if (message.transactionIndex !== undefined && message.transactionIndex !== 0) {
1743
+ obj.transactionIndex = Math.round(message.transactionIndex);
1744
+ }
1745
+ if (message.transactionHash !== undefined) {
1746
+ obj.transactionHash = B256.toJSON(message.transactionHash);
1747
+ }
1748
+ if (message.cumulativeGasUsed !== undefined) {
1749
+ obj.cumulativeGasUsed = U128.toJSON(message.cumulativeGasUsed);
1750
+ }
1751
+ if (message.gasUsed !== undefined) {
1752
+ obj.gasUsed = U128.toJSON(message.gasUsed);
1753
+ }
1754
+ if (message.effectiveGasPrice !== undefined) {
1755
+ obj.effectiveGasPrice = U128.toJSON(message.effectiveGasPrice);
1756
+ }
1757
+ if (message.from !== undefined) {
1758
+ obj.from = Address.toJSON(message.from);
1759
+ }
1760
+ if (message.to !== undefined) {
1761
+ obj.to = Address.toJSON(message.to);
1762
+ }
1763
+ if (message.contractAddress !== undefined) {
1764
+ obj.contractAddress = Address.toJSON(message.contractAddress);
1765
+ }
1766
+ if (message.logsBloom !== undefined) {
1767
+ obj.logsBloom = Bloom.toJSON(message.logsBloom);
1768
+ }
1769
+ if (message.transactionType !== undefined && message.transactionType !== BigInt("0")) {
1770
+ obj.transactionType = message.transactionType.toString();
1771
+ }
1772
+ if (message.blobGasUsed !== undefined) {
1773
+ obj.blobGasUsed = U128.toJSON(message.blobGasUsed);
1774
+ }
1775
+ if (message.blobGasPrice !== undefined) {
1776
+ obj.blobGasPrice = U128.toJSON(message.blobGasPrice);
1777
+ }
1778
+ if (message.transactionStatus !== undefined && message.transactionStatus !== 0) {
1779
+ obj.transactionStatus = transactionStatusToJSON(message.transactionStatus);
1780
+ }
1781
+ return obj;
1782
+ },
1783
+
1784
+ create(base?: DeepPartial<TransactionReceipt>): TransactionReceipt {
1785
+ return TransactionReceipt.fromPartial(base ?? {});
1786
+ },
1787
+ fromPartial(object: DeepPartial<TransactionReceipt>): TransactionReceipt {
1788
+ const message = createBaseTransactionReceipt() as any;
1789
+ message.filterIds = object.filterIds?.map((e) => e) || [];
1790
+ message.transactionIndex = object.transactionIndex ?? 0;
1791
+ message.transactionHash = (object.transactionHash !== undefined && object.transactionHash !== null)
1792
+ ? B256.fromPartial(object.transactionHash)
1793
+ : undefined;
1794
+ message.cumulativeGasUsed = (object.cumulativeGasUsed !== undefined && object.cumulativeGasUsed !== null)
1795
+ ? U128.fromPartial(object.cumulativeGasUsed)
1796
+ : undefined;
1797
+ message.gasUsed = (object.gasUsed !== undefined && object.gasUsed !== null)
1798
+ ? U128.fromPartial(object.gasUsed)
1799
+ : undefined;
1800
+ message.effectiveGasPrice = (object.effectiveGasPrice !== undefined && object.effectiveGasPrice !== null)
1801
+ ? U128.fromPartial(object.effectiveGasPrice)
1802
+ : undefined;
1803
+ message.from = (object.from !== undefined && object.from !== null) ? Address.fromPartial(object.from) : undefined;
1804
+ message.to = (object.to !== undefined && object.to !== null) ? Address.fromPartial(object.to) : undefined;
1805
+ message.contractAddress = (object.contractAddress !== undefined && object.contractAddress !== null)
1806
+ ? Address.fromPartial(object.contractAddress)
1807
+ : undefined;
1808
+ message.logsBloom = (object.logsBloom !== undefined && object.logsBloom !== null)
1809
+ ? Bloom.fromPartial(object.logsBloom)
1810
+ : undefined;
1811
+ message.transactionType = object.transactionType ?? BigInt("0");
1812
+ message.blobGasUsed = (object.blobGasUsed !== undefined && object.blobGasUsed !== null)
1813
+ ? U128.fromPartial(object.blobGasUsed)
1814
+ : undefined;
1815
+ message.blobGasPrice = (object.blobGasPrice !== undefined && object.blobGasPrice !== null)
1816
+ ? U128.fromPartial(object.blobGasPrice)
1817
+ : undefined;
1818
+ message.transactionStatus = object.transactionStatus ?? 0;
1819
+ return message;
1820
+ },
1821
+ };
1822
+
1823
+ function createBaseLog(): Log {
1824
+ return {
1825
+ filterIds: [],
1826
+ logIndex: 0,
1827
+ address: undefined,
1828
+ topics: [],
1829
+ data: new Uint8Array(0),
1830
+ transactionIndex: 0,
1831
+ transactionHash: undefined,
1832
+ transactionStatus: 0,
1833
+ };
1834
+ }
1835
+
1836
+ export const Log = {
1837
+ encode(message: Log, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1838
+ if (message.filterIds !== undefined && message.filterIds.length !== 0) {
1839
+ writer.uint32(10).fork();
1840
+ for (const v of message.filterIds) {
1841
+ writer.uint32(v);
1842
+ }
1843
+ writer.ldelim();
1844
+ }
1845
+ if (message.logIndex !== undefined && message.logIndex !== 0) {
1846
+ writer.uint32(16).uint32(message.logIndex);
1847
+ }
1848
+ if (message.address !== undefined) {
1849
+ Address.encode(message.address, writer.uint32(26).fork()).ldelim();
1850
+ }
1851
+ if (message.topics !== undefined && message.topics.length !== 0) {
1852
+ for (const v of message.topics) {
1853
+ B256.encode(v!, writer.uint32(34).fork()).ldelim();
1854
+ }
1855
+ }
1856
+ if (message.data !== undefined && message.data.length !== 0) {
1857
+ writer.uint32(42).bytes(message.data);
1858
+ }
1859
+ if (message.transactionIndex !== undefined && message.transactionIndex !== 0) {
1860
+ writer.uint32(48).uint32(message.transactionIndex);
1861
+ }
1862
+ if (message.transactionHash !== undefined) {
1863
+ B256.encode(message.transactionHash, writer.uint32(58).fork()).ldelim();
1864
+ }
1865
+ if (message.transactionStatus !== undefined && message.transactionStatus !== 0) {
1866
+ writer.uint32(64).int32(message.transactionStatus);
1867
+ }
1868
+ return writer;
1869
+ },
1870
+
1871
+ decode(input: _m0.Reader | Uint8Array, length?: number): Log {
1872
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
1873
+ let end = length === undefined ? reader.len : reader.pos + length;
1874
+ const message = createBaseLog() as any;
1875
+ while (reader.pos < end) {
1876
+ const tag = reader.uint32();
1877
+ switch (tag >>> 3) {
1878
+ case 1:
1879
+ if (tag === 8) {
1880
+ message.filterIds!.push(reader.uint32());
1881
+
1882
+ continue;
1883
+ }
1884
+
1885
+ if (tag === 10) {
1886
+ const end2 = reader.uint32() + reader.pos;
1887
+ while (reader.pos < end2) {
1888
+ message.filterIds!.push(reader.uint32());
1889
+ }
1890
+
1891
+ continue;
1892
+ }
1893
+
1894
+ break;
1895
+ case 2:
1896
+ if (tag !== 16) {
1897
+ break;
1898
+ }
1899
+
1900
+ message.logIndex = reader.uint32();
1901
+ continue;
1902
+ case 3:
1903
+ if (tag !== 26) {
1904
+ break;
1905
+ }
1906
+
1907
+ message.address = Address.decode(reader, reader.uint32());
1908
+ continue;
1909
+ case 4:
1910
+ if (tag !== 34) {
1911
+ break;
1912
+ }
1913
+
1914
+ message.topics!.push(B256.decode(reader, reader.uint32()));
1915
+ continue;
1916
+ case 5:
1917
+ if (tag !== 42) {
1918
+ break;
1919
+ }
1920
+
1921
+ message.data = reader.bytes();
1922
+ continue;
1923
+ case 6:
1924
+ if (tag !== 48) {
1925
+ break;
1926
+ }
1927
+
1928
+ message.transactionIndex = reader.uint32();
1929
+ continue;
1930
+ case 7:
1931
+ if (tag !== 58) {
1932
+ break;
1933
+ }
1934
+
1935
+ message.transactionHash = B256.decode(reader, reader.uint32());
1936
+ continue;
1937
+ case 8:
1938
+ if (tag !== 64) {
1939
+ break;
1940
+ }
1941
+
1942
+ message.transactionStatus = reader.int32() as any;
1943
+ continue;
1944
+ }
1945
+ if ((tag & 7) === 4 || tag === 0) {
1946
+ break;
1947
+ }
1948
+ reader.skipType(tag & 7);
1949
+ }
1950
+ return message;
1951
+ },
1952
+
1953
+ fromJSON(object: any): Log {
1954
+ return {
1955
+ filterIds: globalThis.Array.isArray(object?.filterIds)
1956
+ ? object.filterIds.map((e: any) => globalThis.Number(e))
1957
+ : [],
1958
+ logIndex: isSet(object.logIndex) ? globalThis.Number(object.logIndex) : 0,
1959
+ address: isSet(object.address) ? Address.fromJSON(object.address) : undefined,
1960
+ topics: globalThis.Array.isArray(object?.topics) ? object.topics.map((e: any) => B256.fromJSON(e)) : [],
1961
+ data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(0),
1962
+ transactionIndex: isSet(object.transactionIndex) ? globalThis.Number(object.transactionIndex) : 0,
1963
+ transactionHash: isSet(object.transactionHash) ? B256.fromJSON(object.transactionHash) : undefined,
1964
+ transactionStatus: isSet(object.transactionStatus) ? transactionStatusFromJSON(object.transactionStatus) : 0,
1965
+ };
1966
+ },
1967
+
1968
+ toJSON(message: Log): unknown {
1969
+ const obj: any = {};
1970
+ if (message.filterIds?.length) {
1971
+ obj.filterIds = message.filterIds.map((e) => Math.round(e));
1972
+ }
1973
+ if (message.logIndex !== undefined && message.logIndex !== 0) {
1974
+ obj.logIndex = Math.round(message.logIndex);
1975
+ }
1976
+ if (message.address !== undefined) {
1977
+ obj.address = Address.toJSON(message.address);
1978
+ }
1979
+ if (message.topics?.length) {
1980
+ obj.topics = message.topics.map((e) => B256.toJSON(e));
1981
+ }
1982
+ if (message.data !== undefined && message.data.length !== 0) {
1983
+ obj.data = base64FromBytes(message.data);
1984
+ }
1985
+ if (message.transactionIndex !== undefined && message.transactionIndex !== 0) {
1986
+ obj.transactionIndex = Math.round(message.transactionIndex);
1987
+ }
1988
+ if (message.transactionHash !== undefined) {
1989
+ obj.transactionHash = B256.toJSON(message.transactionHash);
1990
+ }
1991
+ if (message.transactionStatus !== undefined && message.transactionStatus !== 0) {
1992
+ obj.transactionStatus = transactionStatusToJSON(message.transactionStatus);
1993
+ }
1994
+ return obj;
1995
+ },
1996
+
1997
+ create(base?: DeepPartial<Log>): Log {
1998
+ return Log.fromPartial(base ?? {});
1999
+ },
2000
+ fromPartial(object: DeepPartial<Log>): Log {
2001
+ const message = createBaseLog() as any;
2002
+ message.filterIds = object.filterIds?.map((e) => e) || [];
2003
+ message.logIndex = object.logIndex ?? 0;
2004
+ message.address = (object.address !== undefined && object.address !== null)
2005
+ ? Address.fromPartial(object.address)
2006
+ : undefined;
2007
+ message.topics = object.topics?.map((e) => B256.fromPartial(e)) || [];
2008
+ message.data = object.data ?? new Uint8Array(0);
2009
+ message.transactionIndex = object.transactionIndex ?? 0;
2010
+ message.transactionHash = (object.transactionHash !== undefined && object.transactionHash !== null)
2011
+ ? B256.fromPartial(object.transactionHash)
2012
+ : undefined;
2013
+ message.transactionStatus = object.transactionStatus ?? 0;
2014
+ return message;
2015
+ },
2016
+ };
2017
+
2018
+ function createBaseSignature(): Signature {
2019
+ return { r: undefined, s: undefined, v: undefined, yParity: undefined };
2020
+ }
2021
+
2022
+ export const Signature = {
2023
+ encode(message: Signature, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2024
+ if (message.r !== undefined) {
2025
+ U256.encode(message.r, writer.uint32(10).fork()).ldelim();
2026
+ }
2027
+ if (message.s !== undefined) {
2028
+ U256.encode(message.s, writer.uint32(18).fork()).ldelim();
2029
+ }
2030
+ if (message.v !== undefined) {
2031
+ U256.encode(message.v, writer.uint32(26).fork()).ldelim();
2032
+ }
2033
+ if (message.yParity !== undefined) {
2034
+ writer.uint32(32).bool(message.yParity);
2035
+ }
2036
+ return writer;
2037
+ },
2038
+
2039
+ decode(input: _m0.Reader | Uint8Array, length?: number): Signature {
2040
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
2041
+ let end = length === undefined ? reader.len : reader.pos + length;
2042
+ const message = createBaseSignature() as any;
2043
+ while (reader.pos < end) {
2044
+ const tag = reader.uint32();
2045
+ switch (tag >>> 3) {
2046
+ case 1:
2047
+ if (tag !== 10) {
2048
+ break;
2049
+ }
2050
+
2051
+ message.r = U256.decode(reader, reader.uint32());
2052
+ continue;
2053
+ case 2:
2054
+ if (tag !== 18) {
2055
+ break;
2056
+ }
2057
+
2058
+ message.s = U256.decode(reader, reader.uint32());
2059
+ continue;
2060
+ case 3:
2061
+ if (tag !== 26) {
2062
+ break;
2063
+ }
2064
+
2065
+ message.v = U256.decode(reader, reader.uint32());
2066
+ continue;
2067
+ case 4:
2068
+ if (tag !== 32) {
2069
+ break;
2070
+ }
2071
+
2072
+ message.yParity = reader.bool();
2073
+ continue;
2074
+ }
2075
+ if ((tag & 7) === 4 || tag === 0) {
2076
+ break;
2077
+ }
2078
+ reader.skipType(tag & 7);
2079
+ }
2080
+ return message;
2081
+ },
2082
+
2083
+ fromJSON(object: any): Signature {
2084
+ return {
2085
+ r: isSet(object.r) ? U256.fromJSON(object.r) : undefined,
2086
+ s: isSet(object.s) ? U256.fromJSON(object.s) : undefined,
2087
+ v: isSet(object.v) ? U256.fromJSON(object.v) : undefined,
2088
+ yParity: isSet(object.yParity) ? globalThis.Boolean(object.yParity) : undefined,
2089
+ };
2090
+ },
2091
+
2092
+ toJSON(message: Signature): unknown {
2093
+ const obj: any = {};
2094
+ if (message.r !== undefined) {
2095
+ obj.r = U256.toJSON(message.r);
2096
+ }
2097
+ if (message.s !== undefined) {
2098
+ obj.s = U256.toJSON(message.s);
2099
+ }
2100
+ if (message.v !== undefined) {
2101
+ obj.v = U256.toJSON(message.v);
2102
+ }
2103
+ if (message.yParity !== undefined) {
2104
+ obj.yParity = message.yParity;
2105
+ }
2106
+ return obj;
2107
+ },
2108
+
2109
+ create(base?: DeepPartial<Signature>): Signature {
2110
+ return Signature.fromPartial(base ?? {});
2111
+ },
2112
+ fromPartial(object: DeepPartial<Signature>): Signature {
2113
+ const message = createBaseSignature() as any;
2114
+ message.r = (object.r !== undefined && object.r !== null) ? U256.fromPartial(object.r) : undefined;
2115
+ message.s = (object.s !== undefined && object.s !== null) ? U256.fromPartial(object.s) : undefined;
2116
+ message.v = (object.v !== undefined && object.v !== null) ? U256.fromPartial(object.v) : undefined;
2117
+ message.yParity = object.yParity ?? undefined;
2118
+ return message;
2119
+ },
2120
+ };
2121
+
2122
+ function createBaseAccessListItem(): AccessListItem {
2123
+ return { address: undefined, storageKeys: [] };
2124
+ }
2125
+
2126
+ export const AccessListItem = {
2127
+ encode(message: AccessListItem, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2128
+ if (message.address !== undefined) {
2129
+ Address.encode(message.address, writer.uint32(10).fork()).ldelim();
2130
+ }
2131
+ if (message.storageKeys !== undefined && message.storageKeys.length !== 0) {
2132
+ for (const v of message.storageKeys) {
2133
+ B256.encode(v!, writer.uint32(18).fork()).ldelim();
2134
+ }
2135
+ }
2136
+ return writer;
2137
+ },
2138
+
2139
+ decode(input: _m0.Reader | Uint8Array, length?: number): AccessListItem {
2140
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
2141
+ let end = length === undefined ? reader.len : reader.pos + length;
2142
+ const message = createBaseAccessListItem() as any;
2143
+ while (reader.pos < end) {
2144
+ const tag = reader.uint32();
2145
+ switch (tag >>> 3) {
2146
+ case 1:
2147
+ if (tag !== 10) {
2148
+ break;
2149
+ }
2150
+
2151
+ message.address = Address.decode(reader, reader.uint32());
2152
+ continue;
2153
+ case 2:
2154
+ if (tag !== 18) {
2155
+ break;
2156
+ }
2157
+
2158
+ message.storageKeys!.push(B256.decode(reader, reader.uint32()));
2159
+ continue;
2160
+ }
2161
+ if ((tag & 7) === 4 || tag === 0) {
2162
+ break;
2163
+ }
2164
+ reader.skipType(tag & 7);
2165
+ }
2166
+ return message;
2167
+ },
2168
+
2169
+ fromJSON(object: any): AccessListItem {
2170
+ return {
2171
+ address: isSet(object.address) ? Address.fromJSON(object.address) : undefined,
2172
+ storageKeys: globalThis.Array.isArray(object?.storageKeys)
2173
+ ? object.storageKeys.map((e: any) => B256.fromJSON(e))
2174
+ : [],
2175
+ };
2176
+ },
2177
+
2178
+ toJSON(message: AccessListItem): unknown {
2179
+ const obj: any = {};
2180
+ if (message.address !== undefined) {
2181
+ obj.address = Address.toJSON(message.address);
2182
+ }
2183
+ if (message.storageKeys?.length) {
2184
+ obj.storageKeys = message.storageKeys.map((e) => B256.toJSON(e));
2185
+ }
2186
+ return obj;
2187
+ },
2188
+
2189
+ create(base?: DeepPartial<AccessListItem>): AccessListItem {
2190
+ return AccessListItem.fromPartial(base ?? {});
2191
+ },
2192
+ fromPartial(object: DeepPartial<AccessListItem>): AccessListItem {
2193
+ const message = createBaseAccessListItem() as any;
2194
+ message.address = (object.address !== undefined && object.address !== null)
2195
+ ? Address.fromPartial(object.address)
2196
+ : undefined;
2197
+ message.storageKeys = object.storageKeys?.map((e) => B256.fromPartial(e)) || [];
2198
+ return message;
2199
+ },
2200
+ };
2201
+
2202
+ function bytesFromBase64(b64: string): Uint8Array {
2203
+ if ((globalThis as any).Buffer) {
2204
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
2205
+ } else {
2206
+ const bin = globalThis.atob(b64);
2207
+ const arr = new Uint8Array(bin.length);
2208
+ for (let i = 0; i < bin.length; ++i) {
2209
+ arr[i] = bin.charCodeAt(i);
2210
+ }
2211
+ return arr;
2212
+ }
2213
+ }
2214
+
2215
+ function base64FromBytes(arr: Uint8Array): string {
2216
+ if ((globalThis as any).Buffer) {
2217
+ return globalThis.Buffer.from(arr).toString("base64");
2218
+ } else {
2219
+ const bin: string[] = [];
2220
+ arr.forEach((byte) => {
2221
+ bin.push(globalThis.String.fromCharCode(byte));
2222
+ });
2223
+ return globalThis.btoa(bin.join(""));
2224
+ }
2225
+ }
2226
+
2227
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
2228
+
2229
+ export type DeepPartial<T> = T extends Builtin ? T
2230
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
2231
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
2232
+ : T extends { readonly $case: string }
2233
+ ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { readonly $case: T["$case"] }
2234
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
2235
+ : Partial<T>;
2236
+
2237
+ function toTimestamp(date: Date): Timestamp {
2238
+ const seconds = BigInt(Math.trunc(date.getTime() / 1_000));
2239
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
2240
+ return { seconds, nanos };
2241
+ }
2242
+
2243
+ function fromTimestamp(t: Timestamp): Date {
2244
+ let millis = (globalThis.Number(t.seconds?.toString()) || 0) * 1_000;
2245
+ millis += (t.nanos || 0) / 1_000_000;
2246
+ return new globalThis.Date(millis);
2247
+ }
2248
+
2249
+ function fromJsonTimestamp(o: any): Date {
2250
+ if (o instanceof globalThis.Date) {
2251
+ return o;
2252
+ } else if (typeof o === "string") {
2253
+ return new globalThis.Date(o);
2254
+ } else {
2255
+ return fromTimestamp(Timestamp.fromJSON(o));
2256
+ }
2257
+ }
2258
+
2259
+ function longToBigint(long: Long) {
2260
+ return BigInt(long.toString());
2261
+ }
2262
+
2263
+ if (_m0.util.Long !== Long) {
2264
+ _m0.util.Long = Long as any;
2265
+ _m0.configure();
2266
+ }
2267
+
2268
+ function isSet(value: any): boolean {
2269
+ return value !== null && value !== undefined;
2270
+ }