@divstake-nestjs/validators-registry
Version:
NestJS Validators registry Module for Lido Finance projects. Part of [DivStake NestJS Modules](https://github.com/skaibaLab/divstake-nestjs-modules/#readme)
34 lines (33 loc) • 1.7 kB
TypeScript
import { ConsensusValidatorsAndMetadata, ConsensusMeta } from '../types';
import { BlockId } from './block-id';
import { FilterQuery, FindOptions } from '@mikro-orm/core';
import { ConsensusValidatorEntity } from '../storage/consensus-validator.entity';
export declare const ValidatorsRegistryInterface: import("@divstake-nestjs/di").InterfaceTag<ValidatorsRegistryInterface>;
export interface ValidatorsRegistryInterface {
/**
* Update internal state of validators in the registry to the Consensus Layer (CL) state
* according to `blockId`.
*
* @param {BlockId} blockId - Values: 'head', 'genesis', 'finalized', <slot>, <hex encoded blockRoot with 0x prefix>
*
* If the registry internal state is newer or the same to the CL state - does nothing.
*/
update(blockId: BlockId): Promise<ConsensusMeta>;
/**
* Update internal state of validators in the registry to the Consensus Layer (CL) state
* according to `blockId`. Reading validators in stream.
*
* @param {BlockId} blockId - Values: 'head', 'genesis', 'finalized', <slot>, <hex encoded blockRoot with 0x prefix>
*
* If the registry internal state is newer or the same to the CL state - does nothing.
*/
updateStream(blockId: BlockId): Promise<ConsensusMeta>;
/**
* Get Metadata from registry internal state
*/
getMeta(): Promise<ConsensusMeta | null>;
/**
* Get Validators and metadata from registry internal state
*/
getValidators(pubkeys?: string[], where?: FilterQuery<ConsensusValidatorEntity>, options?: FindOptions<ConsensusValidatorEntity>): Promise<ConsensusValidatorsAndMetadata>;
}