@aztec/stdlib 0.82.2 → 0.82.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/dest/avm/avm.d.ts +919 -1252
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +138 -111
- package/dest/avm/avm_proving_request.d.ts +400 -575
- package/dest/avm/avm_proving_request.d.ts.map +1 -1
- package/dest/block/l2_block_downloader/l2_block_stream.d.ts +1 -0
- package/dest/block/l2_block_downloader/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_downloader/l2_block_stream.js +6 -0
- package/dest/database-version/version_manager.d.ts +4 -2
- package/dest/database-version/version_manager.d.ts.map +1 -1
- package/dest/database-version/version_manager.js +13 -9
- package/dest/epoch-helpers/index.d.ts +2 -0
- package/dest/epoch-helpers/index.d.ts.map +1 -1
- package/dest/epoch-helpers/index.js +3 -0
- package/dest/file-store/factory.d.ts +7 -0
- package/dest/file-store/factory.d.ts.map +1 -0
- package/dest/file-store/factory.js +46 -0
- package/dest/file-store/gcs.d.ts +22 -0
- package/dest/file-store/gcs.d.ts.map +1 -0
- package/dest/file-store/gcs.js +115 -0
- package/dest/file-store/http.d.ts +15 -0
- package/dest/file-store/http.d.ts.map +1 -0
- package/dest/file-store/http.js +53 -0
- package/dest/file-store/index.d.ts +3 -0
- package/dest/file-store/index.d.ts.map +1 -0
- package/dest/file-store/index.js +2 -0
- package/dest/file-store/interface.d.ts +24 -0
- package/dest/file-store/interface.d.ts.map +1 -0
- package/dest/file-store/interface.js +1 -0
- package/dest/file-store/local.d.ts +16 -0
- package/dest/file-store/local.d.ts.map +1 -0
- package/dest/file-store/local.js +40 -0
- package/dest/interfaces/aztec-node-admin.d.ts +9 -1
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +2 -1
- package/dest/interfaces/aztec-node.d.ts +3 -0
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +2 -0
- package/dest/interfaces/p2p.d.ts +2 -0
- package/dest/interfaces/p2p.d.ts.map +1 -1
- package/dest/interfaces/p2p.js +2 -1
- package/dest/interfaces/prover-node.d.ts +4 -0
- package/dest/interfaces/prover-node.d.ts.map +1 -1
- package/dest/interfaces/prover-node.js +5 -1
- package/dest/interfaces/proving-job.d.ts +400 -575
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/service.d.ts +3 -0
- package/dest/interfaces/service.d.ts.map +1 -1
- package/dest/interfaces/service.js +7 -0
- package/dest/interfaces/world_state.d.ts +13 -15
- package/dest/interfaces/world_state.d.ts.map +1 -1
- package/dest/snapshots/download.d.ts +9 -0
- package/dest/snapshots/download.d.ts.map +1 -0
- package/dest/snapshots/download.js +37 -0
- package/dest/snapshots/index.d.ts +4 -0
- package/dest/snapshots/index.d.ts.map +1 -0
- package/dest/snapshots/index.js +3 -0
- package/dest/snapshots/types.d.ts +97 -0
- package/dest/snapshots/types.d.ts.map +1 -0
- package/dest/snapshots/types.js +27 -0
- package/dest/snapshots/upload.d.ts +5 -0
- package/dest/snapshots/upload.d.ts.map +1 -0
- package/dest/snapshots/upload.js +37 -0
- package/dest/tests/factories.d.ts +13 -7
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +37 -25
- package/dest/trees/merkle_tree_id.d.ts +8 -0
- package/dest/trees/merkle_tree_id.d.ts.map +1 -1
- package/dest/trees/merkle_tree_id.js +10 -0
- package/dest/trees/nullifier_leaf.d.ts +11 -2
- package/dest/trees/nullifier_leaf.d.ts.map +1 -1
- package/dest/trees/nullifier_leaf.js +12 -7
- package/dest/trees/nullifier_membership_witness.d.ts +7 -7
- package/dest/trees/public_data_leaf.d.ts +13 -0
- package/dest/trees/public_data_leaf.d.ts.map +1 -1
- package/dest/trees/public_data_leaf.js +6 -0
- package/dest/trees/public_data_witness.d.ts +7 -7
- package/dest/validators/index.d.ts +3 -0
- package/dest/validators/index.d.ts.map +1 -0
- package/dest/validators/index.js +1 -0
- package/dest/validators/schemas.d.ts +342 -0
- package/dest/validators/schemas.d.ts.map +1 -0
- package/dest/validators/schemas.js +40 -0
- package/dest/validators/types.d.ts +39 -0
- package/dest/validators/types.d.ts.map +1 -0
- package/dest/validators/types.js +1 -0
- package/package.json +11 -7
- package/src/avm/avm.ts +131 -106
- package/src/block/l2_block_downloader/l2_block_stream.ts +6 -0
- package/src/database-version/version_manager.ts +12 -8
- package/src/epoch-helpers/index.ts +8 -0
- package/src/file-store/factory.ts +61 -0
- package/src/file-store/gcs.ts +121 -0
- package/src/file-store/http.ts +58 -0
- package/src/file-store/index.ts +2 -0
- package/src/file-store/interface.ts +19 -0
- package/src/file-store/local.ts +46 -0
- package/src/interfaces/aztec-node-admin.ts +11 -1
- package/src/interfaces/aztec-node.ts +7 -0
- package/src/interfaces/p2p.ts +4 -0
- package/src/interfaces/prover-node.ts +10 -0
- package/src/interfaces/service.ts +13 -0
- package/src/interfaces/world_state.ts +17 -15
- package/src/snapshots/download.ts +60 -0
- package/src/snapshots/index.ts +3 -0
- package/src/snapshots/types.ts +58 -0
- package/src/snapshots/upload.ts +53 -0
- package/src/tests/factories.ts +74 -54
- package/src/trees/merkle_tree_id.ts +12 -0
- package/src/trees/nullifier_leaf.ts +9 -5
- package/src/trees/public_data_leaf.ts +9 -0
- package/src/validators/index.ts +3 -0
- package/src/validators/schemas.ts +53 -0
- package/src/validators/types.ts +37 -0
|
@@ -23,3 +23,13 @@ const TREE_HEIGHTS = {
|
|
|
23
23
|
export function getTreeHeight(treeId) {
|
|
24
24
|
return TREE_HEIGHTS[treeId];
|
|
25
25
|
}
|
|
26
|
+
const TREE_NAMES = {
|
|
27
|
+
[MerkleTreeId.NULLIFIER_TREE]: 'NULLIFIER_TREE',
|
|
28
|
+
[MerkleTreeId.NOTE_HASH_TREE]: 'NOTE_HASH_TREE',
|
|
29
|
+
[MerkleTreeId.PUBLIC_DATA_TREE]: 'PUBLIC_DATA_TREE',
|
|
30
|
+
[MerkleTreeId.L1_TO_L2_MESSAGE_TREE]: 'L1_TO_L2_MESSAGE_TREE',
|
|
31
|
+
[MerkleTreeId.ARCHIVE]: 'ARCHIVE'
|
|
32
|
+
};
|
|
33
|
+
export function getTreeName(treeId) {
|
|
34
|
+
return TREE_NAMES[treeId];
|
|
35
|
+
}
|
|
@@ -72,17 +72,26 @@ export declare class NullifierLeaf implements IndexedTreeLeaf {
|
|
|
72
72
|
/**
|
|
73
73
|
* Nullifier value.
|
|
74
74
|
*/
|
|
75
|
-
|
|
75
|
+
value: Fr;
|
|
76
76
|
constructor(
|
|
77
77
|
/**
|
|
78
78
|
* Nullifier value.
|
|
79
79
|
*/
|
|
80
|
-
|
|
80
|
+
value: Fr);
|
|
81
81
|
getKey(): bigint;
|
|
82
82
|
toBuffer(): Buffer;
|
|
83
83
|
isEmpty(): boolean;
|
|
84
84
|
updateTo(_another: NullifierLeaf): NullifierLeaf;
|
|
85
85
|
static buildDummy(key: bigint): NullifierLeaf;
|
|
86
86
|
static fromBuffer(buf: Buffer): NullifierLeaf;
|
|
87
|
+
static get schema(): z.ZodEffects<z.ZodObject<{
|
|
88
|
+
value: z.ZodType<Fr, any, string>;
|
|
89
|
+
}, "strip", z.ZodTypeAny, {
|
|
90
|
+
value: Fr;
|
|
91
|
+
}, {
|
|
92
|
+
value: string;
|
|
93
|
+
}>, NullifierLeaf, {
|
|
94
|
+
value: string;
|
|
95
|
+
}>;
|
|
87
96
|
}
|
|
88
97
|
//# sourceMappingURL=nullifier_leaf.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nullifier_leaf.d.ts","sourceRoot":"","sources":["../../src/trees/nullifier_leaf.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,y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AG,aAAa;IAI7C,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa;IAI7C,MAAM,KAAK,MAAM;;;;;;;;OAEhB;CACF"}
|
|
@@ -67,7 +67,7 @@ import { z } from 'zod';
|
|
|
67
67
|
return new NullifierLeafPreimage(reader.readObject(Fr), reader.readObject(Fr), toBigIntBE(reader.readBytes(32)));
|
|
68
68
|
}
|
|
69
69
|
static fromLeaf(leaf, nextKey, nextIndex) {
|
|
70
|
-
return new NullifierLeafPreimage(leaf.
|
|
70
|
+
return new NullifierLeafPreimage(leaf.value, new Fr(nextKey), nextIndex);
|
|
71
71
|
}
|
|
72
72
|
static clone(preimage) {
|
|
73
73
|
return new NullifierLeafPreimage(preimage.nullifier, preimage.nextNullifier, preimage.nextIndex);
|
|
@@ -76,20 +76,20 @@ import { z } from 'zod';
|
|
|
76
76
|
/**
|
|
77
77
|
* A nullifier to be inserted in the nullifier tree.
|
|
78
78
|
*/ export class NullifierLeaf {
|
|
79
|
-
|
|
79
|
+
value;
|
|
80
80
|
constructor(/**
|
|
81
81
|
* Nullifier value.
|
|
82
|
-
*/
|
|
83
|
-
this.
|
|
82
|
+
*/ value){
|
|
83
|
+
this.value = value;
|
|
84
84
|
}
|
|
85
85
|
getKey() {
|
|
86
|
-
return this.
|
|
86
|
+
return this.value.toBigInt();
|
|
87
87
|
}
|
|
88
88
|
toBuffer() {
|
|
89
|
-
return this.
|
|
89
|
+
return this.value.toBuffer();
|
|
90
90
|
}
|
|
91
91
|
isEmpty() {
|
|
92
|
-
return this.
|
|
92
|
+
return this.value.isZero();
|
|
93
93
|
}
|
|
94
94
|
updateTo(_another) {
|
|
95
95
|
throw new Error('Nullifiers are create only');
|
|
@@ -100,4 +100,9 @@ import { z } from 'zod';
|
|
|
100
100
|
static fromBuffer(buf) {
|
|
101
101
|
return new NullifierLeaf(Fr.fromBuffer(buf));
|
|
102
102
|
}
|
|
103
|
+
static get schema() {
|
|
104
|
+
return z.object({
|
|
105
|
+
value: schemas.Fr
|
|
106
|
+
}).transform(({ value })=>new NullifierLeaf(value));
|
|
107
|
+
}
|
|
103
108
|
}
|
|
@@ -77,30 +77,30 @@ export declare class NullifierMembershipWitness {
|
|
|
77
77
|
}>;
|
|
78
78
|
}, "strip", z.ZodTypeAny, {
|
|
79
79
|
index: bigint;
|
|
80
|
-
siblingPath: SiblingPath<40>;
|
|
81
80
|
leafPreimage: NullifierLeafPreimage;
|
|
81
|
+
siblingPath: SiblingPath<40>;
|
|
82
82
|
}, {
|
|
83
83
|
index: string | number | bigint;
|
|
84
|
-
siblingPath: string | {
|
|
85
|
-
type: "Buffer";
|
|
86
|
-
data: number[];
|
|
87
|
-
};
|
|
88
84
|
leafPreimage: {
|
|
89
85
|
nullifier: string;
|
|
90
86
|
nextNullifier: string;
|
|
91
87
|
nextIndex: string | number | bigint;
|
|
92
88
|
};
|
|
93
|
-
}>, NullifierMembershipWitness, {
|
|
94
|
-
index: string | number | bigint;
|
|
95
89
|
siblingPath: string | {
|
|
96
90
|
type: "Buffer";
|
|
97
91
|
data: number[];
|
|
98
92
|
};
|
|
93
|
+
}>, NullifierMembershipWitness, {
|
|
94
|
+
index: string | number | bigint;
|
|
99
95
|
leafPreimage: {
|
|
100
96
|
nullifier: string;
|
|
101
97
|
nextNullifier: string;
|
|
102
98
|
nextIndex: string | number | bigint;
|
|
103
99
|
};
|
|
100
|
+
siblingPath: string | {
|
|
101
|
+
type: "Buffer";
|
|
102
|
+
data: number[];
|
|
103
|
+
};
|
|
104
104
|
}>;
|
|
105
105
|
static random(): NullifierMembershipWitness;
|
|
106
106
|
/**
|
|
@@ -106,5 +106,18 @@ export declare class PublicDataTreeLeaf implements IndexedTreeLeaf {
|
|
|
106
106
|
updateTo(another: PublicDataTreeLeaf): PublicDataTreeLeaf;
|
|
107
107
|
static buildDummy(key: bigint): PublicDataTreeLeaf;
|
|
108
108
|
static empty(): PublicDataTreeLeaf;
|
|
109
|
+
static get schema(): z.ZodEffects<z.ZodObject<{
|
|
110
|
+
slot: z.ZodType<Fr, any, string>;
|
|
111
|
+
value: z.ZodType<Fr, any, string>;
|
|
112
|
+
}, "strip", z.ZodTypeAny, {
|
|
113
|
+
value: Fr;
|
|
114
|
+
slot: Fr;
|
|
115
|
+
}, {
|
|
116
|
+
value: string;
|
|
117
|
+
slot: string;
|
|
118
|
+
}>, PublicDataTreeLeaf, {
|
|
119
|
+
value: string;
|
|
120
|
+
slot: string;
|
|
121
|
+
}>;
|
|
109
122
|
}
|
|
110
123
|
//# sourceMappingURL=public_data_leaf.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public_data_leaf.d.ts","sourceRoot":"","sources":["../../src/trees/public_data_leaf.ts"],"names":[],"mappings":";;AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAExF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,qBAAa,0BAA2B,YAAW,uBAAuB;IAEtE;;OAEG;IACI,IAAI,EAAE,EAAE;IACf;;OAEG;IACI,KAAK,EAAE,EAAE;IAChB;;OAEG;IACI,QAAQ,EAAE,EAAE;IACnB;;OAEG;IACI,SAAS,EAAE,MAAM;;IAfxB;;OAEG;IACI,IAAI,EAAE,EAAE;IACf;;OAEG;IACI,KAAK,EAAE,EAAE;IAChB;;OAEG;IACI,QAAQ,EAAE,EAAE;IACnB;;OAEG;IACI,SAAS,EAAE,MAAM;IAG1B,MAAM,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;OAWhB;IAED,MAAM,IAAI,MAAM;IAIhB,UAAU,IAAI,MAAM;IAIpB,YAAY,IAAI,MAAM;IAItB,MAAM,IAAI,kBAAkB;IAI5B,QAAQ,IAAI,MAAM;IAIlB,YAAY,IAAI,M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BAAkB,GAAG,OAAO;IAI5C,QAAQ,IAAI,MAAM;IAIlB,OAAO,IAAI,OAAO;IAIlB,QAAQ,CAAC,OAAO,EAAE,kBAAkB,GAAG,kBAAkB;IAOzD,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB;IAIlD,MAAM,CAAC,KAAK,IAAI,kBAAkB;IAIlC,MAAM,KAAK,MAAM;;;;;;;;;;;;OAOhB;CACF"}
|
|
@@ -127,4 +127,10 @@ import { z } from 'zod';
|
|
|
127
127
|
static empty() {
|
|
128
128
|
return new PublicDataTreeLeaf(Fr.ZERO, Fr.ZERO);
|
|
129
129
|
}
|
|
130
|
+
static get schema() {
|
|
131
|
+
return z.object({
|
|
132
|
+
slot: schemas.Fr,
|
|
133
|
+
value: schemas.Fr
|
|
134
|
+
}).transform(({ slot, value })=>new PublicDataTreeLeaf(slot, value));
|
|
135
|
+
}
|
|
130
136
|
}
|
|
@@ -84,32 +84,32 @@ export declare class PublicDataWitness {
|
|
|
84
84
|
}>;
|
|
85
85
|
}, "strip", z.ZodTypeAny, {
|
|
86
86
|
index: bigint;
|
|
87
|
-
siblingPath: SiblingPath<40>;
|
|
88
87
|
leafPreimage: PublicDataTreeLeafPreimage;
|
|
88
|
+
siblingPath: SiblingPath<40>;
|
|
89
89
|
}, {
|
|
90
90
|
index: string | number | bigint;
|
|
91
|
-
siblingPath: string | {
|
|
92
|
-
type: "Buffer";
|
|
93
|
-
data: number[];
|
|
94
|
-
};
|
|
95
91
|
leafPreimage: {
|
|
96
92
|
value: string;
|
|
97
93
|
slot: string;
|
|
98
94
|
nextIndex: string | number | bigint;
|
|
99
95
|
nextSlot: string;
|
|
100
96
|
};
|
|
101
|
-
}>, PublicDataWitness, {
|
|
102
|
-
index: string | number | bigint;
|
|
103
97
|
siblingPath: string | {
|
|
104
98
|
type: "Buffer";
|
|
105
99
|
data: number[];
|
|
106
100
|
};
|
|
101
|
+
}>, PublicDataWitness, {
|
|
102
|
+
index: string | number | bigint;
|
|
107
103
|
leafPreimage: {
|
|
108
104
|
value: string;
|
|
109
105
|
slot: string;
|
|
110
106
|
nextIndex: string | number | bigint;
|
|
111
107
|
nextSlot: string;
|
|
112
108
|
};
|
|
109
|
+
siblingPath: string | {
|
|
110
|
+
type: "Buffer";
|
|
111
|
+
data: number[];
|
|
112
|
+
};
|
|
113
113
|
}>;
|
|
114
114
|
/**
|
|
115
115
|
* Returns a field array representation of a public data witness.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validators/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,YAAY,CAAC;AAEhC,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './schemas.js';
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const ValidatorStatusInSlotSchema: z.ZodEnum<["block-mined", "block-proposed", "block-missed", "attestation-sent", "attestation-missed"]>;
|
|
3
|
+
export declare const ValidatorStatusHistorySchema: z.ZodArray<z.ZodObject<{
|
|
4
|
+
slot: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
5
|
+
status: z.ZodEnum<["block-mined", "block-proposed", "block-missed", "attestation-sent", "attestation-missed"]>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
status: "block-mined" | "block-proposed" | "block-missed" | "attestation-sent" | "attestation-missed";
|
|
8
|
+
slot: bigint;
|
|
9
|
+
}, {
|
|
10
|
+
status: "block-mined" | "block-proposed" | "block-missed" | "attestation-sent" | "attestation-missed";
|
|
11
|
+
slot: string | number | bigint;
|
|
12
|
+
}>, "many">;
|
|
13
|
+
export declare const ValidatorStatusHistorySchemaArray: z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
14
|
+
slot: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
15
|
+
status: z.ZodEnum<["block-mined", "block-proposed", "block-missed", "attestation-sent", "attestation-missed"]>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
status: "block-mined" | "block-proposed" | "block-missed" | "attestation-sent" | "attestation-missed";
|
|
18
|
+
slot: bigint;
|
|
19
|
+
}, {
|
|
20
|
+
status: "block-mined" | "block-proposed" | "block-missed" | "attestation-sent" | "attestation-missed";
|
|
21
|
+
slot: string | number | bigint;
|
|
22
|
+
}>, "many">, "many">;
|
|
23
|
+
export declare const ValidatorStatusHistorySchemaMap: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodArray<z.ZodObject<{
|
|
24
|
+
slot: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
25
|
+
status: z.ZodEnum<["block-mined", "block-proposed", "block-missed", "attestation-sent", "attestation-missed"]>;
|
|
26
|
+
}, "strip", z.ZodTypeAny, {
|
|
27
|
+
status: "block-mined" | "block-proposed" | "block-missed" | "attestation-sent" | "attestation-missed";
|
|
28
|
+
slot: bigint;
|
|
29
|
+
}, {
|
|
30
|
+
status: "block-mined" | "block-proposed" | "block-missed" | "attestation-sent" | "attestation-missed";
|
|
31
|
+
slot: string | number | bigint;
|
|
32
|
+
}>, "many">, "many">>;
|
|
33
|
+
export declare const ValidatorStatsSchema: z.ZodObject<{
|
|
34
|
+
address: z.ZodType<import("@aztec/foundation/schemas").EthAddress, any, string>;
|
|
35
|
+
lastProposal: z.ZodOptional<z.ZodObject<{
|
|
36
|
+
timestamp: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
37
|
+
slot: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
38
|
+
date: z.ZodString;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
date: string;
|
|
41
|
+
slot: bigint;
|
|
42
|
+
timestamp: bigint;
|
|
43
|
+
}, {
|
|
44
|
+
date: string;
|
|
45
|
+
slot: string | number | bigint;
|
|
46
|
+
timestamp: string | number | bigint;
|
|
47
|
+
}>>;
|
|
48
|
+
lastAttestation: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
timestamp: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
50
|
+
slot: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
51
|
+
date: z.ZodString;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
date: string;
|
|
54
|
+
slot: bigint;
|
|
55
|
+
timestamp: bigint;
|
|
56
|
+
}, {
|
|
57
|
+
date: string;
|
|
58
|
+
slot: string | number | bigint;
|
|
59
|
+
timestamp: string | number | bigint;
|
|
60
|
+
}>>;
|
|
61
|
+
totalSlots: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
62
|
+
missedProposals: z.ZodObject<{
|
|
63
|
+
currentStreak: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
64
|
+
rate: z.ZodNumber;
|
|
65
|
+
count: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
|
+
currentStreak: number;
|
|
68
|
+
rate: number;
|
|
69
|
+
count: number;
|
|
70
|
+
}, {
|
|
71
|
+
currentStreak: string | number | bigint;
|
|
72
|
+
rate: number;
|
|
73
|
+
count: string | number | bigint;
|
|
74
|
+
}>;
|
|
75
|
+
missedAttestations: z.ZodObject<{
|
|
76
|
+
currentStreak: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
77
|
+
rate: z.ZodNumber;
|
|
78
|
+
count: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
79
|
+
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
currentStreak: number;
|
|
81
|
+
rate: number;
|
|
82
|
+
count: number;
|
|
83
|
+
}, {
|
|
84
|
+
currentStreak: string | number | bigint;
|
|
85
|
+
rate: number;
|
|
86
|
+
count: string | number | bigint;
|
|
87
|
+
}>;
|
|
88
|
+
history: z.ZodArray<z.ZodObject<{
|
|
89
|
+
slot: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
90
|
+
status: z.ZodEnum<["block-mined", "block-proposed", "block-missed", "attestation-sent", "attestation-missed"]>;
|
|
91
|
+
}, "strip", z.ZodTypeAny, {
|
|
92
|
+
status: "block-mined" | "block-proposed" | "block-missed" | "attestation-sent" | "attestation-missed";
|
|
93
|
+
slot: bigint;
|
|
94
|
+
}, {
|
|
95
|
+
status: "block-mined" | "block-proposed" | "block-missed" | "attestation-sent" | "attestation-missed";
|
|
96
|
+
slot: string | number | bigint;
|
|
97
|
+
}>, "many">;
|
|
98
|
+
}, "strip", z.ZodTypeAny, {
|
|
99
|
+
address: import("@aztec/foundation/schemas").EthAddress;
|
|
100
|
+
totalSlots: number;
|
|
101
|
+
missedProposals: {
|
|
102
|
+
currentStreak: number;
|
|
103
|
+
rate: number;
|
|
104
|
+
count: number;
|
|
105
|
+
};
|
|
106
|
+
missedAttestations: {
|
|
107
|
+
currentStreak: number;
|
|
108
|
+
rate: number;
|
|
109
|
+
count: number;
|
|
110
|
+
};
|
|
111
|
+
history: {
|
|
112
|
+
status: "block-mined" | "block-proposed" | "block-missed" | "attestation-sent" | "attestation-missed";
|
|
113
|
+
slot: bigint;
|
|
114
|
+
}[];
|
|
115
|
+
lastProposal?: {
|
|
116
|
+
date: string;
|
|
117
|
+
slot: bigint;
|
|
118
|
+
timestamp: bigint;
|
|
119
|
+
} | undefined;
|
|
120
|
+
lastAttestation?: {
|
|
121
|
+
date: string;
|
|
122
|
+
slot: bigint;
|
|
123
|
+
timestamp: bigint;
|
|
124
|
+
} | undefined;
|
|
125
|
+
}, {
|
|
126
|
+
address: string;
|
|
127
|
+
totalSlots: string | number | bigint;
|
|
128
|
+
missedProposals: {
|
|
129
|
+
currentStreak: string | number | bigint;
|
|
130
|
+
rate: number;
|
|
131
|
+
count: string | number | bigint;
|
|
132
|
+
};
|
|
133
|
+
missedAttestations: {
|
|
134
|
+
currentStreak: string | number | bigint;
|
|
135
|
+
rate: number;
|
|
136
|
+
count: string | number | bigint;
|
|
137
|
+
};
|
|
138
|
+
history: {
|
|
139
|
+
status: "block-mined" | "block-proposed" | "block-missed" | "attestation-sent" | "attestation-missed";
|
|
140
|
+
slot: string | number | bigint;
|
|
141
|
+
}[];
|
|
142
|
+
lastProposal?: {
|
|
143
|
+
date: string;
|
|
144
|
+
slot: string | number | bigint;
|
|
145
|
+
timestamp: string | number | bigint;
|
|
146
|
+
} | undefined;
|
|
147
|
+
lastAttestation?: {
|
|
148
|
+
date: string;
|
|
149
|
+
slot: string | number | bigint;
|
|
150
|
+
timestamp: string | number | bigint;
|
|
151
|
+
} | undefined;
|
|
152
|
+
}>;
|
|
153
|
+
export declare const ValidatorsStatsSchema: z.ZodObject<{
|
|
154
|
+
stats: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
155
|
+
address: z.ZodType<import("@aztec/foundation/schemas").EthAddress, any, string>;
|
|
156
|
+
lastProposal: z.ZodOptional<z.ZodObject<{
|
|
157
|
+
timestamp: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
158
|
+
slot: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
159
|
+
date: z.ZodString;
|
|
160
|
+
}, "strip", z.ZodTypeAny, {
|
|
161
|
+
date: string;
|
|
162
|
+
slot: bigint;
|
|
163
|
+
timestamp: bigint;
|
|
164
|
+
}, {
|
|
165
|
+
date: string;
|
|
166
|
+
slot: string | number | bigint;
|
|
167
|
+
timestamp: string | number | bigint;
|
|
168
|
+
}>>;
|
|
169
|
+
lastAttestation: z.ZodOptional<z.ZodObject<{
|
|
170
|
+
timestamp: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
171
|
+
slot: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
172
|
+
date: z.ZodString;
|
|
173
|
+
}, "strip", z.ZodTypeAny, {
|
|
174
|
+
date: string;
|
|
175
|
+
slot: bigint;
|
|
176
|
+
timestamp: bigint;
|
|
177
|
+
}, {
|
|
178
|
+
date: string;
|
|
179
|
+
slot: string | number | bigint;
|
|
180
|
+
timestamp: string | number | bigint;
|
|
181
|
+
}>>;
|
|
182
|
+
totalSlots: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
183
|
+
missedProposals: z.ZodObject<{
|
|
184
|
+
currentStreak: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
185
|
+
rate: z.ZodNumber;
|
|
186
|
+
count: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
187
|
+
}, "strip", z.ZodTypeAny, {
|
|
188
|
+
currentStreak: number;
|
|
189
|
+
rate: number;
|
|
190
|
+
count: number;
|
|
191
|
+
}, {
|
|
192
|
+
currentStreak: string | number | bigint;
|
|
193
|
+
rate: number;
|
|
194
|
+
count: string | number | bigint;
|
|
195
|
+
}>;
|
|
196
|
+
missedAttestations: z.ZodObject<{
|
|
197
|
+
currentStreak: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
198
|
+
rate: z.ZodNumber;
|
|
199
|
+
count: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
200
|
+
}, "strip", z.ZodTypeAny, {
|
|
201
|
+
currentStreak: number;
|
|
202
|
+
rate: number;
|
|
203
|
+
count: number;
|
|
204
|
+
}, {
|
|
205
|
+
currentStreak: string | number | bigint;
|
|
206
|
+
rate: number;
|
|
207
|
+
count: string | number | bigint;
|
|
208
|
+
}>;
|
|
209
|
+
history: z.ZodArray<z.ZodObject<{
|
|
210
|
+
slot: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
211
|
+
status: z.ZodEnum<["block-mined", "block-proposed", "block-missed", "attestation-sent", "attestation-missed"]>;
|
|
212
|
+
}, "strip", z.ZodTypeAny, {
|
|
213
|
+
status: "block-mined" | "block-proposed" | "block-missed" | "attestation-sent" | "attestation-missed";
|
|
214
|
+
slot: bigint;
|
|
215
|
+
}, {
|
|
216
|
+
status: "block-mined" | "block-proposed" | "block-missed" | "attestation-sent" | "attestation-missed";
|
|
217
|
+
slot: string | number | bigint;
|
|
218
|
+
}>, "many">;
|
|
219
|
+
}, "strip", z.ZodTypeAny, {
|
|
220
|
+
address: import("@aztec/foundation/schemas").EthAddress;
|
|
221
|
+
totalSlots: number;
|
|
222
|
+
missedProposals: {
|
|
223
|
+
currentStreak: number;
|
|
224
|
+
rate: number;
|
|
225
|
+
count: number;
|
|
226
|
+
};
|
|
227
|
+
missedAttestations: {
|
|
228
|
+
currentStreak: number;
|
|
229
|
+
rate: number;
|
|
230
|
+
count: number;
|
|
231
|
+
};
|
|
232
|
+
history: {
|
|
233
|
+
status: "block-mined" | "block-proposed" | "block-missed" | "attestation-sent" | "attestation-missed";
|
|
234
|
+
slot: bigint;
|
|
235
|
+
}[];
|
|
236
|
+
lastProposal?: {
|
|
237
|
+
date: string;
|
|
238
|
+
slot: bigint;
|
|
239
|
+
timestamp: bigint;
|
|
240
|
+
} | undefined;
|
|
241
|
+
lastAttestation?: {
|
|
242
|
+
date: string;
|
|
243
|
+
slot: bigint;
|
|
244
|
+
timestamp: bigint;
|
|
245
|
+
} | undefined;
|
|
246
|
+
}, {
|
|
247
|
+
address: string;
|
|
248
|
+
totalSlots: string | number | bigint;
|
|
249
|
+
missedProposals: {
|
|
250
|
+
currentStreak: string | number | bigint;
|
|
251
|
+
rate: number;
|
|
252
|
+
count: string | number | bigint;
|
|
253
|
+
};
|
|
254
|
+
missedAttestations: {
|
|
255
|
+
currentStreak: string | number | bigint;
|
|
256
|
+
rate: number;
|
|
257
|
+
count: string | number | bigint;
|
|
258
|
+
};
|
|
259
|
+
history: {
|
|
260
|
+
status: "block-mined" | "block-proposed" | "block-missed" | "attestation-sent" | "attestation-missed";
|
|
261
|
+
slot: string | number | bigint;
|
|
262
|
+
}[];
|
|
263
|
+
lastProposal?: {
|
|
264
|
+
date: string;
|
|
265
|
+
slot: string | number | bigint;
|
|
266
|
+
timestamp: string | number | bigint;
|
|
267
|
+
} | undefined;
|
|
268
|
+
lastAttestation?: {
|
|
269
|
+
date: string;
|
|
270
|
+
slot: string | number | bigint;
|
|
271
|
+
timestamp: string | number | bigint;
|
|
272
|
+
} | undefined;
|
|
273
|
+
}>>;
|
|
274
|
+
lastProcessedSlot: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>>;
|
|
275
|
+
initialSlot: z.ZodOptional<z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>>;
|
|
276
|
+
slotWindow: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodNumber>;
|
|
277
|
+
}, "strip", z.ZodTypeAny, {
|
|
278
|
+
stats: Record<string, {
|
|
279
|
+
address: import("@aztec/foundation/schemas").EthAddress;
|
|
280
|
+
totalSlots: number;
|
|
281
|
+
missedProposals: {
|
|
282
|
+
currentStreak: number;
|
|
283
|
+
rate: number;
|
|
284
|
+
count: number;
|
|
285
|
+
};
|
|
286
|
+
missedAttestations: {
|
|
287
|
+
currentStreak: number;
|
|
288
|
+
rate: number;
|
|
289
|
+
count: number;
|
|
290
|
+
};
|
|
291
|
+
history: {
|
|
292
|
+
status: "block-mined" | "block-proposed" | "block-missed" | "attestation-sent" | "attestation-missed";
|
|
293
|
+
slot: bigint;
|
|
294
|
+
}[];
|
|
295
|
+
lastProposal?: {
|
|
296
|
+
date: string;
|
|
297
|
+
slot: bigint;
|
|
298
|
+
timestamp: bigint;
|
|
299
|
+
} | undefined;
|
|
300
|
+
lastAttestation?: {
|
|
301
|
+
date: string;
|
|
302
|
+
slot: bigint;
|
|
303
|
+
timestamp: bigint;
|
|
304
|
+
} | undefined;
|
|
305
|
+
}>;
|
|
306
|
+
slotWindow: number;
|
|
307
|
+
lastProcessedSlot?: bigint | undefined;
|
|
308
|
+
initialSlot?: bigint | undefined;
|
|
309
|
+
}, {
|
|
310
|
+
stats: Record<string, {
|
|
311
|
+
address: string;
|
|
312
|
+
totalSlots: string | number | bigint;
|
|
313
|
+
missedProposals: {
|
|
314
|
+
currentStreak: string | number | bigint;
|
|
315
|
+
rate: number;
|
|
316
|
+
count: string | number | bigint;
|
|
317
|
+
};
|
|
318
|
+
missedAttestations: {
|
|
319
|
+
currentStreak: string | number | bigint;
|
|
320
|
+
rate: number;
|
|
321
|
+
count: string | number | bigint;
|
|
322
|
+
};
|
|
323
|
+
history: {
|
|
324
|
+
status: "block-mined" | "block-proposed" | "block-missed" | "attestation-sent" | "attestation-missed";
|
|
325
|
+
slot: string | number | bigint;
|
|
326
|
+
}[];
|
|
327
|
+
lastProposal?: {
|
|
328
|
+
date: string;
|
|
329
|
+
slot: string | number | bigint;
|
|
330
|
+
timestamp: string | number | bigint;
|
|
331
|
+
} | undefined;
|
|
332
|
+
lastAttestation?: {
|
|
333
|
+
date: string;
|
|
334
|
+
slot: string | number | bigint;
|
|
335
|
+
timestamp: string | number | bigint;
|
|
336
|
+
} | undefined;
|
|
337
|
+
}>;
|
|
338
|
+
slotWindow: string | number | bigint;
|
|
339
|
+
lastProcessedSlot?: string | number | bigint | undefined;
|
|
340
|
+
initialSlot?: string | number | bigint | undefined;
|
|
341
|
+
}>;
|
|
342
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/validators/schemas.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,2BAA2B,wGAME,CAAC;AAE3C,eAAO,MAAM,4BAA4B;;;;;;;;;WAKC,CAAC;AAE3C,eAAO,MAAM,iCAAiC;;;;;;;;;oBAAwC,CAAC;AAEvF,eAAO,MAAM,+BAA+B;;;;;;;;;qBAA8C,CAAC;AAc3F,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQE,CAAC;AAEpC,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKE,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { schemas } from '@aztec/foundation/schemas';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export const ValidatorStatusInSlotSchema = z.enum([
|
|
4
|
+
'block-mined',
|
|
5
|
+
'block-proposed',
|
|
6
|
+
'block-missed',
|
|
7
|
+
'attestation-sent',
|
|
8
|
+
'attestation-missed'
|
|
9
|
+
]);
|
|
10
|
+
export const ValidatorStatusHistorySchema = z.array(z.object({
|
|
11
|
+
slot: schemas.BigInt,
|
|
12
|
+
status: ValidatorStatusInSlotSchema
|
|
13
|
+
}));
|
|
14
|
+
export const ValidatorStatusHistorySchemaArray = z.array(ValidatorStatusHistorySchema);
|
|
15
|
+
export const ValidatorStatusHistorySchemaMap = z.record(ValidatorStatusHistorySchemaArray);
|
|
16
|
+
const ValidatorTimeStatSchema = z.object({
|
|
17
|
+
timestamp: schemas.BigInt,
|
|
18
|
+
slot: schemas.BigInt,
|
|
19
|
+
date: z.string()
|
|
20
|
+
});
|
|
21
|
+
const ValidatorFilteredHistorySchema = z.object({
|
|
22
|
+
currentStreak: schemas.Integer,
|
|
23
|
+
rate: z.number(),
|
|
24
|
+
count: schemas.Integer
|
|
25
|
+
});
|
|
26
|
+
export const ValidatorStatsSchema = z.object({
|
|
27
|
+
address: schemas.EthAddress,
|
|
28
|
+
lastProposal: ValidatorTimeStatSchema.optional(),
|
|
29
|
+
lastAttestation: ValidatorTimeStatSchema.optional(),
|
|
30
|
+
totalSlots: schemas.Integer,
|
|
31
|
+
missedProposals: ValidatorFilteredHistorySchema,
|
|
32
|
+
missedAttestations: ValidatorFilteredHistorySchema,
|
|
33
|
+
history: ValidatorStatusHistorySchema
|
|
34
|
+
});
|
|
35
|
+
export const ValidatorsStatsSchema = z.object({
|
|
36
|
+
stats: z.record(ValidatorStatsSchema),
|
|
37
|
+
lastProcessedSlot: schemas.BigInt.optional(),
|
|
38
|
+
initialSlot: schemas.BigInt.optional(),
|
|
39
|
+
slotWindow: schemas.Integer
|
|
40
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
+
export type ValidatorStatusType = 'block' | 'attestation';
|
|
3
|
+
export type ValidatorStatusInSlot = 'block-mined' | 'block-proposed' | 'block-missed' | 'attestation-sent' | 'attestation-missed';
|
|
4
|
+
export type ValidatorStatusHistory = {
|
|
5
|
+
slot: bigint;
|
|
6
|
+
status: ValidatorStatusInSlot;
|
|
7
|
+
}[];
|
|
8
|
+
export type ValidatorStats = {
|
|
9
|
+
address: EthAddress;
|
|
10
|
+
lastProposal?: {
|
|
11
|
+
timestamp: bigint;
|
|
12
|
+
slot: bigint;
|
|
13
|
+
date: string;
|
|
14
|
+
};
|
|
15
|
+
lastAttestation?: {
|
|
16
|
+
timestamp: bigint;
|
|
17
|
+
slot: bigint;
|
|
18
|
+
date: string;
|
|
19
|
+
};
|
|
20
|
+
totalSlots: number;
|
|
21
|
+
missedProposals: {
|
|
22
|
+
currentStreak: number;
|
|
23
|
+
rate: number;
|
|
24
|
+
count: number;
|
|
25
|
+
};
|
|
26
|
+
missedAttestations: {
|
|
27
|
+
currentStreak: number;
|
|
28
|
+
rate: number;
|
|
29
|
+
count: number;
|
|
30
|
+
};
|
|
31
|
+
history: ValidatorStatusHistory;
|
|
32
|
+
};
|
|
33
|
+
export type ValidatorsStats = {
|
|
34
|
+
stats: Record<string, ValidatorStats>;
|
|
35
|
+
lastProcessedSlot?: bigint;
|
|
36
|
+
initialSlot?: bigint;
|
|
37
|
+
slotWindow: number;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/validators/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,aAAa,CAAC;AAE1D,MAAM,MAAM,qBAAqB,GAC7B,aAAa,GACb,gBAAgB,GAChB,cAAc,GACd,kBAAkB,G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