Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3fed51cb37 | ||
|
|
24f216dbaf | ||
|
|
919fc62ec4 | ||
|
|
00941770ba | ||
|
|
931a797ca0 | ||
|
|
bd513bfafe | ||
|
|
2100d2ccd5 | ||
|
|
b0e49ca2a1 | ||
|
|
e3066bd41b | ||
|
|
1ff10ce523 | ||
|
|
bd2e448008 | ||
|
|
58d6db9cee | ||
|
|
5e49e2e830 | ||
|
|
5abb5acc79 | ||
|
|
d8b1a78f6f | ||
|
|
b7d3c04e4e | ||
|
|
7ceefd2dcd | ||
|
|
7c61a1321c | ||
|
|
428150bccd | ||
|
|
42ac2205cd | ||
|
|
1daf44a0dd | ||
|
|
83b3b3a47e | ||
|
|
889875bee2 | ||
|
|
1c4edab5c7 |
@@ -34,6 +34,7 @@ changelog:
|
||||
exclude:
|
||||
- "^docs:"
|
||||
- "^test:"
|
||||
- "^chore:"
|
||||
release:
|
||||
footer: >-
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
### 🌟 目前支持收款类型
|
||||
|
||||
🔥 主流网络:TRON(`trx` `usdt.trc20`) Ethereum(`usdt.erc20`) BSC(`usdt.bep20`)
|
||||
⚡ 其他网络:Polygon(`usdt.polygon`) X-Layer(`usdt.xlayer`) Solana(`usdt.solana`) Aptos(`usdt.aptos`)
|
||||
⚡ 其他网络:Polygon(`usdt.polygon`) X-Layer(`usdt.xlayer`) Solana(`usdt.solana`) Aptos(`usdt.aptos`) Arbitrum-One(`usdt.arbitrum`)
|
||||
|
||||
- ✅ 完全兼容 `Epusdt`,插件可无缝替换
|
||||
- ✅ 实时同步 USDT 汇率,支持自定义浮动
|
||||
@@ -39,13 +39,15 @@
|
||||
- ✅ 支持创建订单时 自定义超时 钱包地址
|
||||
- ✅ 完整支持`等待支付 支付超时`回调
|
||||
- ✅ 支持事件`WebHook` 方便多方协同
|
||||
- 🏖️ 增加稳定币`USDC`支付交易 待实现
|
||||
- 🏖️ 摆脱TG依赖 完整WEB后台管理 待实现
|
||||
|
||||
## 🚀 安装部署
|
||||
|
||||
- 安装:[Docker](./docs/docker.md)・[Linux](./docs/systemd.md)・1Panel・宝塔
|
||||
- 对接:[独角数卡](./docs/dujiaoka.md)・[异次元](./docs/acg-faka.md)・[萌次元](./docs/mcy-shop.md)・[彩虹易支付](https://github.com/v03413/Epay-BEpusdt)
|
||||
- 安装:[Docker](./docs/docker.md)・[Linux](./docs/systemd.md)・[1Panel](./docs/1panel/README.md)・[宝塔](./docs/bt_panel/README.md)
|
||||
- 对接:[独角数卡](./docs/dujiaoka.md)・[异次元](./docs/acg-faka.md)・[萌次元](./docs/mcy-shop.md)・[彩虹易支付](https://github.com/v03413/Epay-BEpusdt)
|
||||
- 开发:[API对接](./docs/api.md)・[订单回调](./docs/notify-epusdt.md)・[Webhook 事件](./docs/webhook.md)
|
||||
- 其它:[https 配置](./docs/ssl.md)・[Linux 时钟同步](./docs/systemd-timesyncd.md)
|
||||
- 其它:[https 配置](./docs/ssl.md)・[时钟同步](./docs/systemd-timesyncd.md)・[模板修改](./docs/template/README.md)・[参数配置](./conf.example.toml)
|
||||
|
||||
## 🖼 功能截图
|
||||
|
||||
@@ -53,7 +55,7 @@
|
||||
|
||||
## 🤔 常见问题
|
||||
|
||||
### 如何获取参数 TG_BOT_ADMIN_ID
|
||||
### 如何获取参数 admin_id
|
||||
|
||||
Telegram 搜索加入群`@BEpusdtChat`,随后发送命令`/info`,返回的`ID`就是`TG_BOT_ADMIN_ID`
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import (
|
||||
"github.com/v03413/go-cache"
|
||||
"gorm.io/gorm"
|
||||
"io"
|
||||
"math/big"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
@@ -120,13 +121,19 @@ func cbAddressAction(ctx context.Context, b *bot.Bot, u *models.Update) {
|
||||
otherTextLabel = "🔴已禁用 非订单交易监控通知"
|
||||
}
|
||||
|
||||
var text = fmt.Sprintf("> %s", wa.Address)
|
||||
var text = fmt.Sprintf(">`%s`", wa.Address)
|
||||
if help.IsValidTronAddress(wa.Address) {
|
||||
text = getTronWalletInfo(wa.Address)
|
||||
}
|
||||
if help.IsValidEvmAddress(wa.Address) {
|
||||
text = getEvmWalletInfo(wa)
|
||||
}
|
||||
if help.IsValidAptosAddress(wa.Address) {
|
||||
text = getAptosWalletInfo(wa.Address)
|
||||
}
|
||||
if help.IsValidSolanaAddress(wa.Address) {
|
||||
text = getSolanaWalletInfo(wa.Address)
|
||||
}
|
||||
|
||||
EditMessageText(ctx, b, &bot.EditMessageTextParams{
|
||||
ChatID: u.CallbackQuery.Message.Message.Chat.ID,
|
||||
@@ -394,6 +401,74 @@ func getTronWalletInfo(address string) string {
|
||||
return text
|
||||
}
|
||||
|
||||
func getAptosWalletInfo(address string) string {
|
||||
var text = fmt.Sprintf(">`%s`", address)
|
||||
var client = http.Client{Timeout: time.Second * 5}
|
||||
resp, err := client.Get(fmt.Sprintf("%sv1/accounts/%s/balance/%s", conf.GetAptosRpcNode(), address, conf.UsdtAptos))
|
||||
if err != nil {
|
||||
log.Error("getAptosWalletInfo client.Get(url)", err)
|
||||
|
||||
return text
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
if resp.StatusCode != 200 {
|
||||
log.Error("getAptosWalletInfo resp.StatusCode != 200", resp.StatusCode, err)
|
||||
|
||||
return text
|
||||
}
|
||||
|
||||
all, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
log.Error("getAptosWalletInfo io.ReadAll(resp.Body)", err)
|
||||
|
||||
return text
|
||||
}
|
||||
|
||||
result, _ := new(big.Int).SetString(string(all), 10)
|
||||
balance := decimal.NewFromBigInt(result, conf.UsdtAptosDecimals)
|
||||
|
||||
return fmt.Sprintf(">💲余额:%s\\(%s\\)\n>☘️地址:`%s`", help.Ec(balance.String()), help.Ec(model.OrderTradeTypeUsdtAptos), address)
|
||||
}
|
||||
|
||||
func getSolanaWalletInfo(address string) string {
|
||||
var text = fmt.Sprintf(">`%s`", address)
|
||||
var jsonData = []byte(fmt.Sprintf(`{"jsonrpc":"2.0","id":1,"method":"getTokenAccountsByOwner","params":["%s",{"programId":"%s"},{"commitment":"finalized","encoding":"jsonParsed"}]}`,
|
||||
address, conf.SolSplToken))
|
||||
var client = &http.Client{Timeout: time.Second * 5}
|
||||
resp, err := client.Post(conf.GetSolanaRpcEndpoint(), "application/json", bytes.NewBuffer(jsonData))
|
||||
if err != nil {
|
||||
log.Warn("Error Post response:", err)
|
||||
|
||||
return text
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
if resp.StatusCode != 200 {
|
||||
log.Error("getAptosWalletInfo resp.StatusCode != 200", resp.StatusCode, err)
|
||||
|
||||
return text
|
||||
}
|
||||
|
||||
all, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
log.Error("getAptosWalletInfo io.ReadAll(resp.Body)", err)
|
||||
|
||||
return text
|
||||
}
|
||||
|
||||
for _, v := range gjson.GetBytes(all, "result.value").Array() {
|
||||
if v.Get("account.data.parsed.info.mint").String() == conf.UsdtSolana {
|
||||
return fmt.Sprintf(">💲余额:%s\\(%s\\)\n>☘️地址:`%s`",
|
||||
help.Ec(v.Get("account.data.parsed.info.tokenAmount.uiAmountString").String()),
|
||||
help.Ec(model.OrderTradeTypeUsdtAptos),
|
||||
address)
|
||||
}
|
||||
}
|
||||
|
||||
return text
|
||||
}
|
||||
|
||||
func getEvmWalletInfo(wa model.WalletAddress) string {
|
||||
|
||||
return fmt.Sprintf(">💲余额:%s\\(%s\\)\n>☘️地址:`%s`", help.Ec(evmUSDTBalanceOf(wa)), help.Ec(wa.TradeType), wa.Address)
|
||||
|
||||
@@ -73,100 +73,122 @@ func cmdStateHandle(ctx context.Context, b *bot.Bot, u *models.Update) {
|
||||
var rows []model.TradeOrders
|
||||
model.DB.Where("created_at > ?", time.Now().Format(time.DateOnly)).Find(&rows)
|
||||
var succ uint64
|
||||
var money, trx, uTrc20, uErc20, uBep20, uXlayer, uSolana, uPol, uAptos float64
|
||||
var money float64
|
||||
|
||||
var types []string
|
||||
model.DB.Model(&model.WalletAddress{}).Distinct("trade_type").Where("status = ?", model.StatusEnable).Pluck("trade_type", &types)
|
||||
|
||||
// 动态统计各类型金额
|
||||
typeAmounts := make(map[string]float64)
|
||||
for _, t := range types {
|
||||
typeAmounts[t] = 0
|
||||
}
|
||||
|
||||
for _, o := range rows {
|
||||
if o.Status != model.OrderStatusSuccess {
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
succ++
|
||||
money += o.Money
|
||||
|
||||
var amount = cast.ToFloat64(o.Amount)
|
||||
if o.TradeType == model.OrderTradeTypeTronTrx {
|
||||
trx += amount
|
||||
}
|
||||
if o.TradeType == model.OrderTradeTypeUsdtBep20 {
|
||||
uBep20 += amount
|
||||
}
|
||||
if o.TradeType == model.OrderTradeTypeUsdtTrc20 {
|
||||
uTrc20 += amount
|
||||
}
|
||||
if o.TradeType == model.OrderTradeTypeUsdtErc20 {
|
||||
uErc20 += amount
|
||||
}
|
||||
if o.TradeType == model.OrderTradeTypeUsdtPolygon {
|
||||
uPol += amount
|
||||
}
|
||||
if o.TradeType == model.OrderTradeTypeUsdtXlayer {
|
||||
uXlayer += amount
|
||||
}
|
||||
if o.TradeType == model.OrderTradeTypeUsdtSolana {
|
||||
uSolana += amount
|
||||
}
|
||||
if o.TradeType == model.OrderTradeTypeUsdtAptos {
|
||||
uAptos += amount
|
||||
// 只统计启用类型的金额
|
||||
if _, exists := typeAmounts[o.TradeType]; exists {
|
||||
typeAmounts[o.TradeType] += cast.ToFloat64(o.Amount)
|
||||
}
|
||||
}
|
||||
|
||||
var base = "```" + `
|
||||
🎁今日成功订单:%d
|
||||
💎今日总数订单:%d
|
||||
💰今日收款汇总
|
||||
- %.2f CNY
|
||||
- %.2f TRX
|
||||
- %.2f USDT.Trc20
|
||||
- %.2f USDT.Erc20
|
||||
- %.2f USDT.Bep20
|
||||
- %.2f USDT.Aptos
|
||||
- %.2f USDT.Xlayer
|
||||
- %.2f USDT.Solana
|
||||
- %.2f USDT.Polygon
|
||||
🌟扫块成功数据
|
||||
- Bsc %s
|
||||
- Tron %s
|
||||
- Aptos %s
|
||||
- Xlayer %s
|
||||
- Solana %s
|
||||
- Polygon %s
|
||||
- Ethereum %s
|
||||
-----------------------
|
||||
🪧基准汇率(TRX):%v
|
||||
🪧基准汇率(USDT):%v
|
||||
✅订单汇率(TRX):%v
|
||||
✅订单汇率(USDT):%v
|
||||
-----------------------
|
||||
` + "```" + `
|
||||
>基准汇率:来源于交易所的原始数据。
|
||||
>订单汇率:订单创建过程中实际使用的汇率。
|
||||
>扫块成功数据:如果该值过低,说明您的服务器与区块链网络连接不稳定,请尝试更换区块节点。
|
||||
`
|
||||
// 构建基础统计信息
|
||||
var text = "```\n"
|
||||
text += fmt.Sprintf("🎁今日成功订单:%d\n", succ)
|
||||
text += fmt.Sprintf("💎今日总数订单:%d\n", len(rows))
|
||||
text += "💰今日收款汇总\n"
|
||||
text += fmt.Sprintf(" - %.2f CNY\n", money)
|
||||
|
||||
var text = fmt.Sprintf(base,
|
||||
succ,
|
||||
len(rows),
|
||||
money,
|
||||
trx,
|
||||
uTrc20,
|
||||
uErc20,
|
||||
uBep20,
|
||||
uAptos,
|
||||
uXlayer,
|
||||
uSolana,
|
||||
uPol,
|
||||
conf.GetBlockSuccRate(conf.Bsc),
|
||||
conf.GetBlockSuccRate(conf.Tron),
|
||||
conf.GetBlockSuccRate(conf.Aptos),
|
||||
conf.GetBlockSuccRate(conf.Xlayer),
|
||||
conf.GetBlockSuccRate(conf.Solana),
|
||||
conf.GetBlockSuccRate(conf.Polygon),
|
||||
conf.GetBlockSuccRate(conf.Ethereum),
|
||||
cast.ToString(rate.GetOkxTrxRawRate()),
|
||||
cast.ToString(rate.GetOkxUsdtRawRate()),
|
||||
cast.ToString(rate.GetTrxCalcRate()),
|
||||
cast.ToString(rate.GetUsdtCalcRate()),
|
||||
)
|
||||
// 动态显示启用类型的收款汇总
|
||||
typeDisplayNames := map[string]string{
|
||||
model.OrderTradeTypeTronTrx: "TRX",
|
||||
model.OrderTradeTypeUsdtTrc20: "USDT.Trc20",
|
||||
model.OrderTradeTypeUsdtErc20: "USDT.Erc20",
|
||||
model.OrderTradeTypeUsdtBep20: "USDT.Bep20",
|
||||
model.OrderTradeTypeUsdtAptos: "USDT.Aptos",
|
||||
model.OrderTradeTypeUsdtXlayer: "USDT.Xlayer",
|
||||
model.OrderTradeTypeUsdtSolana: "USDT.Solana",
|
||||
model.OrderTradeTypeUsdtPolygon: "USDT.Polygon",
|
||||
model.OrderTradeTypeUsdtArbitrum: "USDT.Arbitrum",
|
||||
}
|
||||
|
||||
for _, t := range types {
|
||||
if displayName, exists := typeDisplayNames[t]; exists {
|
||||
text += fmt.Sprintf(" - %.2f %s\n", typeAmounts[t], displayName)
|
||||
}
|
||||
}
|
||||
|
||||
// 动态显示扫块成功数据
|
||||
text += "🌟扫块成功数据\n"
|
||||
blockchainMap := map[string]string{
|
||||
model.OrderTradeTypeUsdtBep20: conf.Bsc,
|
||||
model.OrderTradeTypeTronTrx: conf.Tron,
|
||||
model.OrderTradeTypeUsdtTrc20: conf.Tron,
|
||||
model.OrderTradeTypeUsdtAptos: conf.Aptos,
|
||||
model.OrderTradeTypeUsdtXlayer: conf.Xlayer,
|
||||
model.OrderTradeTypeUsdtSolana: conf.Solana,
|
||||
model.OrderTradeTypeUsdtPolygon: conf.Polygon,
|
||||
model.OrderTradeTypeUsdtArbitrum: conf.Arbitrum,
|
||||
model.OrderTradeTypeUsdtErc20: conf.Ethereum,
|
||||
}
|
||||
|
||||
blockchainNames := map[string]string{
|
||||
conf.Bsc: "Bsc",
|
||||
conf.Tron: "Tron",
|
||||
conf.Aptos: "Aptos",
|
||||
conf.Xlayer: "Xlayer",
|
||||
conf.Solana: "Solana",
|
||||
conf.Polygon: "Polygon",
|
||||
conf.Arbitrum: "Arbitrum",
|
||||
conf.Ethereum: "Ethereum",
|
||||
}
|
||||
|
||||
// 收集需要显示的区块链
|
||||
blockchainSet := make(map[string]bool)
|
||||
for _, t := range types {
|
||||
if blockchain, exists := blockchainMap[t]; exists {
|
||||
blockchainSet[blockchain] = true
|
||||
}
|
||||
}
|
||||
|
||||
// 将区块链转换为切片并按名字长度排序
|
||||
var blockchains []string
|
||||
for blockchain := range blockchainSet {
|
||||
blockchains = append(blockchains, blockchain)
|
||||
}
|
||||
|
||||
// 按区块链名字长度排序,名字越长排越后
|
||||
for i := 0; i < len(blockchains)-1; i++ {
|
||||
for j := 0; j < len(blockchains)-1-i; j++ {
|
||||
name1 := blockchainNames[blockchains[j]]
|
||||
name2 := blockchainNames[blockchains[j+1]]
|
||||
if len(name1) > len(name2) {
|
||||
blockchains[j], blockchains[j+1] = blockchains[j+1], blockchains[j]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 按排序后的顺序显示区块链数据
|
||||
for _, blockchain := range blockchains {
|
||||
text += fmt.Sprintf(" - %s %s\n", blockchainNames[blockchain], conf.GetBlockSuccRate(blockchain))
|
||||
}
|
||||
|
||||
text += "-----------------------\n"
|
||||
text += fmt.Sprintf("🪧基准汇率(TRX):%v\n", cast.ToString(rate.GetOkxTrxRawRate()))
|
||||
text += fmt.Sprintf("🪧基准汇率(USDT):%v\n", cast.ToString(rate.GetOkxUsdtRawRate()))
|
||||
text += fmt.Sprintf("✅订单汇率(TRX):%v\n", cast.ToString(rate.GetTrxCalcRate()))
|
||||
text += fmt.Sprintf("✅订单汇率(USDT):%v\n", cast.ToString(rate.GetUsdtCalcRate()))
|
||||
text += "-----------------------\n"
|
||||
text += "```\n"
|
||||
text += ">基准汇率:来源于交易所的原始数据。\n"
|
||||
text += ">订单汇率:订单创建过程中实际使用的汇率。\n"
|
||||
text += ">扫块成功数据:如果该值过低,说明您的服务器与区块链网络连接不稳定,请尝试更换区块节点。"
|
||||
|
||||
SendMessage(&bot.SendMessageParams{
|
||||
ChatID: u.Message.Chat.ID,
|
||||
|
||||
@@ -26,6 +26,7 @@ type Conf struct {
|
||||
Solana string `toml:"solana"`
|
||||
Xlayer string `toml:"xlayer"`
|
||||
Polygon string `toml:"polygon"`
|
||||
Arbitrum string `toml:"arbitrum"`
|
||||
Ethereum string `toml:"ethereum"`
|
||||
} `toml:"evm_rpc"`
|
||||
Bot struct {
|
||||
|
||||
@@ -11,34 +11,38 @@ const (
|
||||
defaultUsdtAtomicity = 0.01 // 原子精度
|
||||
defaultTrxAtomicity = 0.01
|
||||
|
||||
defaultTronGrpcNode = "18.141.79.38:50051" // 默认GRPC节点
|
||||
defaultBscRpcEndpoint = "https://bsc-dataseed.bnbchain.org/" // 默认BSC RPC节点
|
||||
defaultSolanaRpcEndpoint = "https://solana-rpc.publicnode.com/" // 默认Solana RPC节点 官方是 https://api.mainnet-beta.solana.com/ 但存在速率限制
|
||||
defaultXlayerRpcEndpoint = "https://xlayerrpc.okx.com/" // 默认Xlayer RPC节点
|
||||
defaultPolygonRpcEndpoint = "https://polygon-rpc.com/" // 默认Polygon RPC节点
|
||||
defaultEthereumRpcEndpoint = "https://ethereum.publicnode.com/" // 默认Ethereum RPC节点
|
||||
defaultAptosRpcEndpoint = "https://aptos-rest.publicnode.com/" // 默认Aptos RPC节点
|
||||
defaultOutputLog = "/var/log/bepusdt.log" // 默认日志输出文件
|
||||
defaultSqlitePath = "/var/lib/bepusdt/sqlite.db" // 默认数据库文件
|
||||
defaultTronGrpcNode = "18.141.79.38:50051" // 默认GRPC节点
|
||||
defaultBscRpcEndpoint = "https://bsc-dataseed.bnbchain.org/" // 默认BSC RPC节点
|
||||
defaultSolanaRpcEndpoint = "https://solana-rpc.publicnode.com/" // 默认Solana RPC节点 官方是 https://api.mainnet-beta.solana.com/ 但存在速率限制
|
||||
defaultXlayerRpcEndpoint = "https://xlayerrpc.okx.com/" // 默认Xlayer RPC节点
|
||||
defaultPolygonRpcEndpoint = "https://polygon-bor-rpc.publicnode.com/" // 默认Polygon RPC节点 官方 https://polygon-rpc.com 存在速率限制
|
||||
defaultArbitrumRpcEndpoint = "https://arb1.arbitrum.io/rpc" // 默认Arbitrum One RPC节点
|
||||
defaultEthereumRpcEndpoint = "https://ethereum.publicnode.com/" // 默认Ethereum RPC节点
|
||||
defaultAptosRpcEndpoint = "https://aptos-rest.publicnode.com/" // 默认Aptos RPC节点
|
||||
defaultOutputLog = "/var/log/bepusdt.log" // 默认日志输出文件
|
||||
defaultSqlitePath = "/var/lib/bepusdt/sqlite.db" // 默认数据库文件
|
||||
)
|
||||
|
||||
const (
|
||||
UsdtErc20 = "0xdac17f958d2ee523a2206206994597c13d831ec7" // Eth USDT合约地址
|
||||
UsdtBep20 = "0x55d398326f99059ff775485246999027b3197955" // BSC USDT合约地址
|
||||
UsdtXlayer = "0x1e4a5963abfd975d8c9021ce480b42188849d41d" // Xlayer USDT合约地址
|
||||
UsdtPolygon = "0xc2132d05d31c914a87c6611c10748aeb04b58e8f" // Polygon USDT合约地址
|
||||
UsdtSolana = "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB" // Solana USDT合约地址
|
||||
SolSplToken = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" // Solana SPL Token合约地址
|
||||
UsdtAptos = "0x357b0b74bc833e95a115ad22604854d6b0fca151cecd94111770e5d6ffc9dc2b" // Aptos USDT合约地址
|
||||
UsdtErc20 = "0xdac17f958d2ee523a2206206994597c13d831ec7" // Eth USDT合约地址
|
||||
UsdtBep20 = "0x55d398326f99059ff775485246999027b3197955" // BSC USDT合约地址
|
||||
UsdtXlayer = "0x1e4a5963abfd975d8c9021ce480b42188849d41d" // Xlayer USDT合约地址
|
||||
UsdtPolygon = "0xc2132d05d31c914a87c6611c10748aeb04b58e8f" // Polygon USDT合约地址
|
||||
UsdtArbitrum = "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9" // Arbitum One USDT合约地址
|
||||
UsdtSolana = "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB" // Solana USDT合约地址
|
||||
SolSplToken = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" // Solana SPL Token合约地址
|
||||
UsdtAptos = "0x357b0b74bc833e95a115ad22604854d6b0fca151cecd94111770e5d6ffc9dc2b" // Aptos USDT合约地址
|
||||
)
|
||||
|
||||
// UsdtDecimals USDT合约小数位数
|
||||
const (
|
||||
UsdtBscDecimals = -18 // USDT BEP20小数位数
|
||||
UsdtEthDecimals = -6 // USDT ERC20小数位数
|
||||
UsdtXlayerDecimals = -6 // USDT Xlayer小数位数
|
||||
UsdtPolygonDecimals = -6 // USDT Polygon小数位数
|
||||
UsdtAptosDecimals = -6 // USDT Aptos小数位数
|
||||
UsdtTronDecimals = -6 // USDT Tron小数位数
|
||||
UsdtBscDecimals = -18 // USDT BEP20小数位数
|
||||
UsdtEthDecimals = -6 // USDT ERC20小数位数
|
||||
UsdtXlayerDecimals = -6 // USDT Xlayer小数位数
|
||||
UsdtPolygonDecimals = -6 // USDT Polygon小数位数
|
||||
UsdtArbitrumDecimals = -6 // USDT Arbitrum小数位数
|
||||
UsdtAptosDecimals = -6 // USDT Aptos小数位数
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package conf
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"flag"
|
||||
"fmt"
|
||||
"github.com/pelletier/go-toml/v2"
|
||||
@@ -19,6 +20,7 @@ const (
|
||||
Solana = "solana"
|
||||
Xlayer = "xlayer"
|
||||
Polygon = "polygon"
|
||||
Arbitrum = "arbitrum"
|
||||
Ethereum = "ethereum"
|
||||
)
|
||||
|
||||
@@ -42,6 +44,11 @@ func Init() error {
|
||||
return fmt.Errorf("配置数据解析失败:%w", err)
|
||||
}
|
||||
|
||||
if BotToken() == "" || BotAdminID() == 0 {
|
||||
|
||||
return errors.New("telegram bot 参数 admin_id 或 token 均不能为空")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -53,6 +53,15 @@ func GetPolygonRpcEndpoint() string {
|
||||
return defaultPolygonRpcEndpoint
|
||||
}
|
||||
|
||||
func GetArbitrumRpcEndpoint() string {
|
||||
if cfg.EvmRpc.Arbitrum != "" {
|
||||
|
||||
return cfg.EvmRpc.Arbitrum
|
||||
}
|
||||
|
||||
return defaultArbitrumRpcEndpoint
|
||||
}
|
||||
|
||||
func GetEthereumRpcEndpoint() string {
|
||||
if cfg.EvmRpc.Ethereum != "" {
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ var SupportTradeTypes = []string{
|
||||
OrderTradeTypeUsdtXlayer,
|
||||
OrderTradeTypeUsdtSolana,
|
||||
OrderTradeTypeUsdtPolygon,
|
||||
OrderTradeTypeUsdtArbitrum,
|
||||
}
|
||||
|
||||
type WalletAddress struct {
|
||||
@@ -102,6 +103,8 @@ func (wa *WalletAddress) GetUsdtContract() string {
|
||||
switch wa.TradeType {
|
||||
case OrderTradeTypeUsdtPolygon:
|
||||
return conf.UsdtPolygon
|
||||
case OrderTradeTypeUsdtArbitrum:
|
||||
return conf.UsdtArbitrum
|
||||
case OrderTradeTypeUsdtErc20:
|
||||
return conf.UsdtErc20
|
||||
case OrderTradeTypeUsdtBep20:
|
||||
@@ -117,6 +120,8 @@ func (wa *WalletAddress) GetUsdtDecimals() int32 {
|
||||
switch wa.TradeType {
|
||||
case OrderTradeTypeUsdtPolygon:
|
||||
return conf.UsdtPolygonDecimals
|
||||
case OrderTradeTypeUsdtArbitrum:
|
||||
return conf.UsdtArbitrumDecimals
|
||||
case OrderTradeTypeUsdtErc20:
|
||||
return conf.UsdtEthDecimals
|
||||
case OrderTradeTypeUsdtBep20:
|
||||
@@ -132,6 +137,8 @@ func (wa *WalletAddress) GetEvmRpcEndpoint() string {
|
||||
switch wa.TradeType {
|
||||
case OrderTradeTypeUsdtPolygon:
|
||||
return conf.GetPolygonRpcEndpoint()
|
||||
case OrderTradeTypeUsdtArbitrum:
|
||||
return conf.GetArbitrumRpcEndpoint()
|
||||
case OrderTradeTypeUsdtErc20:
|
||||
return conf.GetEthereumRpcEndpoint()
|
||||
case OrderTradeTypeUsdtBep20:
|
||||
|
||||
@@ -18,19 +18,15 @@ const (
|
||||
OrderStatusSuccess = 2 // 订单成功
|
||||
OrderStatusWaiting = 1 // 等待支付
|
||||
|
||||
OrderTradeTypeBscBnb = "bsc.bnb"
|
||||
OrderTradeTypeEthEth = "ethereum.eth"
|
||||
OrderTradeTypeXlayerOkb = "xlayer.okb"
|
||||
OrderTradeTypePolygonPol = "polygon.pol"
|
||||
|
||||
OrderTradeTypeTronTrx = "tron.trx"
|
||||
OrderTradeTypeUsdtTrc20 = "usdt.trc20"
|
||||
OrderTradeTypeUsdtPolygon = "usdt.polygon"
|
||||
OrderTradeTypeUsdtErc20 = "usdt.erc20"
|
||||
OrderTradeTypeUsdtBep20 = "usdt.bep20"
|
||||
OrderTradeTypeUsdtXlayer = "usdt.xlayer"
|
||||
OrderTradeTypeUsdtSolana = "usdt.solana"
|
||||
OrderTradeTypeUsdtAptos = "usdt.aptos"
|
||||
OrderTradeTypeTronTrx = "tron.trx"
|
||||
OrderTradeTypeUsdtTrc20 = "usdt.trc20"
|
||||
OrderTradeTypeUsdtPolygon = "usdt.polygon"
|
||||
OrderTradeTypeUsdtArbitrum = "usdt.arbitrum"
|
||||
OrderTradeTypeUsdtErc20 = "usdt.erc20"
|
||||
OrderTradeTypeUsdtBep20 = "usdt.bep20"
|
||||
OrderTradeTypeUsdtXlayer = "usdt.xlayer"
|
||||
OrderTradeTypeUsdtSolana = "usdt.solana"
|
||||
OrderTradeTypeUsdtAptos = "usdt.aptos"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -153,6 +149,9 @@ func GetDetailUrl(tradeType, hash string) string {
|
||||
if tradeType == OrderTradeTypeUsdtPolygon {
|
||||
return "https://polygonscan.com/tx/" + hash
|
||||
}
|
||||
if tradeType == OrderTradeTypeUsdtArbitrum {
|
||||
return "https://arbiscan.io/tx/" + hash
|
||||
}
|
||||
if tradeType == OrderTradeTypeUsdtSolana {
|
||||
return "https://solscan.io/tx/" + hash
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/v03413/bepusdt/app/model"
|
||||
"io"
|
||||
"math/big"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -259,7 +260,7 @@ func (a *aptos) parsePrimaryFungibleStoreTransfer(net, hash, sender string, ver
|
||||
TxHash: hash,
|
||||
Amount: decimal.NewFromBigInt(rawAmount, conf.UsdtAptosDecimals),
|
||||
FromAddress: sender,
|
||||
RecvAddress: args[1].String(),
|
||||
RecvAddress: a.padAddressLeadingZeros(args[1].String()),
|
||||
Timestamp: t,
|
||||
TradeType: model.OrderTradeTypeUsdtAptos,
|
||||
BlockNum: ver,
|
||||
@@ -287,7 +288,7 @@ func (a *aptos) parseAptosAccountBatchTransferFungibleAssets(net, hash, sender s
|
||||
TxHash: hash,
|
||||
Amount: decimal.NewFromBigInt(rawAmount, conf.UsdtAptosDecimals),
|
||||
FromAddress: sender,
|
||||
RecvAddress: recv.String(),
|
||||
RecvAddress: a.padAddressLeadingZeros(recv.String()),
|
||||
Timestamp: t,
|
||||
TradeType: model.OrderTradeTypeUsdtAptos,
|
||||
BlockNum: ver,
|
||||
@@ -314,10 +315,17 @@ func (a *aptos) parseAptosAccountTransferFungibleAssets(net, hash, sender string
|
||||
TxHash: hash,
|
||||
Amount: decimal.NewFromBigInt(rawAmount, conf.UsdtAptosDecimals),
|
||||
FromAddress: sender,
|
||||
RecvAddress: args[1].String(),
|
||||
RecvAddress: a.padAddressLeadingZeros(args[1].String()),
|
||||
Timestamp: t,
|
||||
TradeType: model.OrderTradeTypeUsdtAptos,
|
||||
BlockNum: ver,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func (a *aptos) padAddressLeadingZeros(addr string) string {
|
||||
addr = strings.TrimPrefix(addr, "0x")
|
||||
addr = strings.Repeat("0", 64-len(addr)) + addr
|
||||
|
||||
return "0x" + addr
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package task
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/smallnest/chanx"
|
||||
"github.com/v03413/bepusdt/app/conf"
|
||||
"time"
|
||||
)
|
||||
|
||||
func arbitrumInit() {
|
||||
ctx := context.Background()
|
||||
arb := evm{
|
||||
Type: conf.Arbitrum,
|
||||
Endpoint: conf.GetArbitrumRpcEndpoint(),
|
||||
Decimals: decimals{
|
||||
Usdt: conf.UsdtArbitrumDecimals,
|
||||
Native: -18, // arbitrum.arb 小数位数
|
||||
},
|
||||
Block: block{
|
||||
InitStartOffset: -600,
|
||||
ConfirmedOffset: 40,
|
||||
},
|
||||
blockScanQueue: chanx.NewUnboundedChan[[]int64](context.Background(), 30),
|
||||
}
|
||||
|
||||
register(task{ctx: ctx, callback: arb.blockDispatch})
|
||||
register(task{ctx: ctx, callback: arb.blockRoll, duration: time.Second * 3})
|
||||
}
|
||||
@@ -2,25 +2,27 @@ package task
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/smallnest/chanx"
|
||||
"github.com/v03413/bepusdt/app/conf"
|
||||
"time"
|
||||
)
|
||||
|
||||
func bscInit() {
|
||||
register(task{
|
||||
ctx: context.WithValue(context.Background(), "cfg", evmCfg{
|
||||
Endpoint: conf.GetBscRpcEndpoint(),
|
||||
Type: conf.Bsc,
|
||||
Decimals: decimals{
|
||||
Usdt: conf.UsdtBscDecimals,
|
||||
Native: -18, // bsc.bnb 小数位数
|
||||
},
|
||||
Block: block{
|
||||
InitStartOffset: -400,
|
||||
ConfirmedOffset: 15,
|
||||
},
|
||||
}),
|
||||
duration: time.Second * 3,
|
||||
callback: evmBlockRoll,
|
||||
})
|
||||
ctx := context.Background()
|
||||
bsc := evm{
|
||||
Type: conf.Bsc,
|
||||
Endpoint: conf.GetBscRpcEndpoint(),
|
||||
Decimals: decimals{
|
||||
Usdt: conf.UsdtBscDecimals,
|
||||
Native: -18, // bsc.bnb 小数位数
|
||||
},
|
||||
Block: block{
|
||||
InitStartOffset: -400,
|
||||
ConfirmedOffset: 15,
|
||||
},
|
||||
blockScanQueue: chanx.NewUnboundedChan[[]int64](context.Background(), 30),
|
||||
}
|
||||
|
||||
register(task{ctx: ctx, callback: bsc.blockDispatch})
|
||||
register(task{ctx: ctx, callback: bsc.blockRoll, duration: time.Second * 3})
|
||||
}
|
||||
|
||||
@@ -2,25 +2,27 @@ package task
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/smallnest/chanx"
|
||||
"github.com/v03413/bepusdt/app/conf"
|
||||
"time"
|
||||
)
|
||||
|
||||
func ethInit() {
|
||||
register(task{
|
||||
ctx: context.WithValue(context.Background(), "cfg", evmCfg{
|
||||
Endpoint: conf.GetEthereumRpcEndpoint(),
|
||||
Type: conf.Ethereum,
|
||||
Decimals: decimals{
|
||||
Usdt: conf.UsdtEthDecimals,
|
||||
Native: -18, // ethereum.eth 小数位数
|
||||
},
|
||||
Block: block{
|
||||
InitStartOffset: -100,
|
||||
ConfirmedOffset: 12,
|
||||
},
|
||||
}),
|
||||
duration: time.Second * 12,
|
||||
callback: evmBlockRoll,
|
||||
})
|
||||
ctx := context.Background()
|
||||
eth := evm{
|
||||
Type: conf.Ethereum,
|
||||
Endpoint: conf.GetEthereumRpcEndpoint(),
|
||||
Decimals: decimals{
|
||||
Usdt: conf.UsdtEthDecimals,
|
||||
Native: -18,
|
||||
},
|
||||
Block: block{
|
||||
InitStartOffset: -100,
|
||||
ConfirmedOffset: 12,
|
||||
},
|
||||
blockScanQueue: chanx.NewUnboundedChan[[]int64](context.Background(), 30),
|
||||
}
|
||||
|
||||
register(task{ctx: ctx, callback: eth.blockDispatch})
|
||||
register(task{ctx: ctx, callback: eth.blockRoll, duration: time.Second * 12})
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package task
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"github.com/panjf2000/ants/v2"
|
||||
"github.com/shopspring/decimal"
|
||||
@@ -22,39 +23,26 @@ import (
|
||||
|
||||
const (
|
||||
blockParseMaxNum = 10 // 每次解析区块的最大数量
|
||||
|
||||
usdtTransfer = "0xa9059cbb" // Tether transfer function ID
|
||||
contentType = "application/json"
|
||||
|
||||
inputAddressTotal = 138 // USDT转账 input 正确总长度
|
||||
inputAddressStart = 34 // USDT转账 接收地址在input中的起始位置
|
||||
inputAddressEnd = 74 // USDT转账 接收地址在input中的结束位置 amount在input中的起始位置
|
||||
)
|
||||
|
||||
var chainBlockNum sync.Map
|
||||
var nativeToken = map[string]string{
|
||||
conf.Bsc: model.OrderTradeTypeBscBnb,
|
||||
conf.Xlayer: model.OrderTradeTypeXlayerOkb,
|
||||
conf.Polygon: model.OrderTradeTypePolygonPol,
|
||||
conf.Ethereum: model.OrderTradeTypeEthEth,
|
||||
}
|
||||
var contractMap = map[string]string{
|
||||
conf.UsdtXlayer: model.OrderTradeTypeUsdtXlayer,
|
||||
conf.UsdtBep20: model.OrderTradeTypeUsdtBep20,
|
||||
conf.UsdtPolygon: model.OrderTradeTypeUsdtPolygon,
|
||||
conf.UsdtErc20: model.OrderTradeTypeUsdtErc20,
|
||||
conf.UsdtXlayer: model.OrderTradeTypeUsdtXlayer,
|
||||
conf.UsdtBep20: model.OrderTradeTypeUsdtBep20,
|
||||
conf.UsdtPolygon: model.OrderTradeTypeUsdtPolygon,
|
||||
conf.UsdtArbitrum: model.OrderTradeTypeUsdtArbitrum,
|
||||
conf.UsdtErc20: model.OrderTradeTypeUsdtErc20,
|
||||
}
|
||||
var chainUsdtMap = map[string]string{
|
||||
conf.Bsc: model.OrderTradeTypeUsdtBep20,
|
||||
conf.Xlayer: model.OrderTradeTypeUsdtXlayer,
|
||||
conf.Polygon: model.OrderTradeTypeUsdtPolygon,
|
||||
conf.Arbitrum: model.OrderTradeTypeUsdtArbitrum,
|
||||
conf.Ethereum: model.OrderTradeTypeUsdtErc20,
|
||||
conf.Solana: model.OrderTradeTypeUsdtSolana,
|
||||
conf.Aptos: model.OrderTradeTypeUsdtAptos,
|
||||
}
|
||||
|
||||
var client = &http.Client{Timeout: time.Second * 30}
|
||||
var chainScanQueue = chanx.NewUnboundedChan[[]evmBlock](context.Background(), 30)
|
||||
|
||||
type decimals struct {
|
||||
Usdt int32 // USDT小数位数
|
||||
@@ -67,44 +55,34 @@ type block struct {
|
||||
ConfirmedOffset int64 // 确认偏移量,开启交易确认后,区块高度需要减去此值认为交易已确认
|
||||
}
|
||||
|
||||
type evmCfg struct {
|
||||
Type string
|
||||
Endpoint string
|
||||
Decimals decimals
|
||||
Block block
|
||||
}
|
||||
|
||||
type evmBlock struct {
|
||||
Network evmCfg
|
||||
Num int64
|
||||
type evm struct {
|
||||
Type string
|
||||
Endpoint string
|
||||
Decimals decimals
|
||||
Block block
|
||||
blockScanQueue *chanx.UnboundedChan[[]int64]
|
||||
}
|
||||
|
||||
func init() {
|
||||
register(task{callback: evmBlockDispatch})
|
||||
//register(task{callback: evmBlockDispatch})
|
||||
}
|
||||
|
||||
func evmBlockRoll(ctx context.Context) {
|
||||
val := ctx.Value("cfg")
|
||||
if val == nil {
|
||||
log.Warn("evmBlockRoll: context value 'cfg' is nil")
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
cfg, ok := val.(evmCfg)
|
||||
if !ok {
|
||||
log.Warn("evmBlockRoll: context value 'cfg' is not of type evmCfg")
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
if rollBreak(cfg.Type) {
|
||||
func (e *evm) blockRoll(ctx context.Context) {
|
||||
if rollBreak(e.Type) {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
post := []byte(`{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}`)
|
||||
resp, err := client.Post(cfg.Endpoint, contentType, bytes.NewBuffer(post))
|
||||
req, err := http.NewRequestWithContext(ctx, "POST", e.Endpoint, bytes.NewBuffer(post))
|
||||
if err != nil {
|
||||
log.Warn("Error creating request:", err)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
log.Warn("Error sending request:", err)
|
||||
|
||||
@@ -121,7 +99,7 @@ func evmBlockRoll(ctx context.Context) {
|
||||
}
|
||||
|
||||
var res = gjson.ParseBytes(body)
|
||||
var now = help.HexStr2Int(res.Get("result").String()).Int64() - cfg.Block.RollDelayOffset
|
||||
var now = help.HexStr2Int(res.Get("result").String()).Int64() - e.Block.RollDelayOffset
|
||||
if now <= 0 {
|
||||
|
||||
return
|
||||
@@ -129,70 +107,70 @@ func evmBlockRoll(ctx context.Context) {
|
||||
|
||||
if conf.GetTradeIsConfirmed() {
|
||||
|
||||
now = now - cfg.Block.ConfirmedOffset
|
||||
now = now - e.Block.ConfirmedOffset
|
||||
}
|
||||
|
||||
var lastBlockNumber int64
|
||||
if v, ok := chainBlockNum.Load(cfg.Type); ok {
|
||||
if v, ok := chainBlockNum.Load(e.Type); ok {
|
||||
|
||||
lastBlockNumber = v.(int64)
|
||||
}
|
||||
|
||||
if now-lastBlockNumber > conf.BlockHeightMaxDiff {
|
||||
|
||||
lastBlockNumber = evmBlockInitOffset(now, cfg.Block.InitStartOffset, cfg) - 1
|
||||
lastBlockNumber = e.blockInitOffset(now, e.Block.InitStartOffset) - 1
|
||||
}
|
||||
|
||||
chainBlockNum.Store(cfg.Type, now)
|
||||
chainBlockNum.Store(e.Type, now)
|
||||
if now <= lastBlockNumber { // 区块高度没有变化
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
blocks := make([]evmBlock, 0)
|
||||
blocks := make([]int64, 0)
|
||||
for n := lastBlockNumber + 1; n <= now; n++ {
|
||||
blocks = append(blocks, evmBlock{Num: n, Network: cfg})
|
||||
blocks = append(blocks, n)
|
||||
if len(blocks) >= blockParseMaxNum {
|
||||
chainScanQueue.In <- blocks
|
||||
blocks = make([]evmBlock, 0)
|
||||
e.blockScanQueue.In <- blocks
|
||||
blocks = make([]int64, 0)
|
||||
}
|
||||
}
|
||||
|
||||
if len(blocks) > 0 {
|
||||
chainScanQueue.In <- blocks
|
||||
e.blockScanQueue.In <- blocks
|
||||
}
|
||||
}
|
||||
|
||||
func evmBlockInitOffset(now, offset int64, cfg evmCfg) int64 {
|
||||
func (e *evm) blockInitOffset(now, offset int64) int64 {
|
||||
go func() {
|
||||
var blocks []evmBlock
|
||||
var blocks []int64
|
||||
ticker := time.NewTicker(time.Second)
|
||||
defer ticker.Stop()
|
||||
|
||||
for b := now; b >= now+offset; b-- {
|
||||
if rollBreak(cfg.Type) {
|
||||
if rollBreak(e.Type) {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
blocks = append(blocks, evmBlock{Num: b, Network: cfg})
|
||||
blocks = append(blocks, b)
|
||||
if len(blocks) >= blockParseMaxNum {
|
||||
chainScanQueue.In <- blocks
|
||||
e.blockScanQueue.In <- blocks
|
||||
blocks = blocks[:0]
|
||||
}
|
||||
|
||||
<-ticker.C
|
||||
}
|
||||
if len(blocks) > 0 {
|
||||
chainScanQueue.In <- blocks
|
||||
e.blockScanQueue.In <- blocks
|
||||
}
|
||||
}()
|
||||
|
||||
return now
|
||||
}
|
||||
|
||||
func evmBlockDispatch(context.Context) {
|
||||
p, err := ants.NewPoolWithFunc(8, evmBlockParse)
|
||||
func (e *evm) blockDispatch(ctx context.Context) {
|
||||
p, err := ants.NewPoolWithFunc(2, e.blockParse)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
||||
@@ -201,35 +179,39 @@ func evmBlockDispatch(context.Context) {
|
||||
|
||||
defer p.Release()
|
||||
|
||||
for n := range chainScanQueue.Out {
|
||||
if err := p.Invoke(n); err != nil {
|
||||
chainScanQueue.In <- n
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case n := <-e.blockScanQueue.Out:
|
||||
if err := p.Invoke(n); err != nil {
|
||||
e.blockScanQueue.In <- n
|
||||
|
||||
log.Warn("evmBlockDispatch Error invoking process block:", err)
|
||||
log.Warn("evmBlockDispatch Error invoking process block:", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func evmBlockParse(b any) {
|
||||
var blocks, ok = b.([]evmBlock)
|
||||
func (e *evm) blockParse(a any) {
|
||||
blocks, ok := a.([]int64)
|
||||
if !ok {
|
||||
log.Warn("evmBlockParse: received non-evmBlock type")
|
||||
log.Warn("evmBlockParse Error: expected []int64, got", a)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
first := blocks[0]
|
||||
items := make([]string, 0)
|
||||
for _, v := range blocks {
|
||||
conf.SetBlockTotal(v.Network.Type)
|
||||
items = append(items, fmt.Sprintf(`{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x%x",true],"id":%d}`, v.Num, v.Num))
|
||||
conf.SetBlockTotal(e.Type)
|
||||
items = append(items, fmt.Sprintf(`{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["0x%x",true],"id":%d}`, v, v))
|
||||
}
|
||||
|
||||
post := []byte(fmt.Sprintf(`[%s]`, strings.Join(items, ",")))
|
||||
resp, err := client.Post(first.Network.Endpoint, contentType, bytes.NewBuffer(post))
|
||||
resp, err := client.Post(e.Endpoint, "application/json", bytes.NewBuffer(post))
|
||||
if err != nil {
|
||||
conf.SetBlockFail(first.Network.Type)
|
||||
chainScanQueue.In <- blocks
|
||||
conf.SetBlockFail(e.Type)
|
||||
e.blockScanQueue.In <- blocks
|
||||
log.Warn("Error sending request:", err)
|
||||
|
||||
return
|
||||
@@ -239,8 +221,8 @@ func evmBlockParse(b any) {
|
||||
|
||||
body, err := io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
conf.SetBlockFail(first.Network.Type)
|
||||
chainScanQueue.In <- blocks
|
||||
conf.SetBlockFail(e.Type)
|
||||
e.blockScanQueue.In <- blocks
|
||||
log.Warn("Error reading response body:", err)
|
||||
|
||||
return
|
||||
@@ -249,9 +231,9 @@ func evmBlockParse(b any) {
|
||||
var list = gjson.ParseBytes(body).Array()
|
||||
for _, data := range list {
|
||||
if !data.Get("result").Exists() {
|
||||
conf.SetBlockFail(first.Network.Type)
|
||||
chainScanQueue.In <- []evmBlock{{Network: first.Network, Num: data.Get("id").Int()}}
|
||||
log.Warn(fmt.Sprintf("%s getBlockByNumber response error %s", first.Network.Type, data.String()))
|
||||
conf.SetBlockFail(e.Type)
|
||||
e.blockScanQueue.In <- []int64{data.Get("id").Int()}
|
||||
log.Warn(fmt.Sprintf("%s getBlockByNumber response error %s", e.Type, data.String()))
|
||||
|
||||
continue
|
||||
}
|
||||
@@ -261,44 +243,45 @@ func evmBlockParse(b any) {
|
||||
timestamp := time.Unix(help.HexStr2Int(result.Get("timestamp").String()).Int64(), 0)
|
||||
transfers := make([]transfer, 0)
|
||||
for _, v := range result.Get("transactions").Array() {
|
||||
recv := v.Get("to").String()
|
||||
input := v.Get("input").String()
|
||||
rawValue := v.Get("value").String()
|
||||
rawAmount, ok := new(big.Int).SetString(rawValue, 0)
|
||||
if !ok {
|
||||
log.Warn("Error converting value to integer:" + " " + rawValue)
|
||||
to := v.Get("to").String()
|
||||
input, err := hex.DecodeString(strings.TrimPrefix(v.Get("input").String(), "0x"))
|
||||
if err != nil {
|
||||
log.Warn("evmBlockParse Error:", err)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
tradeType, ok := contractMap[to]
|
||||
if !ok { // 暂时忽略掉EVM原生代币的转账,后续... 暂时也没计划
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
amount := decimal.NewFromBigInt(rawAmount, first.Network.Decimals.Native)
|
||||
tradeType := evmParseTradeType(first.Network.Type, recv, input, rawAmount)
|
||||
if tradeType == nil {
|
||||
|
||||
continue
|
||||
var recv string
|
||||
var from = v.Get("from").String()
|
||||
var amount *big.Int
|
||||
if bytes.Equal(input[0:4], []byte{0xa9, 0x05, 0x9c, 0xbb}) { // transfer function ID
|
||||
recv, amount = e.parseUsdtContractTransfer(input)
|
||||
}
|
||||
|
||||
if !tradeType.Native && len(input) == inputAddressTotal { // usdt transfer
|
||||
rawAmount, ok = new(big.Int).SetString(input[inputAddressEnd:], 16)
|
||||
if !ok {
|
||||
log.Warn("Error converting amount(value):" + input[inputAddressEnd:])
|
||||
if bytes.Equal(input[0:4], []byte{0x23, 0xb8, 0x72, 0xdd}) { // transfer from function ID
|
||||
from, recv, amount = e.parseUsdtContractTransferFrom(input)
|
||||
}
|
||||
|
||||
continue
|
||||
}
|
||||
if amount == nil {
|
||||
|
||||
amount = decimal.NewFromBigInt(rawAmount, first.Network.Decimals.Usdt)
|
||||
recv = "0x" + input[inputAddressStart:inputAddressEnd] // USDT转账接收地址
|
||||
continue
|
||||
}
|
||||
|
||||
transfers = append(transfers, transfer{
|
||||
Network: first.Network.Type,
|
||||
FromAddress: v.Get("from").String(),
|
||||
Network: e.Type,
|
||||
FromAddress: from,
|
||||
RecvAddress: recv,
|
||||
Amount: amount,
|
||||
Amount: decimal.NewFromBigInt(amount, e.Decimals.Usdt),
|
||||
TxHash: v.Get("hash").String(),
|
||||
BlockNum: num,
|
||||
Timestamp: timestamp,
|
||||
TradeType: tradeType.Type,
|
||||
TradeType: tradeType,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -307,26 +290,34 @@ func evmBlockParse(b any) {
|
||||
transferQueue.In <- transfers
|
||||
}
|
||||
|
||||
log.Info("区块扫描完成", num, conf.GetBlockSuccRate(first.Network.Type), first.Network.Type)
|
||||
log.Info("区块扫描完成", num, conf.GetBlockSuccRate(e.Type), e.Type)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func evmParseTradeType(net, to, input string, value *big.Int) *model.TradeType {
|
||||
var tradeType, ok = nativeToken[net]
|
||||
if ok && input == "0x" && value.Sign() == 1 { // 原生代币
|
||||
func (e *evm) parseUsdtContractTransfer(data []byte) (string, *big.Int) {
|
||||
if len(data) < 68 {
|
||||
|
||||
return &model.TradeType{Type: tradeType, Native: true}
|
||||
return "", nil
|
||||
}
|
||||
|
||||
// 触发合约
|
||||
tradeType, ok = contractMap[to]
|
||||
if ok && strings.HasPrefix(input, usdtTransfer) { // USDT转账
|
||||
receiver := hex.EncodeToString(data[16:36])
|
||||
amount := big.NewInt(0).SetBytes(data[36:68])
|
||||
|
||||
return &model.TradeType{Type: tradeType, Native: false}
|
||||
return "0x" + receiver, amount
|
||||
}
|
||||
|
||||
func (e *evm) parseUsdtContractTransferFrom(data []byte) (string, string, *big.Int) {
|
||||
if len(data) < 100 {
|
||||
|
||||
return "", "", nil
|
||||
}
|
||||
|
||||
// 其他合约数据
|
||||
return nil
|
||||
from := hex.EncodeToString(data[16:36])
|
||||
to := hex.EncodeToString(data[48:68])
|
||||
amount := big.NewInt(0).SetBytes(data[68:100])
|
||||
|
||||
return "0x" + from, "0x" + to, amount
|
||||
}
|
||||
|
||||
func rollBreak(network string) bool {
|
||||
|
||||
@@ -2,25 +2,27 @@ package task
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/smallnest/chanx"
|
||||
"github.com/v03413/bepusdt/app/conf"
|
||||
"time"
|
||||
)
|
||||
|
||||
func polygonInit() {
|
||||
register(task{
|
||||
ctx: context.WithValue(context.Background(), "cfg", evmCfg{
|
||||
Endpoint: conf.GetPolygonRpcEndpoint(),
|
||||
Type: conf.Polygon,
|
||||
Decimals: decimals{
|
||||
Usdt: conf.UsdtPolygonDecimals,
|
||||
Native: -18, // polygon.pol 小数位数
|
||||
},
|
||||
Block: block{
|
||||
InitStartOffset: -600,
|
||||
ConfirmedOffset: 40,
|
||||
},
|
||||
}),
|
||||
duration: time.Second * 3,
|
||||
callback: evmBlockRoll,
|
||||
})
|
||||
ctx := context.Background()
|
||||
pol := evm{
|
||||
Type: conf.Polygon,
|
||||
Endpoint: conf.GetPolygonRpcEndpoint(),
|
||||
Decimals: decimals{
|
||||
Usdt: conf.UsdtPolygonDecimals,
|
||||
Native: -18, // polygon.pol 小数位数
|
||||
},
|
||||
Block: block{
|
||||
InitStartOffset: -600,
|
||||
ConfirmedOffset: 40,
|
||||
},
|
||||
blockScanQueue: chanx.NewUnboundedChan[[]int64](context.Background(), 30),
|
||||
}
|
||||
|
||||
register(task{ctx: ctx, callback: pol.blockDispatch})
|
||||
register(task{ctx: ctx, callback: pol.blockRoll, duration: time.Second * 3})
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ func (s *solana) slotRoll(context.Context) {
|
||||
|
||||
post := []byte(`{"jsonrpc":"2.0","id":1,"method":"getSlot"}`)
|
||||
|
||||
resp, err := client.Post(conf.GetSolanaRpcEndpoint(), contentType, bytes.NewBuffer(post))
|
||||
resp, err := client.Post(conf.GetSolanaRpcEndpoint(), "application/json", bytes.NewBuffer(post))
|
||||
if err != nil {
|
||||
log.Warn("slotRoll Error sending request:", err)
|
||||
|
||||
@@ -164,7 +164,7 @@ func (s *solana) slotParse(n any) {
|
||||
network := conf.Solana
|
||||
|
||||
conf.SetBlockTotal(network)
|
||||
resp, err := client.Post(conf.GetSolanaRpcEndpoint(), contentType, bytes.NewBuffer(post))
|
||||
resp, err := client.Post(conf.GetSolanaRpcEndpoint(), "application/json", bytes.NewBuffer(post))
|
||||
if err != nil {
|
||||
conf.SetBlockFail(network)
|
||||
log.Warn("slotParse Error sending request:", err)
|
||||
|
||||
@@ -25,6 +25,7 @@ func Init() error {
|
||||
bscInit()
|
||||
ethInit()
|
||||
polygonInit()
|
||||
arbitrumInit()
|
||||
xlayerInit()
|
||||
|
||||
return nil
|
||||
|
||||
@@ -55,8 +55,8 @@ func orderTransferHandle(context.Context) {
|
||||
var orders = getAllWaitingOrders()
|
||||
for _, t := range transfers {
|
||||
// debug
|
||||
//if t.Network == conf.Aptos {
|
||||
// fmt.Println(t.Network, t.TradeType, t.TxHash, t.Amount.String(), t.RecvAddress)
|
||||
//if t.Network == conf.Polygon {
|
||||
// fmt.Println(t.TradeType, t.TxHash, t.FromAddress, "=>", t.RecvAddress, t.Amount.String())
|
||||
//}
|
||||
|
||||
// 判断金额是否在允许范围内
|
||||
|
||||
@@ -19,7 +19,6 @@ import (
|
||||
"google.golang.org/grpc/backoff"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
"math/big"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -56,6 +55,59 @@ func newTron() tron {
|
||||
}
|
||||
}
|
||||
|
||||
func (t *tron) blockRoll(context.Context) {
|
||||
if t.rollBreak() {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
conn, err := grpc.NewClient(conf.GetTronGrpcNode(), grpc.WithConnectParams(grpcParams), grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||
if err != nil {
|
||||
log.Error("grpc.NewClient", err)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
defer conn.Close()
|
||||
|
||||
var client = api.NewWalletClient(conn)
|
||||
|
||||
var ctx, cancel = context.WithTimeout(context.Background(), time.Second*3)
|
||||
block, err1 := client.GetNowBlock2(ctx, nil)
|
||||
defer cancel()
|
||||
|
||||
if err1 != nil {
|
||||
log.Warn("GetNowBlock2 超时:", err1)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
var now = block.BlockHeader.RawData.Number
|
||||
if conf.GetTradeIsConfirmed() {
|
||||
now = now - t.blockConfirmedOffset
|
||||
}
|
||||
|
||||
// 区块高度变化过大,强制丢块重扫
|
||||
if now-t.lastBlockNum > conf.BlockHeightMaxDiff {
|
||||
t.blockInitOffset(now)
|
||||
t.lastBlockNum = now - 1
|
||||
}
|
||||
|
||||
// 区块高度没有变化
|
||||
if now == t.lastBlockNum {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// 待扫描区块入列
|
||||
for n := t.lastBlockNum + 1; n <= now; n++ {
|
||||
|
||||
t.blockScanQueue.In <- n
|
||||
}
|
||||
|
||||
t.lastBlockNum = now
|
||||
}
|
||||
|
||||
func (t *tron) blockDispatch(context.Context) {
|
||||
p, err := ants.NewPoolWithFunc(8, t.blockParse)
|
||||
if err != nil {
|
||||
@@ -75,64 +127,15 @@ func (t *tron) blockDispatch(context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
func (t *tron) blockRoll(context.Context) {
|
||||
var node = conf.GetTronGrpcNode()
|
||||
|
||||
conn, err := grpc.NewClient(node, grpc.WithConnectParams(grpcParams), grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||
if err != nil {
|
||||
|
||||
log.Error("grpc.NewClient", err)
|
||||
}
|
||||
|
||||
defer conn.Close()
|
||||
|
||||
var client = api.NewWalletClient(conn)
|
||||
|
||||
var ctx, cancel = context.WithTimeout(context.Background(), time.Second*3)
|
||||
block, err1 := client.GetNowBlock2(ctx, nil)
|
||||
defer cancel()
|
||||
|
||||
if err1 != nil {
|
||||
log.Warn("GetNowBlock2 超时:", err1)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
var now = block.BlockHeader.RawData.Number
|
||||
if conf.GetTradeIsConfirmed() {
|
||||
|
||||
now = now - t.blockConfirmedOffset
|
||||
}
|
||||
|
||||
// 首次启动
|
||||
if t.lastBlockNum == 0 {
|
||||
|
||||
t.lastBlockNum = now + t.blockInitStartOffset
|
||||
}
|
||||
|
||||
// 区块高度没有变化
|
||||
if now <= t.lastBlockNum {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// 待扫描区块入列
|
||||
for n := t.lastBlockNum + 1; n <= now; n++ {
|
||||
|
||||
t.blockScanQueue.In <- n
|
||||
}
|
||||
|
||||
t.lastBlockNum = now
|
||||
}
|
||||
|
||||
func (t *tron) blockParse(n any) {
|
||||
var num = n.(int64)
|
||||
var node = conf.GetTronGrpcNode()
|
||||
var conn *grpc.ClientConn
|
||||
var err error
|
||||
if conn, err = grpc.NewClient(node, grpc.WithConnectParams(grpcParams), grpc.WithTransportCredentials(insecure.NewCredentials())); err != nil {
|
||||
|
||||
log.Error("grpc.NewClient", err)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
defer conn.Close()
|
||||
@@ -222,8 +225,6 @@ func (t *tron) blockParse(n any) {
|
||||
TradeType: model.OrderTradeTypeTronTrx,
|
||||
BlockNum: cast.ToInt64(num),
|
||||
})
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
// 触发智能合约
|
||||
@@ -234,52 +235,58 @@ func (t *tron) blockParse(n any) {
|
||||
continue
|
||||
}
|
||||
|
||||
data := foo.GetData()
|
||||
|
||||
// Gas Free 钱包 合约授权转账
|
||||
if bytes.Equal(foo.OwnerAddress, gasFreeOwnerAddress) && bytes.Equal(foo.ContractAddress, gasFreeContractAddress) {
|
||||
from, receiver, amount := t.gasFreePermitTransfer(foo.GetData())
|
||||
if from == "" || receiver == "" || amount == nil {
|
||||
|
||||
continue
|
||||
from, receiver, amount := t.gasFreePermitTransfer(data)
|
||||
if amount != nil {
|
||||
transfers = append(transfers, transfer{
|
||||
Network: conf.Tron,
|
||||
TxHash: id,
|
||||
Amount: decimal.NewFromBigInt(amount, conf.UsdtTronDecimals),
|
||||
FromAddress: from,
|
||||
RecvAddress: receiver,
|
||||
Timestamp: timestamp,
|
||||
TradeType: model.OrderTradeTypeUsdtTrc20,
|
||||
BlockNum: cast.ToInt64(num),
|
||||
})
|
||||
}
|
||||
|
||||
transfers = append(transfers, transfer{
|
||||
Network: conf.Tron,
|
||||
TxHash: id,
|
||||
Amount: decimal.NewFromBigInt(new(big.Int).SetInt64(amount.Int64()), -6),
|
||||
FromAddress: from,
|
||||
RecvAddress: receiver,
|
||||
Timestamp: timestamp,
|
||||
TradeType: model.OrderTradeTypeUsdtTrc20,
|
||||
BlockNum: cast.ToInt64(num),
|
||||
})
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
{
|
||||
var reader = bytes.NewReader(foo.GetData())
|
||||
if !bytes.Equal(foo.GetContractAddress(), usdtTrc20ContractAddress) { // usdt trc20 contract
|
||||
|
||||
continue
|
||||
// usdt trc20 contract
|
||||
if bytes.Equal(foo.GetContractAddress(), usdtTrc20ContractAddress) {
|
||||
if bytes.Equal(data[:4], []byte{0xa9, 0x05, 0x9c, 0xbb}) { // a9059cbb transfer
|
||||
receiver, amount := t.parseUsdtContractTransfer(data)
|
||||
if amount != nil {
|
||||
transfers = append(transfers, transfer{
|
||||
Network: conf.Tron,
|
||||
TxHash: id,
|
||||
Amount: decimal.NewFromBigInt(amount, conf.UsdtTronDecimals),
|
||||
FromAddress: t.base58CheckEncode(foo.OwnerAddress),
|
||||
RecvAddress: receiver,
|
||||
Timestamp: timestamp,
|
||||
TradeType: model.OrderTradeTypeUsdtTrc20,
|
||||
BlockNum: cast.ToInt64(num),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 解析合约数据
|
||||
var recvAddress, amount = t.parseUsdtTrc20Contract(reader)
|
||||
if amount == 0 {
|
||||
|
||||
continue
|
||||
if bytes.Equal(data[:4], []byte{0x23, 0xb8, 0x72, 0xdd}) { // transferFrom (23b872dd)
|
||||
from, to, amount := t.parseUsdtContractTransferFrom(data)
|
||||
if amount != nil {
|
||||
transfers = append(transfers, transfer{
|
||||
Network: conf.Tron,
|
||||
TxHash: id,
|
||||
Amount: decimal.NewFromBigInt(amount, conf.UsdtTronDecimals),
|
||||
FromAddress: from,
|
||||
RecvAddress: to,
|
||||
Timestamp: timestamp,
|
||||
TradeType: model.OrderTradeTypeUsdtTrc20,
|
||||
BlockNum: cast.ToInt64(num),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
transfers = append(transfers, transfer{
|
||||
Network: conf.Tron,
|
||||
TxHash: id,
|
||||
Amount: decimal.NewFromBigInt(new(big.Int).SetInt64(amount), -6),
|
||||
FromAddress: t.base58CheckEncode(foo.OwnerAddress),
|
||||
RecvAddress: recvAddress,
|
||||
Timestamp: timestamp,
|
||||
TradeType: model.OrderTradeTypeUsdtTrc20,
|
||||
BlockNum: cast.ToInt64(num),
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -296,40 +303,56 @@ func (t *tron) blockParse(n any) {
|
||||
log.Info("区块扫描完成", num, conf.GetBlockSuccRate(conf.Tron), conf.Tron)
|
||||
}
|
||||
|
||||
func (t *tron) parseUsdtTrc20Contract(reader *bytes.Reader) (string, int64) {
|
||||
var funcName = make([]byte, 4)
|
||||
_, err = reader.Read(funcName)
|
||||
if err != nil {
|
||||
// 读取funcName失败
|
||||
func (t *tron) blockInitOffset(now int64) {
|
||||
if now == 0 || t.lastBlockNum != 0 {
|
||||
|
||||
return "", 0
|
||||
}
|
||||
if !bytes.Equal(funcName, []byte{0xa9, 0x05, 0x9c, 0xbb}) { // a9059cbb transfer(address,uint256)
|
||||
// funcName不匹配transfer
|
||||
|
||||
return "", 0
|
||||
return
|
||||
}
|
||||
|
||||
var addressBytes = make([]byte, 20)
|
||||
_, err = reader.ReadAt(addressBytes, 4+12)
|
||||
if err != nil {
|
||||
// 读取toAddress失败
|
||||
go func() {
|
||||
ticker := time.NewTicker(time.Second)
|
||||
endOffset := now + t.blockInitStartOffset
|
||||
defer ticker.Stop()
|
||||
|
||||
return "", 0
|
||||
for num := now; num >= endOffset; {
|
||||
if t.rollBreak() {
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
for i := 0; i < 10 && num >= endOffset; i++ {
|
||||
t.blockScanQueue.In <- num
|
||||
num--
|
||||
}
|
||||
|
||||
<-ticker.C
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
func (t *tron) parseUsdtContractTransfer(data []byte) (string, *big.Int) {
|
||||
if len(data) != 68 {
|
||||
|
||||
return "", nil
|
||||
}
|
||||
|
||||
var toAddress = t.base58CheckEncode(append([]byte{0x41}, addressBytes...))
|
||||
var value = make([]byte, 32)
|
||||
_, err = reader.ReadAt(value, 36)
|
||||
if err != nil {
|
||||
// 读取value失败
|
||||
receiver := t.base58CheckEncode(append([]byte{0x41}, data[16:36]...))
|
||||
amount := big.NewInt(0).SetBytes(data[36:68])
|
||||
|
||||
return "", 0
|
||||
return receiver, amount
|
||||
}
|
||||
|
||||
func (t *tron) parseUsdtContractTransferFrom(data []byte) (string, string, *big.Int) {
|
||||
if len(data) != 100 {
|
||||
|
||||
return "", "", nil
|
||||
}
|
||||
|
||||
var amount, _ = strconv.ParseInt(hex.EncodeToString(value), 16, 64)
|
||||
from := t.base58CheckEncode(append([]byte{0x41}, data[16:36]...))
|
||||
to := t.base58CheckEncode(append([]byte{0x41}, data[48:68]...))
|
||||
amount := big.NewInt(0).SetBytes(data[68:100])
|
||||
|
||||
return toAddress, amount
|
||||
return from, to, amount
|
||||
}
|
||||
|
||||
func (t *tron) gasFreePermitTransfer(data []byte) (string, string, *big.Int) {
|
||||
@@ -366,3 +389,21 @@ func (t *tron) base58CheckEncode(input []byte) string {
|
||||
|
||||
return base58.Encode(input)
|
||||
}
|
||||
|
||||
func (t *tron) rollBreak() bool {
|
||||
var count int64 = 0
|
||||
trade := []string{model.OrderTradeTypeTronTrx, model.OrderTradeTypeUsdtTrc20}
|
||||
model.DB.Model(&model.TradeOrders{}).Where("status = ? and trade_type in (?)", model.OrderStatusWaiting, trade).Count(&count)
|
||||
if count > 0 {
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
model.DB.Model(&model.WalletAddress{}).Where("other_notify = ? and trade_type in (?)", model.OtherNotifyEnable, trade).Count(&count)
|
||||
if count > 0 {
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -2,26 +2,28 @@ package task
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/smallnest/chanx"
|
||||
"github.com/v03413/bepusdt/app/conf"
|
||||
"time"
|
||||
)
|
||||
|
||||
func xlayerInit() {
|
||||
register(task{
|
||||
ctx: context.WithValue(context.Background(), "cfg", evmCfg{
|
||||
Endpoint: conf.GetXlayerRpcEndpoint(),
|
||||
Type: conf.Xlayer,
|
||||
Decimals: decimals{
|
||||
Usdt: conf.UsdtXlayerDecimals,
|
||||
Native: -18, // xlayer.okb 小数位数
|
||||
},
|
||||
Block: block{
|
||||
InitStartOffset: -600,
|
||||
RollDelayOffset: 3,
|
||||
ConfirmedOffset: 12,
|
||||
},
|
||||
}),
|
||||
duration: time.Second * 3,
|
||||
callback: evmBlockRoll,
|
||||
})
|
||||
ctx := context.Background()
|
||||
xlayer := evm{
|
||||
Type: conf.Xlayer,
|
||||
Endpoint: conf.GetXlayerRpcEndpoint(),
|
||||
Decimals: decimals{
|
||||
Usdt: conf.UsdtXlayerDecimals,
|
||||
Native: -18, // xlayer.okb 小数位数
|
||||
},
|
||||
Block: block{
|
||||
InitStartOffset: -600,
|
||||
RollDelayOffset: 3,
|
||||
ConfirmedOffset: 12,
|
||||
},
|
||||
blockScanQueue: chanx.NewUnboundedChan[[]int64](context.Background(), 30),
|
||||
}
|
||||
|
||||
register(task{ctx: ctx, callback: xlayer.blockDispatch})
|
||||
register(task{ctx: ctx, callback: xlayer.blockRoll, duration: time.Second * 3})
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package app
|
||||
|
||||
// Version 版本号说明 1.0.0 代表主版本号.功能版本号.修订号
|
||||
const Version = "1.21.1"
|
||||
const Version = "1.21.3"
|
||||
|
||||
@@ -41,8 +41,10 @@ payment_amount_max = 99999
|
||||
|
||||
[evm_rpc]
|
||||
bsc = "https://bsc-dataseed.bnbchain.org/"
|
||||
aptos = "https://aptos-rest.publicnode.com/"
|
||||
xlayer = "https://xlayerrpc.okx.com/"
|
||||
polygon = "https://polygon-rpc.com/"
|
||||
arbitrum = "https://arb1.arbitrum.io/rpc"
|
||||
ethereum = "https://ethereum.publicnode.com/"
|
||||
|
||||
[bot]
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
# 1Panel部署BEpusdt教程
|
||||
|
||||
首先说下核心,其本质上其实还是Docker部署,随后再通过1Panel的OpenResty反向代理;教程图片居多,自己操作的时候注意路径以及参数配置。
|
||||
|
||||
## 建立文件夹,准备配置文件
|
||||
|
||||

|
||||

|
||||
|
||||
建立路径`/opt/BEpusdt`文件夹,注意权限。
|
||||
|
||||

|
||||
|
||||
准备配置文件 https://github.com/v03413/BEpusdt/raw/main/conf.simple.toml 将此文件下载后重命名为 `conf.toml`,随后上传到
|
||||
`/opt/BEpusdt` 文件夹中;图中方框特别标记的内容必须修改,其它内容按需调整。
|
||||
|
||||
## 创建启动 BEpusdt 容器
|
||||
|
||||

|
||||

|
||||
|
||||
按流程进入Docker容器创建页面,镜像和端口务必按图修改,`v03413/bepusdt:latest`,其它勾选按图操作。
|
||||
|
||||

|
||||
容器挂载:本机目录 `/opt/BEpusdt` 权限:读写 `/data`
|
||||
|
||||

|
||||
命令:Command `-conf /data/conf.toml` 其它不填。
|
||||
|
||||

|
||||
重启规则:按图勾选第四个,**未手动停止则重启**
|
||||
|
||||
仔细检查,保证填写无误之后点击确认,正式创建容器;稍等片刻,等待容器部署完成。
|
||||
---
|
||||
|
||||

|
||||

|
||||
|
||||
如果没发生什么错误,随后查看容器日志,如果Telegram Bot 同样收到启动消息,则说明BEpusdt部署成功。
|
||||
|
||||
## 建立网站 配置反代
|
||||
|
||||

|
||||
|
||||
按图一步一步对应操作,如果提示没有安装`OpenResty`请自行安装;确保填写域名和代理地址正确无误,最后点击确认创建网站;
|
||||
如果域名已经解析到服务器IP地址,这个时候访问你的域名能正确打开即代表反向代理成功;如果有必要推荐启用HTTPS,步骤这里不再阐述。
|
||||
|
After Width: | Height: | Size: 168 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 138 KiB |
|
After Width: | Height: | Size: 168 KiB |
|
After Width: | Height: | Size: 148 KiB |
|
After Width: | Height: | Size: 80 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 152 KiB |
|
After Width: | Height: | Size: 238 KiB |
|
After Width: | Height: | Size: 396 KiB |
@@ -102,6 +102,8 @@ POST /api/v1/order/cancel-transaction
|
||||
|
||||
## 签名算法
|
||||
|
||||
**这里给出一个PHP参考签名函数 [点击查看](https://github.com/v03413/Epay-BEpusdt/blob/b7fa8fd608d71ce50e0f8eabb1717783c96761ac/bepusdt_plugin.php#L108:L127),其它语言大家统一参考,避免各种奇怪问题。**
|
||||
|
||||
签名生成的通用步骤如下:
|
||||
|
||||
第一步,将所有非空参数值的参数按照参数名ASCII码从小到大排序(字典序),使用URL键值对的格式(即key1=value1&key2=value2…)拼接成
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
# 宝塔部署 BEpusdt 教程
|
||||
|
||||
> 前言:曾经我也是忠实的宝塔用户,至少7.7版本之前是;现在明确不推荐BEpusdt用户使用此面板,
|
||||
> 哪怕你是用[1Panel](https://github.com/1Panel-dev/1Panel) 也行。作为一款以“开源”起家的面板,现如今连社区版用户竟然也需要强绑账号,其存在的加密模块以及屡次的安全问题这里不再重提。
|
||||
|
||||
教程开始,默认你已经成功安装宝塔面板。
|
||||
|
||||
## 配置文件准备
|
||||
|
||||
文件:https://github.com/v03413/BEpusdt/releases/latest/download/linux-amd64-BEpusdt.tar.gz 下载解压,将文件夹重命名为
|
||||
`BEpusdt`,然后将其上传到服务器的 `/opt` 目录下。
|
||||
|
||||

|
||||
打开配置文件`conf.simple.toml`进行调整,红框所示内容必须修改,同时最好增加指定日志和数据文件路径。
|
||||
|
||||
```toml
|
||||
output_log = "/opt/BEpusdt/bepusdt.log"
|
||||
sqlite_path = "/opt/BEpusdt/sqlite.db"
|
||||
```
|
||||
|
||||

|
||||
确保二进制文件`bepusdt`拥有如图权限。
|
||||
|
||||
## 配置进程守护
|
||||
|
||||
宝塔应用商店中搜索`进程守护管理器`,安装后进入应用,随后添加守护进程。
|
||||

|
||||
|
||||
运行目录:`/opt/BEpusdt`
|
||||
启动命令:`/opt/BEpusdt/bepusdt -conf /opt/BEpusdt/conf.simple.toml`
|
||||
|
||||

|
||||
确认添加,随后查看日志如图,即代表部署启动成功,bot也会收到启动消息。
|
||||
|
||||
## 配置反向代理
|
||||
|
||||
宝塔面板 -> 添加站点(PHP版本: 纯静态),随后配置添加一个反向代理,如图:
|
||||

|
||||
|
||||
添加之间后确保域名解析成功,访问你的域名,如果能正确打开即代表反向代理成功,推荐启用HTTPS,方法这里不再阐述。
|
||||
|
After Width: | Height: | Size: 189 KiB |
|
After Width: | Height: | Size: 107 KiB |
|
After Width: | Height: | Size: 185 KiB |
|
After Width: | Height: | Size: 119 KiB |
|
After Width: | Height: | Size: 214 KiB |
@@ -0,0 +1,58 @@
|
||||
# 修改默认模板
|
||||
|
||||
BEpusdt 所有的静态文件都存放在 `static` 目录,而模板文件则存放在 `views` 目录下。
|
||||
|
||||
当前目录结构:
|
||||
|
||||
```
|
||||
➜ bepusdt git:(main) ✗ tree ./static
|
||||
./static
|
||||
├── css
|
||||
│ ├── layer.css
|
||||
│ ├── main.min.css
|
||||
│ └── usdt.min.css
|
||||
├── embep.go
|
||||
├── font
|
||||
├── img
|
||||
│ ├── cloud.png
|
||||
│ ├── Detector.js
|
||||
│ ├── favicon.ico
|
||||
│ ├── icon-1.png
|
||||
│ ├── icon-2.png
|
||||
│ ├── icon-3.png
|
||||
│ ├── icon-4.png
|
||||
│ ├── key.png
|
||||
│ ├── lock_icon_copy.png
|
||||
│ ├── logo.png
|
||||
│ ├── puff.svg
|
||||
│ ├── RequestAnimationFrame.js
|
||||
│ ├── tether.svg
|
||||
│ ├── ThreeExtras.js
|
||||
│ ├── ThreeWebGL.js
|
||||
│ ├── tick.png
|
||||
│ ├── tron_trx.svg
|
||||
│ ├── trx.png
|
||||
│ └── user_icon_copy.png
|
||||
├── js
|
||||
│ ├── clipboard.min.js
|
||||
│ ├── jquery.min.js
|
||||
│ ├── jquery.qrcode_1.0.min.js
|
||||
│ ├── layer.min.js
|
||||
│ └── usdt.min.js
|
||||
└── views
|
||||
├── index.html
|
||||
├── tron.trx.html
|
||||
├── usdt.aptos.html
|
||||
├── usdt.bep20.html
|
||||
├── usdt.erc20.html
|
||||
├── usdt.polygon.html
|
||||
├── usdt.solana.html
|
||||
├── usdt.trc20.html
|
||||
└── usdt.xlayer.html
|
||||
|
||||
```
|
||||
|
||||
能够看到,`static/views` 对应了不同支付交易类型的页面模板,模板内容可以自定义,但是模板文件名不能修改,
|
||||
必须和交易类型保持一致,否则系统无法识别。
|
||||
|
||||
当你修改之后,通过配置文件里面的`static_path`参数指定静态文件目录即可,最好是绝对路径;至于其它 css js img 等文件,自行调整。
|
||||
@@ -25,11 +25,6 @@ func init() {
|
||||
panic(fmt.Sprintf("初始化失败: %v", err))
|
||||
}
|
||||
}
|
||||
|
||||
if conf.BotToken() == "" || conf.BotAdminID() == 0 {
|
||||
|
||||
panic("请配置参数 BOT_TOKEN 和 BOT_ADMIN_ID")
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>TRX・Tron 一款更好用的个人TRX收款网关 Bepusdt</title>
|
||||
<link rel="shortcut icon" href="/img/tether.svg"/>
|
||||
<title>TRX・Tron 一款更好用的个人TRX收款网关 BEpusdt</title>
|
||||
<link rel="shortcut icon" href="/img/tether.svg">
|
||||
<link rel="stylesheet" href="/css/usdt.min.css">
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
<script src="/js/jquery.qrcode_1.0.min.js"></script>
|
||||
@@ -13,81 +13,81 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="payment-container">
|
||||
<div class="crypto-icon">TRX</div>
|
||||
<h1 class="payment-title">TRX 支付</h1>
|
||||
<p class="payment-subtitle">
|
||||
<span class="status-indicator"></span>
|
||||
请使用 <strong>Tron</strong> 网络进行转账
|
||||
<span class="network-badge">Tron</span>
|
||||
</p>
|
||||
<div class="order-info">
|
||||
<div class="order-item">
|
||||
<span class="order-label">转账金额:</span>
|
||||
<span class="order-value amount-highlight" id="payAmount">{{.amount}} TRX</span>
|
||||
</div>
|
||||
<div class="order-item">
|
||||
<span class="order-label">商户订单:</span>
|
||||
<span class="order-value" id="orderNumber">{{.order_id}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="countdown-banner">
|
||||
<div class="countdown-content">
|
||||
<div class="countdown-info">
|
||||
<div class="countdown-title">⏰ 支付倒计时</div>
|
||||
<div class="countdown-subtitle">请在时间内完成转账</div>
|
||||
<div class="payment-container">
|
||||
<div class="crypto-icon">TRX</div>
|
||||
<h1 class="payment-title">TRX 支付</h1>
|
||||
<p class="payment-subtitle">
|
||||
<span class="status-indicator"></span>
|
||||
请使用 <strong>Tron</strong> 网络进行转账
|
||||
<span class="network-badge">Tron</span>
|
||||
</p>
|
||||
<div class="order-info">
|
||||
<div class="order-item">
|
||||
<span class="order-label">转账金额:</span>
|
||||
<span class="order-value amount-highlight" id="payAmount">{{.amount}} TRX</span>
|
||||
</div>
|
||||
<div class="countdown-timer" id="countdown">
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="minutes">15</span>
|
||||
<span class="time-label">分</span>
|
||||
<div class="order-item">
|
||||
<span class="order-label">商户订单:</span>
|
||||
<span class="order-value" id="orderNumber">{{.order_id}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="countdown-banner">
|
||||
<div class="countdown-content">
|
||||
<div class="countdown-info">
|
||||
<div class="countdown-title">⏰ 支付倒计时</div>
|
||||
<div class="countdown-subtitle">请在指定时间内完成转账,超时勿付请重新下单</div>
|
||||
</div>
|
||||
<span class="time-separator">:</span>
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="seconds">00</span>
|
||||
<span class="time-label">秒</span>
|
||||
<div class="countdown-timer" id="countdown">
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="minutes">15</span>
|
||||
<span class="time-label">分</span>
|
||||
</div>
|
||||
<span class="time-separator">:</span>
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="seconds">00</span>
|
||||
<span class="time-label">秒</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="qr-section">
|
||||
<div class="qr-code" id="qrcode"></div>
|
||||
<div class="address-section">
|
||||
<div class="address-label">收款地址 (Tron 网络)</div>
|
||||
<div class="address-text" id="walletAddress">{{.address}}</div>
|
||||
<button class="copy-btn" onclick="copyAddress()">复制地址</button>
|
||||
<div class="qr-section">
|
||||
<div class="qr-code" id="qrcode"></div>
|
||||
<div class="address-section">
|
||||
<div class="address-label">收款地址 (Tron 网络)</div>
|
||||
<div class="address-text" id="walletAddress">{{.address}}</div>
|
||||
<button class="copy-btn" onclick="copyAddress()">复制地址</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="instructions">
|
||||
<h4>📋 转账说明</h4>
|
||||
<ol>
|
||||
<li>必须使用 <strong>Tron 网络</strong> 进行转账,请勿转入 USDT!</li>
|
||||
<li>转账完成后系统会自动确认到账</li>
|
||||
<li>转账金额必须与显示金额完全一致</li>
|
||||
<li>如果有其它疑问,请联系客服处理</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="footer-info">
|
||||
<div class="project-info">
|
||||
<span class="powered-by">Powered by</span>
|
||||
<a href="https://github.com/v03413/BEpusdt" target="_blank" class="project-link">
|
||||
<strong>BEpusdt</strong>
|
||||
</a>
|
||||
<span class="open-source">Github</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="instructions">
|
||||
<h4>📋 转账说明</h4>
|
||||
<ol>
|
||||
<li>必须使用 <strong>Tron 网络</strong> 进行转账</li>
|
||||
<li>转账完成后系统会自动确认到账</li>
|
||||
<li>转账金额必须与显示金额完全一致</li>
|
||||
<li>如果有其它疑问 请联系客服处理</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="footer-info">
|
||||
<div class="project-info">
|
||||
<span class="powered-by">Powered by</span>
|
||||
<a href="https://github.com/v03413/bepusdt" target="_blank" class="project-link">
|
||||
<strong>Bepusdt</strong>
|
||||
</a>
|
||||
<span class="open-source">Github</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
USDTPayment.init({
|
||||
expire: "{{.expire}}",
|
||||
address: "{{.address}}",
|
||||
trade_id: "{{.trade_id}}",
|
||||
return_url: "{{.return_url}}"
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
USDTPayment.init({
|
||||
expire: "{{.expire}}",
|
||||
address: "{{.address}}",
|
||||
trade_id: "{{.trade_id}}",
|
||||
return_url: "{{.return_url}}"
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -4,8 +4,8 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>USDT・Aptos 一款更好用的个人USDT收款网关 Bepusdt</title>
|
||||
<link rel="shortcut icon" href="/img/tether.svg"/>
|
||||
<title>USDT・Aptos 一款更好用的个人USDT收款网关 BEpusdt</title>
|
||||
<link rel="shortcut icon" href="/img/tether.svg">
|
||||
<link rel="stylesheet" href="/css/usdt.min.css">
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
<script src="/js/jquery.qrcode_1.0.min.js"></script>
|
||||
@@ -13,81 +13,81 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="payment-container">
|
||||
<div class="crypto-icon">USDT</div>
|
||||
<h1 class="payment-title">USDT 支付</h1>
|
||||
<p class="payment-subtitle">
|
||||
<span class="status-indicator"></span>
|
||||
请使用 <strong>Aptos</strong> 区块网络进行转账
|
||||
<span class="network-badge">Aptos</span>
|
||||
</p>
|
||||
<div class="order-info">
|
||||
<div class="order-item">
|
||||
<span class="order-label">转账金额:</span>
|
||||
<span class="order-value amount-highlight" id="payAmount">{{.amount}} USDT</span>
|
||||
</div>
|
||||
<div class="order-item">
|
||||
<span class="order-label">商户订单:</span>
|
||||
<span class="order-value" id="orderNumber">{{.order_id}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="countdown-banner">
|
||||
<div class="countdown-content">
|
||||
<div class="countdown-info">
|
||||
<div class="countdown-title">⏰ 支付倒计时</div>
|
||||
<div class="countdown-subtitle">请在时间内完成转账</div>
|
||||
<div class="payment-container">
|
||||
<div class="crypto-icon">USDT</div>
|
||||
<h1 class="payment-title">USDT 支付</h1>
|
||||
<p class="payment-subtitle">
|
||||
<span class="status-indicator"></span>
|
||||
请使用 <strong>Aptos</strong> 网络进行转账
|
||||
<span class="network-badge">Aptos</span>
|
||||
</p>
|
||||
<div class="order-info">
|
||||
<div class="order-item">
|
||||
<span class="order-label">转账金额:</span>
|
||||
<span class="order-value amount-highlight" id="payAmount">{{.amount}} USDT</span>
|
||||
</div>
|
||||
<div class="countdown-timer" id="countdown">
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="minutes">15</span>
|
||||
<span class="time-label">分</span>
|
||||
<div class="order-item">
|
||||
<span class="order-label">商户订单:</span>
|
||||
<span class="order-value" id="orderNumber">{{.order_id}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="countdown-banner">
|
||||
<div class="countdown-content">
|
||||
<div class="countdown-info">
|
||||
<div class="countdown-title">⏰ 支付倒计时</div>
|
||||
<div class="countdown-subtitle">请在指定时间内完成转账,超时勿付请重新下单</div>
|
||||
</div>
|
||||
<span class="time-separator">:</span>
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="seconds">00</span>
|
||||
<span class="time-label">秒</span>
|
||||
<div class="countdown-timer" id="countdown">
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="minutes">15</span>
|
||||
<span class="time-label">分</span>
|
||||
</div>
|
||||
<span class="time-separator">:</span>
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="seconds">00</span>
|
||||
<span class="time-label">秒</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="qr-section">
|
||||
<div class="qr-code" id="qrcode"></div>
|
||||
<div class="address-section">
|
||||
<div class="address-label">收款地址 (Aptos 网络)</div>
|
||||
<div class="address-text" id="walletAddress">{{.address}}</div>
|
||||
<button class="copy-btn" onclick="copyAddress()">复制地址</button>
|
||||
<div class="qr-section">
|
||||
<div class="qr-code" id="qrcode"></div>
|
||||
<div class="address-section">
|
||||
<div class="address-label">收款地址 (Aptos 网络)</div>
|
||||
<div class="address-text" id="walletAddress">{{.address}}</div>
|
||||
<button class="copy-btn" onclick="copyAddress()">复制地址</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="instructions">
|
||||
<h4>📋 转账说明</h4>
|
||||
<ol>
|
||||
<li>必须使用 <strong>Aptos 网络</strong> 进行转账,请勿转入 APT!</li>
|
||||
<li>转账完成后系统会自动确认到账</li>
|
||||
<li>转账金额必须与显示金额完全一致</li>
|
||||
<li>如果有其它疑问,请联系客服处理</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="footer-info">
|
||||
<div class="project-info">
|
||||
<span class="powered-by">Powered by</span>
|
||||
<a href="https://github.com/v03413/BEpusdt" target="_blank" class="project-link">
|
||||
<strong>BEpusdt</strong>
|
||||
</a>
|
||||
<span class="open-source">Github</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="instructions">
|
||||
<h4>📋 转账说明</h4>
|
||||
<ol>
|
||||
<li>必须使用 <strong>Aptos 网络</strong> 进行转账</li>
|
||||
<li>转账完成后系统会自动确认到账</li>
|
||||
<li>转账金额必须与显示金额完全一致</li>
|
||||
<li>如果有其它疑问 请联系客服处理</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="footer-info">
|
||||
<div class="project-info">
|
||||
<span class="powered-by">Powered by</span>
|
||||
<a href="https://github.com/v03413/bepusdt" target="_blank" class="project-link">
|
||||
<strong>Bepusdt</strong>
|
||||
</a>
|
||||
<span class="open-source">Github</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
USDTPayment.init({
|
||||
expire: "{{.expire}}",
|
||||
address: "{{.address}}",
|
||||
trade_id: "{{.trade_id}}",
|
||||
return_url: "{{.return_url}}"
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
USDTPayment.init({
|
||||
expire: "{{.expire}}",
|
||||
address: "{{.address}}",
|
||||
trade_id: "{{.trade_id}}",
|
||||
return_url: "{{.return_url}}"
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,93 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>USDT・Arbitrum 一款更好用的个人USDT收款网关 BEpusdt</title>
|
||||
<link rel="shortcut icon" href="/img/tether.svg">
|
||||
<link rel="stylesheet" href="/css/usdt.min.css">
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
<script src="/js/jquery.qrcode_1.0.min.js"></script>
|
||||
<script src="/js/usdt.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="payment-container">
|
||||
<div class="crypto-icon">USDT</div>
|
||||
<h1 class="payment-title">USDT 支付</h1>
|
||||
<p class="payment-subtitle">
|
||||
<span class="status-indicator"></span>
|
||||
请使用 <strong>Arbitrum One</strong> 网络进行转账
|
||||
<span class="network-badge">Arbitrum</span>
|
||||
</p>
|
||||
<div class="order-info">
|
||||
<div class="order-item">
|
||||
<span class="order-label">转账金额:</span>
|
||||
<span class="order-value amount-highlight" id="payAmount">{{.amount}} USDT</span>
|
||||
</div>
|
||||
<div class="order-item">
|
||||
<span class="order-label">商户订单:</span>
|
||||
<span class="order-value" id="orderNumber">{{.order_id}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="countdown-banner">
|
||||
<div class="countdown-content">
|
||||
<div class="countdown-info">
|
||||
<div class="countdown-title">⏰ 支付倒计时</div>
|
||||
<div class="countdown-subtitle">请在指定时间内完成转账,超时勿付请重新下单</div>
|
||||
</div>
|
||||
<div class="countdown-timer" id="countdown">
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="minutes">15</span>
|
||||
<span class="time-label">分</span>
|
||||
</div>
|
||||
<span class="time-separator">:</span>
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="seconds">00</span>
|
||||
<span class="time-label">秒</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="qr-section">
|
||||
<div class="qr-code" id="qrcode"></div>
|
||||
<div class="address-section">
|
||||
<div class="address-label">收款地址 (Arbitrum One 网络)</div>
|
||||
<div class="address-text" id="walletAddress">{{.address}}</div>
|
||||
<button class="copy-btn" onclick="copyAddress()">复制地址</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="instructions">
|
||||
<h4>📋 转账说明</h4>
|
||||
<ol>
|
||||
<li>必须使用 <strong>Arbitrum One 网络</strong> 进行转账,请勿转入 ARB!</li>
|
||||
<li>转账完成后系统会自动确认到账</li>
|
||||
<li>转账金额必须与显示金额完全一致</li>
|
||||
<li>如果有其它疑问,请联系客服处理</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="footer-info">
|
||||
<div class="project-info">
|
||||
<span class="powered-by">Powered by</span>
|
||||
<a href="https://github.com/v03413/BEpusdt" target="_blank" class="project-link">
|
||||
<strong>BEpusdt</strong>
|
||||
</a>
|
||||
<span class="open-source">Github</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
USDTPayment.init({
|
||||
expire: "{{.expire}}",
|
||||
address: "{{.address}}",
|
||||
trade_id: "{{.trade_id}}",
|
||||
return_url: "{{.return_url}}"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -4,11 +4,12 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>USDT・BEP20 一款更好用的个人USDT收款网关 Bepusdt</title>
|
||||
<link rel="shortcut icon" href="/img/tether.svg" />
|
||||
<title>USDT・BEP20 一款更好用的个人USDT收款网关 BEpusdt</title>
|
||||
<link rel="shortcut icon" href="/img/tether.svg">
|
||||
<link rel="stylesheet" href="/css/usdt.min.css">
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
<script src="/js/jquery.qrcode_1.0.min.js"></script>
|
||||
<script src="/js/usdt.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -17,7 +18,7 @@
|
||||
<h1 class="payment-title">USDT 支付</h1>
|
||||
<p class="payment-subtitle">
|
||||
<span class="status-indicator"></span>
|
||||
请使用 币安智能链<strong>(BSC)</strong> 进行转账
|
||||
请使用 <strong>币安智能链 (BSC)</strong> BEP20 网络进行转账
|
||||
<span class="network-badge">BEP20</span>
|
||||
</p>
|
||||
<div class="order-info">
|
||||
@@ -34,7 +35,7 @@
|
||||
<div class="countdown-content">
|
||||
<div class="countdown-info">
|
||||
<div class="countdown-title">⏰ 支付倒计时</div>
|
||||
<div class="countdown-subtitle">请在时间内完成转账</div>
|
||||
<div class="countdown-subtitle">请在指定时间内完成转账,超时勿付请重新下单</div>
|
||||
</div>
|
||||
<div class="countdown-timer" id="countdown">
|
||||
<div class="time-unit">
|
||||
@@ -60,258 +61,31 @@
|
||||
<div class="instructions">
|
||||
<h4>📋 转账说明</h4>
|
||||
<ol>
|
||||
<li>必须使用 <strong>BEP20 网络</strong> 进行转账</li>
|
||||
<li>必须使用 <strong>BEP20 网络</strong> 进行转账,请勿转入 BNB!</li>
|
||||
<li>转账完成后系统会自动确认到账</li>
|
||||
<li>转账金额必须与显示金额完全一致</li>
|
||||
<li>如果有其它疑问 请联系客服处理</li>
|
||||
<li>如果有其它疑问,请联系客服处理</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="footer-info">
|
||||
<div class="project-info">
|
||||
<span class="powered-by">Powered by</span>
|
||||
<a href="https://github.com/v03413/bepusdt" target="_blank" class="project-link">
|
||||
<strong>Bepusdt</strong>
|
||||
<a href="https://github.com/v03413/BEpusdt" target="_blank" class="project-link">
|
||||
<strong>BEpusdt</strong>
|
||||
</a>
|
||||
<span class="open-source">优雅开源</span>
|
||||
<span class="open-source">Github</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 全局变量
|
||||
let countdownTimer = null;
|
||||
let statusCheckTimer = null;
|
||||
let totalSeconds = '{{.expire }}';
|
||||
|
||||
// 生成二维码
|
||||
function generateQRCode() {
|
||||
const qrContainer = document.getElementById('qrcode');
|
||||
const containerWidth = qrContainer.offsetWidth;
|
||||
const qrSize = Math.min(containerWidth - 10, 150); // 留出10px的边距
|
||||
|
||||
$('#qrcode').qrcode({
|
||||
text: "{{.address}}",
|
||||
width: qrSize,
|
||||
height: qrSize,
|
||||
foreground: "#000000",
|
||||
background: "#ffffff",
|
||||
typeNumber: -1
|
||||
});
|
||||
}
|
||||
|
||||
// 复制地址
|
||||
function copyAddress() {
|
||||
const address = document.getElementById('walletAddress').textContent;
|
||||
navigator.clipboard.writeText(address).then(function () {
|
||||
const btn = document.querySelector('.copy-btn');
|
||||
const originalText = btn.textContent;
|
||||
btn.textContent = '已复制!';
|
||||
btn.style.background = '#48bb78';
|
||||
|
||||
setTimeout(function () {
|
||||
btn.textContent = originalText;
|
||||
btn.style.background = '#667eea';
|
||||
}, 2000);
|
||||
}).catch(function (err) {
|
||||
console.error('复制失败: ', err);
|
||||
// 降级方案
|
||||
const textArea = document.createElement('textarea');
|
||||
textArea.value = address;
|
||||
document.body.appendChild(textArea);
|
||||
textArea.select();
|
||||
try {
|
||||
document.execCommand('copy');
|
||||
const btn = document.querySelector('.copy-btn');
|
||||
const originalText = btn.textContent;
|
||||
btn.textContent = '已复制!';
|
||||
btn.style.background = '#48bb78';
|
||||
setTimeout(function () {
|
||||
btn.textContent = originalText;
|
||||
btn.style.background = '#667eea';
|
||||
}, 2000);
|
||||
} catch (err) {
|
||||
alert('复制失败,请手动复制地址');
|
||||
}
|
||||
document.body.removeChild(textArea);
|
||||
});
|
||||
}
|
||||
|
||||
// 倒计时
|
||||
function startCountdown() {
|
||||
const minutesEl = document.getElementById('minutes');
|
||||
const secondsEl = document.getElementById('seconds');
|
||||
|
||||
function updateDisplay() {
|
||||
const minutes = Math.floor(totalSeconds / 60);
|
||||
const seconds = totalSeconds % 60;
|
||||
|
||||
if (totalSeconds <= 0) {
|
||||
minutesEl.textContent = '00';
|
||||
secondsEl.textContent = '00';
|
||||
} else {
|
||||
minutesEl.textContent = minutes.toString().padStart(2, '0');
|
||||
secondsEl.textContent = seconds.toString().padStart(2, '0');
|
||||
}
|
||||
|
||||
// 当剩余时间少于5分钟时,倒计时变红色
|
||||
if (totalSeconds <= 300) { // 5分钟 = 300秒
|
||||
document.querySelector('.countdown-banner').style.background = 'linear-gradient(135deg, #ff4757, #ff3838)';
|
||||
}
|
||||
|
||||
// 当剩余时间少于1分钟时,添加紧急闪烁效果
|
||||
if (totalSeconds <= 60) {
|
||||
document.querySelector('.countdown-banner').style.animation = 'urgentBlink 1s infinite';
|
||||
}
|
||||
}
|
||||
|
||||
countdownTimer = setInterval(function () {
|
||||
totalSeconds--;
|
||||
updateDisplay();
|
||||
|
||||
if (totalSeconds <= 0) {
|
||||
clearInterval(countdownTimer);
|
||||
clearInterval(statusCheckTimer);
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
// 初始化显示
|
||||
updateDisplay();
|
||||
}
|
||||
|
||||
// 支付超时
|
||||
function showTimeoutMessage() {
|
||||
const overlay = document.createElement('div');
|
||||
overlay.style.cssText = `
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 9999;
|
||||
`;
|
||||
|
||||
const modal = document.createElement('div');
|
||||
modal.style.cssText = `
|
||||
background: white;
|
||||
padding: 30px;
|
||||
border-radius: 12px;
|
||||
text-align: center;
|
||||
max-width: 400px;
|
||||
width: 90%;
|
||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
|
||||
`;
|
||||
|
||||
|
||||
modal.innerHTML = `
|
||||
<div style="font-size: 48px; margin-bottom: 20px;">⏰</div>
|
||||
<h3 style="color: #e53e3e; margin-bottom: 15px;">支付时间已过期</h3>
|
||||
<p style="color: #666; margin-bottom: 25px; line-height: 1.5;">
|
||||
很抱歉,支付时间已超时。<br>
|
||||
请重新发起支付或联系客服处理。
|
||||
</p>
|
||||
<button onclick="location.href='{{.return_url}}'" style="
|
||||
background: #667eea;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 12px 24px;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
margin-right: 10px;
|
||||
">返回商户平台</button>
|
||||
`;
|
||||
|
||||
overlay.appendChild(modal);
|
||||
document.body.appendChild(overlay);
|
||||
}
|
||||
|
||||
// 支付成功
|
||||
function showSuccessMessage(data) {
|
||||
const overlay = document.createElement('div');
|
||||
overlay.style.cssText = `
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 9999;
|
||||
`;
|
||||
|
||||
const modal = document.createElement('div');
|
||||
modal.style.cssText = `
|
||||
background: white;
|
||||
padding: 30px;
|
||||
border-radius: 12px;
|
||||
text-align: center;
|
||||
max-width: 400px;
|
||||
width: 90%;
|
||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
|
||||
`;
|
||||
|
||||
modal.innerHTML = `
|
||||
<div style="font-size: 48px; margin-bottom: 20px;">✅</div>
|
||||
<h3 style="color: #48bb78; margin-bottom: 15px;">支付成功!</h3>
|
||||
<p style="color: #666; margin-bottom: 20px; line-height: 1.5;">
|
||||
您的支付已确认,交易哈希:<br>
|
||||
<code style="background: #e6f0fa; color: #2563eb; padding: 4px 8px; border-radius: 4px; font-size: 12px; word-break: break-all;">
|
||||
${data.trade_hash || '处理中...'}
|
||||
</code>
|
||||
</p>
|
||||
<button onclick="location.href='${data.return_url || '/'}'" style="
|
||||
background: #48bb78;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 12px 24px;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
">返回商户平台</button>
|
||||
`;
|
||||
|
||||
overlay.appendChild(modal);
|
||||
document.body.appendChild(overlay);
|
||||
|
||||
// 清除定时器
|
||||
if (countdownTimer) clearInterval(countdownTimer);
|
||||
if (statusCheckTimer) clearInterval(statusCheckTimer);
|
||||
}
|
||||
|
||||
// 检查支付状态
|
||||
function checkPaymentStatus() {
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
url: "/pay/check-status/{{.trade_id}}",
|
||||
success: function (data) {
|
||||
if (data.status === 1) {
|
||||
|
||||
return setTimeout(checkPaymentStatus, 5000); // 等待支付
|
||||
}
|
||||
if (data.status === 2) {
|
||||
|
||||
return showSuccessMessage(data); // 支付成功
|
||||
}
|
||||
if (data.status === 3) {
|
||||
|
||||
return showTimeoutMessage(); // 支付超时
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
generateQRCode();
|
||||
startCountdown();
|
||||
|
||||
setTimeout(checkPaymentStatus, 2000);
|
||||
USDTPayment.init({
|
||||
expire: "{{.expire}}",
|
||||
address: "{{.address}}",
|
||||
trade_id: "{{.trade_id}}",
|
||||
return_url: "{{.return_url}}"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>USDT・ERC20 一款更好用的个人USDT收款网关 Bepusdt</title>
|
||||
<link rel="shortcut icon" href="/img/tether.svg"/>
|
||||
<title>USDT・ERC20 一款更好用的个人USDT收款网关 BEpusdt</title>
|
||||
<link rel="shortcut icon" href="/img/tether.svg">
|
||||
<link rel="stylesheet" href="/css/usdt.min.css">
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
<script src="/js/jquery.qrcode_1.0.min.js"></script>
|
||||
@@ -13,81 +13,81 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="payment-container">
|
||||
<div class="crypto-icon">USDT</div>
|
||||
<h1 class="payment-title">USDT 支付</h1>
|
||||
<p class="payment-subtitle">
|
||||
<span class="status-indicator"></span>
|
||||
请使用 以太坊<strong>(Ethereum)</strong> 进行转账
|
||||
<span class="network-badge">ERC20</span>
|
||||
</p>
|
||||
<div class="order-info">
|
||||
<div class="order-item">
|
||||
<span class="order-label">转账金额:</span>
|
||||
<span class="order-value amount-highlight" id="payAmount">{{.amount}} USDT</span>
|
||||
</div>
|
||||
<div class="order-item">
|
||||
<span class="order-label">商户订单:</span>
|
||||
<span class="order-value" id="orderNumber">{{.order_id}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="countdown-banner">
|
||||
<div class="countdown-content">
|
||||
<div class="countdown-info">
|
||||
<div class="countdown-title">⏰ 支付倒计时</div>
|
||||
<div class="countdown-subtitle">请在时间内完成转账</div>
|
||||
<div class="payment-container">
|
||||
<div class="crypto-icon">USDT</div>
|
||||
<h1 class="payment-title">USDT 支付</h1>
|
||||
<p class="payment-subtitle">
|
||||
<span class="status-indicator"></span>
|
||||
请使用 <strong>以太坊 (Ethereum)</strong> ERC20 网络进行转账
|
||||
<span class="network-badge">ERC20</span>
|
||||
</p>
|
||||
<div class="order-info">
|
||||
<div class="order-item">
|
||||
<span class="order-label">转账金额:</span>
|
||||
<span class="order-value amount-highlight" id="payAmount">{{.amount}} USDT</span>
|
||||
</div>
|
||||
<div class="countdown-timer" id="countdown">
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="minutes">15</span>
|
||||
<span class="time-label">分</span>
|
||||
<div class="order-item">
|
||||
<span class="order-label">商户订单:</span>
|
||||
<span class="order-value" id="orderNumber">{{.order_id}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="countdown-banner">
|
||||
<div class="countdown-content">
|
||||
<div class="countdown-info">
|
||||
<div class="countdown-title">⏰ 支付倒计时</div>
|
||||
<div class="countdown-subtitle">请在指定时间内完成转账,超时勿付请重新下单</div>
|
||||
</div>
|
||||
<span class="time-separator">:</span>
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="seconds">00</span>
|
||||
<span class="time-label">秒</span>
|
||||
<div class="countdown-timer" id="countdown">
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="minutes">15</span>
|
||||
<span class="time-label">分</span>
|
||||
</div>
|
||||
<span class="time-separator">:</span>
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="seconds">00</span>
|
||||
<span class="time-label">秒</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="qr-section">
|
||||
<div class="qr-code" id="qrcode"></div>
|
||||
<div class="address-section">
|
||||
<div class="address-label">收款地址 (ERC20 网络)</div>
|
||||
<div class="address-text" id="walletAddress">{{.address}}</div>
|
||||
<button class="copy-btn" onclick="copyAddress()">复制地址</button>
|
||||
<div class="qr-section">
|
||||
<div class="qr-code" id="qrcode"></div>
|
||||
<div class="address-section">
|
||||
<div class="address-label">收款地址 (ERC20 网络)</div>
|
||||
<div class="address-text" id="walletAddress">{{.address}}</div>
|
||||
<button class="copy-btn" onclick="copyAddress()">复制地址</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="instructions">
|
||||
<h4>📋 转账说明</h4>
|
||||
<ol>
|
||||
<li>必须使用 <strong>ERC20 网络</strong> 进行转账,请勿转入 ETH!</li>
|
||||
<li>转账完成后系统会自动确认到账</li>
|
||||
<li>转账金额必须与显示金额完全一致</li>
|
||||
<li>如果有其它疑问,请联系客服处理</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="footer-info">
|
||||
<div class="project-info">
|
||||
<span class="powered-by">Powered by</span>
|
||||
<a href="https://github.com/v03413/BEpusdt" target="_blank" class="project-link">
|
||||
<strong>BEpusdt</strong>
|
||||
</a>
|
||||
<span class="open-source">Github</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="instructions">
|
||||
<h4>📋 转账说明</h4>
|
||||
<ol>
|
||||
<li>必须使用 <strong>ERC20 网络</strong> 进行转账</li>
|
||||
<li>转账完成后系统会自动确认到账</li>
|
||||
<li>转账金额必须与显示金额完全一致</li>
|
||||
<li>如果有其它疑问 请联系客服处理</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="footer-info">
|
||||
<div class="project-info">
|
||||
<span class="powered-by">Powered by</span>
|
||||
<a href="https://github.com/v03413/bepusdt" target="_blank" class="project-link">
|
||||
<strong>Bepusdt</strong>
|
||||
</a>
|
||||
<span class="open-source">Github</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
USDTPayment.init({
|
||||
expire: "{{.expire}}",
|
||||
address: "{{.address}}",
|
||||
trade_id: "{{.trade_id}}",
|
||||
return_url: "{{.return_url}}"
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
USDTPayment.init({
|
||||
expire: "{{.expire}}",
|
||||
address: "{{.address}}",
|
||||
trade_id: "{{.trade_id}}",
|
||||
return_url: "{{.return_url}}"
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -4,8 +4,8 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>USDT・Polygon 一款更好用的个人USDT收款网关 Bepusdt</title>
|
||||
<link rel="shortcut icon" href="/img/tether.svg"/>
|
||||
<title>USDT・Polygon 一款更好用的个人USDT收款网关 BEpusdt</title>
|
||||
<link rel="shortcut icon" href="/img/tether.svg">
|
||||
<link rel="stylesheet" href="/css/usdt.min.css">
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
<script src="/js/jquery.qrcode_1.0.min.js"></script>
|
||||
@@ -13,81 +13,81 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="payment-container">
|
||||
<div class="crypto-icon">USDT</div>
|
||||
<h1 class="payment-title">USDT 支付</h1>
|
||||
<p class="payment-subtitle">
|
||||
<span class="status-indicator"></span>
|
||||
请使用 <strong>Polygon</strong> 进行转账
|
||||
<span class="network-badge">Polygon</span>
|
||||
</p>
|
||||
<div class="order-info">
|
||||
<div class="order-item">
|
||||
<span class="order-label">转账金额:</span>
|
||||
<span class="order-value amount-highlight" id="payAmount">{{.amount}} USDT</span>
|
||||
</div>
|
||||
<div class="order-item">
|
||||
<span class="order-label">商户订单:</span>
|
||||
<span class="order-value" id="orderNumber">{{.order_id}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="countdown-banner">
|
||||
<div class="countdown-content">
|
||||
<div class="countdown-info">
|
||||
<div class="countdown-title">⏰ 支付倒计时</div>
|
||||
<div class="countdown-subtitle">请在时间内完成转账</div>
|
||||
<div class="payment-container">
|
||||
<div class="crypto-icon">USDT</div>
|
||||
<h1 class="payment-title">USDT 支付</h1>
|
||||
<p class="payment-subtitle">
|
||||
<span class="status-indicator"></span>
|
||||
请使用 <strong>Polygon</strong> 网络进行转账
|
||||
<span class="network-badge">Polygon</span>
|
||||
</p>
|
||||
<div class="order-info">
|
||||
<div class="order-item">
|
||||
<span class="order-label">转账金额:</span>
|
||||
<span class="order-value amount-highlight" id="payAmount">{{.amount}} USDT</span>
|
||||
</div>
|
||||
<div class="countdown-timer" id="countdown">
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="minutes">15</span>
|
||||
<span class="time-label">分</span>
|
||||
<div class="order-item">
|
||||
<span class="order-label">商户订单:</span>
|
||||
<span class="order-value" id="orderNumber">{{.order_id}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="countdown-banner">
|
||||
<div class="countdown-content">
|
||||
<div class="countdown-info">
|
||||
<div class="countdown-title">⏰ 支付倒计时</div>
|
||||
<div class="countdown-subtitle">请在指定时间内完成转账,超时勿付请重新下单</div>
|
||||
</div>
|
||||
<span class="time-separator">:</span>
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="seconds">00</span>
|
||||
<span class="time-label">秒</span>
|
||||
<div class="countdown-timer" id="countdown">
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="minutes">15</span>
|
||||
<span class="time-label">分</span>
|
||||
</div>
|
||||
<span class="time-separator">:</span>
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="seconds">00</span>
|
||||
<span class="time-label">秒</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="qr-section">
|
||||
<div class="qr-code" id="qrcode"></div>
|
||||
<div class="address-section">
|
||||
<div class="address-label">收款地址 (Polygon 网络)</div>
|
||||
<div class="address-text" id="walletAddress">{{.address}}</div>
|
||||
<button class="copy-btn" onclick="copyAddress()">复制地址</button>
|
||||
<div class="qr-section">
|
||||
<div class="qr-code" id="qrcode"></div>
|
||||
<div class="address-section">
|
||||
<div class="address-label">收款地址 (Polygon 网络)</div>
|
||||
<div class="address-text" id="walletAddress">{{.address}}</div>
|
||||
<button class="copy-btn" onclick="copyAddress()">复制地址</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="instructions">
|
||||
<h4>📋 转账说明</h4>
|
||||
<ol>
|
||||
<li>必须使用 <strong>Polygon 网络</strong> 进行转账,请勿转入 POL!</li>
|
||||
<li>转账完成后系统会自动确认到账</li>
|
||||
<li>转账金额必须与显示金额完全一致</li>
|
||||
<li>如果有其它疑问,请联系客服处理</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="footer-info">
|
||||
<div class="project-info">
|
||||
<span class="powered-by">Powered by</span>
|
||||
<a href="https://github.com/v03413/BEpusdt" target="_blank" class="project-link">
|
||||
<strong>BEpusdt</strong>
|
||||
</a>
|
||||
<span class="open-source">Github</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="instructions">
|
||||
<h4>📋 转账说明</h4>
|
||||
<ol>
|
||||
<li>必须使用 <strong>Polygon 网络</strong> 进行转账</li>
|
||||
<li>转账完成后系统会自动确认到账</li>
|
||||
<li>转账金额必须与显示金额完全一致</li>
|
||||
<li>如果有其它疑问 请联系客服处理</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="footer-info">
|
||||
<div class="project-info">
|
||||
<span class="powered-by">Powered by</span>
|
||||
<a href="https://github.com/v03413/bepusdt" target="_blank" class="project-link">
|
||||
<strong>Bepusdt</strong>
|
||||
</a>
|
||||
<span class="open-source">Github</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
USDTPayment.init({
|
||||
expire: "{{.expire}}",
|
||||
address: "{{.address}}",
|
||||
trade_id: "{{.trade_id}}",
|
||||
return_url: "{{.return_url}}"
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
USDTPayment.init({
|
||||
expire: "{{.expire}}",
|
||||
address: "{{.address}}",
|
||||
trade_id: "{{.trade_id}}",
|
||||
return_url: "{{.return_url}}"
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -4,8 +4,8 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>USDT・Solana 一款更好用的个人USDT收款网关 Bepusdt</title>
|
||||
<link rel="shortcut icon" href="/img/tether.svg"/>
|
||||
<title>USDT・Solana 一款更好用的个人USDT收款网关 BEpusdt</title>
|
||||
<link rel="shortcut icon" href="/img/tether.svg">
|
||||
<link rel="stylesheet" href="/css/usdt.min.css">
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
<script src="/js/jquery.qrcode_1.0.min.js"></script>
|
||||
@@ -13,81 +13,81 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="payment-container">
|
||||
<div class="crypto-icon">USDT</div>
|
||||
<h1 class="payment-title">USDT 支付</h1>
|
||||
<p class="payment-subtitle">
|
||||
<span class="status-indicator"></span>
|
||||
请使用 <strong>Solana</strong> 区块网络进行转账
|
||||
<span class="network-badge">Solana</span>
|
||||
</p>
|
||||
<div class="order-info">
|
||||
<div class="order-item">
|
||||
<span class="order-label">转账金额:</span>
|
||||
<span class="order-value amount-highlight" id="payAmount">{{.amount}} USDT</span>
|
||||
</div>
|
||||
<div class="order-item">
|
||||
<span class="order-label">商户订单:</span>
|
||||
<span class="order-value" id="orderNumber">{{.order_id}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="countdown-banner">
|
||||
<div class="countdown-content">
|
||||
<div class="countdown-info">
|
||||
<div class="countdown-title">⏰ 支付倒计时</div>
|
||||
<div class="countdown-subtitle">请在时间内完成转账</div>
|
||||
<div class="payment-container">
|
||||
<div class="crypto-icon">USDT</div>
|
||||
<h1 class="payment-title">USDT 支付</h1>
|
||||
<p class="payment-subtitle">
|
||||
<span class="status-indicator"></span>
|
||||
请使用 <strong>Solana</strong> 网络进行转账
|
||||
<span class="network-badge">Solana</span>
|
||||
</p>
|
||||
<div class="order-info">
|
||||
<div class="order-item">
|
||||
<span class="order-label">转账金额:</span>
|
||||
<span class="order-value amount-highlight" id="payAmount">{{.amount}} USDT</span>
|
||||
</div>
|
||||
<div class="countdown-timer" id="countdown">
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="minutes">15</span>
|
||||
<span class="time-label">分</span>
|
||||
<div class="order-item">
|
||||
<span class="order-label">商户订单:</span>
|
||||
<span class="order-value" id="orderNumber">{{.order_id}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="countdown-banner">
|
||||
<div class="countdown-content">
|
||||
<div class="countdown-info">
|
||||
<div class="countdown-title">⏰ 支付倒计时</div>
|
||||
<div class="countdown-subtitle">请在指定时间内完成转账,超时勿付请重新下单</div>
|
||||
</div>
|
||||
<span class="time-separator">:</span>
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="seconds">00</span>
|
||||
<span class="time-label">秒</span>
|
||||
<div class="countdown-timer" id="countdown">
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="minutes">15</span>
|
||||
<span class="time-label">分</span>
|
||||
</div>
|
||||
<span class="time-separator">:</span>
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="seconds">00</span>
|
||||
<span class="time-label">秒</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="qr-section">
|
||||
<div class="qr-code" id="qrcode"></div>
|
||||
<div class="address-section">
|
||||
<div class="address-label">收款地址 (Solana 网络)</div>
|
||||
<div class="address-text" id="walletAddress">{{.address}}</div>
|
||||
<button class="copy-btn" onclick="copyAddress()">复制地址</button>
|
||||
<div class="qr-section">
|
||||
<div class="qr-code" id="qrcode"></div>
|
||||
<div class="address-section">
|
||||
<div class="address-label">收款地址 (Solana 网络)</div>
|
||||
<div class="address-text" id="walletAddress">{{.address}}</div>
|
||||
<button class="copy-btn" onclick="copyAddress()">复制地址</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="instructions">
|
||||
<h4>📋 转账说明</h4>
|
||||
<ol>
|
||||
<li>必须使用 <strong>Solana 网络</strong> 进行转账,请勿转入 SOL!</li>
|
||||
<li>转账完成后系统会自动确认到账</li>
|
||||
<li>转账金额必须与显示金额完全一致</li>
|
||||
<li>如果有其它疑问,请联系客服处理</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="footer-info">
|
||||
<div class="project-info">
|
||||
<span class="powered-by">Powered by</span>
|
||||
<a href="https://github.com/v03413/BEpusdt" target="_blank" class="project-link">
|
||||
<strong>BEpusdt</strong>
|
||||
</a>
|
||||
<span class="open-source">Github</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="instructions">
|
||||
<h4>📋 转账说明</h4>
|
||||
<ol>
|
||||
<li>必须使用 <strong>Solana 网络</strong> 进行转账</li>
|
||||
<li>转账完成后系统会自动确认到账</li>
|
||||
<li>转账金额必须与显示金额完全一致</li>
|
||||
<li>如果有其它疑问 请联系客服处理</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="footer-info">
|
||||
<div class="project-info">
|
||||
<span class="powered-by">Powered by</span>
|
||||
<a href="https://github.com/v03413/bepusdt" target="_blank" class="project-link">
|
||||
<strong>Bepusdt</strong>
|
||||
</a>
|
||||
<span class="open-source">Github</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
USDTPayment.init({
|
||||
expire: "{{.expire}}",
|
||||
address: "{{.address}}",
|
||||
trade_id: "{{.trade_id}}",
|
||||
return_url: "{{.return_url}}"
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
USDTPayment.init({
|
||||
expire: "{{.expire}}",
|
||||
address: "{{.address}}",
|
||||
trade_id: "{{.trade_id}}",
|
||||
return_url: "{{.return_url}}"
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -4,8 +4,8 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>USDT・TRC20 一款更好用的个人USDT收款网关 Bepusdt</title>
|
||||
<link rel="shortcut icon" href="/img/tether.svg"/>
|
||||
<title>USDT・TRC20 一款更好用的个人USDT收款网关 BEpusdt</title>
|
||||
<link rel="shortcut icon" href="/img/tether.svg">
|
||||
<link rel="stylesheet" href="/css/usdt.min.css">
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
<script src="/js/jquery.qrcode_1.0.min.js"></script>
|
||||
@@ -13,81 +13,81 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="payment-container">
|
||||
<div class="crypto-icon">USDT</div>
|
||||
<h1 class="payment-title">USDT 支付</h1>
|
||||
<p class="payment-subtitle">
|
||||
<span class="status-indicator"></span>
|
||||
请使用 波场<strong>(TRON)</strong> 进行转账
|
||||
<span class="network-badge">TRC20</span>
|
||||
</p>
|
||||
<div class="order-info">
|
||||
<div class="order-item">
|
||||
<span class="order-label">转账金额:</span>
|
||||
<span class="order-value amount-highlight" id="payAmount">{{.amount}} USDT</span>
|
||||
</div>
|
||||
<div class="order-item">
|
||||
<span class="order-label">商户订单:</span>
|
||||
<span class="order-value" id="orderNumber">{{.order_id}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="countdown-banner">
|
||||
<div class="countdown-content">
|
||||
<div class="countdown-info">
|
||||
<div class="countdown-title">⏰ 支付倒计时</div>
|
||||
<div class="countdown-subtitle">请在时间内完成转账</div>
|
||||
<div class="payment-container">
|
||||
<div class="crypto-icon">USDT</div>
|
||||
<h1 class="payment-title">USDT 支付</h1>
|
||||
<p class="payment-subtitle">
|
||||
<span class="status-indicator"></span>
|
||||
请使用 <strong>波场 (TRON)</strong> TRC20 网络进行转账
|
||||
<span class="network-badge">TRC20</span>
|
||||
</p>
|
||||
<div class="order-info">
|
||||
<div class="order-item">
|
||||
<span class="order-label">转账金额:</span>
|
||||
<span class="order-value amount-highlight" id="payAmount">{{.amount}} USDT</span>
|
||||
</div>
|
||||
<div class="countdown-timer" id="countdown">
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="minutes">15</span>
|
||||
<span class="time-label">分</span>
|
||||
<div class="order-item">
|
||||
<span class="order-label">商户订单:</span>
|
||||
<span class="order-value" id="orderNumber">{{.order_id}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="countdown-banner">
|
||||
<div class="countdown-content">
|
||||
<div class="countdown-info">
|
||||
<div class="countdown-title">⏰ 支付倒计时</div>
|
||||
<div class="countdown-subtitle">请在指定时间内完成转账,超时勿付请重新下单</div>
|
||||
</div>
|
||||
<span class="time-separator">:</span>
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="seconds">00</span>
|
||||
<span class="time-label">秒</span>
|
||||
<div class="countdown-timer" id="countdown">
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="minutes">15</span>
|
||||
<span class="time-label">分</span>
|
||||
</div>
|
||||
<span class="time-separator">:</span>
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="seconds">00</span>
|
||||
<span class="time-label">秒</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="qr-section">
|
||||
<div class="qr-code" id="qrcode"></div>
|
||||
<div class="address-section">
|
||||
<div class="address-label">收款地址 (TRC20 网络)</div>
|
||||
<div class="address-text" id="walletAddress">{{.address}}</div>
|
||||
<button class="copy-btn" onclick="copyAddress()">复制地址</button>
|
||||
<div class="qr-section">
|
||||
<div class="qr-code" id="qrcode"></div>
|
||||
<div class="address-section">
|
||||
<div class="address-label">收款地址 (TRC20 网络)</div>
|
||||
<div class="address-text" id="walletAddress">{{.address}}</div>
|
||||
<button class="copy-btn" onclick="copyAddress()">复制地址</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="instructions">
|
||||
<h4>📋 转账说明</h4>
|
||||
<ol>
|
||||
<li>必须使用 <strong>TRC20 网络</strong> 进行转账,请勿转入 TRX!</li>
|
||||
<li>转账完成后系统会自动确认到账</li>
|
||||
<li>转账金额必须与显示金额完全一致</li>
|
||||
<li>如果有其它疑问,请联系客服处理</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="footer-info">
|
||||
<div class="project-info">
|
||||
<span class="powered-by">Powered by</span>
|
||||
<a href="https://github.com/v03413/BEpusdt" target="_blank" class="project-link">
|
||||
<strong>BEpusdt</strong>
|
||||
</a>
|
||||
<span class="open-source">Github</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="instructions">
|
||||
<h4>📋 转账说明</h4>
|
||||
<ol>
|
||||
<li>必须使用 <strong>TRC20 网络</strong> 进行转账</li>
|
||||
<li>转账完成后系统会自动确认到账</li>
|
||||
<li>转账金额必须与显示金额完全一致</li>
|
||||
<li>如果有其它疑问 请联系客服处理</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="footer-info">
|
||||
<div class="project-info">
|
||||
<span class="powered-by">Powered by</span>
|
||||
<a href="https://github.com/v03413/bepusdt" target="_blank" class="project-link">
|
||||
<strong>Bepusdt</strong>
|
||||
</a>
|
||||
<span class="open-source">Github</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
USDTPayment.init({
|
||||
expire: "{{.expire}}",
|
||||
address: "{{.address}}",
|
||||
trade_id: "{{.trade_id}}",
|
||||
return_url: "{{.return_url}}"
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
USDTPayment.init({
|
||||
expire: "{{.expire}}",
|
||||
address: "{{.address}}",
|
||||
trade_id: "{{.trade_id}}",
|
||||
return_url: "{{.return_url}}"
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -4,8 +4,8 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>USDT・X Layer 一款更好用的个人USDT收款网关 Bepusdt</title>
|
||||
<link rel="shortcut icon" href="/img/tether.svg"/>
|
||||
<title>USDT・X Layer 一款更好用的个人USDT收款网关 BEpusdt</title>
|
||||
<link rel="shortcut icon" href="/img/tether.svg">
|
||||
<link rel="stylesheet" href="/css/usdt.min.css">
|
||||
<script src="/js/jquery.min.js"></script>
|
||||
<script src="/js/jquery.qrcode_1.0.min.js"></script>
|
||||
@@ -13,81 +13,81 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="payment-container">
|
||||
<div class="crypto-icon">USDT</div>
|
||||
<h1 class="payment-title">USDT 支付</h1>
|
||||
<p class="payment-subtitle">
|
||||
<span class="status-indicator"></span>
|
||||
请使用 OKX<strong>(X Layer)</strong> 进行转账
|
||||
<span class="network-badge">X Layer</span>
|
||||
</p>
|
||||
<div class="order-info">
|
||||
<div class="order-item">
|
||||
<span class="order-label">转账金额:</span>
|
||||
<span class="order-value amount-highlight" id="payAmount">{{.amount}} USDT</span>
|
||||
</div>
|
||||
<div class="order-item">
|
||||
<span class="order-label">商户订单:</span>
|
||||
<span class="order-value" id="orderNumber">{{.order_id}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="countdown-banner">
|
||||
<div class="countdown-content">
|
||||
<div class="countdown-info">
|
||||
<div class="countdown-title">⏰ 支付倒计时</div>
|
||||
<div class="countdown-subtitle">请在时间内完成转账</div>
|
||||
<div class="payment-container">
|
||||
<div class="crypto-icon">USDT</div>
|
||||
<h1 class="payment-title">USDT 支付</h1>
|
||||
<p class="payment-subtitle">
|
||||
<span class="status-indicator"></span>
|
||||
请使用 <strong>OKX (X Layer)</strong> 网络进行转账
|
||||
<span class="network-badge">X Layer</span>
|
||||
</p>
|
||||
<div class="order-info">
|
||||
<div class="order-item">
|
||||
<span class="order-label">转账金额:</span>
|
||||
<span class="order-value amount-highlight" id="payAmount">{{.amount}} USDT</span>
|
||||
</div>
|
||||
<div class="countdown-timer" id="countdown">
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="minutes">15</span>
|
||||
<span class="time-label">分</span>
|
||||
<div class="order-item">
|
||||
<span class="order-label">商户订单:</span>
|
||||
<span class="order-value" id="orderNumber">{{.order_id}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="countdown-banner">
|
||||
<div class="countdown-content">
|
||||
<div class="countdown-info">
|
||||
<div class="countdown-title">⏰ 支付倒计时</div>
|
||||
<div class="countdown-subtitle">请在指定时间内完成转账,超时勿付请重新下单</div>
|
||||
</div>
|
||||
<span class="time-separator">:</span>
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="seconds">00</span>
|
||||
<span class="time-label">秒</span>
|
||||
<div class="countdown-timer" id="countdown">
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="minutes">15</span>
|
||||
<span class="time-label">分</span>
|
||||
</div>
|
||||
<span class="time-separator">:</span>
|
||||
<div class="time-unit">
|
||||
<span class="time-number" id="seconds">00</span>
|
||||
<span class="time-label">秒</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="qr-section">
|
||||
<div class="qr-code" id="qrcode"></div>
|
||||
<div class="address-section">
|
||||
<div class="address-label">收款地址 (X Layer 网络)</div>
|
||||
<div class="address-text" id="walletAddress">{{.address}}</div>
|
||||
<button class="copy-btn" onclick="copyAddress()">复制地址</button>
|
||||
<div class="qr-section">
|
||||
<div class="qr-code" id="qrcode"></div>
|
||||
<div class="address-section">
|
||||
<div class="address-label">收款地址 (X Layer 网络)</div>
|
||||
<div class="address-text" id="walletAddress">{{.address}}</div>
|
||||
<button class="copy-btn" onclick="copyAddress()">复制地址</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="instructions">
|
||||
<h4>📋 转账说明</h4>
|
||||
<ol>
|
||||
<li>必须使用 <strong>X Layer 网络</strong> 进行转账,请勿转入 OKB!</li>
|
||||
<li>转账完成后系统会自动确认到账</li>
|
||||
<li>转账金额必须与显示金额完全一致</li>
|
||||
<li>如果有其它疑问,请联系客服处理</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="footer-info">
|
||||
<div class="project-info">
|
||||
<span class="powered-by">Powered by</span>
|
||||
<a href="https://github.com/v03413/BEpusdt" target="_blank" class="project-link">
|
||||
<strong>BEpusdt</strong>
|
||||
</a>
|
||||
<span class="open-source">Github</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="instructions">
|
||||
<h4>📋 转账说明</h4>
|
||||
<ol>
|
||||
<li>必须使用 <strong>X Layer 网络</strong> 进行转账</li>
|
||||
<li>转账完成后系统会自动确认到账</li>
|
||||
<li>转账金额必须与显示金额完全一致</li>
|
||||
<li>如果有其它疑问 请联系客服处理</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="footer-info">
|
||||
<div class="project-info">
|
||||
<span class="powered-by">Powered by</span>
|
||||
<a href="https://github.com/v03413/bepusdt" target="_blank" class="project-link">
|
||||
<strong>Bepusdt</strong>
|
||||
</a>
|
||||
<span class="open-source">Github</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
USDTPayment.init({
|
||||
expire: "{{.expire}}",
|
||||
address: "{{.address}}",
|
||||
trade_id: "{{.trade_id}}",
|
||||
return_url: "{{.return_url}}"
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
USDTPayment.init({
|
||||
expire: "{{.expire}}",
|
||||
address: "{{.address}}",
|
||||
trade_id: "{{.trade_id}}",
|
||||
return_url: "{{.return_url}}"
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||