UNPKG

@lodestar/api

Version:

A Typescript REST client for the Ethereum Consensus API

61 lines 2.61 kB
import { ListCompositeType, ValueOf } from "@chainsafe/ssz"; import { ChainForkConfig } from "@lodestar/config"; import { ForkName } from "@lodestar/params"; import { LightClientBootstrap, LightClientFinalityUpdate, LightClientOptimisticUpdate, LightClientUpdate, SyncPeriod } from "@lodestar/types"; import { EmptyArgs, EmptyMeta, EmptyRequest } from "../../utils/codecs.js"; import { Endpoint, RouteDefinitions } from "../../utils/index.js"; import { VersionMeta } from "../../utils/metadata.js"; export declare const HashListType: ListCompositeType<import("@chainsafe/ssz").ByteVectorType>; export type HashList = ValueOf<typeof HashListType>; export type Endpoints = { /** * Returns an array of best updates given a `startPeriod` and `count` number of sync committee period to return. * Best is defined by (in order of priority): * - Is finalized update * - Has most bits * - Oldest update */ getLightClientUpdatesByRange: Endpoint<"GET", { startPeriod: SyncPeriod; count: number; }, { query: { start_period: number; count: number; }; }, LightClientUpdate[], { versions: ForkName[]; }>; /** * Returns the latest optimistic head update available. Clients should use the SSE type `light_client_optimistic_update` * unless to get the very first head update after syncing, or if SSE are not supported by the server. */ getLightClientOptimisticUpdate: Endpoint<"GET", EmptyArgs, EmptyRequest, LightClientOptimisticUpdate, VersionMeta>; getLightClientFinalityUpdate: Endpoint<"GET", EmptyArgs, EmptyRequest, LightClientFinalityUpdate, VersionMeta>; /** * Fetch a bootstrapping state with a proof to a trusted block root. * The trusted block root should be fetched with similar means to a weak subjectivity checkpoint. * Only block roots for checkpoints are guaranteed to be available. */ getLightClientBootstrap: Endpoint<"GET", { blockRoot: string; }, { params: { block_root: string; }; }, LightClientBootstrap, VersionMeta>; /** * Returns an array of sync committee hashes based on the provided period and count */ getLightClientCommitteeRoot: Endpoint<"GET", { startPeriod: SyncPeriod; count: number; }, { query: { start_period: number; count: number; }; }, HashList, EmptyMeta>; }; export declare function getDefinitions(config: ChainForkConfig): RouteDefinitions<Endpoints>; //# sourceMappingURL=lightclient.d.ts.map