import { DictionaryQueryEntry as DictionaryV1QueryEntry } from '@subql/types-core'; import { MetaData as DictionaryV1Metadata } from '@subql/utils'; import { NodeConfig } from '../../../configure'; import { CoreDictionary } from '../coreDictionary'; import { DictionaryResponse } from '../types'; import { buildDictQueryFragment } from './utils'; type GraphQLError = { message: string; [key: string]: unknown; }; /** * A dictionary query that failed. `graphQLErrors` holds the errors the dictionary returned, if any, and `body` the * response body when it isn't a GraphQL error response. Callers inspect both to tell an unsupported argument from a * failed request. */ export declare class DictionaryQueryError extends Error { readonly status: number; readonly graphQLErrors: GraphQLError[]; readonly body?: unknown | undefined; constructor(message: string, status: number, graphQLErrors?: GraphQLError[], body?: unknown | undefined); } export declare abstract class DictionaryV1 extends CoreDictionary { readonly dictionaryEndpoint: string; protected readonly metadataKeys: string[]; protected buildQueryFragment: typeof buildDictQueryFragment; private useDistinct; private useStartHeight; constructor(dictionaryEndpoint: string, chainId: string, nodeConfig: NodeConfig, metadataKeys?: string[], // Cosmos uses chain instead of genesisHash buildQueryFragment?: typeof buildDictQueryFragment); /** * Posts a GraphQL query to the dictionary and returns its `data`. * * Sent without a GraphQL client: each batch's query text differs, and a client parses and caches * a document for every one. */ protected query(query: string, variables?: Record): Promise; protected init(): Promise; getQueryEndBlock(targetBlockHeight: number, apiFinalizedHeight: number): number; /** * * @param startBlock * @param queryEndBlock this block number will limit the max query range, increase dictionary query speed * @param batchSize * @param conditions */ getData(startBlock: number, endBlock: number, batchSize: number): Promise | undefined>; queryMapValidByHeight(height: number): boolean; protected dictionaryValidation(metaData?: DictionaryV1Metadata, startBlockHeight?: number): boolean; private dictionaryQuery; private metadataQuery; protected validateChainMeta(metaData: DictionaryV1Metadata): boolean; } export {};