import type { RestConfig } from '../../types.js'; import type { HttpRequest } from '../http.js'; /** * Sans-I/O Esplora REST API protocol. * * Every method returns an {@link HttpRequest} descriptor (a plain object * describing *what* to request) without performing any I/O. The caller * is responsible for executing the request with an HTTP client of their * choice and deserializing the response. * * This mirrors the pattern used by the Rust `esploda` crate where * `Esplora` methods return `http::Request<()>` objects. * * @example * ```ts * const protocol = new EsploraProtocol({ host: 'https://mempool.space/api' }); * * // Build a request descriptor (no I/O) * const req = protocol.getTx('abc123...'); * * // Execute with any HTTP client * const res = await fetch(req.url, req); * const tx: RawTransactionRest = await res.json(); * ``` */ export declare class EsploraProtocol { private readonly baseUrl; private readonly defaultHeaders; constructor(config: RestConfig); private static assertHex64; private static assertAddress; private get; private post; /** GET /tx/:txid */ getTx(txid: string): HttpRequest; /** GET /tx/:txid/hex */ getTxHex(txid: string): HttpRequest; /** GET /tx/:txid/raw */ getTxRaw(txid: string): HttpRequest; /** POST /tx */ postTx(hex: string): HttpRequest; /** GET /blocks/tip/height */ getBlockTipHeight(): HttpRequest; /** GET /block/:blockhash */ getBlock(blockhash: string): HttpRequest; /** GET /block-height/:height */ getBlockHeight(height: number): HttpRequest; /** GET /address/:address/txs */ getAddressTxs(address: string): HttpRequest; /** GET /address/:address/txs/mempool */ getAddressTxsMempool(address: string): HttpRequest; /** GET /address/:address/txs/chain[/:last_seen_txid] */ getAddressTxsChain(address: string, lastSeenTxId?: string): HttpRequest; /** GET /address/:address */ getAddressInfo(address: string): HttpRequest; /** GET /address/:address/utxo */ getAddressUtxos(address: string): HttpRequest; } //# sourceMappingURL=protocol.d.ts.map