@apibara/starknet 2.0.0-beta.7 → 2.0.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1463 -291
- package/dist/index.d.cts +966 -78
- package/dist/index.d.mts +966 -78
- package/dist/index.d.ts +966 -78
- package/dist/index.mjs +1451 -292
- package/package.json +2 -2
- package/src/block.ts +102 -0
- package/src/filter.test.ts +257 -9
- package/src/filter.ts +105 -7
- package/src/proto/data.ts +846 -2
- package/src/proto/filter.ts +593 -74
package/src/proto/filter.ts
CHANGED
|
@@ -12,6 +12,51 @@ export const protobufPackage = "starknet.v2";
|
|
|
12
12
|
|
|
13
13
|
/** Starknet DNA definitions (filter). */
|
|
14
14
|
|
|
15
|
+
export enum HeaderFilter {
|
|
16
|
+
UNSPECIFIED = 0,
|
|
17
|
+
ALWAYS = 1,
|
|
18
|
+
ON_DATA = 2,
|
|
19
|
+
ON_DATA_OR_ON_NEW_BLOCK = 3,
|
|
20
|
+
UNRECOGNIZED = -1,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function headerFilterFromJSON(object: any): HeaderFilter {
|
|
24
|
+
switch (object) {
|
|
25
|
+
case 0:
|
|
26
|
+
case "HEADER_FILTER_UNSPECIFIED":
|
|
27
|
+
return HeaderFilter.UNSPECIFIED;
|
|
28
|
+
case 1:
|
|
29
|
+
case "HEADER_FILTER_ALWAYS":
|
|
30
|
+
return HeaderFilter.ALWAYS;
|
|
31
|
+
case 2:
|
|
32
|
+
case "HEADER_FILTER_ON_DATA":
|
|
33
|
+
return HeaderFilter.ON_DATA;
|
|
34
|
+
case 3:
|
|
35
|
+
case "HEADER_FILTER_ON_DATA_OR_ON_NEW_BLOCK":
|
|
36
|
+
return HeaderFilter.ON_DATA_OR_ON_NEW_BLOCK;
|
|
37
|
+
case -1:
|
|
38
|
+
case "UNRECOGNIZED":
|
|
39
|
+
default:
|
|
40
|
+
return HeaderFilter.UNRECOGNIZED;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function headerFilterToJSON(object: HeaderFilter): string {
|
|
45
|
+
switch (object) {
|
|
46
|
+
case HeaderFilter.UNSPECIFIED:
|
|
47
|
+
return "HEADER_FILTER_UNSPECIFIED";
|
|
48
|
+
case HeaderFilter.ALWAYS:
|
|
49
|
+
return "HEADER_FILTER_ALWAYS";
|
|
50
|
+
case HeaderFilter.ON_DATA:
|
|
51
|
+
return "HEADER_FILTER_ON_DATA";
|
|
52
|
+
case HeaderFilter.ON_DATA_OR_ON_NEW_BLOCK:
|
|
53
|
+
return "HEADER_FILTER_ON_DATA_OR_ON_NEW_BLOCK";
|
|
54
|
+
case HeaderFilter.UNRECOGNIZED:
|
|
55
|
+
default:
|
|
56
|
+
return "UNRECOGNIZED";
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
15
60
|
export enum TransactionStatusFilter {
|
|
16
61
|
UNSPECIFIED = 0,
|
|
17
62
|
SUCCEEDED = 1,
|
|
@@ -71,12 +116,19 @@ export interface Filter {
|
|
|
71
116
|
| readonly EventFilter[]
|
|
72
117
|
| undefined;
|
|
73
118
|
/** Filter messages to L1. */
|
|
74
|
-
readonly messages?:
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
119
|
+
readonly messages?:
|
|
120
|
+
| readonly MessageToL1Filter[]
|
|
121
|
+
| undefined;
|
|
122
|
+
/** Filter storage diffs. */
|
|
123
|
+
readonly storageDiffs?:
|
|
124
|
+
| readonly StorageDiffFilter[]
|
|
125
|
+
| undefined;
|
|
126
|
+
/** Filter contract changes. */
|
|
127
|
+
readonly contractChanges?:
|
|
128
|
+
| readonly ContractChangeFilter[]
|
|
129
|
+
| undefined;
|
|
130
|
+
/** Filter nonce updates. */
|
|
131
|
+
readonly nonceUpdates?: readonly NonceUpdateFilter[] | undefined;
|
|
80
132
|
}
|
|
81
133
|
|
|
82
134
|
/** Filter events. */
|
|
@@ -281,14 +333,56 @@ export interface DeployAccountV1TransactionFilter {
|
|
|
281
333
|
export interface DeployAccountV3TransactionFilter {
|
|
282
334
|
}
|
|
283
335
|
|
|
336
|
+
export interface StorageDiffFilter {
|
|
337
|
+
readonly id?:
|
|
338
|
+
| number
|
|
339
|
+
| undefined;
|
|
340
|
+
/** Filter by contract address. */
|
|
341
|
+
readonly contractAddress?: FieldElement | undefined;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export interface ContractChangeFilter {
|
|
345
|
+
readonly id?: number | undefined;
|
|
346
|
+
readonly change?:
|
|
347
|
+
| { readonly $case: "declaredClass"; readonly declaredClass: DeclaredClassFilter }
|
|
348
|
+
| { readonly $case: "replacedClass"; readonly replacedClass: ReplacedClassFilter }
|
|
349
|
+
| { readonly $case: "deployedContract"; readonly deployedContract: DeployedContractFilter }
|
|
350
|
+
| undefined;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
export interface DeclaredClassFilter {
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
export interface ReplacedClassFilter {
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
export interface DeployedContractFilter {
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export interface NonceUpdateFilter {
|
|
363
|
+
readonly id?:
|
|
364
|
+
| number
|
|
365
|
+
| undefined;
|
|
366
|
+
/** Filter by contract address. */
|
|
367
|
+
readonly contractAddress?: FieldElement | undefined;
|
|
368
|
+
}
|
|
369
|
+
|
|
284
370
|
function createBaseFilter(): Filter {
|
|
285
|
-
return {
|
|
371
|
+
return {
|
|
372
|
+
header: 0,
|
|
373
|
+
transactions: [],
|
|
374
|
+
events: [],
|
|
375
|
+
messages: [],
|
|
376
|
+
storageDiffs: [],
|
|
377
|
+
contractChanges: [],
|
|
378
|
+
nonceUpdates: [],
|
|
379
|
+
};
|
|
286
380
|
}
|
|
287
381
|
|
|
288
382
|
export const Filter = {
|
|
289
383
|
encode(message: Filter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
290
|
-
if (message.header !== undefined) {
|
|
291
|
-
|
|
384
|
+
if (message.header !== undefined && message.header !== 0) {
|
|
385
|
+
writer.uint32(8).int32(message.header);
|
|
292
386
|
}
|
|
293
387
|
if (message.transactions !== undefined && message.transactions.length !== 0) {
|
|
294
388
|
for (const v of message.transactions) {
|
|
@@ -305,6 +399,21 @@ export const Filter = {
|
|
|
305
399
|
MessageToL1Filter.encode(v!, writer.uint32(34).fork()).ldelim();
|
|
306
400
|
}
|
|
307
401
|
}
|
|
402
|
+
if (message.storageDiffs !== undefined && message.storageDiffs.length !== 0) {
|
|
403
|
+
for (const v of message.storageDiffs) {
|
|
404
|
+
StorageDiffFilter.encode(v!, writer.uint32(42).fork()).ldelim();
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
if (message.contractChanges !== undefined && message.contractChanges.length !== 0) {
|
|
408
|
+
for (const v of message.contractChanges) {
|
|
409
|
+
ContractChangeFilter.encode(v!, writer.uint32(50).fork()).ldelim();
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
if (message.nonceUpdates !== undefined && message.nonceUpdates.length !== 0) {
|
|
413
|
+
for (const v of message.nonceUpdates) {
|
|
414
|
+
NonceUpdateFilter.encode(v!, writer.uint32(58).fork()).ldelim();
|
|
415
|
+
}
|
|
416
|
+
}
|
|
308
417
|
return writer;
|
|
309
418
|
},
|
|
310
419
|
|
|
@@ -316,11 +425,11 @@ export const Filter = {
|
|
|
316
425
|
const tag = reader.uint32();
|
|
317
426
|
switch (tag >>> 3) {
|
|
318
427
|
case 1:
|
|
319
|
-
if (tag !==
|
|
428
|
+
if (tag !== 8) {
|
|
320
429
|
break;
|
|
321
430
|
}
|
|
322
431
|
|
|
323
|
-
message.header =
|
|
432
|
+
message.header = reader.int32() as any;
|
|
324
433
|
continue;
|
|
325
434
|
case 2:
|
|
326
435
|
if (tag !== 18) {
|
|
@@ -343,6 +452,27 @@ export const Filter = {
|
|
|
343
452
|
|
|
344
453
|
message.messages!.push(MessageToL1Filter.decode(reader, reader.uint32()));
|
|
345
454
|
continue;
|
|
455
|
+
case 5:
|
|
456
|
+
if (tag !== 42) {
|
|
457
|
+
break;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
message.storageDiffs!.push(StorageDiffFilter.decode(reader, reader.uint32()));
|
|
461
|
+
continue;
|
|
462
|
+
case 6:
|
|
463
|
+
if (tag !== 50) {
|
|
464
|
+
break;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
message.contractChanges!.push(ContractChangeFilter.decode(reader, reader.uint32()));
|
|
468
|
+
continue;
|
|
469
|
+
case 7:
|
|
470
|
+
if (tag !== 58) {
|
|
471
|
+
break;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
message.nonceUpdates!.push(NonceUpdateFilter.decode(reader, reader.uint32()));
|
|
475
|
+
continue;
|
|
346
476
|
}
|
|
347
477
|
if ((tag & 7) === 4 || tag === 0) {
|
|
348
478
|
break;
|
|
@@ -354,7 +484,7 @@ export const Filter = {
|
|
|
354
484
|
|
|
355
485
|
fromJSON(object: any): Filter {
|
|
356
486
|
return {
|
|
357
|
-
header: isSet(object.header) ?
|
|
487
|
+
header: isSet(object.header) ? headerFilterFromJSON(object.header) : 0,
|
|
358
488
|
transactions: globalThis.Array.isArray(object?.transactions)
|
|
359
489
|
? object.transactions.map((e: any) => TransactionFilter.fromJSON(e))
|
|
360
490
|
: [],
|
|
@@ -362,13 +492,22 @@ export const Filter = {
|
|
|
362
492
|
messages: globalThis.Array.isArray(object?.messages)
|
|
363
493
|
? object.messages.map((e: any) => MessageToL1Filter.fromJSON(e))
|
|
364
494
|
: [],
|
|
495
|
+
storageDiffs: globalThis.Array.isArray(object?.storageDiffs)
|
|
496
|
+
? object.storageDiffs.map((e: any) => StorageDiffFilter.fromJSON(e))
|
|
497
|
+
: [],
|
|
498
|
+
contractChanges: globalThis.Array.isArray(object?.contractChanges)
|
|
499
|
+
? object.contractChanges.map((e: any) => ContractChangeFilter.fromJSON(e))
|
|
500
|
+
: [],
|
|
501
|
+
nonceUpdates: globalThis.Array.isArray(object?.nonceUpdates)
|
|
502
|
+
? object.nonceUpdates.map((e: any) => NonceUpdateFilter.fromJSON(e))
|
|
503
|
+
: [],
|
|
365
504
|
};
|
|
366
505
|
},
|
|
367
506
|
|
|
368
507
|
toJSON(message: Filter): unknown {
|
|
369
508
|
const obj: any = {};
|
|
370
|
-
if (message.header !== undefined) {
|
|
371
|
-
obj.header =
|
|
509
|
+
if (message.header !== undefined && message.header !== 0) {
|
|
510
|
+
obj.header = headerFilterToJSON(message.header);
|
|
372
511
|
}
|
|
373
512
|
if (message.transactions?.length) {
|
|
374
513
|
obj.transactions = message.transactions.map((e) => TransactionFilter.toJSON(e));
|
|
@@ -379,6 +518,15 @@ export const Filter = {
|
|
|
379
518
|
if (message.messages?.length) {
|
|
380
519
|
obj.messages = message.messages.map((e) => MessageToL1Filter.toJSON(e));
|
|
381
520
|
}
|
|
521
|
+
if (message.storageDiffs?.length) {
|
|
522
|
+
obj.storageDiffs = message.storageDiffs.map((e) => StorageDiffFilter.toJSON(e));
|
|
523
|
+
}
|
|
524
|
+
if (message.contractChanges?.length) {
|
|
525
|
+
obj.contractChanges = message.contractChanges.map((e) => ContractChangeFilter.toJSON(e));
|
|
526
|
+
}
|
|
527
|
+
if (message.nonceUpdates?.length) {
|
|
528
|
+
obj.nonceUpdates = message.nonceUpdates.map((e) => NonceUpdateFilter.toJSON(e));
|
|
529
|
+
}
|
|
382
530
|
return obj;
|
|
383
531
|
},
|
|
384
532
|
|
|
@@ -387,69 +535,13 @@ export const Filter = {
|
|
|
387
535
|
},
|
|
388
536
|
fromPartial(object: DeepPartial<Filter>): Filter {
|
|
389
537
|
const message = createBaseFilter() as any;
|
|
390
|
-
message.header =
|
|
391
|
-
? HeaderFilter.fromPartial(object.header)
|
|
392
|
-
: undefined;
|
|
538
|
+
message.header = object.header ?? 0;
|
|
393
539
|
message.transactions = object.transactions?.map((e) => TransactionFilter.fromPartial(e)) || [];
|
|
394
540
|
message.events = object.events?.map((e) => EventFilter.fromPartial(e)) || [];
|
|
395
541
|
message.messages = object.messages?.map((e) => MessageToL1Filter.fromPartial(e)) || [];
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
function createBaseHeaderFilter(): HeaderFilter {
|
|
401
|
-
return { always: undefined };
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
export const HeaderFilter = {
|
|
405
|
-
encode(message: HeaderFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
406
|
-
if (message.always !== undefined) {
|
|
407
|
-
writer.uint32(8).bool(message.always);
|
|
408
|
-
}
|
|
409
|
-
return writer;
|
|
410
|
-
},
|
|
411
|
-
|
|
412
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): HeaderFilter {
|
|
413
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
414
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
415
|
-
const message = createBaseHeaderFilter() as any;
|
|
416
|
-
while (reader.pos < end) {
|
|
417
|
-
const tag = reader.uint32();
|
|
418
|
-
switch (tag >>> 3) {
|
|
419
|
-
case 1:
|
|
420
|
-
if (tag !== 8) {
|
|
421
|
-
break;
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
message.always = reader.bool();
|
|
425
|
-
continue;
|
|
426
|
-
}
|
|
427
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
428
|
-
break;
|
|
429
|
-
}
|
|
430
|
-
reader.skipType(tag & 7);
|
|
431
|
-
}
|
|
432
|
-
return message;
|
|
433
|
-
},
|
|
434
|
-
|
|
435
|
-
fromJSON(object: any): HeaderFilter {
|
|
436
|
-
return { always: isSet(object.always) ? globalThis.Boolean(object.always) : undefined };
|
|
437
|
-
},
|
|
438
|
-
|
|
439
|
-
toJSON(message: HeaderFilter): unknown {
|
|
440
|
-
const obj: any = {};
|
|
441
|
-
if (message.always !== undefined) {
|
|
442
|
-
obj.always = message.always;
|
|
443
|
-
}
|
|
444
|
-
return obj;
|
|
445
|
-
},
|
|
446
|
-
|
|
447
|
-
create(base?: DeepPartial<HeaderFilter>): HeaderFilter {
|
|
448
|
-
return HeaderFilter.fromPartial(base ?? {});
|
|
449
|
-
},
|
|
450
|
-
fromPartial(object: DeepPartial<HeaderFilter>): HeaderFilter {
|
|
451
|
-
const message = createBaseHeaderFilter() as any;
|
|
452
|
-
message.always = object.always ?? undefined;
|
|
542
|
+
message.storageDiffs = object.storageDiffs?.map((e) => StorageDiffFilter.fromPartial(e)) || [];
|
|
543
|
+
message.contractChanges = object.contractChanges?.map((e) => ContractChangeFilter.fromPartial(e)) || [];
|
|
544
|
+
message.nonceUpdates = object.nonceUpdates?.map((e) => NonceUpdateFilter.fromPartial(e)) || [];
|
|
453
545
|
return message;
|
|
454
546
|
},
|
|
455
547
|
};
|
|
@@ -1725,6 +1817,433 @@ export const DeployAccountV3TransactionFilter = {
|
|
|
1725
1817
|
},
|
|
1726
1818
|
};
|
|
1727
1819
|
|
|
1820
|
+
function createBaseStorageDiffFilter(): StorageDiffFilter {
|
|
1821
|
+
return { id: 0, contractAddress: undefined };
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
export const StorageDiffFilter = {
|
|
1825
|
+
encode(message: StorageDiffFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
1826
|
+
if (message.id !== undefined && message.id !== 0) {
|
|
1827
|
+
writer.uint32(8).uint32(message.id);
|
|
1828
|
+
}
|
|
1829
|
+
if (message.contractAddress !== undefined) {
|
|
1830
|
+
FieldElement.encode(message.contractAddress, writer.uint32(18).fork()).ldelim();
|
|
1831
|
+
}
|
|
1832
|
+
return writer;
|
|
1833
|
+
},
|
|
1834
|
+
|
|
1835
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): StorageDiffFilter {
|
|
1836
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
1837
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1838
|
+
const message = createBaseStorageDiffFilter() as any;
|
|
1839
|
+
while (reader.pos < end) {
|
|
1840
|
+
const tag = reader.uint32();
|
|
1841
|
+
switch (tag >>> 3) {
|
|
1842
|
+
case 1:
|
|
1843
|
+
if (tag !== 8) {
|
|
1844
|
+
break;
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
message.id = reader.uint32();
|
|
1848
|
+
continue;
|
|
1849
|
+
case 2:
|
|
1850
|
+
if (tag !== 18) {
|
|
1851
|
+
break;
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
message.contractAddress = FieldElement.decode(reader, reader.uint32());
|
|
1855
|
+
continue;
|
|
1856
|
+
}
|
|
1857
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1858
|
+
break;
|
|
1859
|
+
}
|
|
1860
|
+
reader.skipType(tag & 7);
|
|
1861
|
+
}
|
|
1862
|
+
return message;
|
|
1863
|
+
},
|
|
1864
|
+
|
|
1865
|
+
fromJSON(object: any): StorageDiffFilter {
|
|
1866
|
+
return {
|
|
1867
|
+
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
|
1868
|
+
contractAddress: isSet(object.contractAddress) ? FieldElement.fromJSON(object.contractAddress) : undefined,
|
|
1869
|
+
};
|
|
1870
|
+
},
|
|
1871
|
+
|
|
1872
|
+
toJSON(message: StorageDiffFilter): unknown {
|
|
1873
|
+
const obj: any = {};
|
|
1874
|
+
if (message.id !== undefined && message.id !== 0) {
|
|
1875
|
+
obj.id = Math.round(message.id);
|
|
1876
|
+
}
|
|
1877
|
+
if (message.contractAddress !== undefined) {
|
|
1878
|
+
obj.contractAddress = FieldElement.toJSON(message.contractAddress);
|
|
1879
|
+
}
|
|
1880
|
+
return obj;
|
|
1881
|
+
},
|
|
1882
|
+
|
|
1883
|
+
create(base?: DeepPartial<StorageDiffFilter>): StorageDiffFilter {
|
|
1884
|
+
return StorageDiffFilter.fromPartial(base ?? {});
|
|
1885
|
+
},
|
|
1886
|
+
fromPartial(object: DeepPartial<StorageDiffFilter>): StorageDiffFilter {
|
|
1887
|
+
const message = createBaseStorageDiffFilter() as any;
|
|
1888
|
+
message.id = object.id ?? 0;
|
|
1889
|
+
message.contractAddress = (object.contractAddress !== undefined && object.contractAddress !== null)
|
|
1890
|
+
? FieldElement.fromPartial(object.contractAddress)
|
|
1891
|
+
: undefined;
|
|
1892
|
+
return message;
|
|
1893
|
+
},
|
|
1894
|
+
};
|
|
1895
|
+
|
|
1896
|
+
function createBaseContractChangeFilter(): ContractChangeFilter {
|
|
1897
|
+
return { id: 0, change: undefined };
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
export const ContractChangeFilter = {
|
|
1901
|
+
encode(message: ContractChangeFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
1902
|
+
if (message.id !== undefined && message.id !== 0) {
|
|
1903
|
+
writer.uint32(8).uint32(message.id);
|
|
1904
|
+
}
|
|
1905
|
+
switch (message.change?.$case) {
|
|
1906
|
+
case "declaredClass":
|
|
1907
|
+
DeclaredClassFilter.encode(message.change.declaredClass, writer.uint32(18).fork()).ldelim();
|
|
1908
|
+
break;
|
|
1909
|
+
case "replacedClass":
|
|
1910
|
+
ReplacedClassFilter.encode(message.change.replacedClass, writer.uint32(26).fork()).ldelim();
|
|
1911
|
+
break;
|
|
1912
|
+
case "deployedContract":
|
|
1913
|
+
DeployedContractFilter.encode(message.change.deployedContract, writer.uint32(34).fork()).ldelim();
|
|
1914
|
+
break;
|
|
1915
|
+
}
|
|
1916
|
+
return writer;
|
|
1917
|
+
},
|
|
1918
|
+
|
|
1919
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ContractChangeFilter {
|
|
1920
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
1921
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1922
|
+
const message = createBaseContractChangeFilter() as any;
|
|
1923
|
+
while (reader.pos < end) {
|
|
1924
|
+
const tag = reader.uint32();
|
|
1925
|
+
switch (tag >>> 3) {
|
|
1926
|
+
case 1:
|
|
1927
|
+
if (tag !== 8) {
|
|
1928
|
+
break;
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1931
|
+
message.id = reader.uint32();
|
|
1932
|
+
continue;
|
|
1933
|
+
case 2:
|
|
1934
|
+
if (tag !== 18) {
|
|
1935
|
+
break;
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
message.change = {
|
|
1939
|
+
$case: "declaredClass",
|
|
1940
|
+
declaredClass: DeclaredClassFilter.decode(reader, reader.uint32()),
|
|
1941
|
+
};
|
|
1942
|
+
continue;
|
|
1943
|
+
case 3:
|
|
1944
|
+
if (tag !== 26) {
|
|
1945
|
+
break;
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1948
|
+
message.change = {
|
|
1949
|
+
$case: "replacedClass",
|
|
1950
|
+
replacedClass: ReplacedClassFilter.decode(reader, reader.uint32()),
|
|
1951
|
+
};
|
|
1952
|
+
continue;
|
|
1953
|
+
case 4:
|
|
1954
|
+
if (tag !== 34) {
|
|
1955
|
+
break;
|
|
1956
|
+
}
|
|
1957
|
+
|
|
1958
|
+
message.change = {
|
|
1959
|
+
$case: "deployedContract",
|
|
1960
|
+
deployedContract: DeployedContractFilter.decode(reader, reader.uint32()),
|
|
1961
|
+
};
|
|
1962
|
+
continue;
|
|
1963
|
+
}
|
|
1964
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1965
|
+
break;
|
|
1966
|
+
}
|
|
1967
|
+
reader.skipType(tag & 7);
|
|
1968
|
+
}
|
|
1969
|
+
return message;
|
|
1970
|
+
},
|
|
1971
|
+
|
|
1972
|
+
fromJSON(object: any): ContractChangeFilter {
|
|
1973
|
+
return {
|
|
1974
|
+
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
|
1975
|
+
change: isSet(object.declaredClass)
|
|
1976
|
+
? { $case: "declaredClass", declaredClass: DeclaredClassFilter.fromJSON(object.declaredClass) }
|
|
1977
|
+
: isSet(object.replacedClass)
|
|
1978
|
+
? { $case: "replacedClass", replacedClass: ReplacedClassFilter.fromJSON(object.replacedClass) }
|
|
1979
|
+
: isSet(object.deployedContract)
|
|
1980
|
+
? { $case: "deployedContract", deployedContract: DeployedContractFilter.fromJSON(object.deployedContract) }
|
|
1981
|
+
: undefined,
|
|
1982
|
+
};
|
|
1983
|
+
},
|
|
1984
|
+
|
|
1985
|
+
toJSON(message: ContractChangeFilter): unknown {
|
|
1986
|
+
const obj: any = {};
|
|
1987
|
+
if (message.id !== undefined && message.id !== 0) {
|
|
1988
|
+
obj.id = Math.round(message.id);
|
|
1989
|
+
}
|
|
1990
|
+
if (message.change?.$case === "declaredClass") {
|
|
1991
|
+
obj.declaredClass = DeclaredClassFilter.toJSON(message.change.declaredClass);
|
|
1992
|
+
}
|
|
1993
|
+
if (message.change?.$case === "replacedClass") {
|
|
1994
|
+
obj.replacedClass = ReplacedClassFilter.toJSON(message.change.replacedClass);
|
|
1995
|
+
}
|
|
1996
|
+
if (message.change?.$case === "deployedContract") {
|
|
1997
|
+
obj.deployedContract = DeployedContractFilter.toJSON(message.change.deployedContract);
|
|
1998
|
+
}
|
|
1999
|
+
return obj;
|
|
2000
|
+
},
|
|
2001
|
+
|
|
2002
|
+
create(base?: DeepPartial<ContractChangeFilter>): ContractChangeFilter {
|
|
2003
|
+
return ContractChangeFilter.fromPartial(base ?? {});
|
|
2004
|
+
},
|
|
2005
|
+
fromPartial(object: DeepPartial<ContractChangeFilter>): ContractChangeFilter {
|
|
2006
|
+
const message = createBaseContractChangeFilter() as any;
|
|
2007
|
+
message.id = object.id ?? 0;
|
|
2008
|
+
if (
|
|
2009
|
+
object.change?.$case === "declaredClass" &&
|
|
2010
|
+
object.change?.declaredClass !== undefined &&
|
|
2011
|
+
object.change?.declaredClass !== null
|
|
2012
|
+
) {
|
|
2013
|
+
message.change = {
|
|
2014
|
+
$case: "declaredClass",
|
|
2015
|
+
declaredClass: DeclaredClassFilter.fromPartial(object.change.declaredClass),
|
|
2016
|
+
};
|
|
2017
|
+
}
|
|
2018
|
+
if (
|
|
2019
|
+
object.change?.$case === "replacedClass" &&
|
|
2020
|
+
object.change?.replacedClass !== undefined &&
|
|
2021
|
+
object.change?.replacedClass !== null
|
|
2022
|
+
) {
|
|
2023
|
+
message.change = {
|
|
2024
|
+
$case: "replacedClass",
|
|
2025
|
+
replacedClass: ReplacedClassFilter.fromPartial(object.change.replacedClass),
|
|
2026
|
+
};
|
|
2027
|
+
}
|
|
2028
|
+
if (
|
|
2029
|
+
object.change?.$case === "deployedContract" &&
|
|
2030
|
+
object.change?.deployedContract !== undefined &&
|
|
2031
|
+
object.change?.deployedContract !== null
|
|
2032
|
+
) {
|
|
2033
|
+
message.change = {
|
|
2034
|
+
$case: "deployedContract",
|
|
2035
|
+
deployedContract: DeployedContractFilter.fromPartial(object.change.deployedContract),
|
|
2036
|
+
};
|
|
2037
|
+
}
|
|
2038
|
+
return message;
|
|
2039
|
+
},
|
|
2040
|
+
};
|
|
2041
|
+
|
|
2042
|
+
function createBaseDeclaredClassFilter(): DeclaredClassFilter {
|
|
2043
|
+
return {};
|
|
2044
|
+
}
|
|
2045
|
+
|
|
2046
|
+
export const DeclaredClassFilter = {
|
|
2047
|
+
encode(_: DeclaredClassFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
2048
|
+
return writer;
|
|
2049
|
+
},
|
|
2050
|
+
|
|
2051
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): DeclaredClassFilter {
|
|
2052
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
2053
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
2054
|
+
const message = createBaseDeclaredClassFilter() as any;
|
|
2055
|
+
while (reader.pos < end) {
|
|
2056
|
+
const tag = reader.uint32();
|
|
2057
|
+
switch (tag >>> 3) {
|
|
2058
|
+
}
|
|
2059
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2060
|
+
break;
|
|
2061
|
+
}
|
|
2062
|
+
reader.skipType(tag & 7);
|
|
2063
|
+
}
|
|
2064
|
+
return message;
|
|
2065
|
+
},
|
|
2066
|
+
|
|
2067
|
+
fromJSON(_: any): DeclaredClassFilter {
|
|
2068
|
+
return {};
|
|
2069
|
+
},
|
|
2070
|
+
|
|
2071
|
+
toJSON(_: DeclaredClassFilter): unknown {
|
|
2072
|
+
const obj: any = {};
|
|
2073
|
+
return obj;
|
|
2074
|
+
},
|
|
2075
|
+
|
|
2076
|
+
create(base?: DeepPartial<DeclaredClassFilter>): DeclaredClassFilter {
|
|
2077
|
+
return DeclaredClassFilter.fromPartial(base ?? {});
|
|
2078
|
+
},
|
|
2079
|
+
fromPartial(_: DeepPartial<DeclaredClassFilter>): DeclaredClassFilter {
|
|
2080
|
+
const message = createBaseDeclaredClassFilter() as any;
|
|
2081
|
+
return message;
|
|
2082
|
+
},
|
|
2083
|
+
};
|
|
2084
|
+
|
|
2085
|
+
function createBaseReplacedClassFilter(): ReplacedClassFilter {
|
|
2086
|
+
return {};
|
|
2087
|
+
}
|
|
2088
|
+
|
|
2089
|
+
export const ReplacedClassFilter = {
|
|
2090
|
+
encode(_: ReplacedClassFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
2091
|
+
return writer;
|
|
2092
|
+
},
|
|
2093
|
+
|
|
2094
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): ReplacedClassFilter {
|
|
2095
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
2096
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
2097
|
+
const message = createBaseReplacedClassFilter() as any;
|
|
2098
|
+
while (reader.pos < end) {
|
|
2099
|
+
const tag = reader.uint32();
|
|
2100
|
+
switch (tag >>> 3) {
|
|
2101
|
+
}
|
|
2102
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2103
|
+
break;
|
|
2104
|
+
}
|
|
2105
|
+
reader.skipType(tag & 7);
|
|
2106
|
+
}
|
|
2107
|
+
return message;
|
|
2108
|
+
},
|
|
2109
|
+
|
|
2110
|
+
fromJSON(_: any): ReplacedClassFilter {
|
|
2111
|
+
return {};
|
|
2112
|
+
},
|
|
2113
|
+
|
|
2114
|
+
toJSON(_: ReplacedClassFilter): unknown {
|
|
2115
|
+
const obj: any = {};
|
|
2116
|
+
return obj;
|
|
2117
|
+
},
|
|
2118
|
+
|
|
2119
|
+
create(base?: DeepPartial<ReplacedClassFilter>): ReplacedClassFilter {
|
|
2120
|
+
return ReplacedClassFilter.fromPartial(base ?? {});
|
|
2121
|
+
},
|
|
2122
|
+
fromPartial(_: DeepPartial<ReplacedClassFilter>): ReplacedClassFilter {
|
|
2123
|
+
const message = createBaseReplacedClassFilter() as any;
|
|
2124
|
+
return message;
|
|
2125
|
+
},
|
|
2126
|
+
};
|
|
2127
|
+
|
|
2128
|
+
function createBaseDeployedContractFilter(): DeployedContractFilter {
|
|
2129
|
+
return {};
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
export const DeployedContractFilter = {
|
|
2133
|
+
encode(_: DeployedContractFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
2134
|
+
return writer;
|
|
2135
|
+
},
|
|
2136
|
+
|
|
2137
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): DeployedContractFilter {
|
|
2138
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
2139
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
2140
|
+
const message = createBaseDeployedContractFilter() as any;
|
|
2141
|
+
while (reader.pos < end) {
|
|
2142
|
+
const tag = reader.uint32();
|
|
2143
|
+
switch (tag >>> 3) {
|
|
2144
|
+
}
|
|
2145
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2146
|
+
break;
|
|
2147
|
+
}
|
|
2148
|
+
reader.skipType(tag & 7);
|
|
2149
|
+
}
|
|
2150
|
+
return message;
|
|
2151
|
+
},
|
|
2152
|
+
|
|
2153
|
+
fromJSON(_: any): DeployedContractFilter {
|
|
2154
|
+
return {};
|
|
2155
|
+
},
|
|
2156
|
+
|
|
2157
|
+
toJSON(_: DeployedContractFilter): unknown {
|
|
2158
|
+
const obj: any = {};
|
|
2159
|
+
return obj;
|
|
2160
|
+
},
|
|
2161
|
+
|
|
2162
|
+
create(base?: DeepPartial<DeployedContractFilter>): DeployedContractFilter {
|
|
2163
|
+
return DeployedContractFilter.fromPartial(base ?? {});
|
|
2164
|
+
},
|
|
2165
|
+
fromPartial(_: DeepPartial<DeployedContractFilter>): DeployedContractFilter {
|
|
2166
|
+
const message = createBaseDeployedContractFilter() as any;
|
|
2167
|
+
return message;
|
|
2168
|
+
},
|
|
2169
|
+
};
|
|
2170
|
+
|
|
2171
|
+
function createBaseNonceUpdateFilter(): NonceUpdateFilter {
|
|
2172
|
+
return { id: 0, contractAddress: undefined };
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
export const NonceUpdateFilter = {
|
|
2176
|
+
encode(message: NonceUpdateFilter, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
2177
|
+
if (message.id !== undefined && message.id !== 0) {
|
|
2178
|
+
writer.uint32(8).uint32(message.id);
|
|
2179
|
+
}
|
|
2180
|
+
if (message.contractAddress !== undefined) {
|
|
2181
|
+
FieldElement.encode(message.contractAddress, writer.uint32(18).fork()).ldelim();
|
|
2182
|
+
}
|
|
2183
|
+
return writer;
|
|
2184
|
+
},
|
|
2185
|
+
|
|
2186
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): NonceUpdateFilter {
|
|
2187
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
2188
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
2189
|
+
const message = createBaseNonceUpdateFilter() as any;
|
|
2190
|
+
while (reader.pos < end) {
|
|
2191
|
+
const tag = reader.uint32();
|
|
2192
|
+
switch (tag >>> 3) {
|
|
2193
|
+
case 1:
|
|
2194
|
+
if (tag !== 8) {
|
|
2195
|
+
break;
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2198
|
+
message.id = reader.uint32();
|
|
2199
|
+
continue;
|
|
2200
|
+
case 2:
|
|
2201
|
+
if (tag !== 18) {
|
|
2202
|
+
break;
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2205
|
+
message.contractAddress = FieldElement.decode(reader, reader.uint32());
|
|
2206
|
+
continue;
|
|
2207
|
+
}
|
|
2208
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2209
|
+
break;
|
|
2210
|
+
}
|
|
2211
|
+
reader.skipType(tag & 7);
|
|
2212
|
+
}
|
|
2213
|
+
return message;
|
|
2214
|
+
},
|
|
2215
|
+
|
|
2216
|
+
fromJSON(object: any): NonceUpdateFilter {
|
|
2217
|
+
return {
|
|
2218
|
+
id: isSet(object.id) ? globalThis.Number(object.id) : 0,
|
|
2219
|
+
contractAddress: isSet(object.contractAddress) ? FieldElement.fromJSON(object.contractAddress) : undefined,
|
|
2220
|
+
};
|
|
2221
|
+
},
|
|
2222
|
+
|
|
2223
|
+
toJSON(message: NonceUpdateFilter): unknown {
|
|
2224
|
+
const obj: any = {};
|
|
2225
|
+
if (message.id !== undefined && message.id !== 0) {
|
|
2226
|
+
obj.id = Math.round(message.id);
|
|
2227
|
+
}
|
|
2228
|
+
if (message.contractAddress !== undefined) {
|
|
2229
|
+
obj.contractAddress = FieldElement.toJSON(message.contractAddress);
|
|
2230
|
+
}
|
|
2231
|
+
return obj;
|
|
2232
|
+
},
|
|
2233
|
+
|
|
2234
|
+
create(base?: DeepPartial<NonceUpdateFilter>): NonceUpdateFilter {
|
|
2235
|
+
return NonceUpdateFilter.fromPartial(base ?? {});
|
|
2236
|
+
},
|
|
2237
|
+
fromPartial(object: DeepPartial<NonceUpdateFilter>): NonceUpdateFilter {
|
|
2238
|
+
const message = createBaseNonceUpdateFilter() as any;
|
|
2239
|
+
message.id = object.id ?? 0;
|
|
2240
|
+
message.contractAddress = (object.contractAddress !== undefined && object.contractAddress !== null)
|
|
2241
|
+
? FieldElement.fromPartial(object.contractAddress)
|
|
2242
|
+
: undefined;
|
|
2243
|
+
return message;
|
|
2244
|
+
},
|
|
2245
|
+
};
|
|
2246
|
+
|
|
1728
2247
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
1729
2248
|
|
|
1730
2249
|
export type DeepPartial<T> = T extends Builtin ? T
|