import { IRpcClient } from '@interchainjs/types'; import { ICosmosQueryClient } from '../types/cosmos-client-interfaces'; import { ProtocolInfo } from '../types/protocol'; import { StatusResponse as ChainStatus } from '../types/responses/common/status'; import { Block } from '../types/responses/common/block/block'; import { TxResponse } from '../types/responses/common/tx'; import { ValidatorsResponse as ValidatorSet } from '../types/responses/common/validators'; import { BlockSearchResponse as SearchBlocksResult } from '../types/responses/common/block-search'; import { TxSearchResponse as SearchTxsResult } from '../types/responses/common/tx-search'; import { BlockchainResponse } from '../types/responses/common/block/blockchain-response'; import { BlockHeader } from '../types/responses/common/header/block-header'; import { Commit } from '../types/responses/common/commit/commit'; import { UnconfirmedTxsResponse as UnconfirmedTxs } from '../types/responses/common/unconfirmed-txs'; import { ConsensusParams } from '../types/responses/common/consensus-params/consensus-params'; import { HealthResponse as HealthResult } from '../types/responses/common/health'; import { NumUnconfirmedTxsResponse as NumUnconfirmedTxs } from '../types/responses/common/num-unconfirmed-txs'; import { AbciInfoResponse as AbciInfo } from '../types/responses/common/abci/abci-info-response'; import { NetInfoResponse as NetInfo } from '../types/responses/common/net-info'; import { AbciQueryResponse as AbciQueryResult } from '../types/responses/common/abci/abci-query-response'; import { ConsensusStateResponse as ConsensusState } from '../types/responses/common/consensus-state'; import { BroadcastTxSyncResponse } from '../types/responses/common/broadcast-tx-sync'; import { GenesisResponse as Genesis } from '../types/responses/common/genesis'; import { GenesisChunkedResponse as GenesisChunk } from '../types/responses/common/genesis-chunked'; import { ConsensusStateDumpResponse } from '../types/responses/common/consensus'; import { BroadcastTxAsyncResponse } from '../types/responses/common/broadcast-tx-async'; import { BroadcastTxCommitResponse } from '../types/responses/common/broadcast-tx-commit'; import { BlockResultsResponse as BlockResults } from '../types/responses/common/block/block-results-response'; import { TxSearchParams } from '../types/requests/common/tx'; import { CheckTxResponse } from '../types/responses/common/tx'; import { BlockSearchParams } from '../types/requests/common/block'; import { AbciQueryParams } from '../types/requests/common/abci'; import { BroadcastTxParams } from '../types/requests/common/tx'; import { ICosmosProtocolAdapter } from '../adapters/base'; import { BaseAccount } from '@interchainjs/cosmos-types'; import { type PubkeyDecoderMap } from '../utils'; import { EncodedMessage } from '../signers'; export declare class CosmosQueryClient implements ICosmosQueryClient { private rpcClient; private protocolAdapter; constructor(rpcClient: IRpcClient, protocolAdapter: ICosmosProtocolAdapter); get endpoint(): string; connect(): Promise; disconnect(): Promise; isConnected(): boolean; getStatus(): Promise; getAbciInfo(): Promise; getHealth(): Promise; getNetInfo(): Promise; getBlock(height?: number): Promise; getBlockByHash(hash: string): Promise; getBlockResults(height?: number): Promise; /** * Search for blocks matching the given query * @param params - Search parameters including query string and pagination options * @returns Search results with matching blocks and total count * @example * ```typescript * const results = await client.searchBlocks({ * query: "block.height >= 100 AND block.height <= 200", * page: 1, * perPage: 10 * }); * ``` */ searchBlocks(params: BlockSearchParams): Promise; /** * Get blockchain metadata for a range of blocks * @param minHeight - Minimum block height (inclusive) * @param maxHeight - Maximum block height (inclusive) * @returns Blockchain metadata including block headers * @remarks * - If no parameters are provided, returns the last 20 blocks * - The response includes block metadata but not full block data * - Heights must be valid: minHeight <= maxHeight and both > 0 */ getBlockchain(minHeight?: number, maxHeight?: number): Promise; /** * Get block header by height * @param {number} [height] - Optional block height. If not provided, returns the latest header * @returns {Promise} The block header containing metadata like chain ID, height, time, and various hashes */ getHeader(height?: number): Promise; /** * Get block header by hash * @param {string} hash - The block hash in hexadecimal format (case-insensitive) * @returns {Promise} The block header containing metadata like chain ID, height, time, and various hashes * @throws {Error} If the hash is invalid or block not found */ getHeaderByHash(hash: string): Promise; getCommit(height?: number): Promise; getTx(hash: string, prove?: boolean): Promise; searchTxs(params: TxSearchParams): Promise; checkTx(tx: string): Promise; getUnconfirmedTxs(limit?: number): Promise; getNumUnconfirmedTxs(): Promise; broadcastTxSync(params: BroadcastTxParams): Promise; broadcastTxAsync(params: BroadcastTxParams): Promise; broadcastTxCommit(params: BroadcastTxParams): Promise; /** * Get validators at a specific height with optional pagination * @param height - Block height to query validators at (optional, defaults to latest) * @param page - Page number for pagination (optional) * @param perPage - Number of validators per page (optional) * @returns Promise resolving to validator set with block height, validators array, count and total */ getValidators(height?: number, page?: number, perPage?: number): Promise; getConsensusParams(height?: number): Promise; getConsensusState(): Promise; dumpConsensusState(): Promise; getGenesis(): Promise; getGenesisChunked(chunk: number): Promise; queryAbci(params: AbciQueryParams): Promise; /** * Rpc interface method for helper functions * @param service - The service name (e.g., "cosmos.auth.v1beta1.Query") * @param method - The method name (e.g., "Accounts" or "Account") * @param data - The encoded request data as Uint8Array * @returns Promise resolving to the response data as Uint8Array */ request(service: string, method: string, data: Uint8Array): Promise; getBaseAccount(address: string, opts?: { readonly pubkeyDecoders?: PubkeyDecoderMap; encodePublicKey?: (publicKey: Uint8Array) => EncodedMessage; }): Promise; getProtocolInfo(): ProtocolInfo; }