fix update

This commit is contained in:
2026-02-03 00:10:43 +08:00
parent 79c1c710a2
commit 8965b96f0e
3 changed files with 102 additions and 15 deletions

View File

@@ -12,8 +12,25 @@ TRON USDT TRC20 收款监听服务 - 基于交易记录扫描 + 区块确认数
## API 使用方式
```go
// 创建监听器
uman := usdtman.NewUSDTMan([]string{"地址1", "地址2"}, "API_KEY")
// 创建监听器(配置对象方式)
uman := usdtman.NewUSDTMan(usdtman.Config{
Addresses: []string{"地址1", "地址2"},
APIKey: "YOUR_API_KEY",
QueryInterval: 5 * time.Second, // 查询间隔(可选,默认 5 秒)
MinConfirmations: 6, // 最小确认数(可选,默认 6
MaxHistoryTxns: 20, // 查询历史交易数(可选,默认 20
ProxyURL: "http://127.0.0.1:7890", // HTTP/SOCKS5 代理(可选)
})
// 或者使用自定义 Transport
uman := usdtman.NewUSDTMan(usdtman.Config{
Addresses: []string{"地址1"},
APIKey: "YOUR_API_KEY",
Transport: &http.Transport{
Proxy: http.ProxyURL(proxyURL),
// 其他自定义配置...
},
})
// 设置收款回调
uman.OnPaymentComplete(func(payment *usdtman.USDTPayment) {
@@ -25,6 +42,10 @@ uman.Start()
// 停止监听
uman.Stop()
// 动态添加/移除地址
uman.AddAddress("新地址")
uman.RemoveAddress("旧地址")
```
## 运行