Skip to content
docs

EsploraClient

Defined in: wallet-btc/src/esplora.ts:19

Esplora REST transport — the API served by mempool.space (https://mempool.space/api) and Blockstream (https://blockstream.info/api). Public instances exist, so it is the natural fallback behind a self-hosted Blockbook.

Balance semantics: unconfirmedOutgoing is the mempool net outflow (spent − funded, clamped at 0), a conservative stand-in for Bitcoin Core’s trusted-change rule that Blockbook’s richer address record allows.

new EsploraClient(config, fetchFn?, timeoutMs?): EsploraClient

Defined in: wallet-btc/src/esplora.ts:24

string

{(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

number = DEFAULT_TIMEOUT_MS

EsploraClient

broadcast(rawTx): Promise<string>

Defined in: wallet-btc/src/esplora.ts:108

Broadcast raw hex; returns the txid.

string

Promise<string>

BtcClient.broadcast


close(): Promise<void>

Defined in: wallet-btc/src/esplora.ts:32

Promise<void>

BtcClient.close


connect(): Promise<void>

Defined in: wallet-btc/src/esplora.ts:31

Promise<void>

BtcClient.connect


estimateFee(blocks): Promise<number>

Defined in: wallet-btc/src/esplora.ts:115

/fee-estimates → { “1”: sat/vB, “2”: …, “25”: …, “144”: … }; picks the nearest target ≥ blocks.

number

Promise<number>

BtcClient.estimateFee


getBalance(address): Promise<{ confirmed: bigint; unconfirmed: bigint; unconfirmedOutgoing: bigint; }>

Defined in: wallet-btc/src/esplora.ts:58

string

Promise<{ confirmed: bigint; unconfirmed: bigint; unconfirmedOutgoing: bigint; }>

BtcClient.getBalance


getBlockHeight(): Promise<number>

Defined in: wallet-btc/src/esplora.ts:124

Current chain tip height (anti-fee-sniping locktime). Optional.

Promise<number>

BtcClient.getBlockHeight


getHistory(address): Promise<object[]>

Defined in: wallet-btc/src/esplora.ts:74

Esplora pages 25 (mempool.space: up to 50) txs per call; walk /txs/chain/<last> until a short page.

string

Promise<object[]>

BtcClient.getHistory


getTransaction(txid): Promise<string>

Defined in: wallet-btc/src/esplora.ts:102

Raw transaction hex.

string

Promise<string>

BtcClient.getTransaction


getTransactionInfo(txid): Promise<BlockbookTx | undefined>

Defined in: wallet-btc/src/esplora.ts:89

Full tx record (used for receipts).

string

Promise<BlockbookTx | undefined>

BtcClient.getTransactionInfo


listUnspent(address): Promise<Utxo[]>

Defined in: wallet-btc/src/esplora.ts:67

string

Promise<Utxo[]>

BtcClient.listUnspent