Optionalopts: { forcePolling?: boolean; pollingInterval?: number }OptionalforcePolling?: booleanForce polling even when websocket transport is available.
OptionalpollingInterval?: numberPolling interval in milliseconds.
Fetch the current chain tip.
Current chain height, median-time-past, and block hash
time is the tip's median-time-past, not the header's own nTime.
BIP-113 evaluates seconds-typed OP_CHECKLOCKTIMEVERIFY /
OP_CHECKSEQUENCEVERIFY against MTP, which lags the tip by roughly an
hour; the header time may sit two hours ahead of it. An implementation
returning the header time calls a timelock mature before the network
does — surfacing as a broadcast the node rejects, not as a bug here.
Fetch spendable onchain outputs for an address.
Bitcoin address to query
Spendable onchain outputs for the address
Fetch the raw wire-format bytes of a transaction.
Transaction id to fetch
Serialized transaction bytes
Fetch transactions associated with an address.
Bitcoin address to query
Transactions involving the address
Fetch outspend information for every output in a transaction.
Transaction id to inspect
Per-output spend status information. txid (the spender) may be
absent even when spent is true: some Esplora deployments
(e.g. mempool.arkade.sh) omit it from /outspends.
Watch a set of addresses over the explorer's WebSocket, degrading to HTTP polling whenever the socket is unavailable and returning to the socket as soon as it can be re-established.
Concurrent calls covering the same address set share one transport. The returned function releases this subscription only; the transport is torn down when the last subscriber releases it. Calling it more than once is a no-op.
Addresses to monitor; order is not significant
Invoked with transactions seen after the watch started
A function releasing this subscription
The HTTP fallback fetches full address history per address per cycle, which is dramatically more expensive than the socket — so callers should release watches they no longer need rather than relying on sharing.
waitForIncomingFunds for the cancellation-aware wallet-level helper
Implementation of the onchain provider interface for esplora REST API.
See
https://mempool.space/docs/api/rest
Example