@apibara/beaconchain 2.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -0
- package/package.json +49 -0
- package/src/block.ts +114 -0
- package/src/common.test.ts +21 -0
- package/src/common.ts +95 -0
- package/src/filter.ts +113 -0
- package/src/index.ts +15 -0
- package/src/proto/common.ts +718 -0
- package/src/proto/data.ts +1909 -0
- package/src/proto/filter.ts +544 -0
- package/src/proto/google/protobuf/timestamp.ts +220 -0
- package/src/proto/index.ts +3 -0
|
@@ -0,0 +1,544 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v1.176.0
|
|
4
|
+
// protoc unknown
|
|
5
|
+
// source: filter.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import _m0 from "protobufjs/minimal";
|
|
9
|
+
import { Address, ValidatorStatus, validatorStatusFromJSON, validatorStatusToJSON } from "./common";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "beaconchain.v2";
|
|
12
|
+
|
|
13
|
+
/** Beacon Chain DNA definitions (filter). */
|
|
14
|
+
|
|
15
|
+
export interface Filter {
|
|
16
|
+
/** Include header. */
|
|
17
|
+
readonly header?:
|
|
18
|
+
| HeaderFilter
|
|
19
|
+
| undefined;
|
|
20
|
+
/** Filter transactions. */
|
|
21
|
+
readonly transactions?:
|
|
22
|
+
| readonly TransactionFilter[]
|
|
23
|
+
| undefined;
|
|
24
|
+
/** Filter validators. */
|
|
25
|
+
readonly validators?:
|
|
26
|
+
| readonly ValidatorFilter[]
|
|
27
|
+
| undefined;
|
|
28
|
+
/** Filter blobs. */
|
|
29
|
+
readonly blobs?: readonly BlobFilter[] | undefined;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface HeaderFilter {
|
|
33
|
+
/** Always include header data. Defaults to `false`. */
|
|
34
|
+
readonly always?: boolean | undefined;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface TransactionFilter {
|
|
38
|
+
readonly id?:
|
|
39
|
+
| number
|
|
40
|
+
| undefined;
|
|
41
|
+
/** Filter based on the transaction's sender address. */
|
|
42
|
+
readonly from?:
|
|
43
|
+
| Address
|
|
44
|
+
| undefined;
|
|
45
|
+
/** Filter based on the transaction's recipient address. */
|
|
46
|
+
readonly to?:
|
|
47
|
+
| Address
|
|
48
|
+
| undefined;
|
|
49
|
+
/** Only return `creat` transactions. Defaults to `false`. */
|
|
50
|
+
readonly create?:
|
|
51
|
+
| boolean
|
|
52
|
+
| undefined;
|
|
53
|
+
/** Include the transaction's blob. Defaults to `false`. */
|
|
54
|
+
readonly includeBlob?: boolean | undefined;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface ValidatorFilter {
|
|
58
|
+
readonly id?:
|
|
59
|
+
| number
|
|
60
|
+
| undefined;
|
|
61
|
+
/** Filter the validator based on its index. */
|
|
62
|
+
readonly validatorIndex?:
|
|
63
|
+
| number
|
|
64
|
+
| undefined;
|
|
65
|
+
/** Filter based on the validator's status. */
|
|
66
|
+
readonly status?: ValidatorStatus | undefined;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface BlobFilter {
|
|
70
|
+
readonly id?:
|
|
71
|
+
| number
|
|
72
|
+
| undefined;
|
|
73
|
+
/** Include the transaction that posted the blob. */
|
|
74
|
+
readonly includeTransaction?: boolean | undefined;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function createBaseFilter(): Filter {
|
|
78
|
+
return { header: undefined, transactions: [], validators: [], blobs: [] };
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export const Filter = {
|
|
82
|
+
encode(message: Filter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
83
|
+
if (message.header !== undefined) {
|
|
84
|
+
HeaderFilter.encode(message.header, writer.uint32(10).fork()).ldelim();
|
|
85
|
+
}
|
|
86
|
+
if (message.transactions !== undefined && message.transactions.length !== 0) {
|
|
87
|
+
for (const v of message.transactions) {
|
|
88
|
+
TransactionFilter.encode(v!, writer.uint32(18).fork()).ldelim();
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (message.validators !== undefined && message.validators.length !== 0) {
|
|
92
|
+
for (const v of message.validators) {
|
|
93
|
+
ValidatorFilter.encode(v!, writer.uint32(26).fork()).ldelim();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (message.blobs !== undefined && message.blobs.length !== 0) {
|
|
97
|
+
for (const v of message.blobs) {
|
|
98
|
+
BlobFilter.encode(v!, writer.uint32(34).fork()).ldelim();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return writer;
|
|
102
|
+
},
|
|
103
|
+
|
|
104
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Filter {
|
|
105
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
106
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
107
|
+
const message = createBaseFilter() as any;
|
|
108
|
+
while (reader.pos < end) {
|
|
109
|
+
const tag = reader.uint32();
|
|
110
|
+
switch (tag >>> 3) {
|
|
111
|
+
case 1:
|
|
112
|
+
if (tag !== 10) {
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
message.header = HeaderFilter.decode(reader, reader.uint32());
|
|
117
|
+
continue;
|
|
118
|
+
case 2:
|
|
119
|
+
if (tag !== 18) {
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
message.transactions!.push(TransactionFilter.decode(reader, reader.uint32()));
|
|
124
|
+
continue;
|
|
125
|
+
case 3:
|
|
126
|
+
if (tag !== 26) {
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
message.validators!.push(ValidatorFilter.decode(reader, reader.uint32()));
|
|
131
|
+
continue;
|
|
132
|
+
case 4:
|
|
133
|
+
if (tag !== 34) {
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
message.blobs!.push(BlobFilter.decode(reader, reader.uint32()));
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
reader.skipType(tag & 7);
|
|
144
|
+
}
|
|
145
|
+
return message;
|
|
146
|
+
},
|
|
147
|
+
|
|
148
|
+
fromJSON(object: any): Filter {
|
|
149
|
+
return {
|
|
150
|
+
header: isSet(object.header) ? HeaderFilter.fromJSON(object.header) : undefined,
|
|
151
|
+
transactions: globalThis.Array.isArray(object?.transactions)
|
|
152
|
+
? object.transactions.map((e: any) => TransactionFilter.fromJSON(e))
|
|
153
|
+
: [],
|
|
154
|
+
validators: globalThis.Array.isArray(object?.validators)
|
|
155
|
+
? object.validators.map((e: any) => ValidatorFilter.fromJSON(e))
|
|
156
|
+
: [],
|
|
157
|
+
blobs: globalThis.Array.isArray(object?.blobs) ? object.blobs.map((e: any) => BlobFilter.fromJSON(e)) : [],
|
|
158
|
+
};
|
|
159
|
+
},
|
|
160
|
+
|
|
161
|
+
toJSON(message: Filter): unknown {
|
|
162
|
+
const obj: any = {};
|
|
163
|
+
if (message.header !== undefined) {
|
|
164
|
+
obj.header = HeaderFilter.toJSON(message.header);
|
|
165
|
+
}
|
|
166
|
+
if (message.transactions?.length) {
|
|
167
|
+
obj.transactions = message.transactions.map((e) => TransactionFilter.toJSON(e));
|
|
168
|
+
}
|
|
169
|
+
if (message.validators?.length) {
|
|
170
|
+
obj.validators = message.validators.map((e) => ValidatorFilter.toJSON(e));
|
|
171
|
+
}
|
|
172
|
+
if (message.blobs?.length) {
|
|
173
|
+
obj.blobs = message.blobs.map((e) => BlobFilter.toJSON(e));
|
|
174
|
+
}
|
|
175
|
+
return obj;
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
create(base?: DeepPartial<Filter>): Filter {
|
|
179
|
+
return Filter.fromPartial(base ?? {});
|
|
180
|
+
},
|
|
181
|
+
fromPartial(object: DeepPartial<Filter>): Filter {
|
|
182
|
+
const message = createBaseFilter() as any;
|
|
183
|
+
message.header = (object.header !== undefined && object.header !== null)
|
|
184
|
+
? HeaderFilter.fromPartial(object.header)
|
|
185
|
+
: undefined;
|
|
186
|
+
message.transactions = object.transactions?.map((e) => TransactionFilter.fromPartial(e)) || [];
|
|
187
|
+
message.validators = object.validators?.map((e) => ValidatorFilter.fromPartial(e)) || [];
|
|
188
|
+
message.blobs = object.blobs?.map((e) => BlobFilter.fromPartial(e)) || [];
|
|
189
|
+
return message;
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
function createBaseHeaderFilter(): HeaderFilter {
|
|
194
|
+
return { always: undefined };
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export const HeaderFilter = {
|
|
198
|
+
encode(message: HeaderFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
199
|
+
if (message.always !== undefined) {
|
|
200
|
+
writer.uint32(8).bool(message.always);
|
|
201
|
+
}
|
|
202
|
+
return writer;
|
|
203
|
+
},
|
|
204
|
+
|
|
205
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): HeaderFilter {
|
|
206
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
207
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
208
|
+
const message = createBaseHeaderFilter() as any;
|
|
209
|
+
while (reader.pos < end) {
|
|
210
|
+
const tag = reader.uint32();
|
|
211
|
+
switch (tag >>> 3) {
|
|
212
|
+
case 1:
|
|
213
|
+
if (tag !== 8) {
|
|
214
|
+
break;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
message.always = reader.bool();
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
reader.skipType(tag & 7);
|
|
224
|
+
}
|
|
225
|
+
return message;
|
|
226
|
+
},
|
|
227
|
+
|
|
228
|
+
fromJSON(object: any): HeaderFilter {
|
|
229
|
+
return { always: isSet(object.always) ? globalThis.Boolean(object.always) : undefined };
|
|
230
|
+
},
|
|
231
|
+
|
|
232
|
+
toJSON(message: HeaderFilter): unknown {
|
|
233
|
+
const obj: any = {};
|
|
234
|
+
if (message.always !== undefined) {
|
|
235
|
+
obj.always = message.always;
|
|
236
|
+
}
|
|
237
|
+
return obj;
|
|
238
|
+
},
|
|
239
|
+
|
|
240
|
+
create(base?: DeepPartial<HeaderFilter>): HeaderFilter {
|
|
241
|
+
return HeaderFilter.fromPartial(base ?? {});
|
|
242
|
+
},
|
|
243
|
+
fromPartial(object: DeepPartial<HeaderFilter>): HeaderFilter {
|
|
244
|
+
const message = createBaseHeaderFilter() as any;
|
|
245
|
+
message.always = object.always ?? undefined;
|
|
246
|
+
return message;
|
|
247
|
+
},
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
function createBaseTransactionFilter(): TransactionFilter {
|
|
251
|
+
return { id: 0, from: undefined, to: undefined, create: undefined, includeBlob: undefined };
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export const TransactionFilter = {
|
|
255
|
+
encode(message: TransactionFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
256
|
+
if (message.id !== undefined && message.id !== 0) {
|
|
257
|
+
writer.uint32(8).uint32(message.id);
|
|
258
|
+
}
|
|
259
|
+
if (message.from !== undefined) {
|
|
260
|
+
Address.encode(message.from, writer.uint32(18).fork()).ldelim();
|
|
261
|
+
}
|
|
262
|
+
if (message.to !== undefined) {
|
|
263
|
+
Address.encode(message.to, writer.uint32(26).fork()).ldelim();
|
|
264
|
+
}
|
|
265
|
+
if (message.create !== undefined) {
|
|
266
|
+
writer.uint32(32).bool(message.create);
|
|
267
|
+
}
|
|
268
|
+
if (message.includeBlob !== undefined) {
|
|
269
|
+
writer.uint32(40).bool(message.includeBlob);
|
|
270
|
+
}
|
|
271
|
+
return writer;
|
|
272
|
+
},
|
|
273
|
+
|
|
274
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): TransactionFilter {
|
|
275
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
276
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
277
|
+
const message = createBaseTransactionFilter() as any;
|
|
278
|
+
while (reader.pos < end) {
|
|
279
|
+
const tag = reader.uint32();
|
|
280
|
+
switch (tag >>> 3) {
|
|
281
|
+
case 1:
|
|
282
|
+
if (tag !== 8) {
|
|
283
|
+
break;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
message.id = reader.uint32();
|
|
287
|
+
continue;
|
|
288
|
+
case 2:
|
|
289
|
+
if (tag !== 18) {
|
|
290
|
+
break;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
message.from = Address.decode(reader, reader.uint32());
|
|
294
|
+
continue;
|
|
295
|
+
case 3:
|
|
296
|
+
if (tag !== 26) {
|
|
297
|
+
break;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
message.to = Address.decode(reader, reader.uint32());
|
|
301
|
+
continue;
|
|
302
|
+
case 4:
|
|
303
|
+
if (tag !== 32) {
|
|
304
|
+
break;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
message.create = reader.bool();
|
|
308
|
+
continue;
|
|
309
|
+
case 5:
|
|
310
|
+
if (tag !== 40) {
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
message.includeBlob = reader.bool();
|
|
315
|
+
continue;
|
|
316
|
+
}
|
|
317
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
318
|
+
break;
|
|
319
|
+
}
|
|
320
|
+
reader.skipType(tag & 7);
|
|
321
|
+
}
|
|
322
|
+
return message;
|
|
323
|
+
},
|
|
324
|
+
|
|
325
|
+
fromJSON(object: any): TransactionFilter {
|
|
326
|
+
return {
|
|
327
|
+
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
|
328
|
+
from: isSet(object.from) ? Address.fromJSON(object.from) : undefined,
|
|
329
|
+
to: isSet(object.to) ? Address.fromJSON(object.to) : undefined,
|
|
330
|
+
create: isSet(object.create) ? globalThis.Boolean(object.create) : undefined,
|
|
331
|
+
includeBlob: isSet(object.includeBlob) ? globalThis.Boolean(object.includeBlob) : undefined,
|
|
332
|
+
};
|
|
333
|
+
},
|
|
334
|
+
|
|
335
|
+
toJSON(message: TransactionFilter): unknown {
|
|
336
|
+
const obj: any = {};
|
|
337
|
+
if (message.id !== undefined && message.id !== 0) {
|
|
338
|
+
obj.id = Math.round(message.id);
|
|
339
|
+
}
|
|
340
|
+
if (message.from !== undefined) {
|
|
341
|
+
obj.from = Address.toJSON(message.from);
|
|
342
|
+
}
|
|
343
|
+
if (message.to !== undefined) {
|
|
344
|
+
obj.to = Address.toJSON(message.to);
|
|
345
|
+
}
|
|
346
|
+
if (message.create !== undefined) {
|
|
347
|
+
obj.create = message.create;
|
|
348
|
+
}
|
|
349
|
+
if (message.includeBlob !== undefined) {
|
|
350
|
+
obj.includeBlob = message.includeBlob;
|
|
351
|
+
}
|
|
352
|
+
return obj;
|
|
353
|
+
},
|
|
354
|
+
|
|
355
|
+
create(base?: DeepPartial<TransactionFilter>): TransactionFilter {
|
|
356
|
+
return TransactionFilter.fromPartial(base ?? {});
|
|
357
|
+
},
|
|
358
|
+
fromPartial(object: DeepPartial<TransactionFilter>): TransactionFilter {
|
|
359
|
+
const message = createBaseTransactionFilter() as any;
|
|
360
|
+
message.id = object.id ?? 0;
|
|
361
|
+
message.from = (object.from !== undefined && object.from !== null) ? Address.fromPartial(object.from) : undefined;
|
|
362
|
+
message.to = (object.to !== undefined && object.to !== null) ? Address.fromPartial(object.to) : undefined;
|
|
363
|
+
message.create = object.create ?? undefined;
|
|
364
|
+
message.includeBlob = object.includeBlob ?? undefined;
|
|
365
|
+
return message;
|
|
366
|
+
},
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
function createBaseValidatorFilter(): ValidatorFilter {
|
|
370
|
+
return { id: 0, validatorIndex: undefined, status: undefined };
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export const ValidatorFilter = {
|
|
374
|
+
encode(message: ValidatorFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
375
|
+
if (message.id !== undefined && message.id !== 0) {
|
|
376
|
+
writer.uint32(8).uint32(message.id);
|
|
377
|
+
}
|
|
378
|
+
if (message.validatorIndex !== undefined) {
|
|
379
|
+
writer.uint32(16).uint32(message.validatorIndex);
|
|
380
|
+
}
|
|
381
|
+
if (message.status !== undefined) {
|
|
382
|
+
writer.uint32(24).int32(message.status);
|
|
383
|
+
}
|
|
384
|
+
return writer;
|
|
385
|
+
},
|
|
386
|
+
|
|
387
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorFilter {
|
|
388
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
389
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
390
|
+
const message = createBaseValidatorFilter() as any;
|
|
391
|
+
while (reader.pos < end) {
|
|
392
|
+
const tag = reader.uint32();
|
|
393
|
+
switch (tag >>> 3) {
|
|
394
|
+
case 1:
|
|
395
|
+
if (tag !== 8) {
|
|
396
|
+
break;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
message.id = reader.uint32();
|
|
400
|
+
continue;
|
|
401
|
+
case 2:
|
|
402
|
+
if (tag !== 16) {
|
|
403
|
+
break;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
message.validatorIndex = reader.uint32();
|
|
407
|
+
continue;
|
|
408
|
+
case 3:
|
|
409
|
+
if (tag !== 24) {
|
|
410
|
+
break;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
message.status = reader.int32() as any;
|
|
414
|
+
continue;
|
|
415
|
+
}
|
|
416
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
417
|
+
break;
|
|
418
|
+
}
|
|
419
|
+
reader.skipType(tag & 7);
|
|
420
|
+
}
|
|
421
|
+
return message;
|
|
422
|
+
},
|
|
423
|
+
|
|
424
|
+
fromJSON(object: any): ValidatorFilter {
|
|
425
|
+
return {
|
|
426
|
+
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
|
427
|
+
validatorIndex: isSet(object.validatorIndex) ? globalThis.Number(object.validatorIndex) : undefined,
|
|
428
|
+
status: isSet(object.status) ? validatorStatusFromJSON(object.status) : undefined,
|
|
429
|
+
};
|
|
430
|
+
},
|
|
431
|
+
|
|
432
|
+
toJSON(message: ValidatorFilter): unknown {
|
|
433
|
+
const obj: any = {};
|
|
434
|
+
if (message.id !== undefined && message.id !== 0) {
|
|
435
|
+
obj.id = Math.round(message.id);
|
|
436
|
+
}
|
|
437
|
+
if (message.validatorIndex !== undefined) {
|
|
438
|
+
obj.validatorIndex = Math.round(message.validatorIndex);
|
|
439
|
+
}
|
|
440
|
+
if (message.status !== undefined) {
|
|
441
|
+
obj.status = validatorStatusToJSON(message.status);
|
|
442
|
+
}
|
|
443
|
+
return obj;
|
|
444
|
+
},
|
|
445
|
+
|
|
446
|
+
create(base?: DeepPartial<ValidatorFilter>): ValidatorFilter {
|
|
447
|
+
return ValidatorFilter.fromPartial(base ?? {});
|
|
448
|
+
},
|
|
449
|
+
fromPartial(object: DeepPartial<ValidatorFilter>): ValidatorFilter {
|
|
450
|
+
const message = createBaseValidatorFilter() as any;
|
|
451
|
+
message.id = object.id ?? 0;
|
|
452
|
+
message.validatorIndex = object.validatorIndex ?? undefined;
|
|
453
|
+
message.status = object.status ?? undefined;
|
|
454
|
+
return message;
|
|
455
|
+
},
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
function createBaseBlobFilter(): BlobFilter {
|
|
459
|
+
return { id: 0, includeTransaction: undefined };
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export const BlobFilter = {
|
|
463
|
+
encode(message: BlobFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
464
|
+
if (message.id !== undefined && message.id !== 0) {
|
|
465
|
+
writer.uint32(8).uint32(message.id);
|
|
466
|
+
}
|
|
467
|
+
if (message.includeTransaction !== undefined) {
|
|
468
|
+
writer.uint32(16).bool(message.includeTransaction);
|
|
469
|
+
}
|
|
470
|
+
return writer;
|
|
471
|
+
},
|
|
472
|
+
|
|
473
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): BlobFilter {
|
|
474
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
475
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
476
|
+
const message = createBaseBlobFilter() as any;
|
|
477
|
+
while (reader.pos < end) {
|
|
478
|
+
const tag = reader.uint32();
|
|
479
|
+
switch (tag >>> 3) {
|
|
480
|
+
case 1:
|
|
481
|
+
if (tag !== 8) {
|
|
482
|
+
break;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
message.id = reader.uint32();
|
|
486
|
+
continue;
|
|
487
|
+
case 2:
|
|
488
|
+
if (tag !== 16) {
|
|
489
|
+
break;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
message.includeTransaction = reader.bool();
|
|
493
|
+
continue;
|
|
494
|
+
}
|
|
495
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
496
|
+
break;
|
|
497
|
+
}
|
|
498
|
+
reader.skipType(tag & 7);
|
|
499
|
+
}
|
|
500
|
+
return message;
|
|
501
|
+
},
|
|
502
|
+
|
|
503
|
+
fromJSON(object: any): BlobFilter {
|
|
504
|
+
return {
|
|
505
|
+
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
|
506
|
+
includeTransaction: isSet(object.includeTransaction) ? globalThis.Boolean(object.includeTransaction) : undefined,
|
|
507
|
+
};
|
|
508
|
+
},
|
|
509
|
+
|
|
510
|
+
toJSON(message: BlobFilter): unknown {
|
|
511
|
+
const obj: any = {};
|
|
512
|
+
if (message.id !== undefined && message.id !== 0) {
|
|
513
|
+
obj.id = Math.round(message.id);
|
|
514
|
+
}
|
|
515
|
+
if (message.includeTransaction !== undefined) {
|
|
516
|
+
obj.includeTransaction = message.includeTransaction;
|
|
517
|
+
}
|
|
518
|
+
return obj;
|
|
519
|
+
},
|
|
520
|
+
|
|
521
|
+
create(base?: DeepPartial<BlobFilter>): BlobFilter {
|
|
522
|
+
return BlobFilter.fromPartial(base ?? {});
|
|
523
|
+
},
|
|
524
|
+
fromPartial(object: DeepPartial<BlobFilter>): BlobFilter {
|
|
525
|
+
const message = createBaseBlobFilter() as any;
|
|
526
|
+
message.id = object.id ?? 0;
|
|
527
|
+
message.includeTransaction = object.includeTransaction ?? undefined;
|
|
528
|
+
return message;
|
|
529
|
+
},
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
533
|
+
|
|
534
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
535
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
536
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
537
|
+
: T extends { readonly $case: string }
|
|
538
|
+
? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { readonly $case: T["$case"] }
|
|
539
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
540
|
+
: Partial<T>;
|
|
541
|
+
|
|
542
|
+
function isSet(value: any): boolean {
|
|
543
|
+
return value !== null && value !== undefined;
|
|
544
|
+
}
|