lodestar-types
Typescript and SSZ types for Eth2 datastructures
Usage
Using the typescript types
import {BeaconState} from "@chainsafe/lodestar-types";
const b: BeaconState = {
slot: 5,
...
};
Using the ssz types
import {types as mainnetTypes} from "@chainsafe/lodestar-types/lib/ssz/presets/mainnet";
import {types as minimalTypes} from "@chainsafe/lodestar-types/lib/ssz/presets/mainnet";
mainnetTypes.BeaconState.defaultValue();
minimalTypes.BeaconState.defaultValue();
...
import {createIBeaconSSZTypes} from "@chainsafe/lodestar-types";
import {IBeaconParams} from "@chainsafe/lodestar-params";
const testnetParams: IBeaconParams = {
...
};
const testnetTypes = createIBeaconSSZTypes(testnetParams);
testnetTypes.BeaconState.defaultValue();
License
Apache-2.0