Files
twoeths 86298a43e6 refactor: move reward apis to state-transition (#8719)
**Motivation**

- the reward apis tightly couple to state-transition functions like
`beforeProcessEpoch() processBlock() processAttestationAltair()` so it
needs to be moved there

**Description**

- move api type definitions to `types` package so that it can be used
everywhere
- move reward apis implementation to `state-transition` package

Closes #8690

---------

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2026-01-06 08:48:58 +07:00
..
2021-05-27 12:17:49 -05:00

Lodestar Eth Consensus API

Discord ETH Beacon APIs Spec v3.1.0 ES Version Node Version

This package is part of ChainSafe's Lodestar project

Typescript REST client for the Ethereum Consensus API

Usage

The REST client extends the native Fetch API, it behaves very similar in terms of error and response handling. It returns the same Response object with additional methods to simplify usage and it allows to override all Request options if needed.

import {getClient} from "@lodestar/api";
import {config} from "@lodestar/config/default";

const api = getClient({baseUrl: "http://localhost:9596"}, {config});

const res = await api.beacon.getStateValidator({stateId: "head", validatorId: 0});

const validator = res.value();

console.log("The validator balance is: ", validator.balance);

Prerequisites

What you need

You will need to go over the specification.

Getting started

Contributors

Read our contributors document, submit an issue or talk to us on our discord!

License

Apache-2.0 ChainSafe Systems