JSPM

@chainsafe/eth2.0-state-transition

0.2.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q25822F
  • License Apache-2.0

Beacon Chain state transition function and utils

Package Exports

  • @chainsafe/eth2.0-state-transition

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@chainsafe/eth2.0-state-transition) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

eth2.0-state-transition

npm License

The beacon state transition and state transition utilities

Usage

import {stateTransition} from "@chainsafe/eth2.0-state-transition";
import {BeaconBlock, BeaconState} from "@chainsafe/eth2.0-types";
import {config as mainnetConfig} from "@chainsafe/eth2.0-config/lib/presets/mainnet";

const state: BeaconState = {
  ...
};

const block: BeaconBlock = {
  ...
};

let postState: BeaconState;
try {
  postState = stateTransition(mainnetConfig, state, block);
} catch (e) {
  console.log(e);
}

License

Apache-2.0