@apibara/evm 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +17 -0
- package/CHANGELOG.md +1 -0
- package/LICENSE.txt +202 -0
- package/README.md +27 -0
- package/buf.gen.yaml +14 -0
- package/build.config.ts +11 -0
- package/dist/index.cjs +2994 -0
- package/dist/index.d.cts +1900 -0
- package/dist/index.d.mts +1900 -0
- package/dist/index.d.ts +1900 -0
- package/dist/index.mjs +2953 -0
- package/package.json +49 -0
- package/proto/common.proto +37 -0
- package/proto/data.proto +192 -0
- package/proto/filter.proto +61 -0
- package/src/block.ts +167 -0
- package/src/common.test.ts +79 -0
- package/src/common.ts +117 -0
- package/src/filter.test.ts +191 -0
- package/src/filter.ts +117 -0
- package/src/index.ts +15 -0
- package/src/proto/common.ts +561 -0
- package/src/proto/data.ts +2111 -0
- package/src/proto/filter.ts +658 -0
- package/src/proto/google/protobuf/timestamp.ts +220 -0
- package/src/proto/index.ts +3 -0
- package/tsconfig.json +11 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2953 @@
|
|
|
1
|
+
import { BytesFromUint8Array, Bytes, StreamConfig } from '@apibara/protocol';
|
|
2
|
+
import { Schema } from '@effect/schema';
|
|
3
|
+
import { hexToBytes, pad } from 'viem';
|
|
4
|
+
import Long from 'long';
|
|
5
|
+
import _m0 from 'protobufjs/minimal';
|
|
6
|
+
|
|
7
|
+
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}`;
|
|
20
|
+
},
|
|
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 };
|
|
28
|
+
}
|
|
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);
|
|
52
|
+
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
|
+
},
|
|
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 };
|
|
73
|
+
}
|
|
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;
|
|
84
|
+
},
|
|
85
|
+
encode(value) {
|
|
86
|
+
const x0 = value >> 8n * 8n & MAX_U64;
|
|
87
|
+
const x1 = value & MAX_U64;
|
|
88
|
+
return { x0, x1 };
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
const u128ToProto = Schema.encodeSync(U128$1);
|
|
92
|
+
const u128FromProto = Schema.decodeSync(U128$1);
|
|
93
|
+
|
|
94
|
+
const protobufPackage$2 = "evm.v2";
|
|
95
|
+
function createBaseAddress() {
|
|
96
|
+
return { x0: BigInt("0"), x1: BigInt("0"), x2: 0 };
|
|
97
|
+
}
|
|
98
|
+
const Address = {
|
|
99
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
100
|
+
if (message.x0 !== void 0 && message.x0 !== BigInt("0")) {
|
|
101
|
+
if (BigInt.asUintN(64, message.x0) !== message.x0) {
|
|
102
|
+
throw new globalThis.Error("value provided for field message.x0 of type fixed64 too large");
|
|
103
|
+
}
|
|
104
|
+
writer.uint32(9).fixed64(message.x0.toString());
|
|
105
|
+
}
|
|
106
|
+
if (message.x1 !== void 0 && message.x1 !== BigInt("0")) {
|
|
107
|
+
if (BigInt.asUintN(64, message.x1) !== message.x1) {
|
|
108
|
+
throw new globalThis.Error("value provided for field message.x1 of type fixed64 too large");
|
|
109
|
+
}
|
|
110
|
+
writer.uint32(17).fixed64(message.x1.toString());
|
|
111
|
+
}
|
|
112
|
+
if (message.x2 !== void 0 && message.x2 !== 0) {
|
|
113
|
+
writer.uint32(29).fixed32(message.x2);
|
|
114
|
+
}
|
|
115
|
+
return writer;
|
|
116
|
+
},
|
|
117
|
+
decode(input, length) {
|
|
118
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
119
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
120
|
+
const message = createBaseAddress();
|
|
121
|
+
while (reader.pos < end) {
|
|
122
|
+
const tag = reader.uint32();
|
|
123
|
+
switch (tag >>> 3) {
|
|
124
|
+
case 1:
|
|
125
|
+
if (tag !== 9) {
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
message.x0 = longToBigint$3(reader.fixed64());
|
|
129
|
+
continue;
|
|
130
|
+
case 2:
|
|
131
|
+
if (tag !== 17) {
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
message.x1 = longToBigint$3(reader.fixed64());
|
|
135
|
+
continue;
|
|
136
|
+
case 3:
|
|
137
|
+
if (tag !== 29) {
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
message.x2 = reader.fixed32();
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
reader.skipType(tag & 7);
|
|
147
|
+
}
|
|
148
|
+
return message;
|
|
149
|
+
},
|
|
150
|
+
fromJSON(object) {
|
|
151
|
+
return {
|
|
152
|
+
x0: isSet$3(object.x0) ? BigInt(object.x0) : BigInt("0"),
|
|
153
|
+
x1: isSet$3(object.x1) ? BigInt(object.x1) : BigInt("0"),
|
|
154
|
+
x2: isSet$3(object.x2) ? globalThis.Number(object.x2) : 0
|
|
155
|
+
};
|
|
156
|
+
},
|
|
157
|
+
toJSON(message) {
|
|
158
|
+
const obj = {};
|
|
159
|
+
if (message.x0 !== void 0 && message.x0 !== BigInt("0")) {
|
|
160
|
+
obj.x0 = message.x0.toString();
|
|
161
|
+
}
|
|
162
|
+
if (message.x1 !== void 0 && message.x1 !== BigInt("0")) {
|
|
163
|
+
obj.x1 = message.x1.toString();
|
|
164
|
+
}
|
|
165
|
+
if (message.x2 !== void 0 && message.x2 !== 0) {
|
|
166
|
+
obj.x2 = Math.round(message.x2);
|
|
167
|
+
}
|
|
168
|
+
return obj;
|
|
169
|
+
},
|
|
170
|
+
create(base) {
|
|
171
|
+
return Address.fromPartial(base ?? {});
|
|
172
|
+
},
|
|
173
|
+
fromPartial(object) {
|
|
174
|
+
const message = createBaseAddress();
|
|
175
|
+
message.x0 = object.x0 ?? BigInt("0");
|
|
176
|
+
message.x1 = object.x1 ?? BigInt("0");
|
|
177
|
+
message.x2 = object.x2 ?? 0;
|
|
178
|
+
return message;
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
function createBaseBloom() {
|
|
182
|
+
return { value: new Uint8Array(0) };
|
|
183
|
+
}
|
|
184
|
+
const Bloom$1 = {
|
|
185
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
186
|
+
if (message.value !== void 0 && message.value.length !== 0) {
|
|
187
|
+
writer.uint32(10).bytes(message.value);
|
|
188
|
+
}
|
|
189
|
+
return writer;
|
|
190
|
+
},
|
|
191
|
+
decode(input, length) {
|
|
192
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
193
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
194
|
+
const message = createBaseBloom();
|
|
195
|
+
while (reader.pos < end) {
|
|
196
|
+
const tag = reader.uint32();
|
|
197
|
+
switch (tag >>> 3) {
|
|
198
|
+
case 1:
|
|
199
|
+
if (tag !== 10) {
|
|
200
|
+
break;
|
|
201
|
+
}
|
|
202
|
+
message.value = reader.bytes();
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
reader.skipType(tag & 7);
|
|
209
|
+
}
|
|
210
|
+
return message;
|
|
211
|
+
},
|
|
212
|
+
fromJSON(object) {
|
|
213
|
+
return { value: isSet$3(object.value) ? bytesFromBase64$1(object.value) : new Uint8Array(0) };
|
|
214
|
+
},
|
|
215
|
+
toJSON(message) {
|
|
216
|
+
const obj = {};
|
|
217
|
+
if (message.value !== void 0 && message.value.length !== 0) {
|
|
218
|
+
obj.value = base64FromBytes$1(message.value);
|
|
219
|
+
}
|
|
220
|
+
return obj;
|
|
221
|
+
},
|
|
222
|
+
create(base) {
|
|
223
|
+
return Bloom$1.fromPartial(base ?? {});
|
|
224
|
+
},
|
|
225
|
+
fromPartial(object) {
|
|
226
|
+
const message = createBaseBloom();
|
|
227
|
+
message.value = object.value ?? new Uint8Array(0);
|
|
228
|
+
return message;
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
function createBaseU128() {
|
|
232
|
+
return { x0: BigInt("0"), x1: BigInt("0") };
|
|
233
|
+
}
|
|
234
|
+
const U128 = {
|
|
235
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
236
|
+
if (message.x0 !== void 0 && message.x0 !== BigInt("0")) {
|
|
237
|
+
if (BigInt.asUintN(64, message.x0) !== message.x0) {
|
|
238
|
+
throw new globalThis.Error("value provided for field message.x0 of type fixed64 too large");
|
|
239
|
+
}
|
|
240
|
+
writer.uint32(9).fixed64(message.x0.toString());
|
|
241
|
+
}
|
|
242
|
+
if (message.x1 !== void 0 && message.x1 !== BigInt("0")) {
|
|
243
|
+
if (BigInt.asUintN(64, message.x1) !== message.x1) {
|
|
244
|
+
throw new globalThis.Error("value provided for field message.x1 of type fixed64 too large");
|
|
245
|
+
}
|
|
246
|
+
writer.uint32(17).fixed64(message.x1.toString());
|
|
247
|
+
}
|
|
248
|
+
return writer;
|
|
249
|
+
},
|
|
250
|
+
decode(input, length) {
|
|
251
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
252
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
253
|
+
const message = createBaseU128();
|
|
254
|
+
while (reader.pos < end) {
|
|
255
|
+
const tag = reader.uint32();
|
|
256
|
+
switch (tag >>> 3) {
|
|
257
|
+
case 1:
|
|
258
|
+
if (tag !== 9) {
|
|
259
|
+
break;
|
|
260
|
+
}
|
|
261
|
+
message.x0 = longToBigint$3(reader.fixed64());
|
|
262
|
+
continue;
|
|
263
|
+
case 2:
|
|
264
|
+
if (tag !== 17) {
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
267
|
+
message.x1 = longToBigint$3(reader.fixed64());
|
|
268
|
+
continue;
|
|
269
|
+
}
|
|
270
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
reader.skipType(tag & 7);
|
|
274
|
+
}
|
|
275
|
+
return message;
|
|
276
|
+
},
|
|
277
|
+
fromJSON(object) {
|
|
278
|
+
return {
|
|
279
|
+
x0: isSet$3(object.x0) ? BigInt(object.x0) : BigInt("0"),
|
|
280
|
+
x1: isSet$3(object.x1) ? BigInt(object.x1) : BigInt("0")
|
|
281
|
+
};
|
|
282
|
+
},
|
|
283
|
+
toJSON(message) {
|
|
284
|
+
const obj = {};
|
|
285
|
+
if (message.x0 !== void 0 && message.x0 !== BigInt("0")) {
|
|
286
|
+
obj.x0 = message.x0.toString();
|
|
287
|
+
}
|
|
288
|
+
if (message.x1 !== void 0 && message.x1 !== BigInt("0")) {
|
|
289
|
+
obj.x1 = message.x1.toString();
|
|
290
|
+
}
|
|
291
|
+
return obj;
|
|
292
|
+
},
|
|
293
|
+
create(base) {
|
|
294
|
+
return U128.fromPartial(base ?? {});
|
|
295
|
+
},
|
|
296
|
+
fromPartial(object) {
|
|
297
|
+
const message = createBaseU128();
|
|
298
|
+
message.x0 = object.x0 ?? BigInt("0");
|
|
299
|
+
message.x1 = object.x1 ?? BigInt("0");
|
|
300
|
+
return message;
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
function createBaseU256() {
|
|
304
|
+
return { x0: BigInt("0"), x1: BigInt("0"), x2: BigInt("0"), x3: BigInt("0") };
|
|
305
|
+
}
|
|
306
|
+
const U256 = {
|
|
307
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
308
|
+
if (message.x0 !== void 0 && message.x0 !== BigInt("0")) {
|
|
309
|
+
if (BigInt.asUintN(64, message.x0) !== message.x0) {
|
|
310
|
+
throw new globalThis.Error("value provided for field message.x0 of type fixed64 too large");
|
|
311
|
+
}
|
|
312
|
+
writer.uint32(9).fixed64(message.x0.toString());
|
|
313
|
+
}
|
|
314
|
+
if (message.x1 !== void 0 && message.x1 !== BigInt("0")) {
|
|
315
|
+
if (BigInt.asUintN(64, message.x1) !== message.x1) {
|
|
316
|
+
throw new globalThis.Error("value provided for field message.x1 of type fixed64 too large");
|
|
317
|
+
}
|
|
318
|
+
writer.uint32(17).fixed64(message.x1.toString());
|
|
319
|
+
}
|
|
320
|
+
if (message.x2 !== void 0 && message.x2 !== BigInt("0")) {
|
|
321
|
+
if (BigInt.asUintN(64, message.x2) !== message.x2) {
|
|
322
|
+
throw new globalThis.Error("value provided for field message.x2 of type fixed64 too large");
|
|
323
|
+
}
|
|
324
|
+
writer.uint32(25).fixed64(message.x2.toString());
|
|
325
|
+
}
|
|
326
|
+
if (message.x3 !== void 0 && message.x3 !== BigInt("0")) {
|
|
327
|
+
if (BigInt.asUintN(64, message.x3) !== message.x3) {
|
|
328
|
+
throw new globalThis.Error("value provided for field message.x3 of type fixed64 too large");
|
|
329
|
+
}
|
|
330
|
+
writer.uint32(33).fixed64(message.x3.toString());
|
|
331
|
+
}
|
|
332
|
+
return writer;
|
|
333
|
+
},
|
|
334
|
+
decode(input, length) {
|
|
335
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
336
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
337
|
+
const message = createBaseU256();
|
|
338
|
+
while (reader.pos < end) {
|
|
339
|
+
const tag = reader.uint32();
|
|
340
|
+
switch (tag >>> 3) {
|
|
341
|
+
case 1:
|
|
342
|
+
if (tag !== 9) {
|
|
343
|
+
break;
|
|
344
|
+
}
|
|
345
|
+
message.x0 = longToBigint$3(reader.fixed64());
|
|
346
|
+
continue;
|
|
347
|
+
case 2:
|
|
348
|
+
if (tag !== 17) {
|
|
349
|
+
break;
|
|
350
|
+
}
|
|
351
|
+
message.x1 = longToBigint$3(reader.fixed64());
|
|
352
|
+
continue;
|
|
353
|
+
case 3:
|
|
354
|
+
if (tag !== 25) {
|
|
355
|
+
break;
|
|
356
|
+
}
|
|
357
|
+
message.x2 = longToBigint$3(reader.fixed64());
|
|
358
|
+
continue;
|
|
359
|
+
case 4:
|
|
360
|
+
if (tag !== 33) {
|
|
361
|
+
break;
|
|
362
|
+
}
|
|
363
|
+
message.x3 = longToBigint$3(reader.fixed64());
|
|
364
|
+
continue;
|
|
365
|
+
}
|
|
366
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
367
|
+
break;
|
|
368
|
+
}
|
|
369
|
+
reader.skipType(tag & 7);
|
|
370
|
+
}
|
|
371
|
+
return message;
|
|
372
|
+
},
|
|
373
|
+
fromJSON(object) {
|
|
374
|
+
return {
|
|
375
|
+
x0: isSet$3(object.x0) ? BigInt(object.x0) : BigInt("0"),
|
|
376
|
+
x1: isSet$3(object.x1) ? BigInt(object.x1) : BigInt("0"),
|
|
377
|
+
x2: isSet$3(object.x2) ? BigInt(object.x2) : BigInt("0"),
|
|
378
|
+
x3: isSet$3(object.x3) ? BigInt(object.x3) : BigInt("0")
|
|
379
|
+
};
|
|
380
|
+
},
|
|
381
|
+
toJSON(message) {
|
|
382
|
+
const obj = {};
|
|
383
|
+
if (message.x0 !== void 0 && message.x0 !== BigInt("0")) {
|
|
384
|
+
obj.x0 = message.x0.toString();
|
|
385
|
+
}
|
|
386
|
+
if (message.x1 !== void 0 && message.x1 !== BigInt("0")) {
|
|
387
|
+
obj.x1 = message.x1.toString();
|
|
388
|
+
}
|
|
389
|
+
if (message.x2 !== void 0 && message.x2 !== BigInt("0")) {
|
|
390
|
+
obj.x2 = message.x2.toString();
|
|
391
|
+
}
|
|
392
|
+
if (message.x3 !== void 0 && message.x3 !== BigInt("0")) {
|
|
393
|
+
obj.x3 = message.x3.toString();
|
|
394
|
+
}
|
|
395
|
+
return obj;
|
|
396
|
+
},
|
|
397
|
+
create(base) {
|
|
398
|
+
return U256.fromPartial(base ?? {});
|
|
399
|
+
},
|
|
400
|
+
fromPartial(object) {
|
|
401
|
+
const message = createBaseU256();
|
|
402
|
+
message.x0 = object.x0 ?? BigInt("0");
|
|
403
|
+
message.x1 = object.x1 ?? BigInt("0");
|
|
404
|
+
message.x2 = object.x2 ?? BigInt("0");
|
|
405
|
+
message.x3 = object.x3 ?? BigInt("0");
|
|
406
|
+
return message;
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
function createBaseB256() {
|
|
410
|
+
return { x0: BigInt("0"), x1: BigInt("0"), x2: BigInt("0"), x3: BigInt("0") };
|
|
411
|
+
}
|
|
412
|
+
const B256 = {
|
|
413
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
414
|
+
if (message.x0 !== void 0 && message.x0 !== BigInt("0")) {
|
|
415
|
+
if (BigInt.asUintN(64, message.x0) !== message.x0) {
|
|
416
|
+
throw new globalThis.Error("value provided for field message.x0 of type fixed64 too large");
|
|
417
|
+
}
|
|
418
|
+
writer.uint32(9).fixed64(message.x0.toString());
|
|
419
|
+
}
|
|
420
|
+
if (message.x1 !== void 0 && message.x1 !== BigInt("0")) {
|
|
421
|
+
if (BigInt.asUintN(64, message.x1) !== message.x1) {
|
|
422
|
+
throw new globalThis.Error("value provided for field message.x1 of type fixed64 too large");
|
|
423
|
+
}
|
|
424
|
+
writer.uint32(17).fixed64(message.x1.toString());
|
|
425
|
+
}
|
|
426
|
+
if (message.x2 !== void 0 && message.x2 !== BigInt("0")) {
|
|
427
|
+
if (BigInt.asUintN(64, message.x2) !== message.x2) {
|
|
428
|
+
throw new globalThis.Error("value provided for field message.x2 of type fixed64 too large");
|
|
429
|
+
}
|
|
430
|
+
writer.uint32(25).fixed64(message.x2.toString());
|
|
431
|
+
}
|
|
432
|
+
if (message.x3 !== void 0 && message.x3 !== BigInt("0")) {
|
|
433
|
+
if (BigInt.asUintN(64, message.x3) !== message.x3) {
|
|
434
|
+
throw new globalThis.Error("value provided for field message.x3 of type fixed64 too large");
|
|
435
|
+
}
|
|
436
|
+
writer.uint32(33).fixed64(message.x3.toString());
|
|
437
|
+
}
|
|
438
|
+
return writer;
|
|
439
|
+
},
|
|
440
|
+
decode(input, length) {
|
|
441
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
442
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
443
|
+
const message = createBaseB256();
|
|
444
|
+
while (reader.pos < end) {
|
|
445
|
+
const tag = reader.uint32();
|
|
446
|
+
switch (tag >>> 3) {
|
|
447
|
+
case 1:
|
|
448
|
+
if (tag !== 9) {
|
|
449
|
+
break;
|
|
450
|
+
}
|
|
451
|
+
message.x0 = longToBigint$3(reader.fixed64());
|
|
452
|
+
continue;
|
|
453
|
+
case 2:
|
|
454
|
+
if (tag !== 17) {
|
|
455
|
+
break;
|
|
456
|
+
}
|
|
457
|
+
message.x1 = longToBigint$3(reader.fixed64());
|
|
458
|
+
continue;
|
|
459
|
+
case 3:
|
|
460
|
+
if (tag !== 25) {
|
|
461
|
+
break;
|
|
462
|
+
}
|
|
463
|
+
message.x2 = longToBigint$3(reader.fixed64());
|
|
464
|
+
continue;
|
|
465
|
+
case 4:
|
|
466
|
+
if (tag !== 33) {
|
|
467
|
+
break;
|
|
468
|
+
}
|
|
469
|
+
message.x3 = longToBigint$3(reader.fixed64());
|
|
470
|
+
continue;
|
|
471
|
+
}
|
|
472
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
473
|
+
break;
|
|
474
|
+
}
|
|
475
|
+
reader.skipType(tag & 7);
|
|
476
|
+
}
|
|
477
|
+
return message;
|
|
478
|
+
},
|
|
479
|
+
fromJSON(object) {
|
|
480
|
+
return {
|
|
481
|
+
x0: isSet$3(object.x0) ? BigInt(object.x0) : BigInt("0"),
|
|
482
|
+
x1: isSet$3(object.x1) ? BigInt(object.x1) : BigInt("0"),
|
|
483
|
+
x2: isSet$3(object.x2) ? BigInt(object.x2) : BigInt("0"),
|
|
484
|
+
x3: isSet$3(object.x3) ? BigInt(object.x3) : BigInt("0")
|
|
485
|
+
};
|
|
486
|
+
},
|
|
487
|
+
toJSON(message) {
|
|
488
|
+
const obj = {};
|
|
489
|
+
if (message.x0 !== void 0 && message.x0 !== BigInt("0")) {
|
|
490
|
+
obj.x0 = message.x0.toString();
|
|
491
|
+
}
|
|
492
|
+
if (message.x1 !== void 0 && message.x1 !== BigInt("0")) {
|
|
493
|
+
obj.x1 = message.x1.toString();
|
|
494
|
+
}
|
|
495
|
+
if (message.x2 !== void 0 && message.x2 !== BigInt("0")) {
|
|
496
|
+
obj.x2 = message.x2.toString();
|
|
497
|
+
}
|
|
498
|
+
if (message.x3 !== void 0 && message.x3 !== BigInt("0")) {
|
|
499
|
+
obj.x3 = message.x3.toString();
|
|
500
|
+
}
|
|
501
|
+
return obj;
|
|
502
|
+
},
|
|
503
|
+
create(base) {
|
|
504
|
+
return B256.fromPartial(base ?? {});
|
|
505
|
+
},
|
|
506
|
+
fromPartial(object) {
|
|
507
|
+
const message = createBaseB256();
|
|
508
|
+
message.x0 = object.x0 ?? BigInt("0");
|
|
509
|
+
message.x1 = object.x1 ?? BigInt("0");
|
|
510
|
+
message.x2 = object.x2 ?? BigInt("0");
|
|
511
|
+
message.x3 = object.x3 ?? BigInt("0");
|
|
512
|
+
return message;
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
function bytesFromBase64$1(b64) {
|
|
516
|
+
if (globalThis.Buffer) {
|
|
517
|
+
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
518
|
+
} else {
|
|
519
|
+
const bin = globalThis.atob(b64);
|
|
520
|
+
const arr = new Uint8Array(bin.length);
|
|
521
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
522
|
+
arr[i] = bin.charCodeAt(i);
|
|
523
|
+
}
|
|
524
|
+
return arr;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
function base64FromBytes$1(arr) {
|
|
528
|
+
if (globalThis.Buffer) {
|
|
529
|
+
return globalThis.Buffer.from(arr).toString("base64");
|
|
530
|
+
} else {
|
|
531
|
+
const bin = [];
|
|
532
|
+
arr.forEach((byte) => {
|
|
533
|
+
bin.push(globalThis.String.fromCharCode(byte));
|
|
534
|
+
});
|
|
535
|
+
return globalThis.btoa(bin.join(""));
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
function longToBigint$3(long) {
|
|
539
|
+
return BigInt(long.toString());
|
|
540
|
+
}
|
|
541
|
+
if (_m0.util.Long !== Long) {
|
|
542
|
+
_m0.util.Long = Long;
|
|
543
|
+
_m0.configure();
|
|
544
|
+
}
|
|
545
|
+
function isSet$3(value) {
|
|
546
|
+
return value !== null && value !== void 0;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
const common = {
|
|
550
|
+
__proto__: null,
|
|
551
|
+
Address: Address,
|
|
552
|
+
B256: B256,
|
|
553
|
+
Bloom: Bloom$1,
|
|
554
|
+
U128: U128,
|
|
555
|
+
U256: U256,
|
|
556
|
+
protobufPackage: protobufPackage$2
|
|
557
|
+
};
|
|
558
|
+
|
|
559
|
+
function createBaseTimestamp() {
|
|
560
|
+
return { seconds: BigInt("0"), nanos: 0 };
|
|
561
|
+
}
|
|
562
|
+
const Timestamp = {
|
|
563
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
564
|
+
if (message.seconds !== void 0 && message.seconds !== BigInt("0")) {
|
|
565
|
+
if (BigInt.asIntN(64, message.seconds) !== message.seconds) {
|
|
566
|
+
throw new globalThis.Error("value provided for field message.seconds of type int64 too large");
|
|
567
|
+
}
|
|
568
|
+
writer.uint32(8).int64(message.seconds.toString());
|
|
569
|
+
}
|
|
570
|
+
if (message.nanos !== void 0 && message.nanos !== 0) {
|
|
571
|
+
writer.uint32(16).int32(message.nanos);
|
|
572
|
+
}
|
|
573
|
+
return writer;
|
|
574
|
+
},
|
|
575
|
+
decode(input, length) {
|
|
576
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
577
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
578
|
+
const message = createBaseTimestamp();
|
|
579
|
+
while (reader.pos < end) {
|
|
580
|
+
const tag = reader.uint32();
|
|
581
|
+
switch (tag >>> 3) {
|
|
582
|
+
case 1:
|
|
583
|
+
if (tag !== 8) {
|
|
584
|
+
break;
|
|
585
|
+
}
|
|
586
|
+
message.seconds = longToBigint$2(reader.int64());
|
|
587
|
+
continue;
|
|
588
|
+
case 2:
|
|
589
|
+
if (tag !== 16) {
|
|
590
|
+
break;
|
|
591
|
+
}
|
|
592
|
+
message.nanos = reader.int32();
|
|
593
|
+
continue;
|
|
594
|
+
}
|
|
595
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
596
|
+
break;
|
|
597
|
+
}
|
|
598
|
+
reader.skipType(tag & 7);
|
|
599
|
+
}
|
|
600
|
+
return message;
|
|
601
|
+
},
|
|
602
|
+
fromJSON(object) {
|
|
603
|
+
return {
|
|
604
|
+
seconds: isSet$2(object.seconds) ? BigInt(object.seconds) : BigInt("0"),
|
|
605
|
+
nanos: isSet$2(object.nanos) ? globalThis.Number(object.nanos) : 0
|
|
606
|
+
};
|
|
607
|
+
},
|
|
608
|
+
toJSON(message) {
|
|
609
|
+
const obj = {};
|
|
610
|
+
if (message.seconds !== void 0 && message.seconds !== BigInt("0")) {
|
|
611
|
+
obj.seconds = message.seconds.toString();
|
|
612
|
+
}
|
|
613
|
+
if (message.nanos !== void 0 && message.nanos !== 0) {
|
|
614
|
+
obj.nanos = Math.round(message.nanos);
|
|
615
|
+
}
|
|
616
|
+
return obj;
|
|
617
|
+
},
|
|
618
|
+
create(base) {
|
|
619
|
+
return Timestamp.fromPartial(base ?? {});
|
|
620
|
+
},
|
|
621
|
+
fromPartial(object) {
|
|
622
|
+
const message = createBaseTimestamp();
|
|
623
|
+
message.seconds = object.seconds ?? BigInt("0");
|
|
624
|
+
message.nanos = object.nanos ?? 0;
|
|
625
|
+
return message;
|
|
626
|
+
}
|
|
627
|
+
};
|
|
628
|
+
function longToBigint$2(long) {
|
|
629
|
+
return BigInt(long.toString());
|
|
630
|
+
}
|
|
631
|
+
if (_m0.util.Long !== Long) {
|
|
632
|
+
_m0.util.Long = Long;
|
|
633
|
+
_m0.configure();
|
|
634
|
+
}
|
|
635
|
+
function isSet$2(value) {
|
|
636
|
+
return value !== null && value !== void 0;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
const protobufPackage$1 = "evm.v2";
|
|
640
|
+
function createBaseBlock() {
|
|
641
|
+
return { header: void 0, withdrawals: [], transactions: [], receipts: [], logs: [] };
|
|
642
|
+
}
|
|
643
|
+
const Block$1 = {
|
|
644
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
645
|
+
if (message.header !== void 0) {
|
|
646
|
+
BlockHeader$1.encode(message.header, writer.uint32(10).fork()).ldelim();
|
|
647
|
+
}
|
|
648
|
+
if (message.withdrawals !== void 0 && message.withdrawals.length !== 0) {
|
|
649
|
+
for (const v of message.withdrawals) {
|
|
650
|
+
Withdrawal$1.encode(v, writer.uint32(18).fork()).ldelim();
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
if (message.transactions !== void 0 && message.transactions.length !== 0) {
|
|
654
|
+
for (const v of message.transactions) {
|
|
655
|
+
Transaction$1.encode(v, writer.uint32(26).fork()).ldelim();
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
if (message.receipts !== void 0 && message.receipts.length !== 0) {
|
|
659
|
+
for (const v of message.receipts) {
|
|
660
|
+
TransactionReceipt$1.encode(v, writer.uint32(34).fork()).ldelim();
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
if (message.logs !== void 0 && message.logs.length !== 0) {
|
|
664
|
+
for (const v of message.logs) {
|
|
665
|
+
Log$1.encode(v, writer.uint32(42).fork()).ldelim();
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
return writer;
|
|
669
|
+
},
|
|
670
|
+
decode(input, length) {
|
|
671
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
672
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
673
|
+
const message = createBaseBlock();
|
|
674
|
+
while (reader.pos < end) {
|
|
675
|
+
const tag = reader.uint32();
|
|
676
|
+
switch (tag >>> 3) {
|
|
677
|
+
case 1:
|
|
678
|
+
if (tag !== 10) {
|
|
679
|
+
break;
|
|
680
|
+
}
|
|
681
|
+
message.header = BlockHeader$1.decode(reader, reader.uint32());
|
|
682
|
+
continue;
|
|
683
|
+
case 2:
|
|
684
|
+
if (tag !== 18) {
|
|
685
|
+
break;
|
|
686
|
+
}
|
|
687
|
+
message.withdrawals.push(Withdrawal$1.decode(reader, reader.uint32()));
|
|
688
|
+
continue;
|
|
689
|
+
case 3:
|
|
690
|
+
if (tag !== 26) {
|
|
691
|
+
break;
|
|
692
|
+
}
|
|
693
|
+
message.transactions.push(Transaction$1.decode(reader, reader.uint32()));
|
|
694
|
+
continue;
|
|
695
|
+
case 4:
|
|
696
|
+
if (tag !== 34) {
|
|
697
|
+
break;
|
|
698
|
+
}
|
|
699
|
+
message.receipts.push(TransactionReceipt$1.decode(reader, reader.uint32()));
|
|
700
|
+
continue;
|
|
701
|
+
case 5:
|
|
702
|
+
if (tag !== 42) {
|
|
703
|
+
break;
|
|
704
|
+
}
|
|
705
|
+
message.logs.push(Log$1.decode(reader, reader.uint32()));
|
|
706
|
+
continue;
|
|
707
|
+
}
|
|
708
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
709
|
+
break;
|
|
710
|
+
}
|
|
711
|
+
reader.skipType(tag & 7);
|
|
712
|
+
}
|
|
713
|
+
return message;
|
|
714
|
+
},
|
|
715
|
+
fromJSON(object) {
|
|
716
|
+
return {
|
|
717
|
+
header: isSet$1(object.header) ? BlockHeader$1.fromJSON(object.header) : void 0,
|
|
718
|
+
withdrawals: globalThis.Array.isArray(object?.withdrawals) ? object.withdrawals.map((e) => Withdrawal$1.fromJSON(e)) : [],
|
|
719
|
+
transactions: globalThis.Array.isArray(object?.transactions) ? object.transactions.map((e) => Transaction$1.fromJSON(e)) : [],
|
|
720
|
+
receipts: globalThis.Array.isArray(object?.receipts) ? object.receipts.map((e) => TransactionReceipt$1.fromJSON(e)) : [],
|
|
721
|
+
logs: globalThis.Array.isArray(object?.logs) ? object.logs.map((e) => Log$1.fromJSON(e)) : []
|
|
722
|
+
};
|
|
723
|
+
},
|
|
724
|
+
toJSON(message) {
|
|
725
|
+
const obj = {};
|
|
726
|
+
if (message.header !== void 0) {
|
|
727
|
+
obj.header = BlockHeader$1.toJSON(message.header);
|
|
728
|
+
}
|
|
729
|
+
if (message.withdrawals?.length) {
|
|
730
|
+
obj.withdrawals = message.withdrawals.map((e) => Withdrawal$1.toJSON(e));
|
|
731
|
+
}
|
|
732
|
+
if (message.transactions?.length) {
|
|
733
|
+
obj.transactions = message.transactions.map((e) => Transaction$1.toJSON(e));
|
|
734
|
+
}
|
|
735
|
+
if (message.receipts?.length) {
|
|
736
|
+
obj.receipts = message.receipts.map((e) => TransactionReceipt$1.toJSON(e));
|
|
737
|
+
}
|
|
738
|
+
if (message.logs?.length) {
|
|
739
|
+
obj.logs = message.logs.map((e) => Log$1.toJSON(e));
|
|
740
|
+
}
|
|
741
|
+
return obj;
|
|
742
|
+
},
|
|
743
|
+
create(base) {
|
|
744
|
+
return Block$1.fromPartial(base ?? {});
|
|
745
|
+
},
|
|
746
|
+
fromPartial(object) {
|
|
747
|
+
const message = createBaseBlock();
|
|
748
|
+
message.header = object.header !== void 0 && object.header !== null ? BlockHeader$1.fromPartial(object.header) : void 0;
|
|
749
|
+
message.withdrawals = object.withdrawals?.map((e) => Withdrawal$1.fromPartial(e)) || [];
|
|
750
|
+
message.transactions = object.transactions?.map((e) => Transaction$1.fromPartial(e)) || [];
|
|
751
|
+
message.receipts = object.receipts?.map((e) => TransactionReceipt$1.fromPartial(e)) || [];
|
|
752
|
+
message.logs = object.logs?.map((e) => Log$1.fromPartial(e)) || [];
|
|
753
|
+
return message;
|
|
754
|
+
}
|
|
755
|
+
};
|
|
756
|
+
function createBaseBlockHeader() {
|
|
757
|
+
return {
|
|
758
|
+
number: BigInt("0"),
|
|
759
|
+
hash: void 0,
|
|
760
|
+
parentHash: void 0,
|
|
761
|
+
unclesHash: void 0,
|
|
762
|
+
miner: void 0,
|
|
763
|
+
stateRoot: void 0,
|
|
764
|
+
transactionsRoot: void 0,
|
|
765
|
+
receiptsRoot: void 0,
|
|
766
|
+
logsBloom: void 0,
|
|
767
|
+
difficulty: void 0,
|
|
768
|
+
gasLimit: void 0,
|
|
769
|
+
gasUsed: void 0,
|
|
770
|
+
timestamp: void 0,
|
|
771
|
+
extraData: new Uint8Array(0),
|
|
772
|
+
mixHash: void 0,
|
|
773
|
+
nonce: BigInt("0"),
|
|
774
|
+
baseFeePerGas: void 0,
|
|
775
|
+
withdrawalsRoot: void 0,
|
|
776
|
+
totalDifficulty: void 0,
|
|
777
|
+
uncles: [],
|
|
778
|
+
size: void 0,
|
|
779
|
+
blobGasUsed: BigInt("0"),
|
|
780
|
+
excessBlobGas: BigInt("0"),
|
|
781
|
+
parentBeaconBlockRoot: void 0
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
const BlockHeader$1 = {
|
|
785
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
786
|
+
if (message.number !== void 0 && message.number !== BigInt("0")) {
|
|
787
|
+
if (BigInt.asUintN(64, message.number) !== message.number) {
|
|
788
|
+
throw new globalThis.Error("value provided for field message.number of type uint64 too large");
|
|
789
|
+
}
|
|
790
|
+
writer.uint32(8).uint64(message.number.toString());
|
|
791
|
+
}
|
|
792
|
+
if (message.hash !== void 0) {
|
|
793
|
+
B256.encode(message.hash, writer.uint32(18).fork()).ldelim();
|
|
794
|
+
}
|
|
795
|
+
if (message.parentHash !== void 0) {
|
|
796
|
+
B256.encode(message.parentHash, writer.uint32(26).fork()).ldelim();
|
|
797
|
+
}
|
|
798
|
+
if (message.unclesHash !== void 0) {
|
|
799
|
+
B256.encode(message.unclesHash, writer.uint32(34).fork()).ldelim();
|
|
800
|
+
}
|
|
801
|
+
if (message.miner !== void 0) {
|
|
802
|
+
Address.encode(message.miner, writer.uint32(42).fork()).ldelim();
|
|
803
|
+
}
|
|
804
|
+
if (message.stateRoot !== void 0) {
|
|
805
|
+
B256.encode(message.stateRoot, writer.uint32(50).fork()).ldelim();
|
|
806
|
+
}
|
|
807
|
+
if (message.transactionsRoot !== void 0) {
|
|
808
|
+
B256.encode(message.transactionsRoot, writer.uint32(58).fork()).ldelim();
|
|
809
|
+
}
|
|
810
|
+
if (message.receiptsRoot !== void 0) {
|
|
811
|
+
B256.encode(message.receiptsRoot, writer.uint32(66).fork()).ldelim();
|
|
812
|
+
}
|
|
813
|
+
if (message.logsBloom !== void 0) {
|
|
814
|
+
Bloom$1.encode(message.logsBloom, writer.uint32(74).fork()).ldelim();
|
|
815
|
+
}
|
|
816
|
+
if (message.difficulty !== void 0) {
|
|
817
|
+
U256.encode(message.difficulty, writer.uint32(82).fork()).ldelim();
|
|
818
|
+
}
|
|
819
|
+
if (message.gasLimit !== void 0) {
|
|
820
|
+
U256.encode(message.gasLimit, writer.uint32(90).fork()).ldelim();
|
|
821
|
+
}
|
|
822
|
+
if (message.gasUsed !== void 0) {
|
|
823
|
+
U256.encode(message.gasUsed, writer.uint32(98).fork()).ldelim();
|
|
824
|
+
}
|
|
825
|
+
if (message.timestamp !== void 0) {
|
|
826
|
+
Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(106).fork()).ldelim();
|
|
827
|
+
}
|
|
828
|
+
if (message.extraData !== void 0 && message.extraData.length !== 0) {
|
|
829
|
+
writer.uint32(114).bytes(message.extraData);
|
|
830
|
+
}
|
|
831
|
+
if (message.mixHash !== void 0) {
|
|
832
|
+
B256.encode(message.mixHash, writer.uint32(122).fork()).ldelim();
|
|
833
|
+
}
|
|
834
|
+
if (message.nonce !== void 0 && message.nonce !== BigInt("0")) {
|
|
835
|
+
if (BigInt.asUintN(64, message.nonce) !== message.nonce) {
|
|
836
|
+
throw new globalThis.Error("value provided for field message.nonce of type uint64 too large");
|
|
837
|
+
}
|
|
838
|
+
writer.uint32(128).uint64(message.nonce.toString());
|
|
839
|
+
}
|
|
840
|
+
if (message.baseFeePerGas !== void 0) {
|
|
841
|
+
U256.encode(message.baseFeePerGas, writer.uint32(138).fork()).ldelim();
|
|
842
|
+
}
|
|
843
|
+
if (message.withdrawalsRoot !== void 0) {
|
|
844
|
+
B256.encode(message.withdrawalsRoot, writer.uint32(146).fork()).ldelim();
|
|
845
|
+
}
|
|
846
|
+
if (message.totalDifficulty !== void 0) {
|
|
847
|
+
U256.encode(message.totalDifficulty, writer.uint32(154).fork()).ldelim();
|
|
848
|
+
}
|
|
849
|
+
if (message.uncles !== void 0 && message.uncles.length !== 0) {
|
|
850
|
+
for (const v of message.uncles) {
|
|
851
|
+
B256.encode(v, writer.uint32(162).fork()).ldelim();
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
if (message.size !== void 0) {
|
|
855
|
+
U256.encode(message.size, writer.uint32(170).fork()).ldelim();
|
|
856
|
+
}
|
|
857
|
+
if (message.blobGasUsed !== void 0 && message.blobGasUsed !== BigInt("0")) {
|
|
858
|
+
if (BigInt.asUintN(64, message.blobGasUsed) !== message.blobGasUsed) {
|
|
859
|
+
throw new globalThis.Error("value provided for field message.blobGasUsed of type uint64 too large");
|
|
860
|
+
}
|
|
861
|
+
writer.uint32(176).uint64(message.blobGasUsed.toString());
|
|
862
|
+
}
|
|
863
|
+
if (message.excessBlobGas !== void 0 && message.excessBlobGas !== BigInt("0")) {
|
|
864
|
+
if (BigInt.asUintN(64, message.excessBlobGas) !== message.excessBlobGas) {
|
|
865
|
+
throw new globalThis.Error("value provided for field message.excessBlobGas of type uint64 too large");
|
|
866
|
+
}
|
|
867
|
+
writer.uint32(184).uint64(message.excessBlobGas.toString());
|
|
868
|
+
}
|
|
869
|
+
if (message.parentBeaconBlockRoot !== void 0) {
|
|
870
|
+
B256.encode(message.parentBeaconBlockRoot, writer.uint32(194).fork()).ldelim();
|
|
871
|
+
}
|
|
872
|
+
return writer;
|
|
873
|
+
},
|
|
874
|
+
decode(input, length) {
|
|
875
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
876
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
877
|
+
const message = createBaseBlockHeader();
|
|
878
|
+
while (reader.pos < end) {
|
|
879
|
+
const tag = reader.uint32();
|
|
880
|
+
switch (tag >>> 3) {
|
|
881
|
+
case 1:
|
|
882
|
+
if (tag !== 8) {
|
|
883
|
+
break;
|
|
884
|
+
}
|
|
885
|
+
message.number = longToBigint$1(reader.uint64());
|
|
886
|
+
continue;
|
|
887
|
+
case 2:
|
|
888
|
+
if (tag !== 18) {
|
|
889
|
+
break;
|
|
890
|
+
}
|
|
891
|
+
message.hash = B256.decode(reader, reader.uint32());
|
|
892
|
+
continue;
|
|
893
|
+
case 3:
|
|
894
|
+
if (tag !== 26) {
|
|
895
|
+
break;
|
|
896
|
+
}
|
|
897
|
+
message.parentHash = B256.decode(reader, reader.uint32());
|
|
898
|
+
continue;
|
|
899
|
+
case 4:
|
|
900
|
+
if (tag !== 34) {
|
|
901
|
+
break;
|
|
902
|
+
}
|
|
903
|
+
message.unclesHash = B256.decode(reader, reader.uint32());
|
|
904
|
+
continue;
|
|
905
|
+
case 5:
|
|
906
|
+
if (tag !== 42) {
|
|
907
|
+
break;
|
|
908
|
+
}
|
|
909
|
+
message.miner = Address.decode(reader, reader.uint32());
|
|
910
|
+
continue;
|
|
911
|
+
case 6:
|
|
912
|
+
if (tag !== 50) {
|
|
913
|
+
break;
|
|
914
|
+
}
|
|
915
|
+
message.stateRoot = B256.decode(reader, reader.uint32());
|
|
916
|
+
continue;
|
|
917
|
+
case 7:
|
|
918
|
+
if (tag !== 58) {
|
|
919
|
+
break;
|
|
920
|
+
}
|
|
921
|
+
message.transactionsRoot = B256.decode(reader, reader.uint32());
|
|
922
|
+
continue;
|
|
923
|
+
case 8:
|
|
924
|
+
if (tag !== 66) {
|
|
925
|
+
break;
|
|
926
|
+
}
|
|
927
|
+
message.receiptsRoot = B256.decode(reader, reader.uint32());
|
|
928
|
+
continue;
|
|
929
|
+
case 9:
|
|
930
|
+
if (tag !== 74) {
|
|
931
|
+
break;
|
|
932
|
+
}
|
|
933
|
+
message.logsBloom = Bloom$1.decode(reader, reader.uint32());
|
|
934
|
+
continue;
|
|
935
|
+
case 10:
|
|
936
|
+
if (tag !== 82) {
|
|
937
|
+
break;
|
|
938
|
+
}
|
|
939
|
+
message.difficulty = U256.decode(reader, reader.uint32());
|
|
940
|
+
continue;
|
|
941
|
+
case 11:
|
|
942
|
+
if (tag !== 90) {
|
|
943
|
+
break;
|
|
944
|
+
}
|
|
945
|
+
message.gasLimit = U256.decode(reader, reader.uint32());
|
|
946
|
+
continue;
|
|
947
|
+
case 12:
|
|
948
|
+
if (tag !== 98) {
|
|
949
|
+
break;
|
|
950
|
+
}
|
|
951
|
+
message.gasUsed = U256.decode(reader, reader.uint32());
|
|
952
|
+
continue;
|
|
953
|
+
case 13:
|
|
954
|
+
if (tag !== 106) {
|
|
955
|
+
break;
|
|
956
|
+
}
|
|
957
|
+
message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
958
|
+
continue;
|
|
959
|
+
case 14:
|
|
960
|
+
if (tag !== 114) {
|
|
961
|
+
break;
|
|
962
|
+
}
|
|
963
|
+
message.extraData = reader.bytes();
|
|
964
|
+
continue;
|
|
965
|
+
case 15:
|
|
966
|
+
if (tag !== 122) {
|
|
967
|
+
break;
|
|
968
|
+
}
|
|
969
|
+
message.mixHash = B256.decode(reader, reader.uint32());
|
|
970
|
+
continue;
|
|
971
|
+
case 16:
|
|
972
|
+
if (tag !== 128) {
|
|
973
|
+
break;
|
|
974
|
+
}
|
|
975
|
+
message.nonce = longToBigint$1(reader.uint64());
|
|
976
|
+
continue;
|
|
977
|
+
case 17:
|
|
978
|
+
if (tag !== 138) {
|
|
979
|
+
break;
|
|
980
|
+
}
|
|
981
|
+
message.baseFeePerGas = U256.decode(reader, reader.uint32());
|
|
982
|
+
continue;
|
|
983
|
+
case 18:
|
|
984
|
+
if (tag !== 146) {
|
|
985
|
+
break;
|
|
986
|
+
}
|
|
987
|
+
message.withdrawalsRoot = B256.decode(reader, reader.uint32());
|
|
988
|
+
continue;
|
|
989
|
+
case 19:
|
|
990
|
+
if (tag !== 154) {
|
|
991
|
+
break;
|
|
992
|
+
}
|
|
993
|
+
message.totalDifficulty = U256.decode(reader, reader.uint32());
|
|
994
|
+
continue;
|
|
995
|
+
case 20:
|
|
996
|
+
if (tag !== 162) {
|
|
997
|
+
break;
|
|
998
|
+
}
|
|
999
|
+
message.uncles.push(B256.decode(reader, reader.uint32()));
|
|
1000
|
+
continue;
|
|
1001
|
+
case 21:
|
|
1002
|
+
if (tag !== 170) {
|
|
1003
|
+
break;
|
|
1004
|
+
}
|
|
1005
|
+
message.size = U256.decode(reader, reader.uint32());
|
|
1006
|
+
continue;
|
|
1007
|
+
case 22:
|
|
1008
|
+
if (tag !== 176) {
|
|
1009
|
+
break;
|
|
1010
|
+
}
|
|
1011
|
+
message.blobGasUsed = longToBigint$1(reader.uint64());
|
|
1012
|
+
continue;
|
|
1013
|
+
case 23:
|
|
1014
|
+
if (tag !== 184) {
|
|
1015
|
+
break;
|
|
1016
|
+
}
|
|
1017
|
+
message.excessBlobGas = longToBigint$1(reader.uint64());
|
|
1018
|
+
continue;
|
|
1019
|
+
case 24:
|
|
1020
|
+
if (tag !== 194) {
|
|
1021
|
+
break;
|
|
1022
|
+
}
|
|
1023
|
+
message.parentBeaconBlockRoot = B256.decode(reader, reader.uint32());
|
|
1024
|
+
continue;
|
|
1025
|
+
}
|
|
1026
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1027
|
+
break;
|
|
1028
|
+
}
|
|
1029
|
+
reader.skipType(tag & 7);
|
|
1030
|
+
}
|
|
1031
|
+
return message;
|
|
1032
|
+
},
|
|
1033
|
+
fromJSON(object) {
|
|
1034
|
+
return {
|
|
1035
|
+
number: isSet$1(object.number) ? BigInt(object.number) : BigInt("0"),
|
|
1036
|
+
hash: isSet$1(object.hash) ? B256.fromJSON(object.hash) : void 0,
|
|
1037
|
+
parentHash: isSet$1(object.parentHash) ? B256.fromJSON(object.parentHash) : void 0,
|
|
1038
|
+
unclesHash: isSet$1(object.unclesHash) ? B256.fromJSON(object.unclesHash) : void 0,
|
|
1039
|
+
miner: isSet$1(object.miner) ? Address.fromJSON(object.miner) : void 0,
|
|
1040
|
+
stateRoot: isSet$1(object.stateRoot) ? B256.fromJSON(object.stateRoot) : void 0,
|
|
1041
|
+
transactionsRoot: isSet$1(object.transactionsRoot) ? B256.fromJSON(object.transactionsRoot) : void 0,
|
|
1042
|
+
receiptsRoot: isSet$1(object.receiptsRoot) ? B256.fromJSON(object.receiptsRoot) : void 0,
|
|
1043
|
+
logsBloom: isSet$1(object.logsBloom) ? Bloom$1.fromJSON(object.logsBloom) : void 0,
|
|
1044
|
+
difficulty: isSet$1(object.difficulty) ? U256.fromJSON(object.difficulty) : void 0,
|
|
1045
|
+
gasLimit: isSet$1(object.gasLimit) ? U256.fromJSON(object.gasLimit) : void 0,
|
|
1046
|
+
gasUsed: isSet$1(object.gasUsed) ? U256.fromJSON(object.gasUsed) : void 0,
|
|
1047
|
+
timestamp: isSet$1(object.timestamp) ? fromJsonTimestamp(object.timestamp) : void 0,
|
|
1048
|
+
extraData: isSet$1(object.extraData) ? bytesFromBase64(object.extraData) : new Uint8Array(0),
|
|
1049
|
+
mixHash: isSet$1(object.mixHash) ? B256.fromJSON(object.mixHash) : void 0,
|
|
1050
|
+
nonce: isSet$1(object.nonce) ? BigInt(object.nonce) : BigInt("0"),
|
|
1051
|
+
baseFeePerGas: isSet$1(object.baseFeePerGas) ? U256.fromJSON(object.baseFeePerGas) : void 0,
|
|
1052
|
+
withdrawalsRoot: isSet$1(object.withdrawalsRoot) ? B256.fromJSON(object.withdrawalsRoot) : void 0,
|
|
1053
|
+
totalDifficulty: isSet$1(object.totalDifficulty) ? U256.fromJSON(object.totalDifficulty) : void 0,
|
|
1054
|
+
uncles: globalThis.Array.isArray(object?.uncles) ? object.uncles.map((e) => B256.fromJSON(e)) : [],
|
|
1055
|
+
size: isSet$1(object.size) ? U256.fromJSON(object.size) : void 0,
|
|
1056
|
+
blobGasUsed: isSet$1(object.blobGasUsed) ? BigInt(object.blobGasUsed) : BigInt("0"),
|
|
1057
|
+
excessBlobGas: isSet$1(object.excessBlobGas) ? BigInt(object.excessBlobGas) : BigInt("0"),
|
|
1058
|
+
parentBeaconBlockRoot: isSet$1(object.parentBeaconBlockRoot) ? B256.fromJSON(object.parentBeaconBlockRoot) : void 0
|
|
1059
|
+
};
|
|
1060
|
+
},
|
|
1061
|
+
toJSON(message) {
|
|
1062
|
+
const obj = {};
|
|
1063
|
+
if (message.number !== void 0 && message.number !== BigInt("0")) {
|
|
1064
|
+
obj.number = message.number.toString();
|
|
1065
|
+
}
|
|
1066
|
+
if (message.hash !== void 0) {
|
|
1067
|
+
obj.hash = B256.toJSON(message.hash);
|
|
1068
|
+
}
|
|
1069
|
+
if (message.parentHash !== void 0) {
|
|
1070
|
+
obj.parentHash = B256.toJSON(message.parentHash);
|
|
1071
|
+
}
|
|
1072
|
+
if (message.unclesHash !== void 0) {
|
|
1073
|
+
obj.unclesHash = B256.toJSON(message.unclesHash);
|
|
1074
|
+
}
|
|
1075
|
+
if (message.miner !== void 0) {
|
|
1076
|
+
obj.miner = Address.toJSON(message.miner);
|
|
1077
|
+
}
|
|
1078
|
+
if (message.stateRoot !== void 0) {
|
|
1079
|
+
obj.stateRoot = B256.toJSON(message.stateRoot);
|
|
1080
|
+
}
|
|
1081
|
+
if (message.transactionsRoot !== void 0) {
|
|
1082
|
+
obj.transactionsRoot = B256.toJSON(message.transactionsRoot);
|
|
1083
|
+
}
|
|
1084
|
+
if (message.receiptsRoot !== void 0) {
|
|
1085
|
+
obj.receiptsRoot = B256.toJSON(message.receiptsRoot);
|
|
1086
|
+
}
|
|
1087
|
+
if (message.logsBloom !== void 0) {
|
|
1088
|
+
obj.logsBloom = Bloom$1.toJSON(message.logsBloom);
|
|
1089
|
+
}
|
|
1090
|
+
if (message.difficulty !== void 0) {
|
|
1091
|
+
obj.difficulty = U256.toJSON(message.difficulty);
|
|
1092
|
+
}
|
|
1093
|
+
if (message.gasLimit !== void 0) {
|
|
1094
|
+
obj.gasLimit = U256.toJSON(message.gasLimit);
|
|
1095
|
+
}
|
|
1096
|
+
if (message.gasUsed !== void 0) {
|
|
1097
|
+
obj.gasUsed = U256.toJSON(message.gasUsed);
|
|
1098
|
+
}
|
|
1099
|
+
if (message.timestamp !== void 0) {
|
|
1100
|
+
obj.timestamp = message.timestamp.toISOString();
|
|
1101
|
+
}
|
|
1102
|
+
if (message.extraData !== void 0 && message.extraData.length !== 0) {
|
|
1103
|
+
obj.extraData = base64FromBytes(message.extraData);
|
|
1104
|
+
}
|
|
1105
|
+
if (message.mixHash !== void 0) {
|
|
1106
|
+
obj.mixHash = B256.toJSON(message.mixHash);
|
|
1107
|
+
}
|
|
1108
|
+
if (message.nonce !== void 0 && message.nonce !== BigInt("0")) {
|
|
1109
|
+
obj.nonce = message.nonce.toString();
|
|
1110
|
+
}
|
|
1111
|
+
if (message.baseFeePerGas !== void 0) {
|
|
1112
|
+
obj.baseFeePerGas = U256.toJSON(message.baseFeePerGas);
|
|
1113
|
+
}
|
|
1114
|
+
if (message.withdrawalsRoot !== void 0) {
|
|
1115
|
+
obj.withdrawalsRoot = B256.toJSON(message.withdrawalsRoot);
|
|
1116
|
+
}
|
|
1117
|
+
if (message.totalDifficulty !== void 0) {
|
|
1118
|
+
obj.totalDifficulty = U256.toJSON(message.totalDifficulty);
|
|
1119
|
+
}
|
|
1120
|
+
if (message.uncles?.length) {
|
|
1121
|
+
obj.uncles = message.uncles.map((e) => B256.toJSON(e));
|
|
1122
|
+
}
|
|
1123
|
+
if (message.size !== void 0) {
|
|
1124
|
+
obj.size = U256.toJSON(message.size);
|
|
1125
|
+
}
|
|
1126
|
+
if (message.blobGasUsed !== void 0 && message.blobGasUsed !== BigInt("0")) {
|
|
1127
|
+
obj.blobGasUsed = message.blobGasUsed.toString();
|
|
1128
|
+
}
|
|
1129
|
+
if (message.excessBlobGas !== void 0 && message.excessBlobGas !== BigInt("0")) {
|
|
1130
|
+
obj.excessBlobGas = message.excessBlobGas.toString();
|
|
1131
|
+
}
|
|
1132
|
+
if (message.parentBeaconBlockRoot !== void 0) {
|
|
1133
|
+
obj.parentBeaconBlockRoot = B256.toJSON(message.parentBeaconBlockRoot);
|
|
1134
|
+
}
|
|
1135
|
+
return obj;
|
|
1136
|
+
},
|
|
1137
|
+
create(base) {
|
|
1138
|
+
return BlockHeader$1.fromPartial(base ?? {});
|
|
1139
|
+
},
|
|
1140
|
+
fromPartial(object) {
|
|
1141
|
+
const message = createBaseBlockHeader();
|
|
1142
|
+
message.number = object.number ?? BigInt("0");
|
|
1143
|
+
message.hash = object.hash !== void 0 && object.hash !== null ? B256.fromPartial(object.hash) : void 0;
|
|
1144
|
+
message.parentHash = object.parentHash !== void 0 && object.parentHash !== null ? B256.fromPartial(object.parentHash) : void 0;
|
|
1145
|
+
message.unclesHash = object.unclesHash !== void 0 && object.unclesHash !== null ? B256.fromPartial(object.unclesHash) : void 0;
|
|
1146
|
+
message.miner = object.miner !== void 0 && object.miner !== null ? Address.fromPartial(object.miner) : void 0;
|
|
1147
|
+
message.stateRoot = object.stateRoot !== void 0 && object.stateRoot !== null ? B256.fromPartial(object.stateRoot) : void 0;
|
|
1148
|
+
message.transactionsRoot = object.transactionsRoot !== void 0 && object.transactionsRoot !== null ? B256.fromPartial(object.transactionsRoot) : void 0;
|
|
1149
|
+
message.receiptsRoot = object.receiptsRoot !== void 0 && object.receiptsRoot !== null ? B256.fromPartial(object.receiptsRoot) : void 0;
|
|
1150
|
+
message.logsBloom = object.logsBloom !== void 0 && object.logsBloom !== null ? Bloom$1.fromPartial(object.logsBloom) : void 0;
|
|
1151
|
+
message.difficulty = object.difficulty !== void 0 && object.difficulty !== null ? U256.fromPartial(object.difficulty) : void 0;
|
|
1152
|
+
message.gasLimit = object.gasLimit !== void 0 && object.gasLimit !== null ? U256.fromPartial(object.gasLimit) : void 0;
|
|
1153
|
+
message.gasUsed = object.gasUsed !== void 0 && object.gasUsed !== null ? U256.fromPartial(object.gasUsed) : void 0;
|
|
1154
|
+
message.timestamp = object.timestamp ?? void 0;
|
|
1155
|
+
message.extraData = object.extraData ?? new Uint8Array(0);
|
|
1156
|
+
message.mixHash = object.mixHash !== void 0 && object.mixHash !== null ? B256.fromPartial(object.mixHash) : void 0;
|
|
1157
|
+
message.nonce = object.nonce ?? BigInt("0");
|
|
1158
|
+
message.baseFeePerGas = object.baseFeePerGas !== void 0 && object.baseFeePerGas !== null ? U256.fromPartial(object.baseFeePerGas) : void 0;
|
|
1159
|
+
message.withdrawalsRoot = object.withdrawalsRoot !== void 0 && object.withdrawalsRoot !== null ? B256.fromPartial(object.withdrawalsRoot) : void 0;
|
|
1160
|
+
message.totalDifficulty = object.totalDifficulty !== void 0 && object.totalDifficulty !== null ? U256.fromPartial(object.totalDifficulty) : void 0;
|
|
1161
|
+
message.uncles = object.uncles?.map((e) => B256.fromPartial(e)) || [];
|
|
1162
|
+
message.size = object.size !== void 0 && object.size !== null ? U256.fromPartial(object.size) : void 0;
|
|
1163
|
+
message.blobGasUsed = object.blobGasUsed ?? BigInt("0");
|
|
1164
|
+
message.excessBlobGas = object.excessBlobGas ?? BigInt("0");
|
|
1165
|
+
message.parentBeaconBlockRoot = object.parentBeaconBlockRoot !== void 0 && object.parentBeaconBlockRoot !== null ? B256.fromPartial(object.parentBeaconBlockRoot) : void 0;
|
|
1166
|
+
return message;
|
|
1167
|
+
}
|
|
1168
|
+
};
|
|
1169
|
+
function createBaseWithdrawal() {
|
|
1170
|
+
return {
|
|
1171
|
+
index: BigInt("0"),
|
|
1172
|
+
validatorIndex: BigInt("0"),
|
|
1173
|
+
withdrawalIndex: BigInt("0"),
|
|
1174
|
+
address: void 0,
|
|
1175
|
+
amount: void 0
|
|
1176
|
+
};
|
|
1177
|
+
}
|
|
1178
|
+
const Withdrawal$1 = {
|
|
1179
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
1180
|
+
if (message.index !== void 0 && message.index !== BigInt("0")) {
|
|
1181
|
+
if (BigInt.asUintN(64, message.index) !== message.index) {
|
|
1182
|
+
throw new globalThis.Error("value provided for field message.index of type uint64 too large");
|
|
1183
|
+
}
|
|
1184
|
+
writer.uint32(8).uint64(message.index.toString());
|
|
1185
|
+
}
|
|
1186
|
+
if (message.validatorIndex !== void 0 && message.validatorIndex !== BigInt("0")) {
|
|
1187
|
+
if (BigInt.asUintN(64, message.validatorIndex) !== message.validatorIndex) {
|
|
1188
|
+
throw new globalThis.Error("value provided for field message.validatorIndex of type uint64 too large");
|
|
1189
|
+
}
|
|
1190
|
+
writer.uint32(16).uint64(message.validatorIndex.toString());
|
|
1191
|
+
}
|
|
1192
|
+
if (message.withdrawalIndex !== void 0 && message.withdrawalIndex !== BigInt("0")) {
|
|
1193
|
+
if (BigInt.asUintN(64, message.withdrawalIndex) !== message.withdrawalIndex) {
|
|
1194
|
+
throw new globalThis.Error("value provided for field message.withdrawalIndex of type uint64 too large");
|
|
1195
|
+
}
|
|
1196
|
+
writer.uint32(24).uint64(message.withdrawalIndex.toString());
|
|
1197
|
+
}
|
|
1198
|
+
if (message.address !== void 0) {
|
|
1199
|
+
Address.encode(message.address, writer.uint32(34).fork()).ldelim();
|
|
1200
|
+
}
|
|
1201
|
+
if (message.amount !== void 0) {
|
|
1202
|
+
U256.encode(message.amount, writer.uint32(42).fork()).ldelim();
|
|
1203
|
+
}
|
|
1204
|
+
return writer;
|
|
1205
|
+
},
|
|
1206
|
+
decode(input, length) {
|
|
1207
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
1208
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
1209
|
+
const message = createBaseWithdrawal();
|
|
1210
|
+
while (reader.pos < end) {
|
|
1211
|
+
const tag = reader.uint32();
|
|
1212
|
+
switch (tag >>> 3) {
|
|
1213
|
+
case 1:
|
|
1214
|
+
if (tag !== 8) {
|
|
1215
|
+
break;
|
|
1216
|
+
}
|
|
1217
|
+
message.index = longToBigint$1(reader.uint64());
|
|
1218
|
+
continue;
|
|
1219
|
+
case 2:
|
|
1220
|
+
if (tag !== 16) {
|
|
1221
|
+
break;
|
|
1222
|
+
}
|
|
1223
|
+
message.validatorIndex = longToBigint$1(reader.uint64());
|
|
1224
|
+
continue;
|
|
1225
|
+
case 3:
|
|
1226
|
+
if (tag !== 24) {
|
|
1227
|
+
break;
|
|
1228
|
+
}
|
|
1229
|
+
message.withdrawalIndex = longToBigint$1(reader.uint64());
|
|
1230
|
+
continue;
|
|
1231
|
+
case 4:
|
|
1232
|
+
if (tag !== 34) {
|
|
1233
|
+
break;
|
|
1234
|
+
}
|
|
1235
|
+
message.address = Address.decode(reader, reader.uint32());
|
|
1236
|
+
continue;
|
|
1237
|
+
case 5:
|
|
1238
|
+
if (tag !== 42) {
|
|
1239
|
+
break;
|
|
1240
|
+
}
|
|
1241
|
+
message.amount = U256.decode(reader, reader.uint32());
|
|
1242
|
+
continue;
|
|
1243
|
+
}
|
|
1244
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1245
|
+
break;
|
|
1246
|
+
}
|
|
1247
|
+
reader.skipType(tag & 7);
|
|
1248
|
+
}
|
|
1249
|
+
return message;
|
|
1250
|
+
},
|
|
1251
|
+
fromJSON(object) {
|
|
1252
|
+
return {
|
|
1253
|
+
index: isSet$1(object.index) ? BigInt(object.index) : BigInt("0"),
|
|
1254
|
+
validatorIndex: isSet$1(object.validatorIndex) ? BigInt(object.validatorIndex) : BigInt("0"),
|
|
1255
|
+
withdrawalIndex: isSet$1(object.withdrawalIndex) ? BigInt(object.withdrawalIndex) : BigInt("0"),
|
|
1256
|
+
address: isSet$1(object.address) ? Address.fromJSON(object.address) : void 0,
|
|
1257
|
+
amount: isSet$1(object.amount) ? U256.fromJSON(object.amount) : void 0
|
|
1258
|
+
};
|
|
1259
|
+
},
|
|
1260
|
+
toJSON(message) {
|
|
1261
|
+
const obj = {};
|
|
1262
|
+
if (message.index !== void 0 && message.index !== BigInt("0")) {
|
|
1263
|
+
obj.index = message.index.toString();
|
|
1264
|
+
}
|
|
1265
|
+
if (message.validatorIndex !== void 0 && message.validatorIndex !== BigInt("0")) {
|
|
1266
|
+
obj.validatorIndex = message.validatorIndex.toString();
|
|
1267
|
+
}
|
|
1268
|
+
if (message.withdrawalIndex !== void 0 && message.withdrawalIndex !== BigInt("0")) {
|
|
1269
|
+
obj.withdrawalIndex = message.withdrawalIndex.toString();
|
|
1270
|
+
}
|
|
1271
|
+
if (message.address !== void 0) {
|
|
1272
|
+
obj.address = Address.toJSON(message.address);
|
|
1273
|
+
}
|
|
1274
|
+
if (message.amount !== void 0) {
|
|
1275
|
+
obj.amount = U256.toJSON(message.amount);
|
|
1276
|
+
}
|
|
1277
|
+
return obj;
|
|
1278
|
+
},
|
|
1279
|
+
create(base) {
|
|
1280
|
+
return Withdrawal$1.fromPartial(base ?? {});
|
|
1281
|
+
},
|
|
1282
|
+
fromPartial(object) {
|
|
1283
|
+
const message = createBaseWithdrawal();
|
|
1284
|
+
message.index = object.index ?? BigInt("0");
|
|
1285
|
+
message.validatorIndex = object.validatorIndex ?? BigInt("0");
|
|
1286
|
+
message.withdrawalIndex = object.withdrawalIndex ?? BigInt("0");
|
|
1287
|
+
message.address = object.address !== void 0 && object.address !== null ? Address.fromPartial(object.address) : void 0;
|
|
1288
|
+
message.amount = object.amount !== void 0 && object.amount !== null ? U256.fromPartial(object.amount) : void 0;
|
|
1289
|
+
return message;
|
|
1290
|
+
}
|
|
1291
|
+
};
|
|
1292
|
+
function createBaseTransaction() {
|
|
1293
|
+
return {
|
|
1294
|
+
hash: void 0,
|
|
1295
|
+
nonce: BigInt("0"),
|
|
1296
|
+
transactionIndex: BigInt("0"),
|
|
1297
|
+
from: void 0,
|
|
1298
|
+
to: void 0,
|
|
1299
|
+
value: void 0,
|
|
1300
|
+
gasPrice: void 0,
|
|
1301
|
+
gas: void 0,
|
|
1302
|
+
maxFeePerGas: void 0,
|
|
1303
|
+
maxPriorityFeePerGas: void 0,
|
|
1304
|
+
input: new Uint8Array(0),
|
|
1305
|
+
signature: void 0,
|
|
1306
|
+
chainId: BigInt("0"),
|
|
1307
|
+
accessList: [],
|
|
1308
|
+
transactionType: BigInt("0"),
|
|
1309
|
+
maxFeePerBlobGas: void 0,
|
|
1310
|
+
blobVersionedHashes: []
|
|
1311
|
+
};
|
|
1312
|
+
}
|
|
1313
|
+
const Transaction$1 = {
|
|
1314
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
1315
|
+
if (message.hash !== void 0) {
|
|
1316
|
+
B256.encode(message.hash, writer.uint32(10).fork()).ldelim();
|
|
1317
|
+
}
|
|
1318
|
+
if (message.nonce !== void 0 && message.nonce !== BigInt("0")) {
|
|
1319
|
+
if (BigInt.asUintN(64, message.nonce) !== message.nonce) {
|
|
1320
|
+
throw new globalThis.Error("value provided for field message.nonce of type uint64 too large");
|
|
1321
|
+
}
|
|
1322
|
+
writer.uint32(16).uint64(message.nonce.toString());
|
|
1323
|
+
}
|
|
1324
|
+
if (message.transactionIndex !== void 0 && message.transactionIndex !== BigInt("0")) {
|
|
1325
|
+
if (BigInt.asUintN(64, message.transactionIndex) !== message.transactionIndex) {
|
|
1326
|
+
throw new globalThis.Error("value provided for field message.transactionIndex of type uint64 too large");
|
|
1327
|
+
}
|
|
1328
|
+
writer.uint32(24).uint64(message.transactionIndex.toString());
|
|
1329
|
+
}
|
|
1330
|
+
if (message.from !== void 0) {
|
|
1331
|
+
Address.encode(message.from, writer.uint32(34).fork()).ldelim();
|
|
1332
|
+
}
|
|
1333
|
+
if (message.to !== void 0) {
|
|
1334
|
+
Address.encode(message.to, writer.uint32(42).fork()).ldelim();
|
|
1335
|
+
}
|
|
1336
|
+
if (message.value !== void 0) {
|
|
1337
|
+
U256.encode(message.value, writer.uint32(50).fork()).ldelim();
|
|
1338
|
+
}
|
|
1339
|
+
if (message.gasPrice !== void 0) {
|
|
1340
|
+
U128.encode(message.gasPrice, writer.uint32(58).fork()).ldelim();
|
|
1341
|
+
}
|
|
1342
|
+
if (message.gas !== void 0) {
|
|
1343
|
+
U256.encode(message.gas, writer.uint32(66).fork()).ldelim();
|
|
1344
|
+
}
|
|
1345
|
+
if (message.maxFeePerGas !== void 0) {
|
|
1346
|
+
U128.encode(message.maxFeePerGas, writer.uint32(74).fork()).ldelim();
|
|
1347
|
+
}
|
|
1348
|
+
if (message.maxPriorityFeePerGas !== void 0) {
|
|
1349
|
+
U128.encode(message.maxPriorityFeePerGas, writer.uint32(82).fork()).ldelim();
|
|
1350
|
+
}
|
|
1351
|
+
if (message.input !== void 0 && message.input.length !== 0) {
|
|
1352
|
+
writer.uint32(90).bytes(message.input);
|
|
1353
|
+
}
|
|
1354
|
+
if (message.signature !== void 0) {
|
|
1355
|
+
Signature$1.encode(message.signature, writer.uint32(98).fork()).ldelim();
|
|
1356
|
+
}
|
|
1357
|
+
if (message.chainId !== void 0 && message.chainId !== BigInt("0")) {
|
|
1358
|
+
if (BigInt.asUintN(64, message.chainId) !== message.chainId) {
|
|
1359
|
+
throw new globalThis.Error("value provided for field message.chainId of type uint64 too large");
|
|
1360
|
+
}
|
|
1361
|
+
writer.uint32(104).uint64(message.chainId.toString());
|
|
1362
|
+
}
|
|
1363
|
+
if (message.accessList !== void 0 && message.accessList.length !== 0) {
|
|
1364
|
+
for (const v of message.accessList) {
|
|
1365
|
+
AccessListItem$1.encode(v, writer.uint32(114).fork()).ldelim();
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
if (message.transactionType !== void 0 && message.transactionType !== BigInt("0")) {
|
|
1369
|
+
if (BigInt.asUintN(64, message.transactionType) !== message.transactionType) {
|
|
1370
|
+
throw new globalThis.Error("value provided for field message.transactionType of type uint64 too large");
|
|
1371
|
+
}
|
|
1372
|
+
writer.uint32(120).uint64(message.transactionType.toString());
|
|
1373
|
+
}
|
|
1374
|
+
if (message.maxFeePerBlobGas !== void 0) {
|
|
1375
|
+
U128.encode(message.maxFeePerBlobGas, writer.uint32(130).fork()).ldelim();
|
|
1376
|
+
}
|
|
1377
|
+
if (message.blobVersionedHashes !== void 0 && message.blobVersionedHashes.length !== 0) {
|
|
1378
|
+
for (const v of message.blobVersionedHashes) {
|
|
1379
|
+
B256.encode(v, writer.uint32(138).fork()).ldelim();
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
return writer;
|
|
1383
|
+
},
|
|
1384
|
+
decode(input, length) {
|
|
1385
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
1386
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
1387
|
+
const message = createBaseTransaction();
|
|
1388
|
+
while (reader.pos < end) {
|
|
1389
|
+
const tag = reader.uint32();
|
|
1390
|
+
switch (tag >>> 3) {
|
|
1391
|
+
case 1:
|
|
1392
|
+
if (tag !== 10) {
|
|
1393
|
+
break;
|
|
1394
|
+
}
|
|
1395
|
+
message.hash = B256.decode(reader, reader.uint32());
|
|
1396
|
+
continue;
|
|
1397
|
+
case 2:
|
|
1398
|
+
if (tag !== 16) {
|
|
1399
|
+
break;
|
|
1400
|
+
}
|
|
1401
|
+
message.nonce = longToBigint$1(reader.uint64());
|
|
1402
|
+
continue;
|
|
1403
|
+
case 3:
|
|
1404
|
+
if (tag !== 24) {
|
|
1405
|
+
break;
|
|
1406
|
+
}
|
|
1407
|
+
message.transactionIndex = longToBigint$1(reader.uint64());
|
|
1408
|
+
continue;
|
|
1409
|
+
case 4:
|
|
1410
|
+
if (tag !== 34) {
|
|
1411
|
+
break;
|
|
1412
|
+
}
|
|
1413
|
+
message.from = Address.decode(reader, reader.uint32());
|
|
1414
|
+
continue;
|
|
1415
|
+
case 5:
|
|
1416
|
+
if (tag !== 42) {
|
|
1417
|
+
break;
|
|
1418
|
+
}
|
|
1419
|
+
message.to = Address.decode(reader, reader.uint32());
|
|
1420
|
+
continue;
|
|
1421
|
+
case 6:
|
|
1422
|
+
if (tag !== 50) {
|
|
1423
|
+
break;
|
|
1424
|
+
}
|
|
1425
|
+
message.value = U256.decode(reader, reader.uint32());
|
|
1426
|
+
continue;
|
|
1427
|
+
case 7:
|
|
1428
|
+
if (tag !== 58) {
|
|
1429
|
+
break;
|
|
1430
|
+
}
|
|
1431
|
+
message.gasPrice = U128.decode(reader, reader.uint32());
|
|
1432
|
+
continue;
|
|
1433
|
+
case 8:
|
|
1434
|
+
if (tag !== 66) {
|
|
1435
|
+
break;
|
|
1436
|
+
}
|
|
1437
|
+
message.gas = U256.decode(reader, reader.uint32());
|
|
1438
|
+
continue;
|
|
1439
|
+
case 9:
|
|
1440
|
+
if (tag !== 74) {
|
|
1441
|
+
break;
|
|
1442
|
+
}
|
|
1443
|
+
message.maxFeePerGas = U128.decode(reader, reader.uint32());
|
|
1444
|
+
continue;
|
|
1445
|
+
case 10:
|
|
1446
|
+
if (tag !== 82) {
|
|
1447
|
+
break;
|
|
1448
|
+
}
|
|
1449
|
+
message.maxPriorityFeePerGas = U128.decode(reader, reader.uint32());
|
|
1450
|
+
continue;
|
|
1451
|
+
case 11:
|
|
1452
|
+
if (tag !== 90) {
|
|
1453
|
+
break;
|
|
1454
|
+
}
|
|
1455
|
+
message.input = reader.bytes();
|
|
1456
|
+
continue;
|
|
1457
|
+
case 12:
|
|
1458
|
+
if (tag !== 98) {
|
|
1459
|
+
break;
|
|
1460
|
+
}
|
|
1461
|
+
message.signature = Signature$1.decode(reader, reader.uint32());
|
|
1462
|
+
continue;
|
|
1463
|
+
case 13:
|
|
1464
|
+
if (tag !== 104) {
|
|
1465
|
+
break;
|
|
1466
|
+
}
|
|
1467
|
+
message.chainId = longToBigint$1(reader.uint64());
|
|
1468
|
+
continue;
|
|
1469
|
+
case 14:
|
|
1470
|
+
if (tag !== 114) {
|
|
1471
|
+
break;
|
|
1472
|
+
}
|
|
1473
|
+
message.accessList.push(AccessListItem$1.decode(reader, reader.uint32()));
|
|
1474
|
+
continue;
|
|
1475
|
+
case 15:
|
|
1476
|
+
if (tag !== 120) {
|
|
1477
|
+
break;
|
|
1478
|
+
}
|
|
1479
|
+
message.transactionType = longToBigint$1(reader.uint64());
|
|
1480
|
+
continue;
|
|
1481
|
+
case 16:
|
|
1482
|
+
if (tag !== 130) {
|
|
1483
|
+
break;
|
|
1484
|
+
}
|
|
1485
|
+
message.maxFeePerBlobGas = U128.decode(reader, reader.uint32());
|
|
1486
|
+
continue;
|
|
1487
|
+
case 17:
|
|
1488
|
+
if (tag !== 138) {
|
|
1489
|
+
break;
|
|
1490
|
+
}
|
|
1491
|
+
message.blobVersionedHashes.push(B256.decode(reader, reader.uint32()));
|
|
1492
|
+
continue;
|
|
1493
|
+
}
|
|
1494
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1495
|
+
break;
|
|
1496
|
+
}
|
|
1497
|
+
reader.skipType(tag & 7);
|
|
1498
|
+
}
|
|
1499
|
+
return message;
|
|
1500
|
+
},
|
|
1501
|
+
fromJSON(object) {
|
|
1502
|
+
return {
|
|
1503
|
+
hash: isSet$1(object.hash) ? B256.fromJSON(object.hash) : void 0,
|
|
1504
|
+
nonce: isSet$1(object.nonce) ? BigInt(object.nonce) : BigInt("0"),
|
|
1505
|
+
transactionIndex: isSet$1(object.transactionIndex) ? BigInt(object.transactionIndex) : BigInt("0"),
|
|
1506
|
+
from: isSet$1(object.from) ? Address.fromJSON(object.from) : void 0,
|
|
1507
|
+
to: isSet$1(object.to) ? Address.fromJSON(object.to) : void 0,
|
|
1508
|
+
value: isSet$1(object.value) ? U256.fromJSON(object.value) : void 0,
|
|
1509
|
+
gasPrice: isSet$1(object.gasPrice) ? U128.fromJSON(object.gasPrice) : void 0,
|
|
1510
|
+
gas: isSet$1(object.gas) ? U256.fromJSON(object.gas) : void 0,
|
|
1511
|
+
maxFeePerGas: isSet$1(object.maxFeePerGas) ? U128.fromJSON(object.maxFeePerGas) : void 0,
|
|
1512
|
+
maxPriorityFeePerGas: isSet$1(object.maxPriorityFeePerGas) ? U128.fromJSON(object.maxPriorityFeePerGas) : void 0,
|
|
1513
|
+
input: isSet$1(object.input) ? bytesFromBase64(object.input) : new Uint8Array(0),
|
|
1514
|
+
signature: isSet$1(object.signature) ? Signature$1.fromJSON(object.signature) : void 0,
|
|
1515
|
+
chainId: isSet$1(object.chainId) ? BigInt(object.chainId) : BigInt("0"),
|
|
1516
|
+
accessList: globalThis.Array.isArray(object?.accessList) ? object.accessList.map((e) => AccessListItem$1.fromJSON(e)) : [],
|
|
1517
|
+
transactionType: isSet$1(object.transactionType) ? BigInt(object.transactionType) : BigInt("0"),
|
|
1518
|
+
maxFeePerBlobGas: isSet$1(object.maxFeePerBlobGas) ? U128.fromJSON(object.maxFeePerBlobGas) : void 0,
|
|
1519
|
+
blobVersionedHashes: globalThis.Array.isArray(object?.blobVersionedHashes) ? object.blobVersionedHashes.map((e) => B256.fromJSON(e)) : []
|
|
1520
|
+
};
|
|
1521
|
+
},
|
|
1522
|
+
toJSON(message) {
|
|
1523
|
+
const obj = {};
|
|
1524
|
+
if (message.hash !== void 0) {
|
|
1525
|
+
obj.hash = B256.toJSON(message.hash);
|
|
1526
|
+
}
|
|
1527
|
+
if (message.nonce !== void 0 && message.nonce !== BigInt("0")) {
|
|
1528
|
+
obj.nonce = message.nonce.toString();
|
|
1529
|
+
}
|
|
1530
|
+
if (message.transactionIndex !== void 0 && message.transactionIndex !== BigInt("0")) {
|
|
1531
|
+
obj.transactionIndex = message.transactionIndex.toString();
|
|
1532
|
+
}
|
|
1533
|
+
if (message.from !== void 0) {
|
|
1534
|
+
obj.from = Address.toJSON(message.from);
|
|
1535
|
+
}
|
|
1536
|
+
if (message.to !== void 0) {
|
|
1537
|
+
obj.to = Address.toJSON(message.to);
|
|
1538
|
+
}
|
|
1539
|
+
if (message.value !== void 0) {
|
|
1540
|
+
obj.value = U256.toJSON(message.value);
|
|
1541
|
+
}
|
|
1542
|
+
if (message.gasPrice !== void 0) {
|
|
1543
|
+
obj.gasPrice = U128.toJSON(message.gasPrice);
|
|
1544
|
+
}
|
|
1545
|
+
if (message.gas !== void 0) {
|
|
1546
|
+
obj.gas = U256.toJSON(message.gas);
|
|
1547
|
+
}
|
|
1548
|
+
if (message.maxFeePerGas !== void 0) {
|
|
1549
|
+
obj.maxFeePerGas = U128.toJSON(message.maxFeePerGas);
|
|
1550
|
+
}
|
|
1551
|
+
if (message.maxPriorityFeePerGas !== void 0) {
|
|
1552
|
+
obj.maxPriorityFeePerGas = U128.toJSON(message.maxPriorityFeePerGas);
|
|
1553
|
+
}
|
|
1554
|
+
if (message.input !== void 0 && message.input.length !== 0) {
|
|
1555
|
+
obj.input = base64FromBytes(message.input);
|
|
1556
|
+
}
|
|
1557
|
+
if (message.signature !== void 0) {
|
|
1558
|
+
obj.signature = Signature$1.toJSON(message.signature);
|
|
1559
|
+
}
|
|
1560
|
+
if (message.chainId !== void 0 && message.chainId !== BigInt("0")) {
|
|
1561
|
+
obj.chainId = message.chainId.toString();
|
|
1562
|
+
}
|
|
1563
|
+
if (message.accessList?.length) {
|
|
1564
|
+
obj.accessList = message.accessList.map((e) => AccessListItem$1.toJSON(e));
|
|
1565
|
+
}
|
|
1566
|
+
if (message.transactionType !== void 0 && message.transactionType !== BigInt("0")) {
|
|
1567
|
+
obj.transactionType = message.transactionType.toString();
|
|
1568
|
+
}
|
|
1569
|
+
if (message.maxFeePerBlobGas !== void 0) {
|
|
1570
|
+
obj.maxFeePerBlobGas = U128.toJSON(message.maxFeePerBlobGas);
|
|
1571
|
+
}
|
|
1572
|
+
if (message.blobVersionedHashes?.length) {
|
|
1573
|
+
obj.blobVersionedHashes = message.blobVersionedHashes.map((e) => B256.toJSON(e));
|
|
1574
|
+
}
|
|
1575
|
+
return obj;
|
|
1576
|
+
},
|
|
1577
|
+
create(base) {
|
|
1578
|
+
return Transaction$1.fromPartial(base ?? {});
|
|
1579
|
+
},
|
|
1580
|
+
fromPartial(object) {
|
|
1581
|
+
const message = createBaseTransaction();
|
|
1582
|
+
message.hash = object.hash !== void 0 && object.hash !== null ? B256.fromPartial(object.hash) : void 0;
|
|
1583
|
+
message.nonce = object.nonce ?? BigInt("0");
|
|
1584
|
+
message.transactionIndex = object.transactionIndex ?? BigInt("0");
|
|
1585
|
+
message.from = object.from !== void 0 && object.from !== null ? Address.fromPartial(object.from) : void 0;
|
|
1586
|
+
message.to = object.to !== void 0 && object.to !== null ? Address.fromPartial(object.to) : void 0;
|
|
1587
|
+
message.value = object.value !== void 0 && object.value !== null ? U256.fromPartial(object.value) : void 0;
|
|
1588
|
+
message.gasPrice = object.gasPrice !== void 0 && object.gasPrice !== null ? U128.fromPartial(object.gasPrice) : void 0;
|
|
1589
|
+
message.gas = object.gas !== void 0 && object.gas !== null ? U256.fromPartial(object.gas) : void 0;
|
|
1590
|
+
message.maxFeePerGas = object.maxFeePerGas !== void 0 && object.maxFeePerGas !== null ? U128.fromPartial(object.maxFeePerGas) : void 0;
|
|
1591
|
+
message.maxPriorityFeePerGas = object.maxPriorityFeePerGas !== void 0 && object.maxPriorityFeePerGas !== null ? U128.fromPartial(object.maxPriorityFeePerGas) : void 0;
|
|
1592
|
+
message.input = object.input ?? new Uint8Array(0);
|
|
1593
|
+
message.signature = object.signature !== void 0 && object.signature !== null ? Signature$1.fromPartial(object.signature) : void 0;
|
|
1594
|
+
message.chainId = object.chainId ?? BigInt("0");
|
|
1595
|
+
message.accessList = object.accessList?.map((e) => AccessListItem$1.fromPartial(e)) || [];
|
|
1596
|
+
message.transactionType = object.transactionType ?? BigInt("0");
|
|
1597
|
+
message.maxFeePerBlobGas = object.maxFeePerBlobGas !== void 0 && object.maxFeePerBlobGas !== null ? U128.fromPartial(object.maxFeePerBlobGas) : void 0;
|
|
1598
|
+
message.blobVersionedHashes = object.blobVersionedHashes?.map((e) => B256.fromPartial(e)) || [];
|
|
1599
|
+
return message;
|
|
1600
|
+
}
|
|
1601
|
+
};
|
|
1602
|
+
function createBaseTransactionReceipt() {
|
|
1603
|
+
return {
|
|
1604
|
+
transactionHash: void 0,
|
|
1605
|
+
transactionIndex: BigInt("0"),
|
|
1606
|
+
cumulativeGasUsed: void 0,
|
|
1607
|
+
gasUsed: void 0,
|
|
1608
|
+
effectiveGasPrice: void 0,
|
|
1609
|
+
from: void 0,
|
|
1610
|
+
to: void 0,
|
|
1611
|
+
contractAddress: void 0,
|
|
1612
|
+
logsBloom: void 0,
|
|
1613
|
+
statusCode: BigInt("0"),
|
|
1614
|
+
transactionType: BigInt("0"),
|
|
1615
|
+
blobGasUsed: void 0,
|
|
1616
|
+
blobGasPrice: void 0
|
|
1617
|
+
};
|
|
1618
|
+
}
|
|
1619
|
+
const TransactionReceipt$1 = {
|
|
1620
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
1621
|
+
if (message.transactionHash !== void 0) {
|
|
1622
|
+
B256.encode(message.transactionHash, writer.uint32(10).fork()).ldelim();
|
|
1623
|
+
}
|
|
1624
|
+
if (message.transactionIndex !== void 0 && message.transactionIndex !== BigInt("0")) {
|
|
1625
|
+
if (BigInt.asUintN(64, message.transactionIndex) !== message.transactionIndex) {
|
|
1626
|
+
throw new globalThis.Error("value provided for field message.transactionIndex of type uint64 too large");
|
|
1627
|
+
}
|
|
1628
|
+
writer.uint32(16).uint64(message.transactionIndex.toString());
|
|
1629
|
+
}
|
|
1630
|
+
if (message.cumulativeGasUsed !== void 0) {
|
|
1631
|
+
U256.encode(message.cumulativeGasUsed, writer.uint32(26).fork()).ldelim();
|
|
1632
|
+
}
|
|
1633
|
+
if (message.gasUsed !== void 0) {
|
|
1634
|
+
U256.encode(message.gasUsed, writer.uint32(34).fork()).ldelim();
|
|
1635
|
+
}
|
|
1636
|
+
if (message.effectiveGasPrice !== void 0) {
|
|
1637
|
+
U128.encode(message.effectiveGasPrice, writer.uint32(42).fork()).ldelim();
|
|
1638
|
+
}
|
|
1639
|
+
if (message.from !== void 0) {
|
|
1640
|
+
Address.encode(message.from, writer.uint32(50).fork()).ldelim();
|
|
1641
|
+
}
|
|
1642
|
+
if (message.to !== void 0) {
|
|
1643
|
+
Address.encode(message.to, writer.uint32(58).fork()).ldelim();
|
|
1644
|
+
}
|
|
1645
|
+
if (message.contractAddress !== void 0) {
|
|
1646
|
+
Address.encode(message.contractAddress, writer.uint32(66).fork()).ldelim();
|
|
1647
|
+
}
|
|
1648
|
+
if (message.logsBloom !== void 0) {
|
|
1649
|
+
Bloom$1.encode(message.logsBloom, writer.uint32(74).fork()).ldelim();
|
|
1650
|
+
}
|
|
1651
|
+
if (message.statusCode !== void 0 && message.statusCode !== BigInt("0")) {
|
|
1652
|
+
if (BigInt.asUintN(64, message.statusCode) !== message.statusCode) {
|
|
1653
|
+
throw new globalThis.Error("value provided for field message.statusCode of type uint64 too large");
|
|
1654
|
+
}
|
|
1655
|
+
writer.uint32(80).uint64(message.statusCode.toString());
|
|
1656
|
+
}
|
|
1657
|
+
if (message.transactionType !== void 0 && message.transactionType !== BigInt("0")) {
|
|
1658
|
+
if (BigInt.asUintN(64, message.transactionType) !== message.transactionType) {
|
|
1659
|
+
throw new globalThis.Error("value provided for field message.transactionType of type uint64 too large");
|
|
1660
|
+
}
|
|
1661
|
+
writer.uint32(88).uint64(message.transactionType.toString());
|
|
1662
|
+
}
|
|
1663
|
+
if (message.blobGasUsed !== void 0) {
|
|
1664
|
+
U128.encode(message.blobGasUsed, writer.uint32(98).fork()).ldelim();
|
|
1665
|
+
}
|
|
1666
|
+
if (message.blobGasPrice !== void 0) {
|
|
1667
|
+
U128.encode(message.blobGasPrice, writer.uint32(106).fork()).ldelim();
|
|
1668
|
+
}
|
|
1669
|
+
return writer;
|
|
1670
|
+
},
|
|
1671
|
+
decode(input, length) {
|
|
1672
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
1673
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
1674
|
+
const message = createBaseTransactionReceipt();
|
|
1675
|
+
while (reader.pos < end) {
|
|
1676
|
+
const tag = reader.uint32();
|
|
1677
|
+
switch (tag >>> 3) {
|
|
1678
|
+
case 1:
|
|
1679
|
+
if (tag !== 10) {
|
|
1680
|
+
break;
|
|
1681
|
+
}
|
|
1682
|
+
message.transactionHash = B256.decode(reader, reader.uint32());
|
|
1683
|
+
continue;
|
|
1684
|
+
case 2:
|
|
1685
|
+
if (tag !== 16) {
|
|
1686
|
+
break;
|
|
1687
|
+
}
|
|
1688
|
+
message.transactionIndex = longToBigint$1(reader.uint64());
|
|
1689
|
+
continue;
|
|
1690
|
+
case 3:
|
|
1691
|
+
if (tag !== 26) {
|
|
1692
|
+
break;
|
|
1693
|
+
}
|
|
1694
|
+
message.cumulativeGasUsed = U256.decode(reader, reader.uint32());
|
|
1695
|
+
continue;
|
|
1696
|
+
case 4:
|
|
1697
|
+
if (tag !== 34) {
|
|
1698
|
+
break;
|
|
1699
|
+
}
|
|
1700
|
+
message.gasUsed = U256.decode(reader, reader.uint32());
|
|
1701
|
+
continue;
|
|
1702
|
+
case 5:
|
|
1703
|
+
if (tag !== 42) {
|
|
1704
|
+
break;
|
|
1705
|
+
}
|
|
1706
|
+
message.effectiveGasPrice = U128.decode(reader, reader.uint32());
|
|
1707
|
+
continue;
|
|
1708
|
+
case 6:
|
|
1709
|
+
if (tag !== 50) {
|
|
1710
|
+
break;
|
|
1711
|
+
}
|
|
1712
|
+
message.from = Address.decode(reader, reader.uint32());
|
|
1713
|
+
continue;
|
|
1714
|
+
case 7:
|
|
1715
|
+
if (tag !== 58) {
|
|
1716
|
+
break;
|
|
1717
|
+
}
|
|
1718
|
+
message.to = Address.decode(reader, reader.uint32());
|
|
1719
|
+
continue;
|
|
1720
|
+
case 8:
|
|
1721
|
+
if (tag !== 66) {
|
|
1722
|
+
break;
|
|
1723
|
+
}
|
|
1724
|
+
message.contractAddress = Address.decode(reader, reader.uint32());
|
|
1725
|
+
continue;
|
|
1726
|
+
case 9:
|
|
1727
|
+
if (tag !== 74) {
|
|
1728
|
+
break;
|
|
1729
|
+
}
|
|
1730
|
+
message.logsBloom = Bloom$1.decode(reader, reader.uint32());
|
|
1731
|
+
continue;
|
|
1732
|
+
case 10:
|
|
1733
|
+
if (tag !== 80) {
|
|
1734
|
+
break;
|
|
1735
|
+
}
|
|
1736
|
+
message.statusCode = longToBigint$1(reader.uint64());
|
|
1737
|
+
continue;
|
|
1738
|
+
case 11:
|
|
1739
|
+
if (tag !== 88) {
|
|
1740
|
+
break;
|
|
1741
|
+
}
|
|
1742
|
+
message.transactionType = longToBigint$1(reader.uint64());
|
|
1743
|
+
continue;
|
|
1744
|
+
case 12:
|
|
1745
|
+
if (tag !== 98) {
|
|
1746
|
+
break;
|
|
1747
|
+
}
|
|
1748
|
+
message.blobGasUsed = U128.decode(reader, reader.uint32());
|
|
1749
|
+
continue;
|
|
1750
|
+
case 13:
|
|
1751
|
+
if (tag !== 106) {
|
|
1752
|
+
break;
|
|
1753
|
+
}
|
|
1754
|
+
message.blobGasPrice = U128.decode(reader, reader.uint32());
|
|
1755
|
+
continue;
|
|
1756
|
+
}
|
|
1757
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1758
|
+
break;
|
|
1759
|
+
}
|
|
1760
|
+
reader.skipType(tag & 7);
|
|
1761
|
+
}
|
|
1762
|
+
return message;
|
|
1763
|
+
},
|
|
1764
|
+
fromJSON(object) {
|
|
1765
|
+
return {
|
|
1766
|
+
transactionHash: isSet$1(object.transactionHash) ? B256.fromJSON(object.transactionHash) : void 0,
|
|
1767
|
+
transactionIndex: isSet$1(object.transactionIndex) ? BigInt(object.transactionIndex) : BigInt("0"),
|
|
1768
|
+
cumulativeGasUsed: isSet$1(object.cumulativeGasUsed) ? U256.fromJSON(object.cumulativeGasUsed) : void 0,
|
|
1769
|
+
gasUsed: isSet$1(object.gasUsed) ? U256.fromJSON(object.gasUsed) : void 0,
|
|
1770
|
+
effectiveGasPrice: isSet$1(object.effectiveGasPrice) ? U128.fromJSON(object.effectiveGasPrice) : void 0,
|
|
1771
|
+
from: isSet$1(object.from) ? Address.fromJSON(object.from) : void 0,
|
|
1772
|
+
to: isSet$1(object.to) ? Address.fromJSON(object.to) : void 0,
|
|
1773
|
+
contractAddress: isSet$1(object.contractAddress) ? Address.fromJSON(object.contractAddress) : void 0,
|
|
1774
|
+
logsBloom: isSet$1(object.logsBloom) ? Bloom$1.fromJSON(object.logsBloom) : void 0,
|
|
1775
|
+
statusCode: isSet$1(object.statusCode) ? BigInt(object.statusCode) : BigInt("0"),
|
|
1776
|
+
transactionType: isSet$1(object.transactionType) ? BigInt(object.transactionType) : BigInt("0"),
|
|
1777
|
+
blobGasUsed: isSet$1(object.blobGasUsed) ? U128.fromJSON(object.blobGasUsed) : void 0,
|
|
1778
|
+
blobGasPrice: isSet$1(object.blobGasPrice) ? U128.fromJSON(object.blobGasPrice) : void 0
|
|
1779
|
+
};
|
|
1780
|
+
},
|
|
1781
|
+
toJSON(message) {
|
|
1782
|
+
const obj = {};
|
|
1783
|
+
if (message.transactionHash !== void 0) {
|
|
1784
|
+
obj.transactionHash = B256.toJSON(message.transactionHash);
|
|
1785
|
+
}
|
|
1786
|
+
if (message.transactionIndex !== void 0 && message.transactionIndex !== BigInt("0")) {
|
|
1787
|
+
obj.transactionIndex = message.transactionIndex.toString();
|
|
1788
|
+
}
|
|
1789
|
+
if (message.cumulativeGasUsed !== void 0) {
|
|
1790
|
+
obj.cumulativeGasUsed = U256.toJSON(message.cumulativeGasUsed);
|
|
1791
|
+
}
|
|
1792
|
+
if (message.gasUsed !== void 0) {
|
|
1793
|
+
obj.gasUsed = U256.toJSON(message.gasUsed);
|
|
1794
|
+
}
|
|
1795
|
+
if (message.effectiveGasPrice !== void 0) {
|
|
1796
|
+
obj.effectiveGasPrice = U128.toJSON(message.effectiveGasPrice);
|
|
1797
|
+
}
|
|
1798
|
+
if (message.from !== void 0) {
|
|
1799
|
+
obj.from = Address.toJSON(message.from);
|
|
1800
|
+
}
|
|
1801
|
+
if (message.to !== void 0) {
|
|
1802
|
+
obj.to = Address.toJSON(message.to);
|
|
1803
|
+
}
|
|
1804
|
+
if (message.contractAddress !== void 0) {
|
|
1805
|
+
obj.contractAddress = Address.toJSON(message.contractAddress);
|
|
1806
|
+
}
|
|
1807
|
+
if (message.logsBloom !== void 0) {
|
|
1808
|
+
obj.logsBloom = Bloom$1.toJSON(message.logsBloom);
|
|
1809
|
+
}
|
|
1810
|
+
if (message.statusCode !== void 0 && message.statusCode !== BigInt("0")) {
|
|
1811
|
+
obj.statusCode = message.statusCode.toString();
|
|
1812
|
+
}
|
|
1813
|
+
if (message.transactionType !== void 0 && message.transactionType !== BigInt("0")) {
|
|
1814
|
+
obj.transactionType = message.transactionType.toString();
|
|
1815
|
+
}
|
|
1816
|
+
if (message.blobGasUsed !== void 0) {
|
|
1817
|
+
obj.blobGasUsed = U128.toJSON(message.blobGasUsed);
|
|
1818
|
+
}
|
|
1819
|
+
if (message.blobGasPrice !== void 0) {
|
|
1820
|
+
obj.blobGasPrice = U128.toJSON(message.blobGasPrice);
|
|
1821
|
+
}
|
|
1822
|
+
return obj;
|
|
1823
|
+
},
|
|
1824
|
+
create(base) {
|
|
1825
|
+
return TransactionReceipt$1.fromPartial(base ?? {});
|
|
1826
|
+
},
|
|
1827
|
+
fromPartial(object) {
|
|
1828
|
+
const message = createBaseTransactionReceipt();
|
|
1829
|
+
message.transactionHash = object.transactionHash !== void 0 && object.transactionHash !== null ? B256.fromPartial(object.transactionHash) : void 0;
|
|
1830
|
+
message.transactionIndex = object.transactionIndex ?? BigInt("0");
|
|
1831
|
+
message.cumulativeGasUsed = object.cumulativeGasUsed !== void 0 && object.cumulativeGasUsed !== null ? U256.fromPartial(object.cumulativeGasUsed) : void 0;
|
|
1832
|
+
message.gasUsed = object.gasUsed !== void 0 && object.gasUsed !== null ? U256.fromPartial(object.gasUsed) : void 0;
|
|
1833
|
+
message.effectiveGasPrice = object.effectiveGasPrice !== void 0 && object.effectiveGasPrice !== null ? U128.fromPartial(object.effectiveGasPrice) : void 0;
|
|
1834
|
+
message.from = object.from !== void 0 && object.from !== null ? Address.fromPartial(object.from) : void 0;
|
|
1835
|
+
message.to = object.to !== void 0 && object.to !== null ? Address.fromPartial(object.to) : void 0;
|
|
1836
|
+
message.contractAddress = object.contractAddress !== void 0 && object.contractAddress !== null ? Address.fromPartial(object.contractAddress) : void 0;
|
|
1837
|
+
message.logsBloom = object.logsBloom !== void 0 && object.logsBloom !== null ? Bloom$1.fromPartial(object.logsBloom) : void 0;
|
|
1838
|
+
message.statusCode = object.statusCode ?? BigInt("0");
|
|
1839
|
+
message.transactionType = object.transactionType ?? BigInt("0");
|
|
1840
|
+
message.blobGasUsed = object.blobGasUsed !== void 0 && object.blobGasUsed !== null ? U128.fromPartial(object.blobGasUsed) : void 0;
|
|
1841
|
+
message.blobGasPrice = object.blobGasPrice !== void 0 && object.blobGasPrice !== null ? U128.fromPartial(object.blobGasPrice) : void 0;
|
|
1842
|
+
return message;
|
|
1843
|
+
}
|
|
1844
|
+
};
|
|
1845
|
+
function createBaseLog() {
|
|
1846
|
+
return {
|
|
1847
|
+
address: void 0,
|
|
1848
|
+
topics: [],
|
|
1849
|
+
data: new Uint8Array(0),
|
|
1850
|
+
logIndex: BigInt("0"),
|
|
1851
|
+
transactionIndex: BigInt("0"),
|
|
1852
|
+
transactionHash: void 0
|
|
1853
|
+
};
|
|
1854
|
+
}
|
|
1855
|
+
const Log$1 = {
|
|
1856
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
1857
|
+
if (message.address !== void 0) {
|
|
1858
|
+
Address.encode(message.address, writer.uint32(10).fork()).ldelim();
|
|
1859
|
+
}
|
|
1860
|
+
if (message.topics !== void 0 && message.topics.length !== 0) {
|
|
1861
|
+
for (const v of message.topics) {
|
|
1862
|
+
B256.encode(v, writer.uint32(18).fork()).ldelim();
|
|
1863
|
+
}
|
|
1864
|
+
}
|
|
1865
|
+
if (message.data !== void 0 && message.data.length !== 0) {
|
|
1866
|
+
writer.uint32(26).bytes(message.data);
|
|
1867
|
+
}
|
|
1868
|
+
if (message.logIndex !== void 0 && message.logIndex !== BigInt("0")) {
|
|
1869
|
+
if (BigInt.asUintN(64, message.logIndex) !== message.logIndex) {
|
|
1870
|
+
throw new globalThis.Error("value provided for field message.logIndex of type uint64 too large");
|
|
1871
|
+
}
|
|
1872
|
+
writer.uint32(32).uint64(message.logIndex.toString());
|
|
1873
|
+
}
|
|
1874
|
+
if (message.transactionIndex !== void 0 && message.transactionIndex !== BigInt("0")) {
|
|
1875
|
+
if (BigInt.asUintN(64, message.transactionIndex) !== message.transactionIndex) {
|
|
1876
|
+
throw new globalThis.Error("value provided for field message.transactionIndex of type uint64 too large");
|
|
1877
|
+
}
|
|
1878
|
+
writer.uint32(40).uint64(message.transactionIndex.toString());
|
|
1879
|
+
}
|
|
1880
|
+
if (message.transactionHash !== void 0) {
|
|
1881
|
+
B256.encode(message.transactionHash, writer.uint32(50).fork()).ldelim();
|
|
1882
|
+
}
|
|
1883
|
+
return writer;
|
|
1884
|
+
},
|
|
1885
|
+
decode(input, length) {
|
|
1886
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
1887
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
1888
|
+
const message = createBaseLog();
|
|
1889
|
+
while (reader.pos < end) {
|
|
1890
|
+
const tag = reader.uint32();
|
|
1891
|
+
switch (tag >>> 3) {
|
|
1892
|
+
case 1:
|
|
1893
|
+
if (tag !== 10) {
|
|
1894
|
+
break;
|
|
1895
|
+
}
|
|
1896
|
+
message.address = Address.decode(reader, reader.uint32());
|
|
1897
|
+
continue;
|
|
1898
|
+
case 2:
|
|
1899
|
+
if (tag !== 18) {
|
|
1900
|
+
break;
|
|
1901
|
+
}
|
|
1902
|
+
message.topics.push(B256.decode(reader, reader.uint32()));
|
|
1903
|
+
continue;
|
|
1904
|
+
case 3:
|
|
1905
|
+
if (tag !== 26) {
|
|
1906
|
+
break;
|
|
1907
|
+
}
|
|
1908
|
+
message.data = reader.bytes();
|
|
1909
|
+
continue;
|
|
1910
|
+
case 4:
|
|
1911
|
+
if (tag !== 32) {
|
|
1912
|
+
break;
|
|
1913
|
+
}
|
|
1914
|
+
message.logIndex = longToBigint$1(reader.uint64());
|
|
1915
|
+
continue;
|
|
1916
|
+
case 5:
|
|
1917
|
+
if (tag !== 40) {
|
|
1918
|
+
break;
|
|
1919
|
+
}
|
|
1920
|
+
message.transactionIndex = longToBigint$1(reader.uint64());
|
|
1921
|
+
continue;
|
|
1922
|
+
case 6:
|
|
1923
|
+
if (tag !== 50) {
|
|
1924
|
+
break;
|
|
1925
|
+
}
|
|
1926
|
+
message.transactionHash = B256.decode(reader, reader.uint32());
|
|
1927
|
+
continue;
|
|
1928
|
+
}
|
|
1929
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1930
|
+
break;
|
|
1931
|
+
}
|
|
1932
|
+
reader.skipType(tag & 7);
|
|
1933
|
+
}
|
|
1934
|
+
return message;
|
|
1935
|
+
},
|
|
1936
|
+
fromJSON(object) {
|
|
1937
|
+
return {
|
|
1938
|
+
address: isSet$1(object.address) ? Address.fromJSON(object.address) : void 0,
|
|
1939
|
+
topics: globalThis.Array.isArray(object?.topics) ? object.topics.map((e) => B256.fromJSON(e)) : [],
|
|
1940
|
+
data: isSet$1(object.data) ? bytesFromBase64(object.data) : new Uint8Array(0),
|
|
1941
|
+
logIndex: isSet$1(object.logIndex) ? BigInt(object.logIndex) : BigInt("0"),
|
|
1942
|
+
transactionIndex: isSet$1(object.transactionIndex) ? BigInt(object.transactionIndex) : BigInt("0"),
|
|
1943
|
+
transactionHash: isSet$1(object.transactionHash) ? B256.fromJSON(object.transactionHash) : void 0
|
|
1944
|
+
};
|
|
1945
|
+
},
|
|
1946
|
+
toJSON(message) {
|
|
1947
|
+
const obj = {};
|
|
1948
|
+
if (message.address !== void 0) {
|
|
1949
|
+
obj.address = Address.toJSON(message.address);
|
|
1950
|
+
}
|
|
1951
|
+
if (message.topics?.length) {
|
|
1952
|
+
obj.topics = message.topics.map((e) => B256.toJSON(e));
|
|
1953
|
+
}
|
|
1954
|
+
if (message.data !== void 0 && message.data.length !== 0) {
|
|
1955
|
+
obj.data = base64FromBytes(message.data);
|
|
1956
|
+
}
|
|
1957
|
+
if (message.logIndex !== void 0 && message.logIndex !== BigInt("0")) {
|
|
1958
|
+
obj.logIndex = message.logIndex.toString();
|
|
1959
|
+
}
|
|
1960
|
+
if (message.transactionIndex !== void 0 && message.transactionIndex !== BigInt("0")) {
|
|
1961
|
+
obj.transactionIndex = message.transactionIndex.toString();
|
|
1962
|
+
}
|
|
1963
|
+
if (message.transactionHash !== void 0) {
|
|
1964
|
+
obj.transactionHash = B256.toJSON(message.transactionHash);
|
|
1965
|
+
}
|
|
1966
|
+
return obj;
|
|
1967
|
+
},
|
|
1968
|
+
create(base) {
|
|
1969
|
+
return Log$1.fromPartial(base ?? {});
|
|
1970
|
+
},
|
|
1971
|
+
fromPartial(object) {
|
|
1972
|
+
const message = createBaseLog();
|
|
1973
|
+
message.address = object.address !== void 0 && object.address !== null ? Address.fromPartial(object.address) : void 0;
|
|
1974
|
+
message.topics = object.topics?.map((e) => B256.fromPartial(e)) || [];
|
|
1975
|
+
message.data = object.data ?? new Uint8Array(0);
|
|
1976
|
+
message.logIndex = object.logIndex ?? BigInt("0");
|
|
1977
|
+
message.transactionIndex = object.transactionIndex ?? BigInt("0");
|
|
1978
|
+
message.transactionHash = object.transactionHash !== void 0 && object.transactionHash !== null ? B256.fromPartial(object.transactionHash) : void 0;
|
|
1979
|
+
return message;
|
|
1980
|
+
}
|
|
1981
|
+
};
|
|
1982
|
+
function createBaseSignature() {
|
|
1983
|
+
return { r: void 0, s: void 0, v: void 0, yParity: false };
|
|
1984
|
+
}
|
|
1985
|
+
const Signature$1 = {
|
|
1986
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
1987
|
+
if (message.r !== void 0) {
|
|
1988
|
+
U256.encode(message.r, writer.uint32(10).fork()).ldelim();
|
|
1989
|
+
}
|
|
1990
|
+
if (message.s !== void 0) {
|
|
1991
|
+
U256.encode(message.s, writer.uint32(18).fork()).ldelim();
|
|
1992
|
+
}
|
|
1993
|
+
if (message.v !== void 0) {
|
|
1994
|
+
U256.encode(message.v, writer.uint32(26).fork()).ldelim();
|
|
1995
|
+
}
|
|
1996
|
+
if (message.yParity !== void 0 && message.yParity !== false) {
|
|
1997
|
+
writer.uint32(32).bool(message.yParity);
|
|
1998
|
+
}
|
|
1999
|
+
return writer;
|
|
2000
|
+
},
|
|
2001
|
+
decode(input, length) {
|
|
2002
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
2003
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2004
|
+
const message = createBaseSignature();
|
|
2005
|
+
while (reader.pos < end) {
|
|
2006
|
+
const tag = reader.uint32();
|
|
2007
|
+
switch (tag >>> 3) {
|
|
2008
|
+
case 1:
|
|
2009
|
+
if (tag !== 10) {
|
|
2010
|
+
break;
|
|
2011
|
+
}
|
|
2012
|
+
message.r = U256.decode(reader, reader.uint32());
|
|
2013
|
+
continue;
|
|
2014
|
+
case 2:
|
|
2015
|
+
if (tag !== 18) {
|
|
2016
|
+
break;
|
|
2017
|
+
}
|
|
2018
|
+
message.s = U256.decode(reader, reader.uint32());
|
|
2019
|
+
continue;
|
|
2020
|
+
case 3:
|
|
2021
|
+
if (tag !== 26) {
|
|
2022
|
+
break;
|
|
2023
|
+
}
|
|
2024
|
+
message.v = U256.decode(reader, reader.uint32());
|
|
2025
|
+
continue;
|
|
2026
|
+
case 4:
|
|
2027
|
+
if (tag !== 32) {
|
|
2028
|
+
break;
|
|
2029
|
+
}
|
|
2030
|
+
message.yParity = reader.bool();
|
|
2031
|
+
continue;
|
|
2032
|
+
}
|
|
2033
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2034
|
+
break;
|
|
2035
|
+
}
|
|
2036
|
+
reader.skipType(tag & 7);
|
|
2037
|
+
}
|
|
2038
|
+
return message;
|
|
2039
|
+
},
|
|
2040
|
+
fromJSON(object) {
|
|
2041
|
+
return {
|
|
2042
|
+
r: isSet$1(object.r) ? U256.fromJSON(object.r) : void 0,
|
|
2043
|
+
s: isSet$1(object.s) ? U256.fromJSON(object.s) : void 0,
|
|
2044
|
+
v: isSet$1(object.v) ? U256.fromJSON(object.v) : void 0,
|
|
2045
|
+
yParity: isSet$1(object.yParity) ? globalThis.Boolean(object.yParity) : false
|
|
2046
|
+
};
|
|
2047
|
+
},
|
|
2048
|
+
toJSON(message) {
|
|
2049
|
+
const obj = {};
|
|
2050
|
+
if (message.r !== void 0) {
|
|
2051
|
+
obj.r = U256.toJSON(message.r);
|
|
2052
|
+
}
|
|
2053
|
+
if (message.s !== void 0) {
|
|
2054
|
+
obj.s = U256.toJSON(message.s);
|
|
2055
|
+
}
|
|
2056
|
+
if (message.v !== void 0) {
|
|
2057
|
+
obj.v = U256.toJSON(message.v);
|
|
2058
|
+
}
|
|
2059
|
+
if (message.yParity !== void 0 && message.yParity !== false) {
|
|
2060
|
+
obj.yParity = message.yParity;
|
|
2061
|
+
}
|
|
2062
|
+
return obj;
|
|
2063
|
+
},
|
|
2064
|
+
create(base) {
|
|
2065
|
+
return Signature$1.fromPartial(base ?? {});
|
|
2066
|
+
},
|
|
2067
|
+
fromPartial(object) {
|
|
2068
|
+
const message = createBaseSignature();
|
|
2069
|
+
message.r = object.r !== void 0 && object.r !== null ? U256.fromPartial(object.r) : void 0;
|
|
2070
|
+
message.s = object.s !== void 0 && object.s !== null ? U256.fromPartial(object.s) : void 0;
|
|
2071
|
+
message.v = object.v !== void 0 && object.v !== null ? U256.fromPartial(object.v) : void 0;
|
|
2072
|
+
message.yParity = object.yParity ?? false;
|
|
2073
|
+
return message;
|
|
2074
|
+
}
|
|
2075
|
+
};
|
|
2076
|
+
function createBaseAccessListItem() {
|
|
2077
|
+
return { address: void 0, storageKeys: [] };
|
|
2078
|
+
}
|
|
2079
|
+
const AccessListItem$1 = {
|
|
2080
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
2081
|
+
if (message.address !== void 0) {
|
|
2082
|
+
Address.encode(message.address, writer.uint32(10).fork()).ldelim();
|
|
2083
|
+
}
|
|
2084
|
+
if (message.storageKeys !== void 0 && message.storageKeys.length !== 0) {
|
|
2085
|
+
for (const v of message.storageKeys) {
|
|
2086
|
+
B256.encode(v, writer.uint32(18).fork()).ldelim();
|
|
2087
|
+
}
|
|
2088
|
+
}
|
|
2089
|
+
return writer;
|
|
2090
|
+
},
|
|
2091
|
+
decode(input, length) {
|
|
2092
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
2093
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2094
|
+
const message = createBaseAccessListItem();
|
|
2095
|
+
while (reader.pos < end) {
|
|
2096
|
+
const tag = reader.uint32();
|
|
2097
|
+
switch (tag >>> 3) {
|
|
2098
|
+
case 1:
|
|
2099
|
+
if (tag !== 10) {
|
|
2100
|
+
break;
|
|
2101
|
+
}
|
|
2102
|
+
message.address = Address.decode(reader, reader.uint32());
|
|
2103
|
+
continue;
|
|
2104
|
+
case 2:
|
|
2105
|
+
if (tag !== 18) {
|
|
2106
|
+
break;
|
|
2107
|
+
}
|
|
2108
|
+
message.storageKeys.push(B256.decode(reader, reader.uint32()));
|
|
2109
|
+
continue;
|
|
2110
|
+
}
|
|
2111
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2112
|
+
break;
|
|
2113
|
+
}
|
|
2114
|
+
reader.skipType(tag & 7);
|
|
2115
|
+
}
|
|
2116
|
+
return message;
|
|
2117
|
+
},
|
|
2118
|
+
fromJSON(object) {
|
|
2119
|
+
return {
|
|
2120
|
+
address: isSet$1(object.address) ? Address.fromJSON(object.address) : void 0,
|
|
2121
|
+
storageKeys: globalThis.Array.isArray(object?.storageKeys) ? object.storageKeys.map((e) => B256.fromJSON(e)) : []
|
|
2122
|
+
};
|
|
2123
|
+
},
|
|
2124
|
+
toJSON(message) {
|
|
2125
|
+
const obj = {};
|
|
2126
|
+
if (message.address !== void 0) {
|
|
2127
|
+
obj.address = Address.toJSON(message.address);
|
|
2128
|
+
}
|
|
2129
|
+
if (message.storageKeys?.length) {
|
|
2130
|
+
obj.storageKeys = message.storageKeys.map((e) => B256.toJSON(e));
|
|
2131
|
+
}
|
|
2132
|
+
return obj;
|
|
2133
|
+
},
|
|
2134
|
+
create(base) {
|
|
2135
|
+
return AccessListItem$1.fromPartial(base ?? {});
|
|
2136
|
+
},
|
|
2137
|
+
fromPartial(object) {
|
|
2138
|
+
const message = createBaseAccessListItem();
|
|
2139
|
+
message.address = object.address !== void 0 && object.address !== null ? Address.fromPartial(object.address) : void 0;
|
|
2140
|
+
message.storageKeys = object.storageKeys?.map((e) => B256.fromPartial(e)) || [];
|
|
2141
|
+
return message;
|
|
2142
|
+
}
|
|
2143
|
+
};
|
|
2144
|
+
function bytesFromBase64(b64) {
|
|
2145
|
+
if (globalThis.Buffer) {
|
|
2146
|
+
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
2147
|
+
} else {
|
|
2148
|
+
const bin = globalThis.atob(b64);
|
|
2149
|
+
const arr = new Uint8Array(bin.length);
|
|
2150
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
2151
|
+
arr[i] = bin.charCodeAt(i);
|
|
2152
|
+
}
|
|
2153
|
+
return arr;
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
function base64FromBytes(arr) {
|
|
2157
|
+
if (globalThis.Buffer) {
|
|
2158
|
+
return globalThis.Buffer.from(arr).toString("base64");
|
|
2159
|
+
} else {
|
|
2160
|
+
const bin = [];
|
|
2161
|
+
arr.forEach((byte) => {
|
|
2162
|
+
bin.push(globalThis.String.fromCharCode(byte));
|
|
2163
|
+
});
|
|
2164
|
+
return globalThis.btoa(bin.join(""));
|
|
2165
|
+
}
|
|
2166
|
+
}
|
|
2167
|
+
function toTimestamp(date) {
|
|
2168
|
+
const seconds = BigInt(Math.trunc(date.getTime() / 1e3));
|
|
2169
|
+
const nanos = date.getTime() % 1e3 * 1e6;
|
|
2170
|
+
return { seconds, nanos };
|
|
2171
|
+
}
|
|
2172
|
+
function fromTimestamp(t) {
|
|
2173
|
+
let millis = (globalThis.Number(t.seconds?.toString()) || 0) * 1e3;
|
|
2174
|
+
millis += (t.nanos || 0) / 1e6;
|
|
2175
|
+
return new globalThis.Date(millis);
|
|
2176
|
+
}
|
|
2177
|
+
function fromJsonTimestamp(o) {
|
|
2178
|
+
if (o instanceof globalThis.Date) {
|
|
2179
|
+
return o;
|
|
2180
|
+
} else if (typeof o === "string") {
|
|
2181
|
+
return new globalThis.Date(o);
|
|
2182
|
+
} else {
|
|
2183
|
+
return fromTimestamp(Timestamp.fromJSON(o));
|
|
2184
|
+
}
|
|
2185
|
+
}
|
|
2186
|
+
function longToBigint$1(long) {
|
|
2187
|
+
return BigInt(long.toString());
|
|
2188
|
+
}
|
|
2189
|
+
if (_m0.util.Long !== Long) {
|
|
2190
|
+
_m0.util.Long = Long;
|
|
2191
|
+
_m0.configure();
|
|
2192
|
+
}
|
|
2193
|
+
function isSet$1(value) {
|
|
2194
|
+
return value !== null && value !== void 0;
|
|
2195
|
+
}
|
|
2196
|
+
|
|
2197
|
+
const data = {
|
|
2198
|
+
__proto__: null,
|
|
2199
|
+
AccessListItem: AccessListItem$1,
|
|
2200
|
+
Block: Block$1,
|
|
2201
|
+
BlockHeader: BlockHeader$1,
|
|
2202
|
+
Log: Log$1,
|
|
2203
|
+
Signature: Signature$1,
|
|
2204
|
+
Transaction: Transaction$1,
|
|
2205
|
+
TransactionReceipt: TransactionReceipt$1,
|
|
2206
|
+
Withdrawal: Withdrawal$1,
|
|
2207
|
+
protobufPackage: protobufPackage$1
|
|
2208
|
+
};
|
|
2209
|
+
|
|
2210
|
+
const protobufPackage = "evm.v2";
|
|
2211
|
+
function createBaseFilter() {
|
|
2212
|
+
return { header: void 0, withdrawals: [], transactions: [], logs: [] };
|
|
2213
|
+
}
|
|
2214
|
+
const Filter$1 = {
|
|
2215
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
2216
|
+
if (message.header !== void 0) {
|
|
2217
|
+
HeaderFilter$1.encode(message.header, writer.uint32(10).fork()).ldelim();
|
|
2218
|
+
}
|
|
2219
|
+
if (message.withdrawals !== void 0 && message.withdrawals.length !== 0) {
|
|
2220
|
+
for (const v of message.withdrawals) {
|
|
2221
|
+
WithdrawalFilter$1.encode(v, writer.uint32(18).fork()).ldelim();
|
|
2222
|
+
}
|
|
2223
|
+
}
|
|
2224
|
+
if (message.transactions !== void 0 && message.transactions.length !== 0) {
|
|
2225
|
+
for (const v of message.transactions) {
|
|
2226
|
+
TransactionFilter$1.encode(v, writer.uint32(26).fork()).ldelim();
|
|
2227
|
+
}
|
|
2228
|
+
}
|
|
2229
|
+
if (message.logs !== void 0 && message.logs.length !== 0) {
|
|
2230
|
+
for (const v of message.logs) {
|
|
2231
|
+
LogFilter$1.encode(v, writer.uint32(34).fork()).ldelim();
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
return writer;
|
|
2235
|
+
},
|
|
2236
|
+
decode(input, length) {
|
|
2237
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
2238
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2239
|
+
const message = createBaseFilter();
|
|
2240
|
+
while (reader.pos < end) {
|
|
2241
|
+
const tag = reader.uint32();
|
|
2242
|
+
switch (tag >>> 3) {
|
|
2243
|
+
case 1:
|
|
2244
|
+
if (tag !== 10) {
|
|
2245
|
+
break;
|
|
2246
|
+
}
|
|
2247
|
+
message.header = HeaderFilter$1.decode(reader, reader.uint32());
|
|
2248
|
+
continue;
|
|
2249
|
+
case 2:
|
|
2250
|
+
if (tag !== 18) {
|
|
2251
|
+
break;
|
|
2252
|
+
}
|
|
2253
|
+
message.withdrawals.push(WithdrawalFilter$1.decode(reader, reader.uint32()));
|
|
2254
|
+
continue;
|
|
2255
|
+
case 3:
|
|
2256
|
+
if (tag !== 26) {
|
|
2257
|
+
break;
|
|
2258
|
+
}
|
|
2259
|
+
message.transactions.push(TransactionFilter$1.decode(reader, reader.uint32()));
|
|
2260
|
+
continue;
|
|
2261
|
+
case 4:
|
|
2262
|
+
if (tag !== 34) {
|
|
2263
|
+
break;
|
|
2264
|
+
}
|
|
2265
|
+
message.logs.push(LogFilter$1.decode(reader, reader.uint32()));
|
|
2266
|
+
continue;
|
|
2267
|
+
}
|
|
2268
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2269
|
+
break;
|
|
2270
|
+
}
|
|
2271
|
+
reader.skipType(tag & 7);
|
|
2272
|
+
}
|
|
2273
|
+
return message;
|
|
2274
|
+
},
|
|
2275
|
+
fromJSON(object) {
|
|
2276
|
+
return {
|
|
2277
|
+
header: isSet(object.header) ? HeaderFilter$1.fromJSON(object.header) : void 0,
|
|
2278
|
+
withdrawals: globalThis.Array.isArray(object?.withdrawals) ? object.withdrawals.map((e) => WithdrawalFilter$1.fromJSON(e)) : [],
|
|
2279
|
+
transactions: globalThis.Array.isArray(object?.transactions) ? object.transactions.map((e) => TransactionFilter$1.fromJSON(e)) : [],
|
|
2280
|
+
logs: globalThis.Array.isArray(object?.logs) ? object.logs.map((e) => LogFilter$1.fromJSON(e)) : []
|
|
2281
|
+
};
|
|
2282
|
+
},
|
|
2283
|
+
toJSON(message) {
|
|
2284
|
+
const obj = {};
|
|
2285
|
+
if (message.header !== void 0) {
|
|
2286
|
+
obj.header = HeaderFilter$1.toJSON(message.header);
|
|
2287
|
+
}
|
|
2288
|
+
if (message.withdrawals?.length) {
|
|
2289
|
+
obj.withdrawals = message.withdrawals.map((e) => WithdrawalFilter$1.toJSON(e));
|
|
2290
|
+
}
|
|
2291
|
+
if (message.transactions?.length) {
|
|
2292
|
+
obj.transactions = message.transactions.map((e) => TransactionFilter$1.toJSON(e));
|
|
2293
|
+
}
|
|
2294
|
+
if (message.logs?.length) {
|
|
2295
|
+
obj.logs = message.logs.map((e) => LogFilter$1.toJSON(e));
|
|
2296
|
+
}
|
|
2297
|
+
return obj;
|
|
2298
|
+
},
|
|
2299
|
+
create(base) {
|
|
2300
|
+
return Filter$1.fromPartial(base ?? {});
|
|
2301
|
+
},
|
|
2302
|
+
fromPartial(object) {
|
|
2303
|
+
const message = createBaseFilter();
|
|
2304
|
+
message.header = object.header !== void 0 && object.header !== null ? HeaderFilter$1.fromPartial(object.header) : void 0;
|
|
2305
|
+
message.withdrawals = object.withdrawals?.map((e) => WithdrawalFilter$1.fromPartial(e)) || [];
|
|
2306
|
+
message.transactions = object.transactions?.map((e) => TransactionFilter$1.fromPartial(e)) || [];
|
|
2307
|
+
message.logs = object.logs?.map((e) => LogFilter$1.fromPartial(e)) || [];
|
|
2308
|
+
return message;
|
|
2309
|
+
}
|
|
2310
|
+
};
|
|
2311
|
+
function createBaseHeaderFilter() {
|
|
2312
|
+
return { always: void 0 };
|
|
2313
|
+
}
|
|
2314
|
+
const HeaderFilter$1 = {
|
|
2315
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
2316
|
+
if (message.always !== void 0) {
|
|
2317
|
+
writer.uint32(8).bool(message.always);
|
|
2318
|
+
}
|
|
2319
|
+
return writer;
|
|
2320
|
+
},
|
|
2321
|
+
decode(input, length) {
|
|
2322
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
2323
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2324
|
+
const message = createBaseHeaderFilter();
|
|
2325
|
+
while (reader.pos < end) {
|
|
2326
|
+
const tag = reader.uint32();
|
|
2327
|
+
switch (tag >>> 3) {
|
|
2328
|
+
case 1:
|
|
2329
|
+
if (tag !== 8) {
|
|
2330
|
+
break;
|
|
2331
|
+
}
|
|
2332
|
+
message.always = reader.bool();
|
|
2333
|
+
continue;
|
|
2334
|
+
}
|
|
2335
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2336
|
+
break;
|
|
2337
|
+
}
|
|
2338
|
+
reader.skipType(tag & 7);
|
|
2339
|
+
}
|
|
2340
|
+
return message;
|
|
2341
|
+
},
|
|
2342
|
+
fromJSON(object) {
|
|
2343
|
+
return { always: isSet(object.always) ? globalThis.Boolean(object.always) : void 0 };
|
|
2344
|
+
},
|
|
2345
|
+
toJSON(message) {
|
|
2346
|
+
const obj = {};
|
|
2347
|
+
if (message.always !== void 0) {
|
|
2348
|
+
obj.always = message.always;
|
|
2349
|
+
}
|
|
2350
|
+
return obj;
|
|
2351
|
+
},
|
|
2352
|
+
create(base) {
|
|
2353
|
+
return HeaderFilter$1.fromPartial(base ?? {});
|
|
2354
|
+
},
|
|
2355
|
+
fromPartial(object) {
|
|
2356
|
+
const message = createBaseHeaderFilter();
|
|
2357
|
+
message.always = object.always ?? void 0;
|
|
2358
|
+
return message;
|
|
2359
|
+
}
|
|
2360
|
+
};
|
|
2361
|
+
function createBaseWithdrawalFilter() {
|
|
2362
|
+
return { validatorIndex: void 0, address: void 0 };
|
|
2363
|
+
}
|
|
2364
|
+
const WithdrawalFilter$1 = {
|
|
2365
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
2366
|
+
if (message.validatorIndex !== void 0) {
|
|
2367
|
+
if (BigInt.asUintN(64, message.validatorIndex) !== message.validatorIndex) {
|
|
2368
|
+
throw new globalThis.Error("value provided for field message.validatorIndex of type uint64 too large");
|
|
2369
|
+
}
|
|
2370
|
+
writer.uint32(8).uint64(message.validatorIndex.toString());
|
|
2371
|
+
}
|
|
2372
|
+
if (message.address !== void 0) {
|
|
2373
|
+
Address.encode(message.address, writer.uint32(18).fork()).ldelim();
|
|
2374
|
+
}
|
|
2375
|
+
return writer;
|
|
2376
|
+
},
|
|
2377
|
+
decode(input, length) {
|
|
2378
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
2379
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2380
|
+
const message = createBaseWithdrawalFilter();
|
|
2381
|
+
while (reader.pos < end) {
|
|
2382
|
+
const tag = reader.uint32();
|
|
2383
|
+
switch (tag >>> 3) {
|
|
2384
|
+
case 1:
|
|
2385
|
+
if (tag !== 8) {
|
|
2386
|
+
break;
|
|
2387
|
+
}
|
|
2388
|
+
message.validatorIndex = longToBigint(reader.uint64());
|
|
2389
|
+
continue;
|
|
2390
|
+
case 2:
|
|
2391
|
+
if (tag !== 18) {
|
|
2392
|
+
break;
|
|
2393
|
+
}
|
|
2394
|
+
message.address = Address.decode(reader, reader.uint32());
|
|
2395
|
+
continue;
|
|
2396
|
+
}
|
|
2397
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2398
|
+
break;
|
|
2399
|
+
}
|
|
2400
|
+
reader.skipType(tag & 7);
|
|
2401
|
+
}
|
|
2402
|
+
return message;
|
|
2403
|
+
},
|
|
2404
|
+
fromJSON(object) {
|
|
2405
|
+
return {
|
|
2406
|
+
validatorIndex: isSet(object.validatorIndex) ? BigInt(object.validatorIndex) : void 0,
|
|
2407
|
+
address: isSet(object.address) ? Address.fromJSON(object.address) : void 0
|
|
2408
|
+
};
|
|
2409
|
+
},
|
|
2410
|
+
toJSON(message) {
|
|
2411
|
+
const obj = {};
|
|
2412
|
+
if (message.validatorIndex !== void 0) {
|
|
2413
|
+
obj.validatorIndex = message.validatorIndex.toString();
|
|
2414
|
+
}
|
|
2415
|
+
if (message.address !== void 0) {
|
|
2416
|
+
obj.address = Address.toJSON(message.address);
|
|
2417
|
+
}
|
|
2418
|
+
return obj;
|
|
2419
|
+
},
|
|
2420
|
+
create(base) {
|
|
2421
|
+
return WithdrawalFilter$1.fromPartial(base ?? {});
|
|
2422
|
+
},
|
|
2423
|
+
fromPartial(object) {
|
|
2424
|
+
const message = createBaseWithdrawalFilter();
|
|
2425
|
+
message.validatorIndex = object.validatorIndex ?? void 0;
|
|
2426
|
+
message.address = object.address !== void 0 && object.address !== null ? Address.fromPartial(object.address) : void 0;
|
|
2427
|
+
return message;
|
|
2428
|
+
}
|
|
2429
|
+
};
|
|
2430
|
+
function createBaseTransactionFilter() {
|
|
2431
|
+
return { from: void 0, to: void 0, includeReceipt: void 0, includeLogs: void 0 };
|
|
2432
|
+
}
|
|
2433
|
+
const TransactionFilter$1 = {
|
|
2434
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
2435
|
+
if (message.from !== void 0) {
|
|
2436
|
+
Address.encode(message.from, writer.uint32(10).fork()).ldelim();
|
|
2437
|
+
}
|
|
2438
|
+
if (message.to !== void 0) {
|
|
2439
|
+
Address.encode(message.to, writer.uint32(18).fork()).ldelim();
|
|
2440
|
+
}
|
|
2441
|
+
if (message.includeReceipt !== void 0) {
|
|
2442
|
+
writer.uint32(24).bool(message.includeReceipt);
|
|
2443
|
+
}
|
|
2444
|
+
if (message.includeLogs !== void 0) {
|
|
2445
|
+
writer.uint32(32).bool(message.includeLogs);
|
|
2446
|
+
}
|
|
2447
|
+
return writer;
|
|
2448
|
+
},
|
|
2449
|
+
decode(input, length) {
|
|
2450
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
2451
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2452
|
+
const message = createBaseTransactionFilter();
|
|
2453
|
+
while (reader.pos < end) {
|
|
2454
|
+
const tag = reader.uint32();
|
|
2455
|
+
switch (tag >>> 3) {
|
|
2456
|
+
case 1:
|
|
2457
|
+
if (tag !== 10) {
|
|
2458
|
+
break;
|
|
2459
|
+
}
|
|
2460
|
+
message.from = Address.decode(reader, reader.uint32());
|
|
2461
|
+
continue;
|
|
2462
|
+
case 2:
|
|
2463
|
+
if (tag !== 18) {
|
|
2464
|
+
break;
|
|
2465
|
+
}
|
|
2466
|
+
message.to = Address.decode(reader, reader.uint32());
|
|
2467
|
+
continue;
|
|
2468
|
+
case 3:
|
|
2469
|
+
if (tag !== 24) {
|
|
2470
|
+
break;
|
|
2471
|
+
}
|
|
2472
|
+
message.includeReceipt = reader.bool();
|
|
2473
|
+
continue;
|
|
2474
|
+
case 4:
|
|
2475
|
+
if (tag !== 32) {
|
|
2476
|
+
break;
|
|
2477
|
+
}
|
|
2478
|
+
message.includeLogs = reader.bool();
|
|
2479
|
+
continue;
|
|
2480
|
+
}
|
|
2481
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2482
|
+
break;
|
|
2483
|
+
}
|
|
2484
|
+
reader.skipType(tag & 7);
|
|
2485
|
+
}
|
|
2486
|
+
return message;
|
|
2487
|
+
},
|
|
2488
|
+
fromJSON(object) {
|
|
2489
|
+
return {
|
|
2490
|
+
from: isSet(object.from) ? Address.fromJSON(object.from) : void 0,
|
|
2491
|
+
to: isSet(object.to) ? Address.fromJSON(object.to) : void 0,
|
|
2492
|
+
includeReceipt: isSet(object.includeReceipt) ? globalThis.Boolean(object.includeReceipt) : void 0,
|
|
2493
|
+
includeLogs: isSet(object.includeLogs) ? globalThis.Boolean(object.includeLogs) : void 0
|
|
2494
|
+
};
|
|
2495
|
+
},
|
|
2496
|
+
toJSON(message) {
|
|
2497
|
+
const obj = {};
|
|
2498
|
+
if (message.from !== void 0) {
|
|
2499
|
+
obj.from = Address.toJSON(message.from);
|
|
2500
|
+
}
|
|
2501
|
+
if (message.to !== void 0) {
|
|
2502
|
+
obj.to = Address.toJSON(message.to);
|
|
2503
|
+
}
|
|
2504
|
+
if (message.includeReceipt !== void 0) {
|
|
2505
|
+
obj.includeReceipt = message.includeReceipt;
|
|
2506
|
+
}
|
|
2507
|
+
if (message.includeLogs !== void 0) {
|
|
2508
|
+
obj.includeLogs = message.includeLogs;
|
|
2509
|
+
}
|
|
2510
|
+
return obj;
|
|
2511
|
+
},
|
|
2512
|
+
create(base) {
|
|
2513
|
+
return TransactionFilter$1.fromPartial(base ?? {});
|
|
2514
|
+
},
|
|
2515
|
+
fromPartial(object) {
|
|
2516
|
+
const message = createBaseTransactionFilter();
|
|
2517
|
+
message.from = object.from !== void 0 && object.from !== null ? Address.fromPartial(object.from) : void 0;
|
|
2518
|
+
message.to = object.to !== void 0 && object.to !== null ? Address.fromPartial(object.to) : void 0;
|
|
2519
|
+
message.includeReceipt = object.includeReceipt ?? void 0;
|
|
2520
|
+
message.includeLogs = object.includeLogs ?? void 0;
|
|
2521
|
+
return message;
|
|
2522
|
+
}
|
|
2523
|
+
};
|
|
2524
|
+
function createBaseLogFilter() {
|
|
2525
|
+
return {
|
|
2526
|
+
address: void 0,
|
|
2527
|
+
topics: [],
|
|
2528
|
+
strict: void 0,
|
|
2529
|
+
includeTransaction: void 0,
|
|
2530
|
+
includeReceipt: void 0
|
|
2531
|
+
};
|
|
2532
|
+
}
|
|
2533
|
+
const LogFilter$1 = {
|
|
2534
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
2535
|
+
if (message.address !== void 0) {
|
|
2536
|
+
Address.encode(message.address, writer.uint32(10).fork()).ldelim();
|
|
2537
|
+
}
|
|
2538
|
+
if (message.topics !== void 0 && message.topics.length !== 0) {
|
|
2539
|
+
for (const v of message.topics) {
|
|
2540
|
+
Topic$1.encode(v, writer.uint32(18).fork()).ldelim();
|
|
2541
|
+
}
|
|
2542
|
+
}
|
|
2543
|
+
if (message.strict !== void 0) {
|
|
2544
|
+
writer.uint32(24).bool(message.strict);
|
|
2545
|
+
}
|
|
2546
|
+
if (message.includeTransaction !== void 0) {
|
|
2547
|
+
writer.uint32(32).bool(message.includeTransaction);
|
|
2548
|
+
}
|
|
2549
|
+
if (message.includeReceipt !== void 0) {
|
|
2550
|
+
writer.uint32(40).bool(message.includeReceipt);
|
|
2551
|
+
}
|
|
2552
|
+
return writer;
|
|
2553
|
+
},
|
|
2554
|
+
decode(input, length) {
|
|
2555
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
2556
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2557
|
+
const message = createBaseLogFilter();
|
|
2558
|
+
while (reader.pos < end) {
|
|
2559
|
+
const tag = reader.uint32();
|
|
2560
|
+
switch (tag >>> 3) {
|
|
2561
|
+
case 1:
|
|
2562
|
+
if (tag !== 10) {
|
|
2563
|
+
break;
|
|
2564
|
+
}
|
|
2565
|
+
message.address = Address.decode(reader, reader.uint32());
|
|
2566
|
+
continue;
|
|
2567
|
+
case 2:
|
|
2568
|
+
if (tag !== 18) {
|
|
2569
|
+
break;
|
|
2570
|
+
}
|
|
2571
|
+
message.topics.push(Topic$1.decode(reader, reader.uint32()));
|
|
2572
|
+
continue;
|
|
2573
|
+
case 3:
|
|
2574
|
+
if (tag !== 24) {
|
|
2575
|
+
break;
|
|
2576
|
+
}
|
|
2577
|
+
message.strict = reader.bool();
|
|
2578
|
+
continue;
|
|
2579
|
+
case 4:
|
|
2580
|
+
if (tag !== 32) {
|
|
2581
|
+
break;
|
|
2582
|
+
}
|
|
2583
|
+
message.includeTransaction = reader.bool();
|
|
2584
|
+
continue;
|
|
2585
|
+
case 5:
|
|
2586
|
+
if (tag !== 40) {
|
|
2587
|
+
break;
|
|
2588
|
+
}
|
|
2589
|
+
message.includeReceipt = reader.bool();
|
|
2590
|
+
continue;
|
|
2591
|
+
}
|
|
2592
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2593
|
+
break;
|
|
2594
|
+
}
|
|
2595
|
+
reader.skipType(tag & 7);
|
|
2596
|
+
}
|
|
2597
|
+
return message;
|
|
2598
|
+
},
|
|
2599
|
+
fromJSON(object) {
|
|
2600
|
+
return {
|
|
2601
|
+
address: isSet(object.address) ? Address.fromJSON(object.address) : void 0,
|
|
2602
|
+
topics: globalThis.Array.isArray(object?.topics) ? object.topics.map((e) => Topic$1.fromJSON(e)) : [],
|
|
2603
|
+
strict: isSet(object.strict) ? globalThis.Boolean(object.strict) : void 0,
|
|
2604
|
+
includeTransaction: isSet(object.includeTransaction) ? globalThis.Boolean(object.includeTransaction) : void 0,
|
|
2605
|
+
includeReceipt: isSet(object.includeReceipt) ? globalThis.Boolean(object.includeReceipt) : void 0
|
|
2606
|
+
};
|
|
2607
|
+
},
|
|
2608
|
+
toJSON(message) {
|
|
2609
|
+
const obj = {};
|
|
2610
|
+
if (message.address !== void 0) {
|
|
2611
|
+
obj.address = Address.toJSON(message.address);
|
|
2612
|
+
}
|
|
2613
|
+
if (message.topics?.length) {
|
|
2614
|
+
obj.topics = message.topics.map((e) => Topic$1.toJSON(e));
|
|
2615
|
+
}
|
|
2616
|
+
if (message.strict !== void 0) {
|
|
2617
|
+
obj.strict = message.strict;
|
|
2618
|
+
}
|
|
2619
|
+
if (message.includeTransaction !== void 0) {
|
|
2620
|
+
obj.includeTransaction = message.includeTransaction;
|
|
2621
|
+
}
|
|
2622
|
+
if (message.includeReceipt !== void 0) {
|
|
2623
|
+
obj.includeReceipt = message.includeReceipt;
|
|
2624
|
+
}
|
|
2625
|
+
return obj;
|
|
2626
|
+
},
|
|
2627
|
+
create(base) {
|
|
2628
|
+
return LogFilter$1.fromPartial(base ?? {});
|
|
2629
|
+
},
|
|
2630
|
+
fromPartial(object) {
|
|
2631
|
+
const message = createBaseLogFilter();
|
|
2632
|
+
message.address = object.address !== void 0 && object.address !== null ? Address.fromPartial(object.address) : void 0;
|
|
2633
|
+
message.topics = object.topics?.map((e) => Topic$1.fromPartial(e)) || [];
|
|
2634
|
+
message.strict = object.strict ?? void 0;
|
|
2635
|
+
message.includeTransaction = object.includeTransaction ?? void 0;
|
|
2636
|
+
message.includeReceipt = object.includeReceipt ?? void 0;
|
|
2637
|
+
return message;
|
|
2638
|
+
}
|
|
2639
|
+
};
|
|
2640
|
+
function createBaseTopic() {
|
|
2641
|
+
return { value: void 0 };
|
|
2642
|
+
}
|
|
2643
|
+
const Topic$1 = {
|
|
2644
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
2645
|
+
if (message.value !== void 0) {
|
|
2646
|
+
B256.encode(message.value, writer.uint32(10).fork()).ldelim();
|
|
2647
|
+
}
|
|
2648
|
+
return writer;
|
|
2649
|
+
},
|
|
2650
|
+
decode(input, length) {
|
|
2651
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
2652
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
2653
|
+
const message = createBaseTopic();
|
|
2654
|
+
while (reader.pos < end) {
|
|
2655
|
+
const tag = reader.uint32();
|
|
2656
|
+
switch (tag >>> 3) {
|
|
2657
|
+
case 1:
|
|
2658
|
+
if (tag !== 10) {
|
|
2659
|
+
break;
|
|
2660
|
+
}
|
|
2661
|
+
message.value = B256.decode(reader, reader.uint32());
|
|
2662
|
+
continue;
|
|
2663
|
+
}
|
|
2664
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2665
|
+
break;
|
|
2666
|
+
}
|
|
2667
|
+
reader.skipType(tag & 7);
|
|
2668
|
+
}
|
|
2669
|
+
return message;
|
|
2670
|
+
},
|
|
2671
|
+
fromJSON(object) {
|
|
2672
|
+
return { value: isSet(object.value) ? B256.fromJSON(object.value) : void 0 };
|
|
2673
|
+
},
|
|
2674
|
+
toJSON(message) {
|
|
2675
|
+
const obj = {};
|
|
2676
|
+
if (message.value !== void 0) {
|
|
2677
|
+
obj.value = B256.toJSON(message.value);
|
|
2678
|
+
}
|
|
2679
|
+
return obj;
|
|
2680
|
+
},
|
|
2681
|
+
create(base) {
|
|
2682
|
+
return Topic$1.fromPartial(base ?? {});
|
|
2683
|
+
},
|
|
2684
|
+
fromPartial(object) {
|
|
2685
|
+
const message = createBaseTopic();
|
|
2686
|
+
message.value = object.value !== void 0 && object.value !== null ? B256.fromPartial(object.value) : void 0;
|
|
2687
|
+
return message;
|
|
2688
|
+
}
|
|
2689
|
+
};
|
|
2690
|
+
function longToBigint(long) {
|
|
2691
|
+
return BigInt(long.toString());
|
|
2692
|
+
}
|
|
2693
|
+
if (_m0.util.Long !== Long) {
|
|
2694
|
+
_m0.util.Long = Long;
|
|
2695
|
+
_m0.configure();
|
|
2696
|
+
}
|
|
2697
|
+
function isSet(value) {
|
|
2698
|
+
return value !== null && value !== void 0;
|
|
2699
|
+
}
|
|
2700
|
+
|
|
2701
|
+
const filter = {
|
|
2702
|
+
__proto__: null,
|
|
2703
|
+
Filter: Filter$1,
|
|
2704
|
+
HeaderFilter: HeaderFilter$1,
|
|
2705
|
+
LogFilter: LogFilter$1,
|
|
2706
|
+
Topic: Topic$1,
|
|
2707
|
+
TransactionFilter: TransactionFilter$1,
|
|
2708
|
+
WithdrawalFilter: WithdrawalFilter$1,
|
|
2709
|
+
protobufPackage: protobufPackage
|
|
2710
|
+
};
|
|
2711
|
+
|
|
2712
|
+
const index = {
|
|
2713
|
+
__proto__: null,
|
|
2714
|
+
common: common,
|
|
2715
|
+
data: data,
|
|
2716
|
+
filter: filter
|
|
2717
|
+
};
|
|
2718
|
+
|
|
2719
|
+
const HexData = Schema.transform(
|
|
2720
|
+
Schema.Struct({
|
|
2721
|
+
value: BytesFromUint8Array
|
|
2722
|
+
}),
|
|
2723
|
+
Bytes,
|
|
2724
|
+
{
|
|
2725
|
+
strict: false,
|
|
2726
|
+
encode(value) {
|
|
2727
|
+
throw new Error("Not implemented");
|
|
2728
|
+
},
|
|
2729
|
+
decode({ value }) {
|
|
2730
|
+
throw new Error("Not implemented");
|
|
2731
|
+
}
|
|
2732
|
+
}
|
|
2733
|
+
);
|
|
2734
|
+
const Bloom = Schema.transform(
|
|
2735
|
+
Schema.Struct({
|
|
2736
|
+
value: BytesFromUint8Array
|
|
2737
|
+
}),
|
|
2738
|
+
Bytes,
|
|
2739
|
+
{
|
|
2740
|
+
strict: false,
|
|
2741
|
+
encode(value) {
|
|
2742
|
+
throw new Error("Not implemented");
|
|
2743
|
+
},
|
|
2744
|
+
decode({ value }) {
|
|
2745
|
+
throw new Error("Not implemented");
|
|
2746
|
+
}
|
|
2747
|
+
}
|
|
2748
|
+
);
|
|
2749
|
+
const BlockHeader = Schema.Struct({
|
|
2750
|
+
number: Schema.BigIntFromSelf,
|
|
2751
|
+
hash: Schema.optional(B256$1),
|
|
2752
|
+
parentHash: Schema.optional(B256$1),
|
|
2753
|
+
uncleHash: Schema.optional(B256$1),
|
|
2754
|
+
miner: Schema.optional(Address$1),
|
|
2755
|
+
stateRoot: Schema.optional(B256$1),
|
|
2756
|
+
transactionRoot: Schema.optional(B256$1),
|
|
2757
|
+
receiptRoot: Schema.optional(B256$1),
|
|
2758
|
+
logsBloom: Schema.optional(Bloom),
|
|
2759
|
+
difficulty: Schema.optional(U256$1),
|
|
2760
|
+
gasLimit: Schema.optional(U256$1),
|
|
2761
|
+
gasUsed: Schema.optional(U256$1),
|
|
2762
|
+
timestamp: Schema.optional(Schema.DateFromSelf),
|
|
2763
|
+
// extraData: Schema.optional(HexData),
|
|
2764
|
+
mixHash: Schema.optional(B256$1),
|
|
2765
|
+
nonce: Schema.BigIntFromSelf,
|
|
2766
|
+
baseFeePerGas: Schema.optional(U256$1),
|
|
2767
|
+
withdrawalsRoot: Schema.optional(B256$1),
|
|
2768
|
+
totalDifficulty: Schema.optional(U256$1),
|
|
2769
|
+
uncles: Schema.Array(B256$1),
|
|
2770
|
+
size: Schema.optional(U256$1),
|
|
2771
|
+
blobGasUsed: Schema.BigIntFromSelf,
|
|
2772
|
+
excessBlobGas: Schema.BigIntFromSelf,
|
|
2773
|
+
parentBeaconBlockRoot: Schema.optional(B256$1)
|
|
2774
|
+
});
|
|
2775
|
+
const Withdrawal = Schema.Struct({
|
|
2776
|
+
index: Schema.BigIntFromSelf,
|
|
2777
|
+
validatorIndex: Schema.BigIntFromSelf,
|
|
2778
|
+
withdrawalIndex: Schema.BigIntFromSelf,
|
|
2779
|
+
address: Schema.optional(Address$1),
|
|
2780
|
+
amount: Schema.optional(U256$1)
|
|
2781
|
+
});
|
|
2782
|
+
const AccessListItem = Schema.Struct({
|
|
2783
|
+
address: Schema.optional(Address$1),
|
|
2784
|
+
storageKeys: Schema.Array(B256$1)
|
|
2785
|
+
});
|
|
2786
|
+
const Signature = Schema.Struct({
|
|
2787
|
+
r: Schema.optional(U256$1),
|
|
2788
|
+
s: Schema.optional(U256$1),
|
|
2789
|
+
v: Schema.optional(U256$1),
|
|
2790
|
+
YParity: Schema.optional(Schema.Boolean)
|
|
2791
|
+
});
|
|
2792
|
+
const Transaction = Schema.Struct({
|
|
2793
|
+
hash: Schema.optional(B256$1),
|
|
2794
|
+
nonce: Schema.BigIntFromSelf,
|
|
2795
|
+
transactionIndex: Schema.BigIntFromSelf,
|
|
2796
|
+
from: Schema.optional(Address$1),
|
|
2797
|
+
to: Schema.optional(Address$1),
|
|
2798
|
+
value: Schema.optional(U256$1),
|
|
2799
|
+
gasPrice: Schema.optional(U128$1),
|
|
2800
|
+
gas: Schema.optional(U256$1),
|
|
2801
|
+
maxFeePerGas: Schema.optional(U128$1),
|
|
2802
|
+
maxPriorityFeePerGas: Schema.optional(U128$1),
|
|
2803
|
+
// TODO
|
|
2804
|
+
// input: Schema.optional(HexData),
|
|
2805
|
+
signature: Schema.optional(Signature),
|
|
2806
|
+
chainId: Schema.BigIntFromSelf,
|
|
2807
|
+
accessList: Schema.Array(AccessListItem),
|
|
2808
|
+
transactionType: Schema.BigIntFromSelf,
|
|
2809
|
+
maxFeePerBlobGas: Schema.optional(U128$1),
|
|
2810
|
+
blobVersionedHashes: Schema.Array(B256$1)
|
|
2811
|
+
});
|
|
2812
|
+
const TransactionReceipt = Schema.Struct({
|
|
2813
|
+
transactionHash: Schema.optional(B256$1),
|
|
2814
|
+
transactionIndex: Schema.BigIntFromSelf,
|
|
2815
|
+
cumulativeGasUsed: Schema.optional(U256$1),
|
|
2816
|
+
gasUsed: Schema.optional(U256$1),
|
|
2817
|
+
effectiveGasPrice: Schema.optional(U128$1),
|
|
2818
|
+
from: Schema.optional(Address$1),
|
|
2819
|
+
to: Schema.optional(Address$1),
|
|
2820
|
+
contractAddress: Schema.optional(Address$1),
|
|
2821
|
+
logsBloom: Schema.optional(Bloom),
|
|
2822
|
+
statusCode: Schema.BigIntFromSelf,
|
|
2823
|
+
transactionType: Schema.BigIntFromSelf,
|
|
2824
|
+
blobGasUsed: Schema.optional(U128$1),
|
|
2825
|
+
blobGasPrice: Schema.optional(U128$1)
|
|
2826
|
+
});
|
|
2827
|
+
const Log = Schema.Struct({
|
|
2828
|
+
address: Schema.optional(Address$1),
|
|
2829
|
+
topics: Schema.Array(B256$1),
|
|
2830
|
+
// TODO
|
|
2831
|
+
// data: Bytes,
|
|
2832
|
+
logIndex: Schema.BigIntFromSelf,
|
|
2833
|
+
transactionIndex: Schema.BigIntFromSelf,
|
|
2834
|
+
transactionHash: Schema.optional(B256$1)
|
|
2835
|
+
});
|
|
2836
|
+
const Block = Schema.Struct({
|
|
2837
|
+
header: Schema.optional(BlockHeader),
|
|
2838
|
+
withdrawals: Schema.Array(Withdrawal),
|
|
2839
|
+
transactions: Schema.Array(Transaction),
|
|
2840
|
+
receipts: Schema.Array(TransactionReceipt),
|
|
2841
|
+
logs: Schema.Array(Log)
|
|
2842
|
+
});
|
|
2843
|
+
const BlockFromBytes = Schema.transform(
|
|
2844
|
+
Schema.Uint8ArrayFromSelf,
|
|
2845
|
+
Schema.NullOr(Block),
|
|
2846
|
+
{
|
|
2847
|
+
strict: false,
|
|
2848
|
+
decode(value) {
|
|
2849
|
+
if (value.length === 0) {
|
|
2850
|
+
return null;
|
|
2851
|
+
}
|
|
2852
|
+
return Block$1.decode(value);
|
|
2853
|
+
},
|
|
2854
|
+
encode(value) {
|
|
2855
|
+
if (value === null) {
|
|
2856
|
+
return new Uint8Array();
|
|
2857
|
+
}
|
|
2858
|
+
return Block$1.encode(value).finish();
|
|
2859
|
+
}
|
|
2860
|
+
}
|
|
2861
|
+
);
|
|
2862
|
+
|
|
2863
|
+
const OptionalArray = (schema) => Schema.optional(Schema.Array(schema));
|
|
2864
|
+
const HeaderFilter = Schema.Struct({
|
|
2865
|
+
always: Schema.optional(Schema.Boolean)
|
|
2866
|
+
});
|
|
2867
|
+
const WithdrawalFilter = Schema.Struct({
|
|
2868
|
+
validatorIndex: Schema.optional(Schema.BigIntFromSelf),
|
|
2869
|
+
address: Schema.optional(Address$1)
|
|
2870
|
+
});
|
|
2871
|
+
const Topic = Schema.transform(
|
|
2872
|
+
Schema.Struct({ value: Schema.UndefinedOr(B256$1) }),
|
|
2873
|
+
Schema.NullOr(B256$1),
|
|
2874
|
+
{
|
|
2875
|
+
strict: false,
|
|
2876
|
+
decode({ value }) {
|
|
2877
|
+
if (value === void 0) {
|
|
2878
|
+
return null;
|
|
2879
|
+
}
|
|
2880
|
+
return b256ToProto(value);
|
|
2881
|
+
},
|
|
2882
|
+
encode(value) {
|
|
2883
|
+
if (value === null) {
|
|
2884
|
+
return { value: void 0 };
|
|
2885
|
+
}
|
|
2886
|
+
return { value: b256FromProto(value) };
|
|
2887
|
+
}
|
|
2888
|
+
}
|
|
2889
|
+
);
|
|
2890
|
+
const LogFilter = Schema.Struct({
|
|
2891
|
+
address: Schema.optional(Address$1),
|
|
2892
|
+
topics: OptionalArray(Topic),
|
|
2893
|
+
strict: Schema.optional(Schema.Boolean),
|
|
2894
|
+
includeTransaction: Schema.optional(Schema.Boolean),
|
|
2895
|
+
includeReceipt: Schema.optional(Schema.Boolean)
|
|
2896
|
+
});
|
|
2897
|
+
const TransactionFilter = Schema.Struct({
|
|
2898
|
+
from: Schema.optional(Address$1),
|
|
2899
|
+
to: Schema.optional(Address$1),
|
|
2900
|
+
includeReceipt: Schema.optional(Schema.Boolean),
|
|
2901
|
+
includeLogs: Schema.optional(Schema.Boolean)
|
|
2902
|
+
});
|
|
2903
|
+
const Filter = Schema.Struct({
|
|
2904
|
+
header: Schema.optional(HeaderFilter),
|
|
2905
|
+
withdrawals: OptionalArray(WithdrawalFilter),
|
|
2906
|
+
logs: OptionalArray(LogFilter),
|
|
2907
|
+
transactions: OptionalArray(TransactionFilter)
|
|
2908
|
+
});
|
|
2909
|
+
const filterToProto = Schema.encodeSync(Filter);
|
|
2910
|
+
const filterFromProto = Schema.decodeSync(Filter);
|
|
2911
|
+
const FilterFromBytes = Schema.transform(
|
|
2912
|
+
Schema.Uint8ArrayFromSelf,
|
|
2913
|
+
Filter,
|
|
2914
|
+
{
|
|
2915
|
+
strict: false,
|
|
2916
|
+
decode(value) {
|
|
2917
|
+
return Filter$1.decode(value);
|
|
2918
|
+
},
|
|
2919
|
+
encode(value) {
|
|
2920
|
+
return Filter$1.encode(value).finish();
|
|
2921
|
+
}
|
|
2922
|
+
}
|
|
2923
|
+
);
|
|
2924
|
+
const filterToBytes = Schema.encodeSync(FilterFromBytes);
|
|
2925
|
+
const filterFromBytes = Schema.decodeSync(FilterFromBytes);
|
|
2926
|
+
function mergeFilter(a, b) {
|
|
2927
|
+
const header = mergeHeaderFilter(a.header, b.header);
|
|
2928
|
+
return {
|
|
2929
|
+
header,
|
|
2930
|
+
withdrawals: [...a.withdrawals ?? [], ...b.withdrawals ?? []],
|
|
2931
|
+
logs: [...a.logs ?? [], ...b.logs ?? []],
|
|
2932
|
+
transactions: [...a.transactions ?? [], ...b.transactions ?? []]
|
|
2933
|
+
};
|
|
2934
|
+
}
|
|
2935
|
+
function mergeHeaderFilter(a, b) {
|
|
2936
|
+
if (a === void 0) {
|
|
2937
|
+
return b;
|
|
2938
|
+
}
|
|
2939
|
+
if (b === void 0) {
|
|
2940
|
+
return a;
|
|
2941
|
+
}
|
|
2942
|
+
return {
|
|
2943
|
+
always: a.always || b.always
|
|
2944
|
+
};
|
|
2945
|
+
}
|
|
2946
|
+
|
|
2947
|
+
const EvmStream = new StreamConfig(
|
|
2948
|
+
FilterFromBytes,
|
|
2949
|
+
BlockFromBytes,
|
|
2950
|
+
mergeFilter
|
|
2951
|
+
);
|
|
2952
|
+
|
|
2953
|
+
export { AccessListItem, Address$1 as Address, B256$1 as B256, Block, BlockFromBytes, BlockHeader, Bloom, EvmStream, Filter, FilterFromBytes, HeaderFilter, HexData, Log, LogFilter, Signature, Topic, Transaction, TransactionFilter, TransactionReceipt, U128$1 as U128, U256$1 as U256, Withdrawal, WithdrawalFilter, b256FromProto, b256ToProto, filterFromBytes, filterFromProto, filterToBytes, filterToProto, mergeFilter, index as proto, u128FromProto, u128ToProto, u256FromProto, u256ToProto };
|