关于 mempool-watch
mempool-watch 是一款命令行技能,通过 mempool.space 公共 API 查询 Bitcoin 交易、地址历史和实时内存池统计,适合无需认证或钱包即可跟踪主网或测试网链上活动的用户。
主要功能
- 01查询交易确认状态
- 02获取地址交易历史
- 03查看内存池积压与费用统计
- 04支持主网和测试网
适用场景
- 01确认交易是否已确认
- 02查看地址近期交易
- 03检查内存池积压和建议费用
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ aibtcdev/ skills --skill mempool-watch安装后在 Claude Code 中输入/mempool-watch确认已加载。
附带文件AGENT.mdmempool-watch.ts
详细介绍
Mempool 监控技能
使用 mempool.space 公共 API 监控 Bitcoin 内存池并跟踪链上活动(无需身份验证)。支持主网和测试网。
用法
bun run mempool-watch/mempool-watch.ts <subcommand> [options]
子命令
tx-status
检查 Bitcoin 交易的确认状态。
bun run mempool-watch/mempool-watch.ts tx-status --txid <txid>
选项:
--txid(必需)— 要查询的 Bitcoin 交易 ID
输出:
{
"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..."
}
如果尚未确认:
{
"txid": "abc123...",
"network": "mainnet",
"confirmed": false,
"blockHeight": null,
"blockHash": null,
"blockTime": null,
"confirmations": 0,
"explorerUrl": "https://mempool.space/tx/abc123..."
}
address-history
获取 Bitcoin 地址的交易历史记录。
bun run mempool-watch/mempool-watch.ts address-history --address <addr> [--limit <n>]
选项:
--address(必需)— 要查询的 Bitcoin 地址--limit(可选)— 返回的最大交易数量(默认值:10,最大值:25)
输出:
{
"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
获取当前 Bitcoin 内存池统计信息,包括待处理交易数量、积压大小和费用直方图。
bun run mempool-watch/mempool-watch.ts mempool-stats
输出:
{
"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]]
}
注意事项
- 所有子命令都使用 mempool.space 公共 API,无需身份验证或钱包
- 默认使用测试网,除非设置了
NETWORK=mainnet tx-status中的confirmations根据当前区块高度减去交易所在区块的高度估算address-history会优先返回最新交易;mempool.space 通过after_txid分页,此处未提供该参数。请使用--limit控制结果数量
评论
支持 Markdown