区块链监控
CatFee 区块链监控服务可以帮助用户实时获取区块链数据的变化,如交易、余额、区块等。 🔗 该服务基于 CatFee 区块链网络,提供了多种接口和工具,支持BTC,ETH,TRON链,专业级监控服务,方便用户进行区块链数据的查询和分析。
Last updated
{
"txn_hash": "0x1a2b3c4d5e...", // 交易哈希
"block_id": 123456789, // 区块编号
"name","我的钱包", // 地址昵称
"address": "T123456...", // 监测地址
"from_address": "T123456...", // 付款地址
"to_address": "T654321...", // 收款地址
"contract_address": "T888888...", // 合约地址
"amount": 1000000, // 原始金额
"decimals": 6, // 金额精度
"currency": "USDT", // 币种
"chain": "TRON", // 公链
"paid_at": 1684789012 // 交易时间戳
}"success"const express = require('express');
const app = express();
app.use(express.json());
app.post('/webhook', async (req, res) => {
try {
const notification = req.body;
// 使用 chain+txn_hash 作为主键防重
const key = `${notification.chain}-${notification.txn_hash}`;
// 异步处理业务逻辑
process.nextTick(() => {
processNotification(notification);
});
// 立即返回成功响应
res.send('success');
} catch (error) {
console.error('处理通知失败:', error);
res.status(500).send('error');
}
});
app.listen(3000, () => {
console.log('Webhook 服务已启动');
});