import type { Message, PartialMessage } from '@bufbuild/protobuf'; import type { CosmosTxV1beta1TxRaw as TxRaw } from '../../protobufs/index.js'; type QueryService, U extends Message> = { typeName: string; method: string; Request: new (msg: PartialMessage) => T; Response: { fromBinary: (bytes: Uint8Array) => U; }; }; /** * Wraps the request message with an optional `height` field. */ type RequestMessage> = T extends { height: bigint | string | number; } ? PartialMessage : PartialMessage & { /** * The block height at which the query should be executed. Providing a height * that is outside the range of the full node will result in an error. Leave * this field empty to default to the latest block. */ height?: number | undefined; }; export declare class RpcClient { private static doRequest; /** * Posts an ABCI query to the RPC `endpoint`. If successful, returns the response, * otherwise throws an error. */ static query, U extends Message>(endpoint: string, { typeName, method, Request, Response }: QueryService, requestMsg: RequestMessage): Promise; /** * Posts a `broadcast_tx_sync` request to the RPC `endpoint`. If successful, * returns the tx hash, otherwise throws an error. */ static broadcastTx(endpoint: string, txRaw: TxRaw): Promise; /** * Creates a new ABCI batch query. */ static newBatchQuery(endpoint: string): BatchQuery; } declare class BatchQuery { private readonly endpoint; private readonly queries; constructor(endpoint: string); /** * Adds an `abci_query` to this query batch. * * @param callback An error-first callback function for the response of the query. * If `err` is not `null`, `response` will be `null` and should not be used. */ add, U extends Message>(queryService: QueryService, requestMsg: RequestMessage, callback: (err: Error | null, response: U) => unknown): this; /** * Executes the batched query. */ send(): Promise; } export {}; //# sourceMappingURL=RpcClient.d.ts.map