mempool-watch
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMempool Watch Skill
Mempool Watch 工具
Monitor the Bitcoin mempool and track on-chain activity using the mempool.space public API (no authentication required). Works on both mainnet and testnet.
通过mempool.space公开API监控比特币内存池并追踪链上活动(无需身份验证),支持主网(mainnet)和测试网(testnet)。
Usage
使用方法
bun run mempool-watch/mempool-watch.ts <subcommand> [options]bun run mempool-watch/mempool-watch.ts <subcommand> [options]Subcommands
子命令
tx-status
tx-status
Check the confirmation status of a Bitcoin transaction.
bun run mempool-watch/mempool-watch.ts tx-status --txid <txid>Options:
- (required) — Bitcoin transaction ID to look up
--txid
Output:
json
{
"txid": "abc123...",
"network": "mainnet",
"confirmed": true,
"blockHeight": 880000,
"blockHash": "000000...",
"blockTime": "2026-01-01T00:00:00.000Z",
"confirmations": 42,
"explorerUrl": "https://mempool.space/tx/abc123..."
}If unconfirmed:
json
{
"txid": "abc123...",
"network": "mainnet",
"confirmed": false,
"blockHeight": null,
"blockHash": null,
"blockTime": null,
"confirmations": 0,
"explorerUrl": "https://mempool.space/tx/abc123..."
}查询比特币交易的确认状态。
bun run mempool-watch/mempool-watch.ts tx-status --txid <txid>选项:
- (必填) — 要查询的比特币交易ID
--txid
输出:
json
{
"txid": "abc123...",
"network": "mainnet",
"confirmed": true,
"blockHeight": 880000,
"blockHash": "000000...",
"blockTime": "2026-01-01T00:00:00.000Z",
"confirmations": 42,
"explorerUrl": "https://mempool.space/tx/abc123..."
}若交易未确认:
json
{
"txid": "abc123...",
"network": "mainnet",
"confirmed": false,
"blockHeight": null,
"blockHash": null,
"blockTime": null,
"confirmations": 0,
"explorerUrl": "https://mempool.space/tx/abc123..."
}address-history
address-history
Retrieve the transaction history for a Bitcoin address.
bun run mempool-watch/mempool-watch.ts address-history --address <addr> [--limit <n>]Options:
- (required) — Bitcoin address to look up
--address - (optional) — Maximum number of transactions to return (default: 10, max: 25)
--limit
Output:
json
{
"address": "bc1q...",
"network": "mainnet",
"count": 3,
"transactions": [
{
"txid": "abc123...",
"confirmed": true,
"blockHeight": 880000,
"blockTime": "2026-01-01T00:00:00.000Z",
"fee": 1200,
"valueIn": 500000,
"valueOut": 498800,
"explorerUrl": "https://mempool.space/tx/abc123..."
}
],
"explorerUrl": "https://mempool.space/address/bc1q..."
}获取比特币地址的交易历史。
bun run mempool-watch/mempool-watch.ts address-history --address <addr> [--limit <n>]选项:
- (必填) — 要查询的比特币地址
--address - (可选) — 返回的最大交易数量(默认:10,上限:25)
--limit
输出:
json
{
"address": "bc1q...",
"network": "mainnet",
"count": 3,
"transactions": [
{
"txid": "abc123...",
"confirmed": true,
"blockHeight": 880000,
"blockTime": "2026-01-01T00:00:00.000Z",
"fee": 1200,
"valueIn": 500000,
"valueOut": 498800,
"explorerUrl": "https://mempool.space/tx/abc123..."
}
],
"explorerUrl": "https://mempool.space/address/bc1q..."
}mempool-stats
mempool-stats
Get current Bitcoin mempool statistics including pending transaction count, backlog size, and fee histogram.
bun run mempool-watch/mempool-watch.ts mempool-statsOutput:
json
{
"network": "mainnet",
"pendingTransactions": 12400,
"pendingVsize": 8500000,
"totalFees": 120000000,
"recommendedFees": {
"fast": { "satPerVb": 15, "target": "~10 minutes (next block)" },
"medium": { "satPerVb": 8, "target": "~30 minutes" },
"slow": { "satPerVb": 3, "target": "~1 hour" },
"economy": { "satPerVb": 1, "target": "~24 hours" }
},
"feeHistogram": [[15, 200000], [8, 500000], [3, 1000000]]
}获取当前比特币内存池的统计数据,包括未确认交易数量、待处理队列大小以及手续费直方图。
bun run mempool-watch/mempool-watch.ts mempool-stats输出:
json
{
"network": "mainnet",
"pendingTransactions": 12400,
"pendingVsize": 8500000,
"totalFees": 120000000,
"recommendedFees": {
"fast": { "satPerVb": 15, "target": "~10 minutes (next block)" },
"medium": { "satPerVb": 8, "target": "~30 minutes" },
"slow": { "satPerVb": 3, "target": "~1 hour" },
"economy": { "satPerVb": 1, "target": "~24 hours" }
},
"feeHistogram": [[15, 200000], [8, 500000], [3, 1000000]]
}Notes
注意事项
- All subcommands use the public mempool.space API — no authentication or wallet required
- Defaults to testnet unless is set
NETWORK=mainnet - in
confirmationsis estimated from current block height minus the transaction's block heighttx-status - returns the most recent transactions first; mempool.space paginates via
address-historywhich is not exposed here — useafter_txidto control result size--limit
- 所有子命令均使用mempool.space公开API——无需身份验证或钱包
- 默认使用测试网,除非设置环境变量
NETWORK=mainnet - 中的
tx-status(确认数)由当前区块高度减去交易所在区块高度估算得出confirmations - 按交易时间倒序返回最新交易;mempool.space通过
address-history实现分页,但本工具未暴露该参数——使用after_txid控制结果数量--limit