Providers
Mempool
mempool.space for Bitcoin. litecoinspace.org for Litecoin. peppool.space for Pepecoin. Fees in sat/vB. Unspent outputs. OP_RETURN decoded. No key.
Provider
Mempool
- bitcoin
- litecoin
- pepecoin
- Chains
- 3
- Auth
- none
- Operations
- 7 of 10
served 7 / 10
Operations
- balance
getBalanceserved - history
getTxHistoryserved - tx detail
getTxDetailserved - utxos
getUtxosserved - pubkey
getPubkeyserved - contract
getContractInfoabsent - tokens
getTokenBalancesabsent - transfers
getTokenTransfersabsent - gas
getGasDataserved - block
getBlockInfoserved
Access
- Create
create("mempool") - Import
@agntn/explorers/providers/mempool - Host
mempool.space - Statusproviders on the docs worker
Address it
import { Mempool } from "@agntn/explorers/providers/mempool";
const mempool = new Mempool();
const history = await mempool.getTxHistory("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa", "bitcoin");
history[0]?.opReturn; // [{ hex, text? }] when the transaction carries one
const utxos = await mempool.getUtxos("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa", "bitcoin");
const reveal = await mempool.getPubkey("1XPTgDRhN8RFnzniWCddobD9iKZatrvH4", "bitcoin");
Default chain Bitcoin. Litecoin goes to litecoinspace.org and Pepecoin to peppool.space, the same Esplora API on three hosts.
What it reads
/api/address/:address for the balance with funded and spent totals and the mempool delta, /api/address/:address/txs for history, /api/address/:address/utxo for the unspent outputs, /api/tx/:hash for one transaction, /api/v1/fees/recommended for fees, and /api/blocks/:height for a block, which answers a page of blocks the provider searches for the exact height. getPubkey needs nothing new. It reads the balance route and the history again.
Gotchas
- Gas and blocks work on Bitcoin and Litecoin only. Peppool has no fee endpoint and doesn't return complete block metadata, so on Pepecoin those two throw
UnsupportedOperationErroreven though the provider advertises them elsewhere. Capabilities are per provider, not per chain, and this is the one place it shows. - Peppool paginates confirmed history with
?after_txid=, not Esplora's/txs/chain/:txidroute, and the provider knows which host it's talking to. - Peppool allows 15 requests a minute. Go over and the 429 asks you to come back in about a minute. So
getPubkeyreads 250 rows on Pepecoin, not 1000. An older key comes back asnullwithspent: true. Better than a wait of a few minutes, right? balanceis the confirmed amount. What's sitting in the mempool goes tounconfirmedas a signed delta, so a balance never moves backwards on you when a transaction drops out./utxohas a ceiling. mempool.space answers 400 past 500 unspent outputs, and the library passes that on as anHTTPError, so the genesis address is exactly the one you can't list. Blockstream draws the same line.- OP_RETURN pushes are decoded from every output.
hexis always there;textonly when the bytes are printable UTF-8, so Runes and Omni carriers never become mojibake. getTxDetailreads Ordinals inscriptions from the input witnesses. A body past 4096 bytes comes back as its size alone. Transactions says why.- Fee units are
sat/vBon Bitcoin andlitoshi/vBon Litecoin, and the unit is in the answer.
Where it lives
src/providers/mempool.ts, with the shared Esplora mapping in src/core/esplora.ts.