@lodestar/types 1.35.0-dev.98d359db41 → 1.35.0-dev.a70bac5bd3

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.
Files changed (102) hide show
  1. package/lib/altair/index.js.map +1 -1
  2. package/lib/bellatrix/index.js.map +1 -1
  3. package/lib/bellatrix/sszTypes.d.ts +14 -14
  4. package/lib/capella/index.js.map +1 -1
  5. package/lib/capella/sszTypes.d.ts +38 -38
  6. package/lib/deneb/index.js.map +1 -1
  7. package/lib/deneb/sszTypes.d.ts +41 -41
  8. package/lib/electra/index.js.map +1 -1
  9. package/lib/electra/sszTypes.d.ts +64 -64
  10. package/lib/fulu/index.js.map +1 -1
  11. package/lib/fulu/sszTypes.d.ts +21 -21
  12. package/lib/fulu/sszTypes.js.map +1 -1
  13. package/lib/gloas/index.js.map +1 -1
  14. package/lib/gloas/sszTypes.d.ts +11 -11
  15. package/lib/index.d.ts +3 -4
  16. package/lib/index.js +4 -5
  17. package/lib/index.js.map +1 -1
  18. package/lib/phase0/index.d.ts +0 -1
  19. package/lib/phase0/index.js +0 -1
  20. package/lib/phase0/index.js.map +1 -1
  21. package/lib/sszTypes.d.ts +658 -658
  22. package/lib/types.d.ts +2 -2
  23. package/lib/types.js +2 -2
  24. package/lib/types.js.map +1 -1
  25. package/lib/utils/container.js.map +1 -1
  26. package/lib/utils/executionAddress.js +1 -1
  27. package/lib/utils/executionAddress.js.map +1 -1
  28. package/lib/utils/stringType.js +8 -5
  29. package/lib/utils/stringType.js.map +1 -1
  30. package/package.json +8 -17
  31. package/lib/altair/index.d.ts.map +0 -1
  32. package/lib/altair/sszTypes.d.ts.map +0 -1
  33. package/lib/altair/types.d.ts.map +0 -1
  34. package/lib/bellatrix/index.d.ts.map +0 -1
  35. package/lib/bellatrix/sszTypes.d.ts.map +0 -1
  36. package/lib/bellatrix/types.d.ts.map +0 -1
  37. package/lib/capella/index.d.ts.map +0 -1
  38. package/lib/capella/sszTypes.d.ts.map +0 -1
  39. package/lib/capella/types.d.ts.map +0 -1
  40. package/lib/deneb/index.d.ts.map +0 -1
  41. package/lib/deneb/sszTypes.d.ts.map +0 -1
  42. package/lib/deneb/types.d.ts.map +0 -1
  43. package/lib/electra/index.d.ts.map +0 -1
  44. package/lib/electra/sszTypes.d.ts.map +0 -1
  45. package/lib/electra/types.d.ts.map +0 -1
  46. package/lib/fulu/index.d.ts.map +0 -1
  47. package/lib/fulu/sszTypes.d.ts.map +0 -1
  48. package/lib/fulu/types.d.ts.map +0 -1
  49. package/lib/gloas/index.d.ts.map +0 -1
  50. package/lib/gloas/sszTypes.d.ts.map +0 -1
  51. package/lib/gloas/types.d.ts.map +0 -1
  52. package/lib/index.d.ts.map +0 -1
  53. package/lib/phase0/index.d.ts.map +0 -1
  54. package/lib/phase0/sszTypes.d.ts.map +0 -1
  55. package/lib/phase0/types.d.ts.map +0 -1
  56. package/lib/phase0/validator.d.ts.map +0 -1
  57. package/lib/primitive/index.d.ts.map +0 -1
  58. package/lib/primitive/sszTypes.d.ts.map +0 -1
  59. package/lib/primitive/types.d.ts.map +0 -1
  60. package/lib/sszTypes.d.ts.map +0 -1
  61. package/lib/types.d.ts.map +0 -1
  62. package/lib/utils/container.d.ts.map +0 -1
  63. package/lib/utils/executionAddress.d.ts.map +0 -1
  64. package/lib/utils/stringType.d.ts.map +0 -1
  65. package/lib/utils/typeguards.d.ts.map +0 -1
  66. package/lib/utils/validatorStatus.d.ts.map +0 -1
  67. package/src/altair/index.ts +0 -5
  68. package/src/altair/sszTypes.ts +0 -243
  69. package/src/altair/types.ts +0 -24
  70. package/src/bellatrix/index.ts +0 -5
  71. package/src/bellatrix/sszTypes.ts +0 -238
  72. package/src/bellatrix/types.ts +0 -24
  73. package/src/capella/index.ts +0 -5
  74. package/src/capella/sszTypes.ts +0 -281
  75. package/src/capella/types.ts +0 -33
  76. package/src/deneb/index.ts +0 -5
  77. package/src/deneb/sszTypes.ts +0 -329
  78. package/src/deneb/types.ts +0 -55
  79. package/src/electra/index.ts +0 -5
  80. package/src/electra/sszTypes.ts +0 -451
  81. package/src/electra/types.ts +0 -54
  82. package/src/fulu/index.ts +0 -5
  83. package/src/fulu/sszTypes.ts +0 -138
  84. package/src/fulu/types.ts +0 -31
  85. package/src/gloas/index.ts +0 -5
  86. package/src/gloas/sszTypes.ts +0 -5
  87. package/src/gloas/types.ts +0 -6
  88. package/src/index.ts +0 -15
  89. package/src/phase0/index.ts +0 -6
  90. package/src/phase0/sszTypes.ts +0 -514
  91. package/src/phase0/types.ts +0 -46
  92. package/src/phase0/validator.ts +0 -78
  93. package/src/primitive/index.ts +0 -3
  94. package/src/primitive/sszTypes.ts +0 -70
  95. package/src/primitive/types.ts +0 -53
  96. package/src/sszTypes.ts +0 -86
  97. package/src/types.ts +0 -375
  98. package/src/utils/container.ts +0 -38
  99. package/src/utils/executionAddress.ts +0 -48
  100. package/src/utils/stringType.ts +0 -58
  101. package/src/utils/typeguards.ts +0 -98
  102. package/src/utils/validatorStatus.ts +0 -52
