@lodestar/types 1.20.0-dev.ff253a7e4b → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -67,13 +67,13 @@ import {Epoch, ssz} from "@lodestar/types";
67
67
  const epoch: Epoch = ssz.Epoch.defaultValue();
68
68
  ```
69
69
 
70
- In some cases, we need interfaces that accept types across all forks, like when the fork is not known ahead of time. Typescript interfaces for this purpose are exported under the `allForks` namespace. SSZ Types typed to these interfaces are also provided under an `allForks` namespace, but keyed by `ForkName`.
70
+ In some cases, we need interfaces that accept types across all forks, like when the fork is not known ahead of time. SSZ Types typed to these interfaces are also provided under an `allForks` namespace, but keyed by `ForkName`.
71
71
 
72
72
  ```typescript
73
73
  import {ForkName} from "@lodestar/params";
74
- import {allForks, ssz} from "@lodestar/types";
74
+ import {ssz, BeaconState} from "@lodestar/types";
75
75
 
76
- const state: allForks.BeaconState = ssz.allForks[ForkName.phase0].BeaconState.defaultValue();
76
+ const state: BeaconState<ForkName.phase0> = ssz.allForks[ForkName.phase0].BeaconState.defaultValue();
77
77
  ```
78
78
 
79
79
  ## License
@@ -1,5 +1,6 @@
1
1
  import { ValueOf } from "@chainsafe/ssz";
2
- import { BlockContents } from "../allForks/types.js";
2
+ import { ForkName } from "@lodestar/params";
3
+ import type { BlockContents } from "../types.js";
3
4
  import * as ssz from "./sszTypes.js";
4
5
  export type KZGProof = ValueOf<typeof ssz.KZGProof>;
5
6
  export type KZGCommitment = ValueOf<typeof ssz.KZGCommitment>;
@@ -36,5 +37,5 @@ export type LightClientFinalityUpdate = ValueOf<typeof ssz.LightClientFinalityUp
36
37
  export type LightClientOptimisticUpdate = ValueOf<typeof ssz.LightClientOptimisticUpdate>;
37
38
  export type LightClientStore = ValueOf<typeof ssz.LightClientStore>;
38
39
  export type ProducedBlobSidecars = Omit<BlobSidecars, "signedBlockHeader" | "kzgCommitmentInclusionProof">;
39
- export type Contents = Omit<BlockContents, "block">;
40
+ export type Contents = Omit<BlockContents<ForkName.deneb>, "block">;
40
41
  //# sourceMappingURL=types.d.ts.map
package/lib/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  export * from "./types.js";
2
2
  import * as ssz from "./sszTypes.js";
3
- export { ssz };
3
+ import { sszTypesFor } from "./sszTypes.js";
4
+ import type { SSZTypesFor } from "./sszTypes.js";
5
+ export { sszTypesFor, SSZTypesFor, ssz };
4
6
  export * from "./utils/typeguards.js";
5
7
  export { StringType, stringType } from "./utils/stringType.js";
6
8
  export * from "./utils/container.js";
package/lib/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from "./types.js";
2
2
  import * as ssz from "./sszTypes.js";
3
- export { ssz };
3
+ import { sszTypesFor } from "./sszTypes.js";
4
+ export { sszTypesFor, ssz };
4
5
  // Typeguards
5
6
  export * from "./utils/typeguards.js";
6
7
  // String type
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,KAAK,GAAG,MAAM,eAAe,CAAC;AACrC,OAAO,EAAC,GAAG,EAAC,CAAC;AACb,aAAa;AACb,cAAc,uBAAuB,CAAC;AACtC,cAAc;AACd,OAAO,EAAC,UAAU,EAAE,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAC7D,kBAAkB;AAClB,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,KAAK,GAAG,MAAM,eAAe,CAAC;AACrC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAC,WAAW,EAAe,GAAG,EAAC,CAAC;AACvC,aAAa;AACb,cAAc,uBAAuB,CAAC;AACtC,cAAc;AACd,OAAO,EAAC,UAAU,EAAE,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAC7D,kBAAkB;AAClB,cAAc,sBAAsB,CAAC"}