fix update
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
"sync"
|
||||
"time"
|
||||
"usdtman"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
@@ -34,8 +35,24 @@ func main() {
|
||||
apiKey = "da1e77dc-b35b-4458-846a-5a551b9df4b2"
|
||||
}
|
||||
|
||||
// 初始化 USDTMan (无初始地址)
|
||||
uman = usdtman.NewUSDTMan([]string{}, apiKey)
|
||||
// 初始化 USDTMan
|
||||
proxyURL := os.Getenv("PROXY_URL") // 例如: http://127.0.0.1:7890
|
||||
|
||||
config := usdtman.Config{
|
||||
Addresses: []string{}, // 初始无地址,可通过 API 添加
|
||||
APIKey: apiKey,
|
||||
QueryInterval: 5 * time.Second, // 每 5 秒查询一次
|
||||
MinConfirmations: 6, // 6 个确认
|
||||
MaxHistoryTxns: 20, // 每次查询最多 20 条历史交易
|
||||
}
|
||||
|
||||
// 如果设置了代理
|
||||
if proxyURL != "" {
|
||||
config.ProxyURL = proxyURL
|
||||
log.Printf("✅ 使用代理: %s", proxyURL)
|
||||
}
|
||||
|
||||
uman = usdtman.NewUSDTMan(config)
|
||||
|
||||
// 设置收款回调
|
||||
uman.OnPaymentComplete(func(payment *usdtman.USDTPayment) {
|
||||
|
||||
Reference in New Issue
Block a user