@lodestar/types 1.27.0-rc.2 → 1.28.0-dev.0ad6d4b05c
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 +6 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -67,13 +67,15 @@ 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. SSZ Types typed to these interfaces
|
|
70
|
+
In some cases, we need interfaces that accept types across all forks, like when the fork is not known ahead of time. Those are directly available without a namespace and SSZ Types typed to these interfaces can be retrieved by calling `sszTypesFor` with the `ForkName`.
|
|
71
71
|
|
|
72
72
|
```typescript
|
|
73
|
-
import {ForkName} from "@lodestar/params";
|
|
74
|
-
import {
|
|
73
|
+
import {ForkName, ForkPostAltair} from "@lodestar/params";
|
|
74
|
+
import {sszTypesFor, BeaconState} from "@lodestar/types";
|
|
75
75
|
|
|
76
|
-
const
|
|
76
|
+
const fork = ForkName.altair;
|
|
77
|
+
|
|
78
|
+
const state: BeaconState<ForkPostAltair> = sszTypesFor(fork).BeaconState.defaultValue();
|
|
77
79
|
```
|
|
78
80
|
|
|
79
81
|
## License
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/ChainSafe/lodestar/issues"
|
|
13
13
|
},
|
|
14
|
-
"version": "1.
|
|
14
|
+
"version": "1.28.0-dev.0ad6d4b05c",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"types": "lib/index.d.ts",
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@chainsafe/ssz": "^1.0.2",
|
|
77
|
-
"@lodestar/params": "1.
|
|
77
|
+
"@lodestar/params": "1.28.0-dev.0ad6d4b05c",
|
|
78
78
|
"ethereum-cryptography": "^2.0.0"
|
|
79
79
|
},
|
|
80
80
|
"keywords": [
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"beacon",
|
|
84
84
|
"blockchain"
|
|
85
85
|
],
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "ccf64719bc0541fd4d0b20e4f986eff1004f1aea"
|
|
87
87
|
}
|