@@ -1,55 +0,0 @@
1
- import {ValueOf} from "@chainsafe/ssz";
2
- import * as ssz from "./sszTypes.js";
3
-
4
- export type KZGProof = ValueOf<typeof ssz.KZGProof>;
5
- export type KZGCommitment = ValueOf<typeof ssz.KZGCommitment>;
6
-
7
- export type Blob = ValueOf<typeof ssz.Blob>;
8
- export type Blobs = ValueOf<typeof ssz.Blobs>;
9
- export type BlobSidecar = ValueOf<typeof ssz.BlobSidecar>;
10
- export type BlobSidecars = ValueOf<typeof ssz.BlobSidecars>;
11
- export type ExecutionPayloadAndBlobsBundle = ValueOf<typeof ssz.ExecutionPayloadAndBlobsBundle>;
12
- export type BlobsBundle = ValueOf<typeof ssz.BlobsBundle>;
13
-
14
- export type KzgCommitmentInclusionProof = ValueOf<typeof ssz.KzgCommitmentInclusionProof>;
15
- export type BlobKzgCommitments = ValueOf<typeof ssz.BlobKzgCommitments>;
16
- export type KZGProofs = ValueOf<typeof ssz.KZGProofs>;
17
- export type BLSFieldElement = ValueOf<typeof ssz.BLSFieldElement>;
18
-
19
- export type BlobIdentifier = ValueOf<typeof ssz.BlobIdentifier>;
20
- export type BlobSidecarsByRangeRequest = ValueOf<typeof ssz.BlobSidecarsByRangeRequest>;
21
-
22
- export type ExecutionPayload = ValueOf<typeof ssz.ExecutionPayload>;
23
- export type ExecutionPayloadHeader = ValueOf<typeof ssz.ExecutionPayloadHeader>;
24
-
25
- export type BeaconBlockBody = ValueOf<typeof ssz.BeaconBlockBody>;
26
- export type BeaconBlock = ValueOf<typeof ssz.BeaconBlock>;
27
- export type SignedBeaconBlock = ValueOf<typeof ssz.SignedBeaconBlock>;
28
-
29
- export type BeaconState = ValueOf<typeof ssz.BeaconState>;
30
-
31
- export type BlindedBeaconBlockBody = ValueOf<typeof ssz.BlindedBeaconBlockBody>;
32
- export type BlindedBeaconBlock = ValueOf<typeof ssz.BlindedBeaconBlock>;
33
- export type SignedBlindedBeaconBlock = ValueOf<typeof ssz.SignedBlindedBeaconBlock>;
34
-
35
- export type FullOrBlindedExecutionPayload = ExecutionPayload | ExecutionPayloadHeader;
36
-
37
- export type BuilderBid = ValueOf<typeof ssz.BuilderBid>;
38
- export type SignedBuilderBid = ValueOf<typeof ssz.SignedBuilderBid>;
39
- export type SSEPayloadAttributes = ValueOf<typeof ssz.SSEPayloadAttributes>;
40
-
41
- export type LightClientHeader = ValueOf<typeof ssz.LightClientHeader>;
42
- export type LightClientBootstrap = ValueOf<typeof ssz.LightClientBootstrap>;
43
- export type LightClientUpdate = ValueOf<typeof ssz.LightClientUpdate>;
44
- export type LightClientFinalityUpdate = ValueOf<typeof ssz.LightClientFinalityUpdate>;
45
- export type LightClientOptimisticUpdate = ValueOf<typeof ssz.LightClientOptimisticUpdate>;
46
- export type LightClientStore = ValueOf<typeof ssz.LightClientStore>;
47
-
48
- export type ProducedBlobSidecars = Omit<BlobSidecars, "signedBlockHeader" | "kzgCommitmentInclusionProof">;
49
-
50
- export type BlockContents = ValueOf<typeof ssz.BlockContents>;
51
- export type SignedBlockContents = ValueOf<typeof ssz.SignedBlockContents>;
52
- export type BlobAndProof = {
53
- blob: Blob;
54
- proof: KZGProof;
55
- };
@@ -1,5 +0,0 @@
1
- export * from "./types.js";
2
-
3
- import * as ssz from "./sszTypes.js";
4
- import * as ts from "./types.js";
5
- export {ts, ssz};
@@ -1,451 +0,0 @@
1
- import {
2
- BitListType,
3
- BitVectorType,
4
- ContainerType,
5
- ListBasicType,
6
- ListCompositeType,
7
- VectorCompositeType,
8
- } from "@chainsafe/ssz";
9
- import {
10
- CURRENT_SYNC_COMMITTEE_DEPTH_ELECTRA,
11
- EPOCHS_PER_SYNC_COMMITTEE_PERIOD,
12
- FINALIZED_ROOT_DEPTH_ELECTRA,
13
- HISTORICAL_ROOTS_LIMIT,
14
- MAX_ATTESTATIONS_ELECTRA,
15
- MAX_ATTESTER_SLASHINGS_ELECTRA,
16
- MAX_COMMITTEES_PER_SLOT,
17
- MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD,
18
- MAX_DEPOSIT_REQUESTS_PER_PAYLOAD,
19
- MAX_VALIDATORS_PER_COMMITTEE,
20
- MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD,
21
- NEXT_SYNC_COMMITTEE_DEPTH_ELECTRA,
22
- PENDING_CONSOLIDATIONS_LIMIT,
23
- PENDING_DEPOSITS_LIMIT,
24
- PENDING_PARTIAL_WITHDRAWALS_LIMIT,
25
- SLOTS_PER_EPOCH,
26
- } from "@lodestar/params";
27
- import {ssz as altairSsz} from "../altair/index.js";
28
- import {ssz as bellatrixSsz} from "../bellatrix/index.js";
29
- import {ssz as capellaSsz} from "../capella/index.js";
30
- import {ssz as denebSsz} from "../deneb/index.js";
31
- import {ssz as phase0Ssz} from "../phase0/index.js";
32
- import {ssz as primitiveSsz} from "../primitive/index.js";
33
-
34
- const {
35
- Epoch,
36
- Gwei,
37
- UintNum64,
38
- Slot,
39
- Root,
40
- BLSSignature,
41
- UintBn256,
42
- Bytes32,
43
- BLSPubkey,
44
- DepositIndex,
45
- UintBn64,
46
- ExecutionAddress,
47
- ValidatorIndex,
48
- CommitteeIndex,
49
- } = primitiveSsz;
50
-
51
- export const CurrentSyncCommitteeBranch = new VectorCompositeType(Bytes32, CURRENT_SYNC_COMMITTEE_DEPTH_ELECTRA);
52
-
53
- export const FinalityBranch = new VectorCompositeType(Bytes32, FINALIZED_ROOT_DEPTH_ELECTRA);
54
-
55
- export const NextSyncCommitteeBranch = new VectorCompositeType(Bytes32, NEXT_SYNC_COMMITTEE_DEPTH_ELECTRA);
56
-
57
- export const AggregationBits = new BitListType(MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT);
58
-
59
- // This CommitteeBits serves a different purpose than CommitteeBits in phase0
60
- // TODO Electra: Rename phase0.CommitteeBits to ParticipationBits to avoid confusion
61
- export const CommitteeBits = new BitVectorType(MAX_COMMITTEES_PER_SLOT);
62
-
63
- export const AttestingIndices = new ListBasicType(
64
- ValidatorIndex,
65
- MAX_VALIDATORS_PER_COMMITTEE * MAX_COMMITTEES_PER_SLOT
66
- );
67
-
68
- export const Attestation = new ContainerType(
69
- {
70
- aggregationBits: AggregationBits, // Modified in ELECTRA
71
- data: phase0Ssz.AttestationData,
72
- signature: BLSSignature,
73
- committeeBits: CommitteeBits, // New in ELECTRA
74
- },
75
- {typeName: "Attestation", jsonCase: "eth2"}
76
- );
77
-
78
- // New type in ELECTRA
79
- export const SingleAttestation = new ContainerType(
80
- {
81
- committeeIndex: CommitteeIndex,
82
- attesterIndex: ValidatorIndex,
83
- data: phase0Ssz.AttestationData,
84
- signature: BLSSignature,
85
- },
86
- {typeName: "SingleAttestation", jsonCase: "eth2"}
87
- );
88
-
89
- export const IndexedAttestation = new ContainerType(
90
- {
91
- attestingIndices: AttestingIndices, // Modified in ELECTRA
92
- data: phase0Ssz.AttestationData,
93
- signature: BLSSignature,
94
- },
95
- {typeName: "IndexedAttestation", jsonCase: "eth2"}
96
- );
97
-
98
- /** Same as `IndexedAttestation` but epoch, slot and index are not bounded and must be a bigint */
99
- export const IndexedAttestationBigint = new ContainerType(
100
- {
101
- attestingIndices: AttestingIndices, // Modified in ELECTRA
102
- data: phase0Ssz.AttestationDataBigint,
103
- signature: BLSSignature,
104
- },
105
- {typeName: "IndexedAttestation", jsonCase: "eth2"}
106
- );
107
-
108
- export const AttesterSlashing = new ContainerType(
109
- {
110
- attestation1: IndexedAttestationBigint, // Modified in ELECTRA
111
- attestation2: IndexedAttestationBigint, // Modified in ELECTRA
112
- },
113
- {typeName: "AttesterSlashing", jsonCase: "eth2"}
114
- );
115
-
116
- export const AggregateAndProof = new ContainerType(
117
- {
118
- aggregatorIndex: ValidatorIndex,
119
- aggregate: Attestation, // Modified in ELECTRA
120
- selectionProof: BLSSignature,
121
- },
122
- {typeName: "AggregateAndProof", jsonCase: "eth2", cachePermanentRootStruct: true}
123
- );
124
-
125
- export const SignedAggregateAndProof = new ContainerType(
126
- {
127
- message: AggregateAndProof, // Modified in ELECTRA
128
- signature: BLSSignature,
129
- },
130
- {typeName: "SignedAggregateAndProof", jsonCase: "eth2"}
131
- );
132
-
133
- export const DepositRequest = new ContainerType(
134
- {
135
- pubkey: BLSPubkey,
136
- withdrawalCredentials: Bytes32,
137
- // this is actually gwei uintbn64 type, but super unlikely to get a high amount here
138
- // to warrant a bn type
139
- amount: UintNum64,
140
- signature: BLSSignature,
141
- index: DepositIndex,
142
- },
143
- {typeName: "DepositRequest", jsonCase: "eth2"}
144
- );
145
-
146
- export const DepositRequests = new ListCompositeType(DepositRequest, MAX_DEPOSIT_REQUESTS_PER_PAYLOAD);
147
-
148
- export const WithdrawalRequest = new ContainerType(
149
- {
150
- sourceAddress: ExecutionAddress,
151
- validatorPubkey: BLSPubkey,
152
- amount: Gwei,
153
- },
154
- {typeName: "WithdrawalRequest", jsonCase: "eth2"}
155
- );
156
- export const WithdrawalRequests = new ListCompositeType(WithdrawalRequest, MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD);
157
- export const ConsolidationRequest = new ContainerType(
158
- {
159
- sourceAddress: ExecutionAddress,
160
- sourcePubkey: BLSPubkey,
161
- targetPubkey: BLSPubkey,
162
- },
163
- {typeName: "ConsolidationRequest", jsonCase: "eth2"}
164
- );
165
- export const ConsolidationRequests = new ListCompositeType(
166
- ConsolidationRequest,
167
- MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD
168
- );
169
-
170
- export const ExecutionRequests = new ContainerType(
171
- {
172
- deposits: DepositRequests,
173
- withdrawals: WithdrawalRequests,
174
- consolidations: ConsolidationRequests,
175
- },
176
- {typeName: "ExecutionRequests", jsonCase: "eth2"}
177
- );
178
-
179
- // Explicitly defining electra containers for consistency's sake
180
- export const ExecutionPayloadHeader = denebSsz.ExecutionPayloadHeader;
181
- export const ExecutionPayload = denebSsz.ExecutionPayload;
182
-
183
- // We have to preserve Fields ordering while changing the type of ExecutionPayload
184
- export const BeaconBlockBody = new ContainerType(
185
- {
186
- randaoReveal: phase0Ssz.BeaconBlockBody.fields.randaoReveal,
187
- eth1Data: phase0Ssz.BeaconBlockBody.fields.eth1Data,
188
- graffiti: phase0Ssz.BeaconBlockBody.fields.graffiti,
189
- proposerSlashings: phase0Ssz.BeaconBlockBody.fields.proposerSlashings,
190
- attesterSlashings: new ListCompositeType(AttesterSlashing, MAX_ATTESTER_SLASHINGS_ELECTRA), // Modified in ELECTRA
191
- attestations: new ListCompositeType(Attestation, MAX_ATTESTATIONS_ELECTRA), // Modified in ELECTRA
192
- deposits: phase0Ssz.BeaconBlockBody.fields.deposits,
193
- voluntaryExits: phase0Ssz.BeaconBlockBody.fields.voluntaryExits,
194
- syncAggregate: altairSsz.BeaconBlockBody.fields.syncAggregate,
195
- executionPayload: ExecutionPayload,
196
- blsToExecutionChanges: capellaSsz.BeaconBlockBody.fields.blsToExecutionChanges,
197
- blobKzgCommitments: denebSsz.BeaconBlockBody.fields.blobKzgCommitments,
198
- executionRequests: ExecutionRequests, // New in ELECTRA:EIP7251
199
- },
200
- {typeName: "BeaconBlockBody", jsonCase: "eth2", cachePermanentRootStruct: true}
201
- );
202
-
203
- export const BeaconBlock = new ContainerType(
204
- {
205
- ...denebSsz.BeaconBlock.fields,
206
- body: BeaconBlockBody, // Modified in ELECTRA
207
- },
208
- {typeName: "BeaconBlock", jsonCase: "eth2", cachePermanentRootStruct: true}
209
- );
210
-
211
- export const SignedBeaconBlock = new ContainerType(
212
- {
213
- message: BeaconBlock, // Modified in ELECTRA
214
- signature: BLSSignature,
215
- },
216
- {typeName: "SignedBeaconBlock", jsonCase: "eth2"}
217
- );
218
-
219
- export const BlindedBeaconBlockBody = new ContainerType(
220
- {
221
- randaoReveal: phase0Ssz.BeaconBlockBody.fields.randaoReveal,
222
- eth1Data: phase0Ssz.BeaconBlockBody.fields.eth1Data,
223
- graffiti: phase0Ssz.BeaconBlockBody.fields.graffiti,
224
- proposerSlashings: phase0Ssz.BeaconBlockBody.fields.proposerSlashings,
225
- attesterSlashings: new ListCompositeType(AttesterSlashing, MAX_ATTESTER_SLASHINGS_ELECTRA), // Modified in ELECTRA
226
- attestations: new ListCompositeType(Attestation, MAX_ATTESTATIONS_ELECTRA), // Modified in ELECTRA
227
- deposits: phase0Ssz.BeaconBlockBody.fields.deposits,
228
- voluntaryExits: phase0Ssz.BeaconBlockBody.fields.voluntaryExits,
229
- syncAggregate: altairSsz.SyncAggregate,
230
- executionPayloadHeader: ExecutionPayloadHeader,
231
- blsToExecutionChanges: capellaSsz.BeaconBlockBody.fields.blsToExecutionChanges,
232
- blobKzgCommitments: denebSsz.BeaconBlockBody.fields.blobKzgCommitments,
233
- executionRequests: ExecutionRequests, // New in ELECTRA
234
- },
235
- {typeName: "BlindedBeaconBlockBody", jsonCase: "eth2", cachePermanentRootStruct: true}
236
- );
237
-
238
- export const BlindedBeaconBlock = new ContainerType(
239
- {
240
- ...denebSsz.BlindedBeaconBlock.fields,
241
- body: BlindedBeaconBlockBody, // Modified in ELECTRA
242
- },
243
- {typeName: "BlindedBeaconBlock", jsonCase: "eth2", cachePermanentRootStruct: true}
244
- );
245
-
246
- export const SignedBlindedBeaconBlock = new ContainerType(
247
- {
248
- message: BlindedBeaconBlock, // Modified in ELECTRA
249
- signature: BLSSignature,
250
- },
251
- {typeName: "SignedBlindedBeaconBlock", jsonCase: "eth2"}
252
- );
253
-
254
- export const BuilderBid = new ContainerType(
255
- {
256
- header: ExecutionPayloadHeader, // Modified in ELECTRA
257
- blobKzgCommitments: denebSsz.BlobKzgCommitments,
258
- executionRequests: ExecutionRequests, // New in ELECTRA
259
- value: UintBn256,
260
- pubkey: BLSPubkey,
261
- },
262
- {typeName: "BuilderBid", jsonCase: "eth2"}
263
- );
264
-
265
- export const SignedBuilderBid = new ContainerType(
266
- {
267
- message: BuilderBid,
268
- signature: BLSSignature,
269
- },
270
- {typeName: "SignedBuilderBid", jsonCase: "eth2"}
271
- );
272
-
273
- export const PendingDeposit = new ContainerType(
274
- {
275
- pubkey: BLSPubkey,
276
- withdrawalCredentials: Bytes32,
277
- // this is actually gwei uintbn64 type, but super unlikely to get a high amount here
278
- // to warrant a bn type
279
- amount: UintNum64,
280
- signature: BLSSignature,
281
- slot: Slot,
282
- },
283
- {typeName: "PendingDeposit", jsonCase: "eth2"}
284
- );
285
-
286
- export const PendingDeposits = new ListCompositeType(PendingDeposit, PENDING_DEPOSITS_LIMIT);
287
-
288
- export const PendingPartialWithdrawal = new ContainerType(
289
- {
290
- validatorIndex: ValidatorIndex,
291
- amount: Gwei,
292
- withdrawableEpoch: Epoch,
293
- },
294
- {typeName: "PendingPartialWithdrawal", jsonCase: "eth2"}
295
- );
296
-
297
- export const PendingPartialWithdrawals = new ListCompositeType(
298
- PendingPartialWithdrawal,
299
- PENDING_PARTIAL_WITHDRAWALS_LIMIT
300
- );
301
-
302
- export const PendingConsolidation = new ContainerType(
303
- {
304
- sourceIndex: ValidatorIndex,
305
- targetIndex: ValidatorIndex,
306
- },
307
- {typeName: "PendingConsolidation", jsonCase: "eth2"}
308
- );
309
-
310
- export const PendingConsolidations = new ListCompositeType(PendingConsolidation, PENDING_CONSOLIDATIONS_LIMIT);
311
-
312
- // In EIP-7251, we spread deneb fields as new fields are appended at the end
313
- export const BeaconState = new ContainerType(
314
- {
315
- genesisTime: UintNum64,
316
- genesisValidatorsRoot: Root,
317
- slot: primitiveSsz.Slot,
318
- fork: phase0Ssz.Fork,
319
- // History
320
- latestBlockHeader: phase0Ssz.BeaconBlockHeader,
321
- blockRoots: phase0Ssz.HistoricalBlockRoots,
322
- stateRoots: phase0Ssz.HistoricalStateRoots,
323
- // historical_roots Frozen in Capella, replaced by historical_summaries
324
- historicalRoots: new ListCompositeType(Root, HISTORICAL_ROOTS_LIMIT),
325
- // Eth1
326
- eth1Data: phase0Ssz.Eth1Data,
327
- eth1DataVotes: phase0Ssz.Eth1DataVotes,
328
- eth1DepositIndex: UintNum64,
329
- // Registry
330
- validators: phase0Ssz.Validators,
331
- balances: phase0Ssz.Balances,
332
- randaoMixes: phase0Ssz.RandaoMixes,
333
- // Slashings
334
- slashings: phase0Ssz.Slashings,
335
- // Participation
336
- previousEpochParticipation: altairSsz.EpochParticipation,
337
- currentEpochParticipation: altairSsz.EpochParticipation,
338
- // Finality
339
- justificationBits: phase0Ssz.JustificationBits,
340
- previousJustifiedCheckpoint: phase0Ssz.Checkpoint,
341
- currentJustifiedCheckpoint: phase0Ssz.Checkpoint,
342
- finalizedCheckpoint: phase0Ssz.Checkpoint,
343
- // Inactivity
344
- inactivityScores: altairSsz.InactivityScores,
345
- // Sync
346
- currentSyncCommittee: altairSsz.SyncCommittee,
347
- nextSyncCommittee: altairSsz.SyncCommittee,
348
- // Execution
349
- latestExecutionPayloadHeader: ExecutionPayloadHeader,
350
- // Withdrawals
351
- nextWithdrawalIndex: capellaSsz.BeaconState.fields.nextWithdrawalIndex,
352
- nextWithdrawalValidatorIndex: capellaSsz.BeaconState.fields.nextWithdrawalValidatorIndex,
353
- // Deep history valid from Capella onwards
354
- historicalSummaries: capellaSsz.BeaconState.fields.historicalSummaries,
355
- depositRequestsStartIndex: UintBn64, // New in ELECTRA:EIP6110
356
- depositBalanceToConsume: Gwei, // New in ELECTRA:EIP7251
357
- exitBalanceToConsume: Gwei, // New in ELECTRA:EIP7251
358
- earliestExitEpoch: Epoch, // New in ELECTRA:EIP7251
359
- consolidationBalanceToConsume: Gwei, // New in ELECTRA:EIP7251
360
- earliestConsolidationEpoch: Epoch, // New in ELECTRA:EIP7251
361
- pendingDeposits: PendingDeposits, // New in ELECTRA:EIP7251
362
- pendingPartialWithdrawals: PendingPartialWithdrawals, // New in ELECTRA:EIP7251
363
- pendingConsolidations: PendingConsolidations, // New in ELECTRA:EIP7251
364
- },
365
- {typeName: "BeaconState", jsonCase: "eth2"}
366
- );
367
-
368
- export const LightClientBootstrap = new ContainerType(
369
- {
370
- header: denebSsz.LightClientHeader,
371
- currentSyncCommittee: altairSsz.SyncCommittee,
372
- currentSyncCommitteeBranch: CurrentSyncCommitteeBranch,
373
- },
374
- {typeName: "LightClientBootstrap", jsonCase: "eth2"}
375
- );
376
-
377
- export const LightClientUpdate = new ContainerType(
378
- {
379
- attestedHeader: denebSsz.LightClientHeader,
380
- nextSyncCommittee: altairSsz.SyncCommittee,
381
- nextSyncCommitteeBranch: NextSyncCommitteeBranch, // Modified in ELECTRA
382
- finalizedHeader: denebSsz.LightClientHeader,
383
- finalityBranch: FinalityBranch, // Modified in ELECTRA
384
- syncAggregate: altairSsz.SyncAggregate,
385
- signatureSlot: Slot,
386
- },
387
- {typeName: "LightClientUpdate", jsonCase: "eth2"}
388
- );
389
-
390
- export const LightClientFinalityUpdate = new ContainerType(
391
- {
392
- attestedHeader: denebSsz.LightClientHeader,
393
- finalizedHeader: denebSsz.LightClientHeader,
394
- finalityBranch: FinalityBranch, // Modified in ELECTRA
395
- syncAggregate: altairSsz.SyncAggregate,
396
- signatureSlot: Slot,
397
- },
398
- {typeName: "LightClientFinalityUpdate", jsonCase: "eth2"}
399
- );
400
-
401
- export const LightClientOptimisticUpdate = new ContainerType(
402
- {
403
- attestedHeader: denebSsz.LightClientHeader,
404
- syncAggregate: altairSsz.SyncAggregate,
405
- signatureSlot: Slot,
406
- },
407
- {typeName: "LightClientOptimisticUpdate", jsonCase: "eth2"}
408
- );
409
-
410
- export const LightClientStore = new ContainerType(
411
- {
412
- snapshot: LightClientBootstrap,
413
- validUpdates: new ListCompositeType(LightClientUpdate, EPOCHS_PER_SYNC_COMMITTEE_PERIOD * SLOTS_PER_EPOCH),
414
- },
415
- {typeName: "LightClientStore", jsonCase: "eth2"}
416
- );
417
-
418
- // PayloadAttributes primarily for SSE event
419
- export const PayloadAttributes = new ContainerType(
420
- {
421
- ...capellaSsz.PayloadAttributes.fields,
422
- parentBeaconBlockRoot: Root,
423
- },
424
- {typeName: "PayloadAttributes", jsonCase: "eth2"}
425
- );
426
-
427
- export const SSEPayloadAttributes = new ContainerType(
428
- {
429
- ...bellatrixSsz.SSEPayloadAttributesCommon.fields,
430
- payloadAttributes: PayloadAttributes,
431
- },
432
- {typeName: "SSEPayloadAttributes", jsonCase: "eth2"}
433
- );
434
-
435
- export const BlockContents = new ContainerType(
436
- {
437
- block: BeaconBlock,
438
- kzgProofs: denebSsz.KZGProofs,
439
- blobs: denebSsz.Blobs,
440
- },
441
- {typeName: "BlockContents", jsonCase: "eth2"}
442
- );
443
-
444
- export const SignedBlockContents = new ContainerType(
445
- {
446
- signedBlock: SignedBeaconBlock,
447
- kzgProofs: denebSsz.KZGProofs,
448
- blobs: denebSsz.Blobs,
449
- },
450
- {typeName: "BlockContents", jsonCase: "eth2"}
451
- );
@@ -1,54 +0,0 @@
1
- import {ValueOf} from "@chainsafe/ssz";
2
- import * as ssz from "./sszTypes.js";
3
-
4
- export type Attestation = ValueOf<typeof ssz.Attestation>;
5
- export type SingleAttestation = ValueOf<typeof ssz.SingleAttestation>;
6
- export type IndexedAttestation = ValueOf<typeof ssz.IndexedAttestation>;
7
- export type IndexedAttestationBigint = ValueOf<typeof ssz.IndexedAttestationBigint>;
8
- export type AttesterSlashing = ValueOf<typeof ssz.AttesterSlashing>;
9
-
10
- export type AggregateAndProof = ValueOf<typeof ssz.AggregateAndProof>;
11
- export type SignedAggregateAndProof = ValueOf<typeof ssz.SignedAggregateAndProof>;
12
-
13
- export type DepositRequest = ValueOf<typeof ssz.DepositRequest>;
14
- export type DepositRequests = ValueOf<typeof ssz.DepositRequests>;
15
-
16
- export type WithdrawalRequest = ValueOf<typeof ssz.WithdrawalRequest>;
17
- export type WithdrawalRequests = ValueOf<typeof ssz.WithdrawalRequests>;
18
-
19
- export type ConsolidationRequest = ValueOf<typeof ssz.ConsolidationRequest>;
20
- export type ConsolidationRequests = ValueOf<typeof ssz.ConsolidationRequests>;
21
-
22
- export type ExecutionPayload = ValueOf<typeof ssz.ExecutionPayload>;
23
- export type ExecutionPayloadHeader = ValueOf<typeof ssz.ExecutionPayloadHeader>;
24
- export type ExecutionRequests = ValueOf<typeof ssz.ExecutionRequests>;
25
-
26
- export type BeaconBlockBody = ValueOf<typeof ssz.BeaconBlockBody>;
27
- export type BeaconBlock = ValueOf<typeof ssz.BeaconBlock>;
28
- export type SignedBeaconBlock = ValueOf<typeof ssz.SignedBeaconBlock>;
29
-
30
- export type BeaconState = ValueOf<typeof ssz.BeaconState>;
31
-
32
- export type BlindedBeaconBlockBody = ValueOf<typeof ssz.BlindedBeaconBlockBody>;
33
- export type BlindedBeaconBlock = ValueOf<typeof ssz.BlindedBeaconBlock>;
34
- export type SignedBlindedBeaconBlock = ValueOf<typeof ssz.SignedBlindedBeaconBlock>;
35
-
36
- export type BuilderBid = ValueOf<typeof ssz.BuilderBid>;
37
- export type SignedBuilderBid = ValueOf<typeof ssz.SignedBuilderBid>;
38
- export type SSEPayloadAttributes = ValueOf<typeof ssz.SSEPayloadAttributes>;
39
-
40
- export type LightClientBootstrap = ValueOf<typeof ssz.LightClientBootstrap>;
41
- export type LightClientUpdate = ValueOf<typeof ssz.LightClientUpdate>;
42
- export type LightClientFinalityUpdate = ValueOf<typeof ssz.LightClientFinalityUpdate>;
43
- export type LightClientOptimisticUpdate = ValueOf<typeof ssz.LightClientOptimisticUpdate>;
44
- export type LightClientStore = ValueOf<typeof ssz.LightClientStore>;
45
-
46
- export type PendingDeposit = ValueOf<typeof ssz.PendingDeposit>;
47
- export type PendingDeposits = ValueOf<typeof ssz.PendingDeposits>;
48
- export type PendingPartialWithdrawal = ValueOf<typeof ssz.PendingPartialWithdrawal>;
49
- export type PendingPartialWithdrawals = ValueOf<typeof ssz.PendingPartialWithdrawals>;
50
- export type PendingConsolidation = ValueOf<typeof ssz.PendingConsolidation>;
51
- export type PendingConsolidations = ValueOf<typeof ssz.PendingConsolidations>;
52
-
53
- export type BlockContents = ValueOf<typeof ssz.BlockContents>;
54
- export type SignedBlockContents = ValueOf<typeof ssz.SignedBlockContents>;
package/src/fulu/index.ts DELETED
@@ -1,5 +0,0 @@
1
- export * from "./types.js";
2
-
3
- import * as ssz from "./sszTypes.js";
4
- import * as ts from "./types.js";
5
- export {ts, ssz};