@apibara/evm 2.1.0-beta.5 → 2.1.0-beta.50

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/dist/index.mjs CHANGED
@@ -1,95 +1,73 @@
1
- import { BytesFromUint8Array, Bytes, StreamConfig } from '@apibara/protocol';
2
- import { Schema } from '@effect/schema';
3
- import { hexToBytes, pad } from 'viem';
1
+ import { BytesFromUint8Array, StreamConfig } from '@apibara/protocol';
2
+ import { MessageCodec, RequiredCodec, BigIntCodec, OptionalCodec, DateCodec, ArrayCodec, NumberCodec, BooleanCodec, OneOfCodec, StringCodec } from '@apibara/protocol/codec';
4
3
  import Long from 'long';
5
4
  import _m0 from 'protobufjs/minimal.js';
6
5
 
7
6
  const MAX_U64 = 0xffffffffffffffffn;
8
- const _Address = Schema.TemplateLiteral(Schema.Literal("0x"), Schema.String);
9
- const AddressProto = Schema.Struct({
10
- x0: Schema.BigIntFromSelf,
11
- x1: Schema.BigIntFromSelf,
12
- x2: Schema.Number
13
- });
14
- const Address$1 = Schema.transform(AddressProto, _Address, {
15
- decode(value) {
16
- const x0 = value.x0.toString(16).padStart(16, "0");
17
- const x1 = value.x1.toString(16).padStart(16, "0");
18
- const x2 = value.x2.toString(16).padStart(8, "0");
19
- return `0x${x0}${x1}${x2}`;
7
+ const MAX_U32 = 0xffffffffn;
8
+ const Address$1 = {
9
+ encode(x) {
10
+ const bn = BigInt(x);
11
+ const x2 = bn & MAX_U32;
12
+ const x1 = bn >> 32n & MAX_U64;
13
+ const x0 = bn >> 96n & MAX_U64;
14
+ return { x0, x1, x2: Number(x2) };
20
15
  },
21
- encode(value) {
22
- const bytes = hexToBytes(pad(value, { size: 20, dir: "left" }));
23
- const dv = new DataView(bytes.buffer);
24
- const x0 = dv.getBigUint64(0);
25
- const x1 = dv.getBigUint64(8);
26
- const x2 = dv.getUint32(16);
27
- return { x0, x1, x2 };
16
+ decode(p) {
17
+ const x0 = p.x0 ?? 0n;
18
+ const x1 = p.x1 ?? 0n;
19
+ const x2 = BigInt(p.x2 ?? 0);
20
+ const bn = x2 + (x1 << 32n) + (x0 << 96n);
21
+ return `0x${bn.toString(16).padStart(40, "0")}`;
28
22
  }
29
- });
30
- const _B256 = Schema.TemplateLiteral(Schema.Literal("0x"), Schema.String);
31
- const B256Proto = Schema.Struct({
32
- x0: Schema.BigIntFromSelf,
33
- x1: Schema.BigIntFromSelf,
34
- x2: Schema.BigIntFromSelf,
35
- x3: Schema.BigIntFromSelf
36
- });
37
- const B256$1 = Schema.transform(B256Proto, _B256, {
38
- decode(value) {
39
- const x0 = value.x0.toString(16).padStart(16, "0");
40
- const x1 = value.x1.toString(16).padStart(16, "0");
41
- const x2 = value.x2.toString(16).padStart(16, "0");
42
- const x3 = value.x3.toString(16).padStart(16, "0");
43
- return `0x${x0}${x1}${x2}${x3}`;
44
- },
45
- encode(value) {
46
- const bytes = hexToBytes(pad(value, { size: 32, dir: "left" }));
47
- const dv = new DataView(bytes.buffer);
48
- const x0 = dv.getBigUint64(0);
49
- const x1 = dv.getBigUint64(8);
50
- const x2 = dv.getBigUint64(16);
51
- const x3 = dv.getBigUint64(24);
23
+ };
24
+ const B256$1 = {
25
+ encode(x) {
26
+ const bn = BigInt(x);
27
+ const x3 = bn & MAX_U64;
28
+ const x2 = bn >> 64n & MAX_U64;
29
+ const x1 = bn >> 128n & MAX_U64;
30
+ const x0 = bn >> 192n & MAX_U64;
52
31
  return { x0, x1, x2, x3 };
53
- }
54
- });
55
- const b256ToProto = Schema.encodeSync(B256$1);
56
- const b256FromProto = Schema.decodeSync(B256$1);
57
- const U256Proto = Schema.Struct({
58
- x0: Schema.BigIntFromSelf,
59
- x1: Schema.BigIntFromSelf,
60
- x2: Schema.BigIntFromSelf,
61
- x3: Schema.BigIntFromSelf
62
- });
63
- const U256$1 = Schema.transform(U256Proto, Schema.BigIntFromSelf, {
64
- decode(value) {
65
- return (value.x0 << 8n * 24n) + (value.x1 << 8n * 16n) + (value.x2 << 8n * 8n) + value.x3;
66
32
  },
67
- encode(value) {
68
- const x0 = value >> 8n * 24n & MAX_U64;
69
- const x1 = value >> 8n * 16n & MAX_U64;
70
- const x2 = value >> 8n * 8n & MAX_U64;
71
- const x3 = value & MAX_U64;
72
- return { x0, x1, x2, x3 };
33
+ decode(p) {
34
+ const x0 = p.x0 ?? 0n;
35
+ const x1 = p.x1 ?? 0n;
36
+ const x2 = p.x2 ?? 0n;
37
+ const x3 = p.x3 ?? 0n;
38
+ const bn = x3 + (x2 << 64n) + (x1 << 128n) + (x0 << 192n);
39
+ return `0x${bn.toString(16).padStart(64, "0")}`;
73
40
  }
74
- });
75
- const u256ToProto = Schema.encodeSync(U256$1);
76
- const u256FromProto = Schema.decodeSync(U256$1);
77
- const U128Proto = Schema.Struct({
78
- x0: Schema.BigIntFromSelf,
79
- x1: Schema.BigIntFromSelf
80
- });
81
- const U128$1 = Schema.transform(U128Proto, Schema.BigIntFromSelf, {
82
- decode(value) {
83
- return (value.x0 << 8n * 8n) + value.x1;
41
+ };
42
+ const U256$1 = {
43
+ encode(x) {
44
+ const bn = BigInt(x);
45
+ const x3 = bn & MAX_U64;
46
+ const x2 = bn >> 64n & MAX_U64;
47
+ const x1 = bn >> 128n & MAX_U64;
48
+ const x0 = bn >> 192n & MAX_U64;
49
+ return { x0, x1, x2, x3 };
84
50
  },
85
- encode(value) {
86
- const x0 = value >> 8n * 8n & MAX_U64;
87
- const x1 = value & MAX_U64;
51
+ decode(p) {
52
+ const x0 = p.x0 ?? 0n;
53
+ const x1 = p.x1 ?? 0n;
54
+ const x2 = p.x2 ?? 0n;
55
+ const x3 = p.x3 ?? 0n;
56
+ return x3 + (x2 << 64n) + (x1 << 128n) + (x0 << 192n);
57
+ }
58
+ };
59
+ const U128$1 = {
60
+ encode(x) {
61
+ const x1 = x & MAX_U64;
62
+ const x0 = x >> 64n & MAX_U64;
88
63
  return { x0, x1 };
64
+ },
65
+ decode(p) {
66
+ const x0 = p.x0 ?? 0n;
67
+ const x1 = p.x1 ?? 0n;
68
+ return x1 + (x0 << 64n);
89
69
  }
90
- });
91
- const u128ToProto = Schema.encodeSync(U128$1);
92
- const u128FromProto = Schema.decodeSync(U128$1);
70
+ };
93
71
 
94
72
  const protobufPackage$2 = "evm.v2";
95
73
  function createBaseAddress() {
@@ -674,8 +652,143 @@ function transactionStatusToJSON(object) {
674
652
  return "UNRECOGNIZED";
675
653
  }
676
654
  }
655
+ var CallType$1 = /* @__PURE__ */ ((CallType2) => {
656
+ CallType2[CallType2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
657
+ CallType2[CallType2["CALL"] = 1] = "CALL";
658
+ CallType2[CallType2["CALL_CODE"] = 2] = "CALL_CODE";
659
+ CallType2[CallType2["DELEGATE_CALL"] = 3] = "DELEGATE_CALL";
660
+ CallType2[CallType2["STATIC_CALL"] = 4] = "STATIC_CALL";
661
+ CallType2[CallType2["AUTH_CALL"] = 5] = "AUTH_CALL";
662
+ CallType2[CallType2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
663
+ return CallType2;
664
+ })(CallType$1 || {});
665
+ function callTypeFromJSON(object) {
666
+ switch (object) {
667
+ case 0:
668
+ case "CALL_TYPE_UNSPECIFIED":
669
+ return 0 /* UNSPECIFIED */;
670
+ case 1:
671
+ case "CALL_TYPE_CALL":
672
+ return 1 /* CALL */;
673
+ case 2:
674
+ case "CALL_TYPE_CALL_CODE":
675
+ return 2 /* CALL_CODE */;
676
+ case 3:
677
+ case "CALL_TYPE_DELEGATE_CALL":
678
+ return 3 /* DELEGATE_CALL */;
679
+ case 4:
680
+ case "CALL_TYPE_STATIC_CALL":
681
+ return 4 /* STATIC_CALL */;
682
+ case 5:
683
+ case "CALL_TYPE_AUTH_CALL":
684
+ return 5 /* AUTH_CALL */;
685
+ case -1:
686
+ case "UNRECOGNIZED":
687
+ default:
688
+ return -1 /* UNRECOGNIZED */;
689
+ }
690
+ }
691
+ function callTypeToJSON(object) {
692
+ switch (object) {
693
+ case 0 /* UNSPECIFIED */:
694
+ return "CALL_TYPE_UNSPECIFIED";
695
+ case 1 /* CALL */:
696
+ return "CALL_TYPE_CALL";
697
+ case 2 /* CALL_CODE */:
698
+ return "CALL_TYPE_CALL_CODE";
699
+ case 3 /* DELEGATE_CALL */:
700
+ return "CALL_TYPE_DELEGATE_CALL";
701
+ case 4 /* STATIC_CALL */:
702
+ return "CALL_TYPE_STATIC_CALL";
703
+ case 5 /* AUTH_CALL */:
704
+ return "CALL_TYPE_AUTH_CALL";
705
+ case -1 /* UNRECOGNIZED */:
706
+ default:
707
+ return "UNRECOGNIZED";
708
+ }
709
+ }
710
+ var CreationMethod$1 = /* @__PURE__ */ ((CreationMethod2) => {
711
+ CreationMethod2[CreationMethod2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
712
+ CreationMethod2[CreationMethod2["CREATE"] = 1] = "CREATE";
713
+ CreationMethod2[CreationMethod2["CREATE2"] = 2] = "CREATE2";
714
+ CreationMethod2[CreationMethod2["EOF_CREATE"] = 3] = "EOF_CREATE";
715
+ CreationMethod2[CreationMethod2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
716
+ return CreationMethod2;
717
+ })(CreationMethod$1 || {});
718
+ function creationMethodFromJSON(object) {
719
+ switch (object) {
720
+ case 0:
721
+ case "CREATION_METHOD_UNSPECIFIED":
722
+ return 0 /* UNSPECIFIED */;
723
+ case 1:
724
+ case "CREATION_METHOD_CREATE":
725
+ return 1 /* CREATE */;
726
+ case 2:
727
+ case "CREATION_METHOD_CREATE2":
728
+ return 2 /* CREATE2 */;
729
+ case 3:
730
+ case "CREATION_METHOD_EOF_CREATE":
731
+ return 3 /* EOF_CREATE */;
732
+ case -1:
733
+ case "UNRECOGNIZED":
734
+ default:
735
+ return -1 /* UNRECOGNIZED */;
736
+ }
737
+ }
738
+ function creationMethodToJSON(object) {
739
+ switch (object) {
740
+ case 0 /* UNSPECIFIED */:
741
+ return "CREATION_METHOD_UNSPECIFIED";
742
+ case 1 /* CREATE */:
743
+ return "CREATION_METHOD_CREATE";
744
+ case 2 /* CREATE2 */:
745
+ return "CREATION_METHOD_CREATE2";
746
+ case 3 /* EOF_CREATE */:
747
+ return "CREATION_METHOD_EOF_CREATE";
748
+ case -1 /* UNRECOGNIZED */:
749
+ default:
750
+ return "UNRECOGNIZED";
751
+ }
752
+ }
753
+ var RewardType$1 = /* @__PURE__ */ ((RewardType2) => {
754
+ RewardType2[RewardType2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
755
+ RewardType2[RewardType2["BLOCK"] = 1] = "BLOCK";
756
+ RewardType2[RewardType2["UNCLE"] = 2] = "UNCLE";
757
+ RewardType2[RewardType2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
758
+ return RewardType2;
759
+ })(RewardType$1 || {});
760
+ function rewardTypeFromJSON(object) {
761
+ switch (object) {
762
+ case 0:
763
+ case "REWARD_TYPE_UNSPECIFIED":
764
+ return 0 /* UNSPECIFIED */;
765
+ case 1:
766
+ case "REWARD_TYPE_BLOCK":
767
+ return 1 /* BLOCK */;
768
+ case 2:
769
+ case "REWARD_TYPE_UNCLE":
770
+ return 2 /* UNCLE */;
771
+ case -1:
772
+ case "UNRECOGNIZED":
773
+ default:
774
+ return -1 /* UNRECOGNIZED */;
775
+ }
776
+ }
777
+ function rewardTypeToJSON(object) {
778
+ switch (object) {
779
+ case 0 /* UNSPECIFIED */:
780
+ return "REWARD_TYPE_UNSPECIFIED";
781
+ case 1 /* BLOCK */:
782
+ return "REWARD_TYPE_BLOCK";
783
+ case 2 /* UNCLE */:
784
+ return "REWARD_TYPE_UNCLE";
785
+ case -1 /* UNRECOGNIZED */:
786
+ default:
787
+ return "UNRECOGNIZED";
788
+ }
789
+ }
677
790
  function createBaseBlock() {
678
- return { header: void 0, withdrawals: [], transactions: [], receipts: [], logs: [] };
791
+ return { header: void 0, withdrawals: [], transactions: [], receipts: [], logs: [], traces: [] };
679
792
  }
680
793
  const Block$1 = {
681
794
  encode(message, writer = _m0.Writer.create()) {
@@ -702,6 +815,11 @@ const Block$1 = {
702
815
  Log$1.encode(v, writer.uint32(42).fork()).ldelim();
703
816
  }
704
817
  }
818
+ if (message.traces !== void 0 && message.traces.length !== 0) {
819
+ for (const v of message.traces) {
820
+ TransactionTrace$1.encode(v, writer.uint32(50).fork()).ldelim();
821
+ }
822
+ }
705
823
  return writer;
706
824
  },
707
825
  decode(input, length) {
@@ -741,6 +859,12 @@ const Block$1 = {
741
859
  }
742
860
  message.logs.push(Log$1.decode(reader, reader.uint32()));
743
861
  continue;
862
+ case 6:
863
+ if (tag !== 50) {
864
+ break;
865
+ }
866
+ message.traces.push(TransactionTrace$1.decode(reader, reader.uint32()));
867
+ continue;
744
868
  }
745
869
  if ((tag & 7) === 4 || tag === 0) {
746
870
  break;
@@ -755,7 +879,8 @@ const Block$1 = {
755
879
  withdrawals: globalThis.Array.isArray(object?.withdrawals) ? object.withdrawals.map((e) => Withdrawal$1.fromJSON(e)) : [],
756
880
  transactions: globalThis.Array.isArray(object?.transactions) ? object.transactions.map((e) => Transaction$1.fromJSON(e)) : [],
757
881
  receipts: globalThis.Array.isArray(object?.receipts) ? object.receipts.map((e) => TransactionReceipt$1.fromJSON(e)) : [],
758
- logs: globalThis.Array.isArray(object?.logs) ? object.logs.map((e) => Log$1.fromJSON(e)) : []
882
+ logs: globalThis.Array.isArray(object?.logs) ? object.logs.map((e) => Log$1.fromJSON(e)) : [],
883
+ traces: globalThis.Array.isArray(object?.traces) ? object.traces.map((e) => TransactionTrace$1.fromJSON(e)) : []
759
884
  };
760
885
  },
761
886
  toJSON(message) {
@@ -775,6 +900,9 @@ const Block$1 = {
775
900
  if (message.logs?.length) {
776
901
  obj.logs = message.logs.map((e) => Log$1.toJSON(e));
777
902
  }
903
+ if (message.traces?.length) {
904
+ obj.traces = message.traces.map((e) => TransactionTrace$1.toJSON(e));
905
+ }
778
906
  return obj;
779
907
  },
780
908
  create(base) {
@@ -787,6 +915,7 @@ const Block$1 = {
787
915
  message.transactions = object.transactions?.map((e) => Transaction$1.fromPartial(e)) || [];
788
916
  message.receipts = object.receipts?.map((e) => TransactionReceipt$1.fromPartial(e)) || [];
789
917
  message.logs = object.logs?.map((e) => Log$1.fromPartial(e)) || [];
918
+ message.traces = object.traces?.map((e) => TransactionTrace$1.fromPartial(e)) || [];
790
919
  return message;
791
920
  }
792
921
  };
@@ -813,7 +942,8 @@ function createBaseBlockHeader() {
813
942
  totalDifficulty: void 0,
814
943
  blobGasUsed: void 0,
815
944
  excessBlobGas: void 0,
816
- parentBeaconBlockRoot: void 0
945
+ parentBeaconBlockRoot: void 0,
946
+ requestsHash: void 0
817
947
  };
818
948
  }
819
949
  const BlockHeader$1 = {
@@ -890,6 +1020,9 @@ const BlockHeader$1 = {
890
1020
  if (message.parentBeaconBlockRoot !== void 0) {
891
1021
  B256.encode(message.parentBeaconBlockRoot, writer.uint32(178).fork()).ldelim();
892
1022
  }
1023
+ if (message.requestsHash !== void 0) {
1024
+ B256.encode(message.requestsHash, writer.uint32(186).fork()).ldelim();
1025
+ }
893
1026
  return writer;
894
1027
  },
895
1028
  decode(input, length) {
@@ -1031,6 +1164,12 @@ const BlockHeader$1 = {
1031
1164
  }
1032
1165
  message.parentBeaconBlockRoot = B256.decode(reader, reader.uint32());
1033
1166
  continue;
1167
+ case 23:
1168
+ if (tag !== 186) {
1169
+ break;
1170
+ }
1171
+ message.requestsHash = B256.decode(reader, reader.uint32());
1172
+ continue;
1034
1173
  }
1035
1174
  if ((tag & 7) === 4 || tag === 0) {
1036
1175
  break;
@@ -1062,7 +1201,8 @@ const BlockHeader$1 = {
1062
1201
  totalDifficulty: isSet$1(object.totalDifficulty) ? U256.fromJSON(object.totalDifficulty) : void 0,
1063
1202
  blobGasUsed: isSet$1(object.blobGasUsed) ? U128.fromJSON(object.blobGasUsed) : void 0,
1064
1203
  excessBlobGas: isSet$1(object.excessBlobGas) ? U128.fromJSON(object.excessBlobGas) : void 0,
1065
- parentBeaconBlockRoot: isSet$1(object.parentBeaconBlockRoot) ? B256.fromJSON(object.parentBeaconBlockRoot) : void 0
1204
+ parentBeaconBlockRoot: isSet$1(object.parentBeaconBlockRoot) ? B256.fromJSON(object.parentBeaconBlockRoot) : void 0,
1205
+ requestsHash: isSet$1(object.requestsHash) ? B256.fromJSON(object.requestsHash) : void 0
1066
1206
  };
1067
1207
  },
1068
1208
  toJSON(message) {
@@ -1133,6 +1273,9 @@ const BlockHeader$1 = {
1133
1273
  if (message.parentBeaconBlockRoot !== void 0) {
1134
1274
  obj.parentBeaconBlockRoot = B256.toJSON(message.parentBeaconBlockRoot);
1135
1275
  }
1276
+ if (message.requestsHash !== void 0) {
1277
+ obj.requestsHash = B256.toJSON(message.requestsHash);
1278
+ }
1136
1279
  return obj;
1137
1280
  },
1138
1281
  create(base) {
@@ -1162,6 +1305,7 @@ const BlockHeader$1 = {
1162
1305
  message.blobGasUsed = object.blobGasUsed !== void 0 && object.blobGasUsed !== null ? U128.fromPartial(object.blobGasUsed) : void 0;
1163
1306
  message.excessBlobGas = object.excessBlobGas !== void 0 && object.excessBlobGas !== null ? U128.fromPartial(object.excessBlobGas) : void 0;
1164
1307
  message.parentBeaconBlockRoot = object.parentBeaconBlockRoot !== void 0 && object.parentBeaconBlockRoot !== null ? B256.fromPartial(object.parentBeaconBlockRoot) : void 0;
1308
+ message.requestsHash = object.requestsHash !== void 0 && object.requestsHash !== null ? B256.fromPartial(object.requestsHash) : void 0;
1165
1309
  return message;
1166
1310
  }
1167
1311
  };
@@ -2271,80 +2415,949 @@ const AccessListItem$1 = {
2271
2415
  return message;
2272
2416
  }
2273
2417
  };
2274
- function bytesFromBase64(b64) {
2275
- if (globalThis.Buffer) {
2276
- return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
2277
- } else {
2278
- const bin = globalThis.atob(b64);
2279
- const arr = new Uint8Array(bin.length);
2280
- for (let i = 0; i < bin.length; ++i) {
2281
- arr[i] = bin.charCodeAt(i);
2282
- }
2283
- return arr;
2284
- }
2285
- }
2286
- function base64FromBytes(arr) {
2287
- if (globalThis.Buffer) {
2288
- return globalThis.Buffer.from(arr).toString("base64");
2289
- } else {
2290
- const bin = [];
2291
- arr.forEach((byte) => {
2292
- bin.push(globalThis.String.fromCharCode(byte));
2293
- });
2294
- return globalThis.btoa(bin.join(""));
2295
- }
2296
- }
2297
- function toTimestamp(date) {
2298
- const seconds = BigInt(Math.trunc(date.getTime() / 1e3));
2299
- const nanos = date.getTime() % 1e3 * 1e6;
2300
- return { seconds, nanos };
2301
- }
2302
- function fromTimestamp(t) {
2303
- let millis = (globalThis.Number(t.seconds?.toString()) || 0) * 1e3;
2304
- millis += (t.nanos || 0) / 1e6;
2305
- return new globalThis.Date(millis);
2418
+ function createBaseTransactionTrace() {
2419
+ return { filterIds: [], transactionIndex: 0, transactionHash: void 0, traces: [] };
2306
2420
  }
2307
- function fromJsonTimestamp(o) {
2308
- if (o instanceof globalThis.Date) {
2309
- return o;
2310
- } else if (typeof o === "string") {
2311
- return new globalThis.Date(o);
2312
- } else {
2313
- return fromTimestamp(Timestamp.fromJSON(o));
2421
+ const TransactionTrace$1 = {
2422
+ encode(message, writer = _m0.Writer.create()) {
2423
+ if (message.filterIds !== void 0 && message.filterIds.length !== 0) {
2424
+ writer.uint32(10).fork();
2425
+ for (const v of message.filterIds) {
2426
+ writer.uint32(v);
2427
+ }
2428
+ writer.ldelim();
2429
+ }
2430
+ if (message.transactionIndex !== void 0 && message.transactionIndex !== 0) {
2431
+ writer.uint32(16).uint32(message.transactionIndex);
2432
+ }
2433
+ if (message.transactionHash !== void 0) {
2434
+ B256.encode(message.transactionHash, writer.uint32(26).fork()).ldelim();
2435
+ }
2436
+ if (message.traces !== void 0 && message.traces.length !== 0) {
2437
+ for (const v of message.traces) {
2438
+ Trace$1.encode(v, writer.uint32(34).fork()).ldelim();
2439
+ }
2440
+ }
2441
+ return writer;
2442
+ },
2443
+ decode(input, length) {
2444
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
2445
+ let end = length === void 0 ? reader.len : reader.pos + length;
2446
+ const message = createBaseTransactionTrace();
2447
+ while (reader.pos < end) {
2448
+ const tag = reader.uint32();
2449
+ switch (tag >>> 3) {
2450
+ case 1:
2451
+ if (tag === 8) {
2452
+ message.filterIds.push(reader.uint32());
2453
+ continue;
2454
+ }
2455
+ if (tag === 10) {
2456
+ const end2 = reader.uint32() + reader.pos;
2457
+ while (reader.pos < end2) {
2458
+ message.filterIds.push(reader.uint32());
2459
+ }
2460
+ continue;
2461
+ }
2462
+ break;
2463
+ case 2:
2464
+ if (tag !== 16) {
2465
+ break;
2466
+ }
2467
+ message.transactionIndex = reader.uint32();
2468
+ continue;
2469
+ case 3:
2470
+ if (tag !== 26) {
2471
+ break;
2472
+ }
2473
+ message.transactionHash = B256.decode(reader, reader.uint32());
2474
+ continue;
2475
+ case 4:
2476
+ if (tag !== 34) {
2477
+ break;
2478
+ }
2479
+ message.traces.push(Trace$1.decode(reader, reader.uint32()));
2480
+ continue;
2481
+ }
2482
+ if ((tag & 7) === 4 || tag === 0) {
2483
+ break;
2484
+ }
2485
+ reader.skipType(tag & 7);
2486
+ }
2487
+ return message;
2488
+ },
2489
+ fromJSON(object) {
2490
+ return {
2491
+ filterIds: globalThis.Array.isArray(object?.filterIds) ? object.filterIds.map((e) => globalThis.Number(e)) : [],
2492
+ transactionIndex: isSet$1(object.transactionIndex) ? globalThis.Number(object.transactionIndex) : 0,
2493
+ transactionHash: isSet$1(object.transactionHash) ? B256.fromJSON(object.transactionHash) : void 0,
2494
+ traces: globalThis.Array.isArray(object?.traces) ? object.traces.map((e) => Trace$1.fromJSON(e)) : []
2495
+ };
2496
+ },
2497
+ toJSON(message) {
2498
+ const obj = {};
2499
+ if (message.filterIds?.length) {
2500
+ obj.filterIds = message.filterIds.map((e) => Math.round(e));
2501
+ }
2502
+ if (message.transactionIndex !== void 0 && message.transactionIndex !== 0) {
2503
+ obj.transactionIndex = Math.round(message.transactionIndex);
2504
+ }
2505
+ if (message.transactionHash !== void 0) {
2506
+ obj.transactionHash = B256.toJSON(message.transactionHash);
2507
+ }
2508
+ if (message.traces?.length) {
2509
+ obj.traces = message.traces.map((e) => Trace$1.toJSON(e));
2510
+ }
2511
+ return obj;
2512
+ },
2513
+ create(base) {
2514
+ return TransactionTrace$1.fromPartial(base ?? {});
2515
+ },
2516
+ fromPartial(object) {
2517
+ const message = createBaseTransactionTrace();
2518
+ message.filterIds = object.filterIds?.map((e) => e) || [];
2519
+ message.transactionIndex = object.transactionIndex ?? 0;
2520
+ message.transactionHash = object.transactionHash !== void 0 && object.transactionHash !== null ? B256.fromPartial(object.transactionHash) : void 0;
2521
+ message.traces = object.traces?.map((e) => Trace$1.fromPartial(e)) || [];
2522
+ return message;
2314
2523
  }
2315
- }
2316
- function longToBigint(long) {
2317
- return BigInt(long.toString());
2318
- }
2319
- if (_m0.util.Long !== Long) {
2320
- _m0.util.Long = Long;
2321
- _m0.configure();
2322
- }
2323
- function isSet$1(value) {
2324
- return value !== null && value !== void 0;
2325
- }
2326
-
2327
- const data = {
2328
- __proto__: null,
2329
- AccessListItem: AccessListItem$1,
2330
- Block: Block$1,
2331
- BlockHeader: BlockHeader$1,
2332
- Log: Log$1,
2333
- Signature: Signature$1,
2334
- Transaction: Transaction$1,
2335
- TransactionReceipt: TransactionReceipt$1,
2336
- TransactionStatus: TransactionStatus$1,
2337
- Withdrawal: Withdrawal$1,
2338
- protobufPackage: protobufPackage$1,
2339
- transactionStatusFromJSON: transactionStatusFromJSON,
2340
- transactionStatusToJSON: transactionStatusToJSON
2341
2524
  };
2342
-
2343
- const protobufPackage = "evm.v2";
2344
- var HeaderFilter$1 = /* @__PURE__ */ ((HeaderFilter2) => {
2345
- HeaderFilter2[HeaderFilter2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
2346
- HeaderFilter2[HeaderFilter2["ALWAYS"] = 1] = "ALWAYS";
2347
- HeaderFilter2[HeaderFilter2["ON_DATA"] = 2] = "ON_DATA";
2525
+ function createBaseTrace() {
2526
+ return { action: void 0, error: void 0, output: void 0, subtraces: 0, traceAddress: [] };
2527
+ }
2528
+ const Trace$1 = {
2529
+ encode(message, writer = _m0.Writer.create()) {
2530
+ switch (message.action?.$case) {
2531
+ case "call":
2532
+ CallAction$1.encode(message.action.call, writer.uint32(10).fork()).ldelim();
2533
+ break;
2534
+ case "create":
2535
+ CreateAction$1.encode(message.action.create, writer.uint32(18).fork()).ldelim();
2536
+ break;
2537
+ case "selfDestruct":
2538
+ SelfDestructAction$1.encode(message.action.selfDestruct, writer.uint32(26).fork()).ldelim();
2539
+ break;
2540
+ case "reward":
2541
+ RewardAction$1.encode(message.action.reward, writer.uint32(34).fork()).ldelim();
2542
+ break;
2543
+ }
2544
+ if (message.error !== void 0) {
2545
+ writer.uint32(42).string(message.error);
2546
+ }
2547
+ switch (message.output?.$case) {
2548
+ case "callOutput":
2549
+ CallOutput$1.encode(message.output.callOutput, writer.uint32(50).fork()).ldelim();
2550
+ break;
2551
+ case "createOutput":
2552
+ CreateOutput$1.encode(message.output.createOutput, writer.uint32(58).fork()).ldelim();
2553
+ break;
2554
+ }
2555
+ if (message.subtraces !== void 0 && message.subtraces !== 0) {
2556
+ writer.uint32(64).uint32(message.subtraces);
2557
+ }
2558
+ if (message.traceAddress !== void 0 && message.traceAddress.length !== 0) {
2559
+ writer.uint32(74).fork();
2560
+ for (const v of message.traceAddress) {
2561
+ writer.uint32(v);
2562
+ }
2563
+ writer.ldelim();
2564
+ }
2565
+ return writer;
2566
+ },
2567
+ decode(input, length) {
2568
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
2569
+ let end = length === void 0 ? reader.len : reader.pos + length;
2570
+ const message = createBaseTrace();
2571
+ while (reader.pos < end) {
2572
+ const tag = reader.uint32();
2573
+ switch (tag >>> 3) {
2574
+ case 1:
2575
+ if (tag !== 10) {
2576
+ break;
2577
+ }
2578
+ message.action = { $case: "call", call: CallAction$1.decode(reader, reader.uint32()) };
2579
+ continue;
2580
+ case 2:
2581
+ if (tag !== 18) {
2582
+ break;
2583
+ }
2584
+ message.action = { $case: "create", create: CreateAction$1.decode(reader, reader.uint32()) };
2585
+ continue;
2586
+ case 3:
2587
+ if (tag !== 26) {
2588
+ break;
2589
+ }
2590
+ message.action = { $case: "selfDestruct", selfDestruct: SelfDestructAction$1.decode(reader, reader.uint32()) };
2591
+ continue;
2592
+ case 4:
2593
+ if (tag !== 34) {
2594
+ break;
2595
+ }
2596
+ message.action = { $case: "reward", reward: RewardAction$1.decode(reader, reader.uint32()) };
2597
+ continue;
2598
+ case 5:
2599
+ if (tag !== 42) {
2600
+ break;
2601
+ }
2602
+ message.error = reader.string();
2603
+ continue;
2604
+ case 6:
2605
+ if (tag !== 50) {
2606
+ break;
2607
+ }
2608
+ message.output = { $case: "callOutput", callOutput: CallOutput$1.decode(reader, reader.uint32()) };
2609
+ continue;
2610
+ case 7:
2611
+ if (tag !== 58) {
2612
+ break;
2613
+ }
2614
+ message.output = { $case: "createOutput", createOutput: CreateOutput$1.decode(reader, reader.uint32()) };
2615
+ continue;
2616
+ case 8:
2617
+ if (tag !== 64) {
2618
+ break;
2619
+ }
2620
+ message.subtraces = reader.uint32();
2621
+ continue;
2622
+ case 9:
2623
+ if (tag === 72) {
2624
+ message.traceAddress.push(reader.uint32());
2625
+ continue;
2626
+ }
2627
+ if (tag === 74) {
2628
+ const end2 = reader.uint32() + reader.pos;
2629
+ while (reader.pos < end2) {
2630
+ message.traceAddress.push(reader.uint32());
2631
+ }
2632
+ continue;
2633
+ }
2634
+ break;
2635
+ }
2636
+ if ((tag & 7) === 4 || tag === 0) {
2637
+ break;
2638
+ }
2639
+ reader.skipType(tag & 7);
2640
+ }
2641
+ return message;
2642
+ },
2643
+ fromJSON(object) {
2644
+ return {
2645
+ action: isSet$1(object.call) ? { $case: "call", call: CallAction$1.fromJSON(object.call) } : isSet$1(object.create) ? { $case: "create", create: CreateAction$1.fromJSON(object.create) } : isSet$1(object.selfDestruct) ? { $case: "selfDestruct", selfDestruct: SelfDestructAction$1.fromJSON(object.selfDestruct) } : isSet$1(object.reward) ? { $case: "reward", reward: RewardAction$1.fromJSON(object.reward) } : void 0,
2646
+ error: isSet$1(object.error) ? globalThis.String(object.error) : void 0,
2647
+ output: isSet$1(object.callOutput) ? { $case: "callOutput", callOutput: CallOutput$1.fromJSON(object.callOutput) } : isSet$1(object.createOutput) ? { $case: "createOutput", createOutput: CreateOutput$1.fromJSON(object.createOutput) } : void 0,
2648
+ subtraces: isSet$1(object.subtraces) ? globalThis.Number(object.subtraces) : 0,
2649
+ traceAddress: globalThis.Array.isArray(object?.traceAddress) ? object.traceAddress.map((e) => globalThis.Number(e)) : []
2650
+ };
2651
+ },
2652
+ toJSON(message) {
2653
+ const obj = {};
2654
+ if (message.action?.$case === "call") {
2655
+ obj.call = CallAction$1.toJSON(message.action.call);
2656
+ }
2657
+ if (message.action?.$case === "create") {
2658
+ obj.create = CreateAction$1.toJSON(message.action.create);
2659
+ }
2660
+ if (message.action?.$case === "selfDestruct") {
2661
+ obj.selfDestruct = SelfDestructAction$1.toJSON(message.action.selfDestruct);
2662
+ }
2663
+ if (message.action?.$case === "reward") {
2664
+ obj.reward = RewardAction$1.toJSON(message.action.reward);
2665
+ }
2666
+ if (message.error !== void 0) {
2667
+ obj.error = message.error;
2668
+ }
2669
+ if (message.output?.$case === "callOutput") {
2670
+ obj.callOutput = CallOutput$1.toJSON(message.output.callOutput);
2671
+ }
2672
+ if (message.output?.$case === "createOutput") {
2673
+ obj.createOutput = CreateOutput$1.toJSON(message.output.createOutput);
2674
+ }
2675
+ if (message.subtraces !== void 0 && message.subtraces !== 0) {
2676
+ obj.subtraces = Math.round(message.subtraces);
2677
+ }
2678
+ if (message.traceAddress?.length) {
2679
+ obj.traceAddress = message.traceAddress.map((e) => Math.round(e));
2680
+ }
2681
+ return obj;
2682
+ },
2683
+ create(base) {
2684
+ return Trace$1.fromPartial(base ?? {});
2685
+ },
2686
+ fromPartial(object) {
2687
+ const message = createBaseTrace();
2688
+ if (object.action?.$case === "call" && object.action?.call !== void 0 && object.action?.call !== null) {
2689
+ message.action = { $case: "call", call: CallAction$1.fromPartial(object.action.call) };
2690
+ }
2691
+ if (object.action?.$case === "create" && object.action?.create !== void 0 && object.action?.create !== null) {
2692
+ message.action = { $case: "create", create: CreateAction$1.fromPartial(object.action.create) };
2693
+ }
2694
+ if (object.action?.$case === "selfDestruct" && object.action?.selfDestruct !== void 0 && object.action?.selfDestruct !== null) {
2695
+ message.action = {
2696
+ $case: "selfDestruct",
2697
+ selfDestruct: SelfDestructAction$1.fromPartial(object.action.selfDestruct)
2698
+ };
2699
+ }
2700
+ if (object.action?.$case === "reward" && object.action?.reward !== void 0 && object.action?.reward !== null) {
2701
+ message.action = { $case: "reward", reward: RewardAction$1.fromPartial(object.action.reward) };
2702
+ }
2703
+ message.error = object.error ?? void 0;
2704
+ if (object.output?.$case === "callOutput" && object.output?.callOutput !== void 0 && object.output?.callOutput !== null) {
2705
+ message.output = { $case: "callOutput", callOutput: CallOutput$1.fromPartial(object.output.callOutput) };
2706
+ }
2707
+ if (object.output?.$case === "createOutput" && object.output?.createOutput !== void 0 && object.output?.createOutput !== null) {
2708
+ message.output = { $case: "createOutput", createOutput: CreateOutput$1.fromPartial(object.output.createOutput) };
2709
+ }
2710
+ message.subtraces = object.subtraces ?? 0;
2711
+ message.traceAddress = object.traceAddress?.map((e) => e) || [];
2712
+ return message;
2713
+ }
2714
+ };
2715
+ function createBaseCallAction() {
2716
+ return {
2717
+ fromAddress: void 0,
2718
+ type: 0,
2719
+ gas: BigInt("0"),
2720
+ input: new Uint8Array(0),
2721
+ toAddress: void 0,
2722
+ value: void 0
2723
+ };
2724
+ }
2725
+ const CallAction$1 = {
2726
+ encode(message, writer = _m0.Writer.create()) {
2727
+ if (message.fromAddress !== void 0) {
2728
+ Address.encode(message.fromAddress, writer.uint32(10).fork()).ldelim();
2729
+ }
2730
+ if (message.type !== void 0 && message.type !== 0) {
2731
+ writer.uint32(16).int32(message.type);
2732
+ }
2733
+ if (message.gas !== void 0 && message.gas !== BigInt("0")) {
2734
+ if (BigInt.asUintN(64, message.gas) !== message.gas) {
2735
+ throw new globalThis.Error("value provided for field message.gas of type uint64 too large");
2736
+ }
2737
+ writer.uint32(24).uint64(message.gas.toString());
2738
+ }
2739
+ if (message.input !== void 0 && message.input.length !== 0) {
2740
+ writer.uint32(34).bytes(message.input);
2741
+ }
2742
+ if (message.toAddress !== void 0) {
2743
+ Address.encode(message.toAddress, writer.uint32(42).fork()).ldelim();
2744
+ }
2745
+ if (message.value !== void 0) {
2746
+ U256.encode(message.value, writer.uint32(50).fork()).ldelim();
2747
+ }
2748
+ return writer;
2749
+ },
2750
+ decode(input, length) {
2751
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
2752
+ let end = length === void 0 ? reader.len : reader.pos + length;
2753
+ const message = createBaseCallAction();
2754
+ while (reader.pos < end) {
2755
+ const tag = reader.uint32();
2756
+ switch (tag >>> 3) {
2757
+ case 1:
2758
+ if (tag !== 10) {
2759
+ break;
2760
+ }
2761
+ message.fromAddress = Address.decode(reader, reader.uint32());
2762
+ continue;
2763
+ case 2:
2764
+ if (tag !== 16) {
2765
+ break;
2766
+ }
2767
+ message.type = reader.int32();
2768
+ continue;
2769
+ case 3:
2770
+ if (tag !== 24) {
2771
+ break;
2772
+ }
2773
+ message.gas = longToBigint(reader.uint64());
2774
+ continue;
2775
+ case 4:
2776
+ if (tag !== 34) {
2777
+ break;
2778
+ }
2779
+ message.input = reader.bytes();
2780
+ continue;
2781
+ case 5:
2782
+ if (tag !== 42) {
2783
+ break;
2784
+ }
2785
+ message.toAddress = Address.decode(reader, reader.uint32());
2786
+ continue;
2787
+ case 6:
2788
+ if (tag !== 50) {
2789
+ break;
2790
+ }
2791
+ message.value = U256.decode(reader, reader.uint32());
2792
+ continue;
2793
+ }
2794
+ if ((tag & 7) === 4 || tag === 0) {
2795
+ break;
2796
+ }
2797
+ reader.skipType(tag & 7);
2798
+ }
2799
+ return message;
2800
+ },
2801
+ fromJSON(object) {
2802
+ return {
2803
+ fromAddress: isSet$1(object.fromAddress) ? Address.fromJSON(object.fromAddress) : void 0,
2804
+ type: isSet$1(object.type) ? callTypeFromJSON(object.type) : 0,
2805
+ gas: isSet$1(object.gas) ? BigInt(object.gas) : BigInt("0"),
2806
+ input: isSet$1(object.input) ? bytesFromBase64(object.input) : new Uint8Array(0),
2807
+ toAddress: isSet$1(object.toAddress) ? Address.fromJSON(object.toAddress) : void 0,
2808
+ value: isSet$1(object.value) ? U256.fromJSON(object.value) : void 0
2809
+ };
2810
+ },
2811
+ toJSON(message) {
2812
+ const obj = {};
2813
+ if (message.fromAddress !== void 0) {
2814
+ obj.fromAddress = Address.toJSON(message.fromAddress);
2815
+ }
2816
+ if (message.type !== void 0 && message.type !== 0) {
2817
+ obj.type = callTypeToJSON(message.type);
2818
+ }
2819
+ if (message.gas !== void 0 && message.gas !== BigInt("0")) {
2820
+ obj.gas = message.gas.toString();
2821
+ }
2822
+ if (message.input !== void 0 && message.input.length !== 0) {
2823
+ obj.input = base64FromBytes(message.input);
2824
+ }
2825
+ if (message.toAddress !== void 0) {
2826
+ obj.toAddress = Address.toJSON(message.toAddress);
2827
+ }
2828
+ if (message.value !== void 0) {
2829
+ obj.value = U256.toJSON(message.value);
2830
+ }
2831
+ return obj;
2832
+ },
2833
+ create(base) {
2834
+ return CallAction$1.fromPartial(base ?? {});
2835
+ },
2836
+ fromPartial(object) {
2837
+ const message = createBaseCallAction();
2838
+ message.fromAddress = object.fromAddress !== void 0 && object.fromAddress !== null ? Address.fromPartial(object.fromAddress) : void 0;
2839
+ message.type = object.type ?? 0;
2840
+ message.gas = object.gas ?? BigInt("0");
2841
+ message.input = object.input ?? new Uint8Array(0);
2842
+ message.toAddress = object.toAddress !== void 0 && object.toAddress !== null ? Address.fromPartial(object.toAddress) : void 0;
2843
+ message.value = object.value !== void 0 && object.value !== null ? U256.fromPartial(object.value) : void 0;
2844
+ return message;
2845
+ }
2846
+ };
2847
+ function createBaseCreateAction() {
2848
+ return { fromAddress: void 0, gas: BigInt("0"), init: new Uint8Array(0), value: void 0, creationMethod: 0 };
2849
+ }
2850
+ const CreateAction$1 = {
2851
+ encode(message, writer = _m0.Writer.create()) {
2852
+ if (message.fromAddress !== void 0) {
2853
+ Address.encode(message.fromAddress, writer.uint32(10).fork()).ldelim();
2854
+ }
2855
+ if (message.gas !== void 0 && message.gas !== BigInt("0")) {
2856
+ if (BigInt.asUintN(64, message.gas) !== message.gas) {
2857
+ throw new globalThis.Error("value provided for field message.gas of type uint64 too large");
2858
+ }
2859
+ writer.uint32(16).uint64(message.gas.toString());
2860
+ }
2861
+ if (message.init !== void 0 && message.init.length !== 0) {
2862
+ writer.uint32(26).bytes(message.init);
2863
+ }
2864
+ if (message.value !== void 0) {
2865
+ U256.encode(message.value, writer.uint32(34).fork()).ldelim();
2866
+ }
2867
+ if (message.creationMethod !== void 0 && message.creationMethod !== 0) {
2868
+ writer.uint32(40).int32(message.creationMethod);
2869
+ }
2870
+ return writer;
2871
+ },
2872
+ decode(input, length) {
2873
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
2874
+ let end = length === void 0 ? reader.len : reader.pos + length;
2875
+ const message = createBaseCreateAction();
2876
+ while (reader.pos < end) {
2877
+ const tag = reader.uint32();
2878
+ switch (tag >>> 3) {
2879
+ case 1:
2880
+ if (tag !== 10) {
2881
+ break;
2882
+ }
2883
+ message.fromAddress = Address.decode(reader, reader.uint32());
2884
+ continue;
2885
+ case 2:
2886
+ if (tag !== 16) {
2887
+ break;
2888
+ }
2889
+ message.gas = longToBigint(reader.uint64());
2890
+ continue;
2891
+ case 3:
2892
+ if (tag !== 26) {
2893
+ break;
2894
+ }
2895
+ message.init = reader.bytes();
2896
+ continue;
2897
+ case 4:
2898
+ if (tag !== 34) {
2899
+ break;
2900
+ }
2901
+ message.value = U256.decode(reader, reader.uint32());
2902
+ continue;
2903
+ case 5:
2904
+ if (tag !== 40) {
2905
+ break;
2906
+ }
2907
+ message.creationMethod = reader.int32();
2908
+ continue;
2909
+ }
2910
+ if ((tag & 7) === 4 || tag === 0) {
2911
+ break;
2912
+ }
2913
+ reader.skipType(tag & 7);
2914
+ }
2915
+ return message;
2916
+ },
2917
+ fromJSON(object) {
2918
+ return {
2919
+ fromAddress: isSet$1(object.fromAddress) ? Address.fromJSON(object.fromAddress) : void 0,
2920
+ gas: isSet$1(object.gas) ? BigInt(object.gas) : BigInt("0"),
2921
+ init: isSet$1(object.init) ? bytesFromBase64(object.init) : new Uint8Array(0),
2922
+ value: isSet$1(object.value) ? U256.fromJSON(object.value) : void 0,
2923
+ creationMethod: isSet$1(object.creationMethod) ? creationMethodFromJSON(object.creationMethod) : 0
2924
+ };
2925
+ },
2926
+ toJSON(message) {
2927
+ const obj = {};
2928
+ if (message.fromAddress !== void 0) {
2929
+ obj.fromAddress = Address.toJSON(message.fromAddress);
2930
+ }
2931
+ if (message.gas !== void 0 && message.gas !== BigInt("0")) {
2932
+ obj.gas = message.gas.toString();
2933
+ }
2934
+ if (message.init !== void 0 && message.init.length !== 0) {
2935
+ obj.init = base64FromBytes(message.init);
2936
+ }
2937
+ if (message.value !== void 0) {
2938
+ obj.value = U256.toJSON(message.value);
2939
+ }
2940
+ if (message.creationMethod !== void 0 && message.creationMethod !== 0) {
2941
+ obj.creationMethod = creationMethodToJSON(message.creationMethod);
2942
+ }
2943
+ return obj;
2944
+ },
2945
+ create(base) {
2946
+ return CreateAction$1.fromPartial(base ?? {});
2947
+ },
2948
+ fromPartial(object) {
2949
+ const message = createBaseCreateAction();
2950
+ message.fromAddress = object.fromAddress !== void 0 && object.fromAddress !== null ? Address.fromPartial(object.fromAddress) : void 0;
2951
+ message.gas = object.gas ?? BigInt("0");
2952
+ message.init = object.init ?? new Uint8Array(0);
2953
+ message.value = object.value !== void 0 && object.value !== null ? U256.fromPartial(object.value) : void 0;
2954
+ message.creationMethod = object.creationMethod ?? 0;
2955
+ return message;
2956
+ }
2957
+ };
2958
+ function createBaseSelfDestructAction() {
2959
+ return { address: void 0, balance: void 0, refundAddress: void 0 };
2960
+ }
2961
+ const SelfDestructAction$1 = {
2962
+ encode(message, writer = _m0.Writer.create()) {
2963
+ if (message.address !== void 0) {
2964
+ Address.encode(message.address, writer.uint32(10).fork()).ldelim();
2965
+ }
2966
+ if (message.balance !== void 0) {
2967
+ U256.encode(message.balance, writer.uint32(18).fork()).ldelim();
2968
+ }
2969
+ if (message.refundAddress !== void 0) {
2970
+ Address.encode(message.refundAddress, writer.uint32(26).fork()).ldelim();
2971
+ }
2972
+ return writer;
2973
+ },
2974
+ decode(input, length) {
2975
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
2976
+ let end = length === void 0 ? reader.len : reader.pos + length;
2977
+ const message = createBaseSelfDestructAction();
2978
+ while (reader.pos < end) {
2979
+ const tag = reader.uint32();
2980
+ switch (tag >>> 3) {
2981
+ case 1:
2982
+ if (tag !== 10) {
2983
+ break;
2984
+ }
2985
+ message.address = Address.decode(reader, reader.uint32());
2986
+ continue;
2987
+ case 2:
2988
+ if (tag !== 18) {
2989
+ break;
2990
+ }
2991
+ message.balance = U256.decode(reader, reader.uint32());
2992
+ continue;
2993
+ case 3:
2994
+ if (tag !== 26) {
2995
+ break;
2996
+ }
2997
+ message.refundAddress = Address.decode(reader, reader.uint32());
2998
+ continue;
2999
+ }
3000
+ if ((tag & 7) === 4 || tag === 0) {
3001
+ break;
3002
+ }
3003
+ reader.skipType(tag & 7);
3004
+ }
3005
+ return message;
3006
+ },
3007
+ fromJSON(object) {
3008
+ return {
3009
+ address: isSet$1(object.address) ? Address.fromJSON(object.address) : void 0,
3010
+ balance: isSet$1(object.balance) ? U256.fromJSON(object.balance) : void 0,
3011
+ refundAddress: isSet$1(object.refundAddress) ? Address.fromJSON(object.refundAddress) : void 0
3012
+ };
3013
+ },
3014
+ toJSON(message) {
3015
+ const obj = {};
3016
+ if (message.address !== void 0) {
3017
+ obj.address = Address.toJSON(message.address);
3018
+ }
3019
+ if (message.balance !== void 0) {
3020
+ obj.balance = U256.toJSON(message.balance);
3021
+ }
3022
+ if (message.refundAddress !== void 0) {
3023
+ obj.refundAddress = Address.toJSON(message.refundAddress);
3024
+ }
3025
+ return obj;
3026
+ },
3027
+ create(base) {
3028
+ return SelfDestructAction$1.fromPartial(base ?? {});
3029
+ },
3030
+ fromPartial(object) {
3031
+ const message = createBaseSelfDestructAction();
3032
+ message.address = object.address !== void 0 && object.address !== null ? Address.fromPartial(object.address) : void 0;
3033
+ message.balance = object.balance !== void 0 && object.balance !== null ? U256.fromPartial(object.balance) : void 0;
3034
+ message.refundAddress = object.refundAddress !== void 0 && object.refundAddress !== null ? Address.fromPartial(object.refundAddress) : void 0;
3035
+ return message;
3036
+ }
3037
+ };
3038
+ function createBaseRewardAction() {
3039
+ return { author: void 0, type: 0, value: void 0 };
3040
+ }
3041
+ const RewardAction$1 = {
3042
+ encode(message, writer = _m0.Writer.create()) {
3043
+ if (message.author !== void 0) {
3044
+ Address.encode(message.author, writer.uint32(10).fork()).ldelim();
3045
+ }
3046
+ if (message.type !== void 0 && message.type !== 0) {
3047
+ writer.uint32(16).int32(message.type);
3048
+ }
3049
+ if (message.value !== void 0) {
3050
+ U256.encode(message.value, writer.uint32(26).fork()).ldelim();
3051
+ }
3052
+ return writer;
3053
+ },
3054
+ decode(input, length) {
3055
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
3056
+ let end = length === void 0 ? reader.len : reader.pos + length;
3057
+ const message = createBaseRewardAction();
3058
+ while (reader.pos < end) {
3059
+ const tag = reader.uint32();
3060
+ switch (tag >>> 3) {
3061
+ case 1:
3062
+ if (tag !== 10) {
3063
+ break;
3064
+ }
3065
+ message.author = Address.decode(reader, reader.uint32());
3066
+ continue;
3067
+ case 2:
3068
+ if (tag !== 16) {
3069
+ break;
3070
+ }
3071
+ message.type = reader.int32();
3072
+ continue;
3073
+ case 3:
3074
+ if (tag !== 26) {
3075
+ break;
3076
+ }
3077
+ message.value = U256.decode(reader, reader.uint32());
3078
+ continue;
3079
+ }
3080
+ if ((tag & 7) === 4 || tag === 0) {
3081
+ break;
3082
+ }
3083
+ reader.skipType(tag & 7);
3084
+ }
3085
+ return message;
3086
+ },
3087
+ fromJSON(object) {
3088
+ return {
3089
+ author: isSet$1(object.author) ? Address.fromJSON(object.author) : void 0,
3090
+ type: isSet$1(object.type) ? rewardTypeFromJSON(object.type) : 0,
3091
+ value: isSet$1(object.value) ? U256.fromJSON(object.value) : void 0
3092
+ };
3093
+ },
3094
+ toJSON(message) {
3095
+ const obj = {};
3096
+ if (message.author !== void 0) {
3097
+ obj.author = Address.toJSON(message.author);
3098
+ }
3099
+ if (message.type !== void 0 && message.type !== 0) {
3100
+ obj.type = rewardTypeToJSON(message.type);
3101
+ }
3102
+ if (message.value !== void 0) {
3103
+ obj.value = U256.toJSON(message.value);
3104
+ }
3105
+ return obj;
3106
+ },
3107
+ create(base) {
3108
+ return RewardAction$1.fromPartial(base ?? {});
3109
+ },
3110
+ fromPartial(object) {
3111
+ const message = createBaseRewardAction();
3112
+ message.author = object.author !== void 0 && object.author !== null ? Address.fromPartial(object.author) : void 0;
3113
+ message.type = object.type ?? 0;
3114
+ message.value = object.value !== void 0 && object.value !== null ? U256.fromPartial(object.value) : void 0;
3115
+ return message;
3116
+ }
3117
+ };
3118
+ function createBaseCallOutput() {
3119
+ return { gasUsed: BigInt("0"), output: new Uint8Array(0) };
3120
+ }
3121
+ const CallOutput$1 = {
3122
+ encode(message, writer = _m0.Writer.create()) {
3123
+ if (message.gasUsed !== void 0 && message.gasUsed !== BigInt("0")) {
3124
+ if (BigInt.asUintN(64, message.gasUsed) !== message.gasUsed) {
3125
+ throw new globalThis.Error("value provided for field message.gasUsed of type uint64 too large");
3126
+ }
3127
+ writer.uint32(8).uint64(message.gasUsed.toString());
3128
+ }
3129
+ if (message.output !== void 0 && message.output.length !== 0) {
3130
+ writer.uint32(18).bytes(message.output);
3131
+ }
3132
+ return writer;
3133
+ },
3134
+ decode(input, length) {
3135
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
3136
+ let end = length === void 0 ? reader.len : reader.pos + length;
3137
+ const message = createBaseCallOutput();
3138
+ while (reader.pos < end) {
3139
+ const tag = reader.uint32();
3140
+ switch (tag >>> 3) {
3141
+ case 1:
3142
+ if (tag !== 8) {
3143
+ break;
3144
+ }
3145
+ message.gasUsed = longToBigint(reader.uint64());
3146
+ continue;
3147
+ case 2:
3148
+ if (tag !== 18) {
3149
+ break;
3150
+ }
3151
+ message.output = reader.bytes();
3152
+ continue;
3153
+ }
3154
+ if ((tag & 7) === 4 || tag === 0) {
3155
+ break;
3156
+ }
3157
+ reader.skipType(tag & 7);
3158
+ }
3159
+ return message;
3160
+ },
3161
+ fromJSON(object) {
3162
+ return {
3163
+ gasUsed: isSet$1(object.gasUsed) ? BigInt(object.gasUsed) : BigInt("0"),
3164
+ output: isSet$1(object.output) ? bytesFromBase64(object.output) : new Uint8Array(0)
3165
+ };
3166
+ },
3167
+ toJSON(message) {
3168
+ const obj = {};
3169
+ if (message.gasUsed !== void 0 && message.gasUsed !== BigInt("0")) {
3170
+ obj.gasUsed = message.gasUsed.toString();
3171
+ }
3172
+ if (message.output !== void 0 && message.output.length !== 0) {
3173
+ obj.output = base64FromBytes(message.output);
3174
+ }
3175
+ return obj;
3176
+ },
3177
+ create(base) {
3178
+ return CallOutput$1.fromPartial(base ?? {});
3179
+ },
3180
+ fromPartial(object) {
3181
+ const message = createBaseCallOutput();
3182
+ message.gasUsed = object.gasUsed ?? BigInt("0");
3183
+ message.output = object.output ?? new Uint8Array(0);
3184
+ return message;
3185
+ }
3186
+ };
3187
+ function createBaseCreateOutput() {
3188
+ return { address: void 0, code: new Uint8Array(0), gasUsed: BigInt("0") };
3189
+ }
3190
+ const CreateOutput$1 = {
3191
+ encode(message, writer = _m0.Writer.create()) {
3192
+ if (message.address !== void 0) {
3193
+ Address.encode(message.address, writer.uint32(10).fork()).ldelim();
3194
+ }
3195
+ if (message.code !== void 0 && message.code.length !== 0) {
3196
+ writer.uint32(18).bytes(message.code);
3197
+ }
3198
+ if (message.gasUsed !== void 0 && message.gasUsed !== BigInt("0")) {
3199
+ if (BigInt.asUintN(64, message.gasUsed) !== message.gasUsed) {
3200
+ throw new globalThis.Error("value provided for field message.gasUsed of type uint64 too large");
3201
+ }
3202
+ writer.uint32(24).uint64(message.gasUsed.toString());
3203
+ }
3204
+ return writer;
3205
+ },
3206
+ decode(input, length) {
3207
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
3208
+ let end = length === void 0 ? reader.len : reader.pos + length;
3209
+ const message = createBaseCreateOutput();
3210
+ while (reader.pos < end) {
3211
+ const tag = reader.uint32();
3212
+ switch (tag >>> 3) {
3213
+ case 1:
3214
+ if (tag !== 10) {
3215
+ break;
3216
+ }
3217
+ message.address = Address.decode(reader, reader.uint32());
3218
+ continue;
3219
+ case 2:
3220
+ if (tag !== 18) {
3221
+ break;
3222
+ }
3223
+ message.code = reader.bytes();
3224
+ continue;
3225
+ case 3:
3226
+ if (tag !== 24) {
3227
+ break;
3228
+ }
3229
+ message.gasUsed = longToBigint(reader.uint64());
3230
+ continue;
3231
+ }
3232
+ if ((tag & 7) === 4 || tag === 0) {
3233
+ break;
3234
+ }
3235
+ reader.skipType(tag & 7);
3236
+ }
3237
+ return message;
3238
+ },
3239
+ fromJSON(object) {
3240
+ return {
3241
+ address: isSet$1(object.address) ? Address.fromJSON(object.address) : void 0,
3242
+ code: isSet$1(object.code) ? bytesFromBase64(object.code) : new Uint8Array(0),
3243
+ gasUsed: isSet$1(object.gasUsed) ? BigInt(object.gasUsed) : BigInt("0")
3244
+ };
3245
+ },
3246
+ toJSON(message) {
3247
+ const obj = {};
3248
+ if (message.address !== void 0) {
3249
+ obj.address = Address.toJSON(message.address);
3250
+ }
3251
+ if (message.code !== void 0 && message.code.length !== 0) {
3252
+ obj.code = base64FromBytes(message.code);
3253
+ }
3254
+ if (message.gasUsed !== void 0 && message.gasUsed !== BigInt("0")) {
3255
+ obj.gasUsed = message.gasUsed.toString();
3256
+ }
3257
+ return obj;
3258
+ },
3259
+ create(base) {
3260
+ return CreateOutput$1.fromPartial(base ?? {});
3261
+ },
3262
+ fromPartial(object) {
3263
+ const message = createBaseCreateOutput();
3264
+ message.address = object.address !== void 0 && object.address !== null ? Address.fromPartial(object.address) : void 0;
3265
+ message.code = object.code ?? new Uint8Array(0);
3266
+ message.gasUsed = object.gasUsed ?? BigInt("0");
3267
+ return message;
3268
+ }
3269
+ };
3270
+ function bytesFromBase64(b64) {
3271
+ if (globalThis.Buffer) {
3272
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
3273
+ } else {
3274
+ const bin = globalThis.atob(b64);
3275
+ const arr = new Uint8Array(bin.length);
3276
+ for (let i = 0; i < bin.length; ++i) {
3277
+ arr[i] = bin.charCodeAt(i);
3278
+ }
3279
+ return arr;
3280
+ }
3281
+ }
3282
+ function base64FromBytes(arr) {
3283
+ if (globalThis.Buffer) {
3284
+ return globalThis.Buffer.from(arr).toString("base64");
3285
+ } else {
3286
+ const bin = [];
3287
+ arr.forEach((byte) => {
3288
+ bin.push(globalThis.String.fromCharCode(byte));
3289
+ });
3290
+ return globalThis.btoa(bin.join(""));
3291
+ }
3292
+ }
3293
+ function toTimestamp(date) {
3294
+ const seconds = BigInt(Math.trunc(date.getTime() / 1e3));
3295
+ const nanos = date.getTime() % 1e3 * 1e6;
3296
+ return { seconds, nanos };
3297
+ }
3298
+ function fromTimestamp(t) {
3299
+ let millis = (globalThis.Number(t.seconds?.toString()) || 0) * 1e3;
3300
+ millis += (t.nanos || 0) / 1e6;
3301
+ return new globalThis.Date(millis);
3302
+ }
3303
+ function fromJsonTimestamp(o) {
3304
+ if (o instanceof globalThis.Date) {
3305
+ return o;
3306
+ } else if (typeof o === "string") {
3307
+ return new globalThis.Date(o);
3308
+ } else {
3309
+ return fromTimestamp(Timestamp.fromJSON(o));
3310
+ }
3311
+ }
3312
+ function longToBigint(long) {
3313
+ return BigInt(long.toString());
3314
+ }
3315
+ if (_m0.util.Long !== Long) {
3316
+ _m0.util.Long = Long;
3317
+ _m0.configure();
3318
+ }
3319
+ function isSet$1(value) {
3320
+ return value !== null && value !== void 0;
3321
+ }
3322
+
3323
+ const data = {
3324
+ __proto__: null,
3325
+ AccessListItem: AccessListItem$1,
3326
+ Block: Block$1,
3327
+ BlockHeader: BlockHeader$1,
3328
+ CallAction: CallAction$1,
3329
+ CallOutput: CallOutput$1,
3330
+ CallType: CallType$1,
3331
+ CreateAction: CreateAction$1,
3332
+ CreateOutput: CreateOutput$1,
3333
+ CreationMethod: CreationMethod$1,
3334
+ Log: Log$1,
3335
+ RewardAction: RewardAction$1,
3336
+ RewardType: RewardType$1,
3337
+ SelfDestructAction: SelfDestructAction$1,
3338
+ Signature: Signature$1,
3339
+ Trace: Trace$1,
3340
+ Transaction: Transaction$1,
3341
+ TransactionReceipt: TransactionReceipt$1,
3342
+ TransactionStatus: TransactionStatus$1,
3343
+ TransactionTrace: TransactionTrace$1,
3344
+ Withdrawal: Withdrawal$1,
3345
+ callTypeFromJSON: callTypeFromJSON,
3346
+ callTypeToJSON: callTypeToJSON,
3347
+ creationMethodFromJSON: creationMethodFromJSON,
3348
+ creationMethodToJSON: creationMethodToJSON,
3349
+ protobufPackage: protobufPackage$1,
3350
+ rewardTypeFromJSON: rewardTypeFromJSON,
3351
+ rewardTypeToJSON: rewardTypeToJSON,
3352
+ transactionStatusFromJSON: transactionStatusFromJSON,
3353
+ transactionStatusToJSON: transactionStatusToJSON
3354
+ };
3355
+
3356
+ const protobufPackage = "evm.v2";
3357
+ var HeaderFilter$1 = /* @__PURE__ */ ((HeaderFilter2) => {
3358
+ HeaderFilter2[HeaderFilter2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
3359
+ HeaderFilter2[HeaderFilter2["ALWAYS"] = 1] = "ALWAYS";
3360
+ HeaderFilter2[HeaderFilter2["ON_DATA"] = 2] = "ON_DATA";
2348
3361
  HeaderFilter2[HeaderFilter2["ON_DATA_OR_ON_NEW_BLOCK"] = 3] = "ON_DATA_OR_ON_NEW_BLOCK";
2349
3362
  HeaderFilter2[HeaderFilter2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
2350
3363
  return HeaderFilter2;
@@ -2615,7 +3628,8 @@ function createBaseTransactionFilter() {
2615
3628
  create: void 0,
2616
3629
  transactionStatus: void 0,
2617
3630
  includeReceipt: void 0,
2618
- includeLogs: void 0
3631
+ includeLogs: void 0,
3632
+ includeTransactionTrace: void 0
2619
3633
  };
2620
3634
  }
2621
3635
  const TransactionFilter$1 = {
@@ -2641,6 +3655,9 @@ const TransactionFilter$1 = {
2641
3655
  if (message.includeLogs !== void 0) {
2642
3656
  writer.uint32(56).bool(message.includeLogs);
2643
3657
  }
3658
+ if (message.includeTransactionTrace !== void 0) {
3659
+ writer.uint32(64).bool(message.includeTransactionTrace);
3660
+ }
2644
3661
  return writer;
2645
3662
  },
2646
3663
  decode(input, length) {
@@ -2692,6 +3709,12 @@ const TransactionFilter$1 = {
2692
3709
  }
2693
3710
  message.includeLogs = reader.bool();
2694
3711
  continue;
3712
+ case 8:
3713
+ if (tag !== 64) {
3714
+ break;
3715
+ }
3716
+ message.includeTransactionTrace = reader.bool();
3717
+ continue;
2695
3718
  }
2696
3719
  if ((tag & 7) === 4 || tag === 0) {
2697
3720
  break;
@@ -2708,7 +3731,8 @@ const TransactionFilter$1 = {
2708
3731
  create: isSet(object.create) ? globalThis.Boolean(object.create) : void 0,
2709
3732
  transactionStatus: isSet(object.transactionStatus) ? transactionStatusFilterFromJSON(object.transactionStatus) : void 0,
2710
3733
  includeReceipt: isSet(object.includeReceipt) ? globalThis.Boolean(object.includeReceipt) : void 0,
2711
- includeLogs: isSet(object.includeLogs) ? globalThis.Boolean(object.includeLogs) : void 0
3734
+ includeLogs: isSet(object.includeLogs) ? globalThis.Boolean(object.includeLogs) : void 0,
3735
+ includeTransactionTrace: isSet(object.includeTransactionTrace) ? globalThis.Boolean(object.includeTransactionTrace) : void 0
2712
3736
  };
2713
3737
  },
2714
3738
  toJSON(message) {
@@ -2734,6 +3758,9 @@ const TransactionFilter$1 = {
2734
3758
  if (message.includeLogs !== void 0) {
2735
3759
  obj.includeLogs = message.includeLogs;
2736
3760
  }
3761
+ if (message.includeTransactionTrace !== void 0) {
3762
+ obj.includeTransactionTrace = message.includeTransactionTrace;
3763
+ }
2737
3764
  return obj;
2738
3765
  },
2739
3766
  create(base) {
@@ -2748,6 +3775,7 @@ const TransactionFilter$1 = {
2748
3775
  message.transactionStatus = object.transactionStatus ?? void 0;
2749
3776
  message.includeReceipt = object.includeReceipt ?? void 0;
2750
3777
  message.includeLogs = object.includeLogs ?? void 0;
3778
+ message.includeTransactionTrace = object.includeTransactionTrace ?? void 0;
2751
3779
  return message;
2752
3780
  }
2753
3781
  };
@@ -2760,7 +3788,8 @@ function createBaseLogFilter() {
2760
3788
  transactionStatus: void 0,
2761
3789
  includeTransaction: void 0,
2762
3790
  includeReceipt: void 0,
2763
- includeSiblings: void 0
3791
+ includeSiblings: void 0,
3792
+ includeTransactionTrace: void 0
2764
3793
  };
2765
3794
  }
2766
3795
  const LogFilter$1 = {
@@ -2791,6 +3820,9 @@ const LogFilter$1 = {
2791
3820
  if (message.includeSiblings !== void 0) {
2792
3821
  writer.uint32(64).bool(message.includeSiblings);
2793
3822
  }
3823
+ if (message.includeTransactionTrace !== void 0) {
3824
+ writer.uint32(72).bool(message.includeTransactionTrace);
3825
+ }
2794
3826
  return writer;
2795
3827
  },
2796
3828
  decode(input, length) {
@@ -2848,6 +3880,12 @@ const LogFilter$1 = {
2848
3880
  }
2849
3881
  message.includeSiblings = reader.bool();
2850
3882
  continue;
3883
+ case 9:
3884
+ if (tag !== 72) {
3885
+ break;
3886
+ }
3887
+ message.includeTransactionTrace = reader.bool();
3888
+ continue;
2851
3889
  }
2852
3890
  if ((tag & 7) === 4 || tag === 0) {
2853
3891
  break;
@@ -2865,7 +3903,8 @@ const LogFilter$1 = {
2865
3903
  transactionStatus: isSet(object.transactionStatus) ? transactionStatusFilterFromJSON(object.transactionStatus) : void 0,
2866
3904
  includeTransaction: isSet(object.includeTransaction) ? globalThis.Boolean(object.includeTransaction) : void 0,
2867
3905
  includeReceipt: isSet(object.includeReceipt) ? globalThis.Boolean(object.includeReceipt) : void 0,
2868
- includeSiblings: isSet(object.includeSiblings) ? globalThis.Boolean(object.includeSiblings) : void 0
3906
+ includeSiblings: isSet(object.includeSiblings) ? globalThis.Boolean(object.includeSiblings) : void 0,
3907
+ includeTransactionTrace: isSet(object.includeTransactionTrace) ? globalThis.Boolean(object.includeTransactionTrace) : void 0
2869
3908
  };
2870
3909
  },
2871
3910
  toJSON(message) {
@@ -2894,6 +3933,9 @@ const LogFilter$1 = {
2894
3933
  if (message.includeSiblings !== void 0) {
2895
3934
  obj.includeSiblings = message.includeSiblings;
2896
3935
  }
3936
+ if (message.includeTransactionTrace !== void 0) {
3937
+ obj.includeTransactionTrace = message.includeTransactionTrace;
3938
+ }
2897
3939
  return obj;
2898
3940
  },
2899
3941
  create(base) {
@@ -2909,6 +3951,7 @@ const LogFilter$1 = {
2909
3951
  message.includeTransaction = object.includeTransaction ?? void 0;
2910
3952
  message.includeReceipt = object.includeReceipt ?? void 0;
2911
3953
  message.includeSiblings = object.includeSiblings ?? void 0;
3954
+ message.includeTransactionTrace = object.includeTransactionTrace ?? void 0;
2912
3955
  return message;
2913
3956
  }
2914
3957
  };
@@ -2989,277 +4032,368 @@ const index = {
2989
4032
  filter: filter
2990
4033
  };
2991
4034
 
2992
- const Bloom = Schema.transform(
2993
- Schema.Struct({
2994
- value: BytesFromUint8Array
2995
- }),
2996
- Bytes,
2997
- {
2998
- strict: false,
2999
- encode(value) {
3000
- throw new Error("Not implemented");
3001
- },
3002
- decode({ value }) {
3003
- return value;
3004
- }
4035
+ const Bloom = {
4036
+ encode(x) {
4037
+ return { value: BytesFromUint8Array.encode(x) };
4038
+ },
4039
+ decode({ value }) {
4040
+ return BytesFromUint8Array.decode(value);
3005
4041
  }
3006
- );
3007
- const TransactionStatus = Schema.transform(
3008
- Schema.Enums(TransactionStatus$1),
3009
- Schema.Literal("unknown", "succeeded", "reverted"),
3010
- {
3011
- decode(value) {
3012
- const enumMap = {
3013
- [TransactionStatus$1.SUCCEEDED]: "succeeded",
3014
- [TransactionStatus$1.REVERTED]: "reverted",
3015
- [TransactionStatus$1.UNSPECIFIED]: "unknown",
3016
- [TransactionStatus$1.UNRECOGNIZED]: "unknown"
3017
- };
3018
- return enumMap[value] ?? "unknown";
3019
- },
3020
- encode(value) {
3021
- throw new Error("encode: not implemented");
3022
- }
4042
+ };
4043
+ const TransactionStatus = {
4044
+ encode(x) {
4045
+ const enumMap = {
4046
+ unknown: TransactionStatus$1.UNSPECIFIED,
4047
+ succeeded: TransactionStatus$1.SUCCEEDED,
4048
+ reverted: TransactionStatus$1.REVERTED
4049
+ };
4050
+ return enumMap[x] ?? TransactionStatus$1.UNSPECIFIED;
4051
+ },
4052
+ decode(p) {
4053
+ const enumMap = {
4054
+ [TransactionStatus$1.SUCCEEDED]: "succeeded",
4055
+ [TransactionStatus$1.REVERTED]: "reverted",
4056
+ [TransactionStatus$1.UNSPECIFIED]: "unknown",
4057
+ [TransactionStatus$1.UNRECOGNIZED]: "unknown"
4058
+ };
4059
+ return enumMap[p] ?? "unknown";
3023
4060
  }
3024
- );
3025
- const BlockHeader = Schema.Struct({
3026
- blockNumber: Schema.BigIntFromSelf,
3027
- blockHash: B256$1,
3028
- parentBlockHash: B256$1,
3029
- unclesHash: B256$1,
3030
- miner: Address$1,
3031
- stateRoot: B256$1,
3032
- transactionsRoot: B256$1,
3033
- receiptsRoot: B256$1,
3034
- logsBloom: Bloom,
3035
- difficulty: U256$1,
3036
- gasLimit: U128$1,
3037
- gasUsed: U128$1,
3038
- timestamp: Schema.DateFromSelf,
3039
- extraData: BytesFromUint8Array,
3040
- mixHash: Schema.optional(B256$1),
3041
- nonce: Schema.optional(Schema.BigIntFromSelf),
3042
- baseFeePerGas: Schema.optional(U128$1),
3043
- withdrawalsRoot: Schema.optional(B256$1),
3044
- totalDifficulty: Schema.optional(U256$1),
3045
- blobGasUsed: Schema.optional(U128$1),
3046
- excessBlobGas: Schema.optional(U128$1),
3047
- parentBeaconBlockRoot: Schema.optional(B256$1)
4061
+ };
4062
+ const BlockHeader = MessageCodec({
4063
+ blockNumber: RequiredCodec(BigIntCodec),
4064
+ blockHash: OptionalCodec(B256$1),
4065
+ parentBlockHash: RequiredCodec(B256$1),
4066
+ unclesHash: RequiredCodec(B256$1),
4067
+ miner: OptionalCodec(Address$1),
4068
+ stateRoot: RequiredCodec(B256$1),
4069
+ transactionsRoot: RequiredCodec(B256$1),
4070
+ receiptsRoot: RequiredCodec(B256$1),
4071
+ logsBloom: OptionalCodec(Bloom),
4072
+ difficulty: RequiredCodec(U256$1),
4073
+ gasLimit: RequiredCodec(U128$1),
4074
+ gasUsed: RequiredCodec(U128$1),
4075
+ timestamp: RequiredCodec(DateCodec),
4076
+ extraData: RequiredCodec(BytesFromUint8Array),
4077
+ mixHash: OptionalCodec(B256$1),
4078
+ nonce: OptionalCodec(BigIntCodec),
4079
+ baseFeePerGas: OptionalCodec(U128$1),
4080
+ withdrawalsRoot: OptionalCodec(B256$1),
4081
+ totalDifficulty: OptionalCodec(U256$1),
4082
+ blobGasUsed: OptionalCodec(U128$1),
4083
+ excessBlobGas: OptionalCodec(U128$1),
4084
+ parentBeaconBlockRoot: OptionalCodec(B256$1),
4085
+ requestsHash: OptionalCodec(B256$1)
4086
+ });
4087
+ const Withdrawal = MessageCodec({
4088
+ filterIds: ArrayCodec(NumberCodec),
4089
+ withdrawalIndex: RequiredCodec(NumberCodec),
4090
+ index: RequiredCodec(BigIntCodec),
4091
+ validatorIndex: RequiredCodec(NumberCodec),
4092
+ address: RequiredCodec(Address$1),
4093
+ amount: RequiredCodec(BigIntCodec)
3048
4094
  });
3049
- const Withdrawal = Schema.Struct({
3050
- filterIds: Schema.Array(Schema.Number),
3051
- withdrawalIndex: Schema.Number,
3052
- index: Schema.BigIntFromSelf,
3053
- validatorIndex: Schema.Number,
3054
- address: Address$1,
3055
- amount: Schema.BigIntFromSelf
4095
+ const AccessListItem = MessageCodec({
4096
+ address: RequiredCodec(Address$1),
4097
+ storageKeys: ArrayCodec(B256$1)
3056
4098
  });
3057
- const AccessListItem = Schema.Struct({
3058
- address: Address$1,
3059
- storageKeys: Schema.Array(B256$1)
4099
+ const Signature = MessageCodec({
4100
+ r: RequiredCodec(U256$1),
4101
+ s: RequiredCodec(U256$1),
4102
+ v: OptionalCodec(U256$1),
4103
+ YParity: OptionalCodec(BooleanCodec)
3060
4104
  });
3061
- const Signature = Schema.Struct({
3062
- r: U256$1,
3063
- s: U256$1,
3064
- v: U256$1,
3065
- YParity: Schema.optional(Schema.Boolean)
4105
+ const Transaction = MessageCodec({
4106
+ filterIds: ArrayCodec(NumberCodec),
4107
+ transactionIndex: RequiredCodec(NumberCodec),
4108
+ transactionHash: RequiredCodec(B256$1),
4109
+ nonce: RequiredCodec(BigIntCodec),
4110
+ from: RequiredCodec(Address$1),
4111
+ to: OptionalCodec(Address$1),
4112
+ value: RequiredCodec(U256$1),
4113
+ gasPrice: OptionalCodec(U128$1),
4114
+ gas: RequiredCodec(U128$1),
4115
+ maxFeePerGas: OptionalCodec(U128$1),
4116
+ maxPriorityFeePerGas: OptionalCodec(U128$1),
4117
+ input: RequiredCodec(BytesFromUint8Array),
4118
+ signature: OptionalCodec(Signature),
4119
+ chainId: OptionalCodec(BigIntCodec),
4120
+ accessList: ArrayCodec(AccessListItem),
4121
+ transactionType: RequiredCodec(BigIntCodec),
4122
+ maxFeePerBlobGas: OptionalCodec(U128$1),
4123
+ blobVersionedHashes: ArrayCodec(B256$1),
4124
+ transactionStatus: RequiredCodec(TransactionStatus)
3066
4125
  });
3067
- const Transaction = Schema.Struct({
3068
- filterIds: Schema.Array(Schema.Number),
3069
- transactionIndex: Schema.Number,
3070
- transactionHash: B256$1,
3071
- nonce: Schema.BigIntFromSelf,
3072
- from: Address$1,
3073
- to: Schema.optional(Address$1),
3074
- value: U256$1,
3075
- gasPrice: Schema.optional(U128$1),
3076
- gas: U128$1,
3077
- maxFeePerGas: Schema.optional(U128$1),
3078
- maxPriorityFeePerGas: Schema.optional(U128$1),
3079
- input: BytesFromUint8Array,
3080
- signature: Schema.optional(Signature),
3081
- chainId: Schema.optional(Schema.BigIntFromSelf),
3082
- accessList: Schema.Array(AccessListItem),
3083
- transactionType: Schema.BigIntFromSelf,
3084
- maxFeePerBlobGas: Schema.optional(U128$1),
3085
- blobVersionedHashes: Schema.Array(B256$1),
3086
- transactionStatus: TransactionStatus
4126
+ const TransactionReceipt = MessageCodec({
4127
+ filterIds: ArrayCodec(NumberCodec),
4128
+ transactionIndex: RequiredCodec(NumberCodec),
4129
+ transactionHash: RequiredCodec(B256$1),
4130
+ cumulativeGasUsed: RequiredCodec(U128$1),
4131
+ gasUsed: RequiredCodec(U128$1),
4132
+ effectiveGasPrice: RequiredCodec(U128$1),
4133
+ from: RequiredCodec(Address$1),
4134
+ to: OptionalCodec(Address$1),
4135
+ contractAddress: OptionalCodec(Address$1),
4136
+ logsBloom: RequiredCodec(Bloom),
4137
+ transactionType: RequiredCodec(BigIntCodec),
4138
+ blobGasUsed: OptionalCodec(U128$1),
4139
+ blobGasPrice: OptionalCodec(U128$1),
4140
+ transactionStatus: RequiredCodec(TransactionStatus)
3087
4141
  });
3088
- const TransactionReceipt = Schema.Struct({
3089
- filterIds: Schema.Array(Schema.Number),
3090
- transactionIndex: Schema.Number,
3091
- transactionHash: B256$1,
3092
- cumulativeGasUsed: U128$1,
3093
- gasUsed: U128$1,
3094
- effectiveGasPrice: U128$1,
3095
- from: Address$1,
3096
- to: Schema.optional(Address$1),
3097
- contractAddress: Schema.optional(Address$1),
3098
- logsBloom: Bloom,
3099
- transactionType: Schema.BigIntFromSelf,
3100
- blobGasUsed: Schema.optional(U128$1),
3101
- blobGasPrice: Schema.optional(U128$1),
3102
- transactionStatus: TransactionStatus
4142
+ const Log = MessageCodec({
4143
+ filterIds: ArrayCodec(NumberCodec),
4144
+ address: RequiredCodec(Address$1),
4145
+ topics: ArrayCodec(B256$1),
4146
+ data: RequiredCodec(BytesFromUint8Array),
4147
+ logIndex: RequiredCodec(NumberCodec),
4148
+ logIndexInTransaction: RequiredCodec(NumberCodec),
4149
+ transactionIndex: RequiredCodec(NumberCodec),
4150
+ transactionHash: RequiredCodec(B256$1),
4151
+ transactionStatus: RequiredCodec(TransactionStatus)
3103
4152
  });
3104
- const Log = Schema.Struct({
3105
- filterIds: Schema.Array(Schema.Number),
3106
- address: Address$1,
3107
- topics: Schema.Array(B256$1),
3108
- data: BytesFromUint8Array,
3109
- logIndex: Schema.Number,
3110
- logIndexInTransaction: Schema.Number,
3111
- transactionIndex: Schema.Number,
3112
- transactionHash: B256$1,
3113
- transactionStatus: TransactionStatus
4153
+ const CallType = {
4154
+ encode(x) {
4155
+ const enumMap = {
4156
+ unknown: CallType$1.UNSPECIFIED,
4157
+ call: CallType$1.CALL,
4158
+ callCode: CallType$1.CALL_CODE,
4159
+ delegateCall: CallType$1.DELEGATE_CALL,
4160
+ staticCall: CallType$1.STATIC_CALL,
4161
+ authCall: CallType$1.AUTH_CALL
4162
+ };
4163
+ return enumMap[x] ?? CallType$1.UNSPECIFIED;
4164
+ },
4165
+ decode(p) {
4166
+ const enumMap = {
4167
+ [CallType$1.CALL]: "call",
4168
+ [CallType$1.CALL_CODE]: "callCode",
4169
+ [CallType$1.DELEGATE_CALL]: "delegateCall",
4170
+ [CallType$1.STATIC_CALL]: "staticCall",
4171
+ [CallType$1.AUTH_CALL]: "authCall",
4172
+ [CallType$1.UNSPECIFIED]: "unknown",
4173
+ [CallType$1.UNRECOGNIZED]: "unknown"
4174
+ };
4175
+ return enumMap[p] ?? "unknown";
4176
+ }
4177
+ };
4178
+ const CreationMethod = {
4179
+ encode(x) {
4180
+ const enumMap = {
4181
+ unknown: CreationMethod$1.UNSPECIFIED,
4182
+ create: CreationMethod$1.CREATE,
4183
+ create2: CreationMethod$1.CREATE2,
4184
+ eofCreate: CreationMethod$1.EOF_CREATE
4185
+ };
4186
+ return enumMap[x] ?? CreationMethod$1.UNSPECIFIED;
4187
+ },
4188
+ decode(p) {
4189
+ const enumMap = {
4190
+ [CreationMethod$1.CREATE]: "create",
4191
+ [CreationMethod$1.CREATE2]: "create2",
4192
+ [CreationMethod$1.EOF_CREATE]: "eofCreate",
4193
+ [CreationMethod$1.UNSPECIFIED]: "unknown",
4194
+ [CreationMethod$1.UNRECOGNIZED]: "unknown"
4195
+ };
4196
+ return enumMap[p] ?? "unknown";
4197
+ }
4198
+ };
4199
+ const CallAction = MessageCodec({
4200
+ fromAddress: RequiredCodec(Address$1),
4201
+ type: RequiredCodec(CallType),
4202
+ gas: RequiredCodec(BigIntCodec),
4203
+ input: RequiredCodec(BytesFromUint8Array),
4204
+ toAddress: RequiredCodec(Address$1),
4205
+ value: RequiredCodec(U256$1)
3114
4206
  });
3115
- const Block = Schema.Struct({
3116
- header: BlockHeader,
3117
- withdrawals: Schema.Array(Withdrawal),
3118
- transactions: Schema.Array(Transaction),
3119
- receipts: Schema.Array(TransactionReceipt),
3120
- logs: Schema.Array(Log)
4207
+ const CreateAction = MessageCodec({
4208
+ fromAddress: RequiredCodec(Address$1),
4209
+ gas: RequiredCodec(BigIntCodec),
4210
+ init: RequiredCodec(BytesFromUint8Array),
4211
+ value: RequiredCodec(U256$1),
4212
+ creationMethod: RequiredCodec(CreationMethod)
3121
4213
  });
3122
- const BlockFromBytes = Schema.transform(
3123
- Schema.Uint8ArrayFromSelf,
3124
- Schema.NullOr(Block),
3125
- {
3126
- strict: false,
3127
- decode(value) {
3128
- if (value.length === 0) {
3129
- return null;
3130
- }
3131
- return Block$1.decode(value);
3132
- },
3133
- encode(value) {
3134
- if (value === null) {
3135
- return new Uint8Array();
3136
- }
3137
- return Block$1.encode(value).finish();
3138
- }
4214
+ const SelfDestructAction = MessageCodec({
4215
+ address: RequiredCodec(Address$1),
4216
+ balance: RequiredCodec(U256$1),
4217
+ refundAddress: RequiredCodec(Address$1)
4218
+ });
4219
+ const RewardType = {
4220
+ encode(x) {
4221
+ const enumMap = {
4222
+ unknown: RewardType$1.UNSPECIFIED,
4223
+ block: RewardType$1.BLOCK,
4224
+ uncle: RewardType$1.UNCLE
4225
+ };
4226
+ return enumMap[x] ?? RewardType$1.UNSPECIFIED;
4227
+ },
4228
+ decode(p) {
4229
+ const enumMap = {
4230
+ [RewardType$1.BLOCK]: "block",
4231
+ [RewardType$1.UNCLE]: "uncle",
4232
+ [RewardType$1.UNSPECIFIED]: "unknown",
4233
+ [RewardType$1.UNRECOGNIZED]: "unknown"
4234
+ };
4235
+ return enumMap[p] ?? "unknown";
3139
4236
  }
3140
- );
4237
+ };
4238
+ const RewardAction = MessageCodec({
4239
+ author: RequiredCodec(Address$1),
4240
+ type: RequiredCodec(RewardType),
4241
+ value: RequiredCodec(U256$1)
4242
+ });
4243
+ const CallOutput = MessageCodec({
4244
+ gasUsed: RequiredCodec(BigIntCodec),
4245
+ output: RequiredCodec(BytesFromUint8Array)
4246
+ });
4247
+ const CreateOutput = MessageCodec({
4248
+ address: RequiredCodec(Address$1),
4249
+ code: RequiredCodec(BytesFromUint8Array),
4250
+ gasUsed: RequiredCodec(BigIntCodec)
4251
+ });
4252
+ const Trace = MessageCodec({
4253
+ action: RequiredCodec(
4254
+ OneOfCodec({
4255
+ call: CallAction,
4256
+ create: CreateAction,
4257
+ selfDestruct: SelfDestructAction,
4258
+ reward: RewardAction
4259
+ })
4260
+ ),
4261
+ error: OptionalCodec(StringCodec),
4262
+ output: OptionalCodec(
4263
+ OneOfCodec({
4264
+ callOutput: CallOutput,
4265
+ createOutput: CreateOutput
4266
+ })
4267
+ ),
4268
+ subtraces: RequiredCodec(NumberCodec),
4269
+ traceAddress: ArrayCodec(NumberCodec)
4270
+ });
4271
+ const TransactionTrace = MessageCodec({
4272
+ filterIds: ArrayCodec(NumberCodec),
4273
+ transactionIndex: RequiredCodec(NumberCodec),
4274
+ transactionHash: RequiredCodec(B256$1),
4275
+ traces: ArrayCodec(Trace)
4276
+ });
4277
+ const Block = MessageCodec({
4278
+ header: RequiredCodec(BlockHeader),
4279
+ withdrawals: ArrayCodec(Withdrawal),
4280
+ transactions: ArrayCodec(Transaction),
4281
+ receipts: ArrayCodec(TransactionReceipt),
4282
+ logs: ArrayCodec(Log),
4283
+ traces: ArrayCodec(TransactionTrace)
4284
+ });
4285
+ const BlockFromBytes = {
4286
+ encode(x) {
4287
+ const block = Block.encode(x);
4288
+ return Block$1.encode(block).finish();
4289
+ },
4290
+ decode(p) {
4291
+ const block = Block$1.decode(p);
4292
+ return Block.decode(block);
4293
+ }
4294
+ };
3141
4295
 
3142
- const OptionalArray = (schema) => Schema.optional(Schema.Array(schema));
3143
- const HeaderFilter = Schema.transform(
3144
- Schema.Enums(HeaderFilter$1),
3145
- Schema.Literal("always", "on_data", "on_data_or_on_new_block", "unknown"),
3146
- {
3147
- decode(value) {
3148
- const enumMap = {
3149
- [HeaderFilter$1.ALWAYS]: "always",
3150
- [HeaderFilter$1.ON_DATA]: "on_data",
3151
- [HeaderFilter$1.ON_DATA_OR_ON_NEW_BLOCK]: "on_data_or_on_new_block",
3152
- [HeaderFilter$1.UNSPECIFIED]: "unknown",
3153
- [HeaderFilter$1.UNRECOGNIZED]: "unknown"
3154
- };
3155
- return enumMap[value] ?? "unknown";
3156
- },
3157
- encode(value) {
3158
- switch (value) {
3159
- case "always":
3160
- return HeaderFilter$1.ALWAYS;
3161
- case "on_data":
3162
- return HeaderFilter$1.ON_DATA;
3163
- case "on_data_or_on_new_block":
3164
- return HeaderFilter$1.ON_DATA_OR_ON_NEW_BLOCK;
3165
- default:
3166
- return HeaderFilter$1.UNSPECIFIED;
3167
- }
4296
+ const HeaderFilter = {
4297
+ encode(x) {
4298
+ switch (x) {
4299
+ case "always":
4300
+ return HeaderFilter$1.ALWAYS;
4301
+ case "on_data":
4302
+ return HeaderFilter$1.ON_DATA;
4303
+ case "on_data_or_on_new_block":
4304
+ return HeaderFilter$1.ON_DATA_OR_ON_NEW_BLOCK;
4305
+ default:
4306
+ return HeaderFilter$1.UNSPECIFIED;
3168
4307
  }
4308
+ },
4309
+ decode(p) {
4310
+ const enumMap = {
4311
+ [HeaderFilter$1.ALWAYS]: "always",
4312
+ [HeaderFilter$1.ON_DATA]: "on_data",
4313
+ [HeaderFilter$1.ON_DATA_OR_ON_NEW_BLOCK]: "on_data_or_on_new_block",
4314
+ [HeaderFilter$1.UNSPECIFIED]: "unknown",
4315
+ [HeaderFilter$1.UNRECOGNIZED]: "unknown"
4316
+ };
4317
+ return enumMap[p] ?? "unknown";
3169
4318
  }
3170
- );
3171
- const WithdrawalFilter = Schema.Struct({
3172
- id: Schema.optional(Schema.Number),
3173
- validatorIndex: Schema.optional(Schema.Number),
3174
- address: Schema.optional(Address$1)
4319
+ };
4320
+ const WithdrawalFilter = MessageCodec({
4321
+ id: OptionalCodec(NumberCodec),
4322
+ validatorIndex: OptionalCodec(NumberCodec),
4323
+ address: OptionalCodec(Address$1)
3175
4324
  });
3176
- const TransactionStatusFilter = Schema.transform(
3177
- Schema.Enums(TransactionStatusFilter$1),
3178
- Schema.Literal("succeeded", "reverted", "all", "unknown"),
3179
- {
3180
- decode(value) {
3181
- const enumMap = {
3182
- [TransactionStatusFilter$1.SUCCEEDED]: "succeeded",
3183
- [TransactionStatusFilter$1.REVERTED]: "reverted",
3184
- [TransactionStatusFilter$1.ALL]: "all",
3185
- [TransactionStatusFilter$1.UNSPECIFIED]: "unknown",
3186
- [TransactionStatusFilter$1.UNRECOGNIZED]: "unknown"
3187
- };
3188
- return enumMap[value] ?? "unknown";
3189
- },
3190
- encode(value) {
3191
- switch (value) {
3192
- case "succeeded":
3193
- return TransactionStatusFilter$1.SUCCEEDED;
3194
- case "reverted":
3195
- return TransactionStatusFilter$1.REVERTED;
3196
- case "all":
3197
- return TransactionStatusFilter$1.ALL;
3198
- default:
3199
- return TransactionStatusFilter$1.UNSPECIFIED;
3200
- }
4325
+ const TransactionStatusFilter = {
4326
+ decode(value) {
4327
+ const enumMap = {
4328
+ [TransactionStatusFilter$1.SUCCEEDED]: "succeeded",
4329
+ [TransactionStatusFilter$1.REVERTED]: "reverted",
4330
+ [TransactionStatusFilter$1.ALL]: "all",
4331
+ [TransactionStatusFilter$1.UNSPECIFIED]: "unknown",
4332
+ [TransactionStatusFilter$1.UNRECOGNIZED]: "unknown"
4333
+ };
4334
+ return enumMap[value] ?? "unknown";
4335
+ },
4336
+ encode(value) {
4337
+ switch (value) {
4338
+ case "succeeded":
4339
+ return TransactionStatusFilter$1.SUCCEEDED;
4340
+ case "reverted":
4341
+ return TransactionStatusFilter$1.REVERTED;
4342
+ case "all":
4343
+ return TransactionStatusFilter$1.ALL;
4344
+ default:
4345
+ return TransactionStatusFilter$1.UNSPECIFIED;
3201
4346
  }
3202
4347
  }
3203
- );
3204
- const Topic = Schema.transform(
3205
- Schema.Struct({ value: Schema.UndefinedOr(B256Proto) }),
3206
- Schema.NullOr(B256$1),
3207
- {
3208
- decode({ value }) {
3209
- if (value === void 0) {
3210
- return null;
3211
- }
3212
- return value;
3213
- },
3214
- encode(value) {
3215
- if (value === null) {
3216
- return { value: void 0 };
3217
- }
3218
- return { value };
4348
+ };
4349
+ const Topic = {
4350
+ encode(x) {
4351
+ if (x === null) {
4352
+ return { value: void 0 };
3219
4353
  }
4354
+ return { value: B256$1.encode(x) };
4355
+ },
4356
+ decode({ value }) {
4357
+ if (value === void 0) {
4358
+ return null;
4359
+ }
4360
+ return B256$1.decode(value);
3220
4361
  }
3221
- );
3222
- const LogFilter = Schema.Struct({
3223
- id: Schema.optional(Schema.Number),
3224
- address: Schema.optional(Address$1),
3225
- topics: OptionalArray(Topic),
3226
- strict: Schema.optional(Schema.Boolean),
3227
- transactionStatus: Schema.optional(TransactionStatusFilter),
3228
- includeTransaction: Schema.optional(Schema.Boolean),
3229
- includeReceipt: Schema.optional(Schema.Boolean)
4362
+ };
4363
+ const LogFilter = MessageCodec({
4364
+ id: OptionalCodec(NumberCodec),
4365
+ address: OptionalCodec(Address$1),
4366
+ topics: OptionalCodec(ArrayCodec(Topic)),
4367
+ strict: OptionalCodec(BooleanCodec),
4368
+ transactionStatus: OptionalCodec(TransactionStatusFilter),
4369
+ includeTransaction: OptionalCodec(BooleanCodec),
4370
+ includeReceipt: OptionalCodec(BooleanCodec),
4371
+ includeTransactionTrace: OptionalCodec(BooleanCodec)
3230
4372
  });
3231
- const TransactionFilter = Schema.Struct({
3232
- id: Schema.optional(Schema.Number),
3233
- from: Schema.optional(Address$1),
3234
- to: Schema.optional(Address$1),
3235
- create: Schema.optional(Schema.Boolean),
3236
- transactionStatus: Schema.optional(TransactionStatusFilter),
3237
- includeReceipt: Schema.optional(Schema.Boolean),
3238
- includeLogs: Schema.optional(Schema.Boolean)
4373
+ const TransactionFilter = MessageCodec({
4374
+ id: OptionalCodec(NumberCodec),
4375
+ from: OptionalCodec(Address$1),
4376
+ to: OptionalCodec(Address$1),
4377
+ create: OptionalCodec(BooleanCodec),
4378
+ transactionStatus: OptionalCodec(TransactionStatusFilter),
4379
+ includeReceipt: OptionalCodec(BooleanCodec),
4380
+ includeLogs: OptionalCodec(BooleanCodec),
4381
+ includeTransactionTrace: OptionalCodec(BooleanCodec)
3239
4382
  });
3240
- const Filter = Schema.Struct({
3241
- header: Schema.optional(HeaderFilter),
3242
- withdrawals: OptionalArray(WithdrawalFilter),
3243
- transactions: OptionalArray(TransactionFilter),
3244
- logs: OptionalArray(LogFilter)
4383
+ const Filter = MessageCodec({
4384
+ header: OptionalCodec(HeaderFilter),
4385
+ withdrawals: OptionalCodec(ArrayCodec(WithdrawalFilter)),
4386
+ transactions: OptionalCodec(ArrayCodec(TransactionFilter)),
4387
+ logs: OptionalCodec(ArrayCodec(LogFilter))
3245
4388
  });
3246
- const filterToProto = Schema.encodeSync(Filter);
3247
- const filterFromProto = Schema.decodeSync(Filter);
3248
- const FilterFromBytes = Schema.transform(
3249
- Schema.Uint8ArrayFromSelf,
3250
- Filter,
3251
- {
3252
- strict: false,
3253
- decode(value) {
3254
- return Filter$1.decode(value);
3255
- },
3256
- encode(value) {
3257
- return Filter$1.encode(value).finish();
3258
- }
4389
+ const FilterFromBytes = {
4390
+ encode(x) {
4391
+ return Filter$1.encode(Filter.encode(x)).finish();
4392
+ },
4393
+ decode(p) {
4394
+ return Filter.decode(Filter$1.decode(p));
3259
4395
  }
3260
- );
3261
- const filterToBytes = Schema.encodeSync(FilterFromBytes);
3262
- const filterFromBytes = Schema.decodeSync(FilterFromBytes);
4396
+ };
3263
4397
  function mergeFilter(a, b) {
3264
4398
  const header = mergeHeaderFilter(a.header, b.header);
3265
4399
  return {
@@ -3288,7 +4422,9 @@ function mergeHeaderFilter(a, b) {
3288
4422
  const EvmStream = new StreamConfig(
3289
4423
  FilterFromBytes,
3290
4424
  BlockFromBytes,
3291
- mergeFilter
4425
+ mergeFilter,
4426
+ "evm"
3292
4427
  );
3293
4428
 
3294
- export { AccessListItem, Address$1 as Address, B256$1 as B256, B256Proto, Block, BlockFromBytes, BlockHeader, Bloom, EvmStream, Filter, FilterFromBytes, HeaderFilter, Log, LogFilter, Signature, Topic, Transaction, TransactionFilter, TransactionReceipt, TransactionStatus, TransactionStatusFilter, U128$1 as U128, U256$1 as U256, Withdrawal, WithdrawalFilter, b256FromProto, b256ToProto, filterFromBytes, filterFromProto, filterToBytes, filterToProto, mergeFilter, index as proto, u128FromProto, u128ToProto, u256FromProto, u256ToProto };
4429
+ export { AccessListItem, Address$1 as Address, B256$1 as B256, Block, BlockFromBytes, BlockHeader, Bloom, CallAction, CallOutput, CallType, CreateAction, CreateOutput, CreationMethod, EvmStream, Filter, FilterFromBytes, HeaderFilter, Log, LogFilter, RewardAction, RewardType, SelfDestructAction, Signature, Topic, Trace, Transaction, TransactionFilter, TransactionReceipt, TransactionStatus, TransactionStatusFilter, TransactionTrace, U128$1 as U128, U256$1 as U256, Withdrawal, WithdrawalFilter, mergeFilter, index as proto };
4430
+ //# sourceMappingURL=index.mjs.map