import { ObservableChainQuery, ObservableChainQueryMap } from "../../chain-query"; import { BondStatus, Validators, Validator } from "./types"; import { ChainGetter } from "../../../chain"; import { ObservableQuery, QuerySharedContext } from "../../../common"; import PQueue from "p-queue"; import { CoinPretty } from "@keplr-wallet/unit"; interface KeybaseResult { status: { code: number; name: string; }; them?: [ { id?: string; pictures?: { primary?: { url?: string; }; }; } ]; } /** * Fetch the validator's thumbnail from keybase if the identity exists. */ export declare class ObservableQueryValidatorThumbnail extends ObservableQuery { /** * Throttle down fetching the thumbnail from Keybase. * If too many requests occurs at the same time, Keybase will reject these requests. * @protected */ protected static fetchingThumbnailQueue: PQueue; protected readonly validator: Validator; constructor(sharedContext: QuerySharedContext, validator: Validator); protected canFetch(): boolean; protected fetchResponse(abortController: AbortController): Promise<{ headers: any; data: KeybaseResult; }>; get thumbnail(): string; } export declare class ObservableQueryValidatorsInner extends ObservableChainQuery { protected thumbnailMap: Map; constructor(sharedContext: QuerySharedContext, chainId: string, chainGetter: ChainGetter, endpoint: string); protected canFetch(): boolean; get validators(): Validator[]; readonly getValidator: (validatorAddress: string) => Validator | undefined; get validatorsSortedByVotingPower(): Validator[]; readonly getValidatorThumbnail: (operatorAddress: string) => string; readonly getQueryValidatorThumbnail: (operatorAddress: string) => ObservableQueryValidatorThumbnail | undefined; /** * Return the validator's voting power as human friendly (considering the coin decimals). */ readonly getValidatorShare: (operatorAddress: string) => CoinPretty | undefined; } export declare class ObservableQueryValidators extends ObservableChainQueryMap { constructor(sharedContext: QuerySharedContext, chainId: string, chainGetter: ChainGetter); getQueryStatus(status?: BondStatus): ObservableQueryValidatorsInner; } export {};