import type { BlockResponse, ChainInfo, CreateRawTxInputs, CreateRawTxOutputs, DerivedAddresses, GetBlockParams, ListTransactionsParams, ListTransactionsResult, RawTransactionResponse, RawTransactionV2, RpcConfig, SignedRawTx, UnspentTxInfo, VerbosityLevel, WalletTransaction } from '../../types.js'; import type { HttpExecutor } from '../http.js'; import type { BitcoinRpcClient } from './interface.js'; import { JsonRpcTransport } from './json-rpc.js'; /** * Maps Bitcoin Core JSON-RPC method names to their parameter and return types. * Used by `BitcoinCoreRpcClient.executeRpc` for compile-time safety. */ export interface RpcMethodMap { getbestblockhash: { params: []; result: string; }; getblock: { params: [string, number?]; result: BlockResponse; }; getblockchaininfo: { params: []; result: ChainInfo; }; getblockcount: { params: []; result: number; }; getblockhash: { params: [number]; result: string; }; getbalance: { params: []; result: number; }; getnewaddress: { params: [string?, string?]; result: string; }; gettransaction: { params: [string, boolean?]; result: WalletTransaction; }; getrawtransaction: { params: [string, number?, string?]; result: RawTransactionResponse; }; createrawtransaction: { params: [CreateRawTxInputs[], CreateRawTxOutputs[], number?, boolean?]; result: string; }; signrawtransactionwithwallet: { params: [string]; result: SignedRawTx; }; sendrawtransaction: { params: [string, (number | string)?, (number | string)?]; result: string; }; listtransactions: { params: [string?, number?, number?, boolean?]; result: ListTransactionsResult; }; listunspent: { params: [number?, number?, string[]?, boolean?]; result: UnspentTxInfo[]; }; sendtoaddress: { params: [string, number]; result: string; }; signmessage: { params: [string, string]; result: string; }; verifymessage: { params: [string, string, string]; result: boolean; }; deriveaddresses: { params: [string, number[]?]; result: DerivedAddresses[]; }; generatetoaddress: { params: [number, string]; result: string[]; }; } /** Method names that have typed definitions in {@link RpcMethodMap}. */ export type TypedRpcMethod = keyof RpcMethodMap; /** * Bitcoin Core RPC client. * @implements {BitcoinRpcClient} */ export declare class BitcoinCoreRpcClient implements BitcoinRpcClient { #private; constructor(config: RpcConfig, executor?: HttpExecutor); get config(): RpcConfig; get client(): JsonRpcTransport; /** * Executes a typed JSON-RPC command on the bitcoind node. */ private executeRpc; /** * Returns the block data associated with a `blockhash` of a valid block. */ getBlock({ blockhash, height, verbosity }: GetBlockParams): Promise; /** Returns the blockheight of the most-work fully-validated chain. */ getBlockCount(): Promise; /** Returns the blockhash of the block at the given height. */ getBlockHash(height: number): Promise; /** Returns various blockchain state info. */ getBlockchainInfo(): Promise; /** Sign inputs for raw transaction (serialized, hex-encoded). */ signRawTransaction(hexstring: string): Promise; /** Submit a raw transaction (serialized, hex-encoded) to local node and network. */ sendRawTransaction(hexstring: string, maxfeerate?: number | string, maxBurnAmount?: number | string): Promise; /** Signs and sends a raw transaction. */ signAndSendRawTransaction(hexstring: string): Promise; /** Creates, signs, and sends a raw transaction. */ createSignSendRawTransaction(inputs: CreateRawTxInputs[], outputs: CreateRawTxOutputs[]): Promise; /** Returns up to 'count' most recent transactions. */ listTransactions(params: ListTransactionsParams): Promise; /** Create a transaction spending the given inputs and creating new outputs. */ createRawTransaction(inputs: CreateRawTxInputs[], outputs: CreateRawTxOutputs[], locktime?: number, replacable?: boolean): Promise; /** Derives one or more addresses corresponding to an output descriptor. */ deriveAddresses(descriptor: string, range?: Array): Promise>; /** Mines blocks to a given address (regtest/signet only). Returns array of block hashes. */ generateToAddress(nblocks: number, address: string): Promise; /** Returns the total available balance. */ getBalance(): Promise; /** Returns a new Bitcoin address for receiving payments. */ getNewAddress(addressType: string, label?: string): Promise; /** Returns array of unspent transaction outputs. */ listUnspent(params: { minconf?: number; maxconf?: number; address?: string[]; include_unsafe?: boolean; }): Promise; /** Send an amount to a given address. */ sendToAddress(address: string, amount: number): Promise; /** Sign a message with the private key of an address. */ signMessage(address: string, message: string): Promise; /** Verify a signed message. */ verifyMessage(address: string, signature: string, message: string): Promise; /** Get detailed information about in-wallet transaction. */ getTransaction(txid: string, include_watchonly?: boolean): Promise; /** Get detailed information about a transaction. */ getRawTransaction(txid: string, verbosity?: VerbosityLevel, blockhash?: string): Promise; /** Get detailed information about multiple transactions using JSON-RPC batching. */ getRawTransactions(txids: string[], verbosity?: VerbosityLevel): Promise; } //# sourceMappingURL=index.d.ts.map