lodestar-types
This package is part of ChainSafe's Lodestar project
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/presets/mainnet";
import {types as minimalTypes} from "@chainsafe/lodestar-types/lib/presets/mainnet";
mainnetTypes.phase0.BeaconState.defaultValue();
minimalTypes.phase0.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 ChainSafe Systems