168 Commits
Author SHA1 Message Date
admin 647e1b96b1 feat(db): 支持 MySQL(MYSQL_DSN 环境变量 / --mysql 参数)
Docker Build (Gitea) / Build and Push Docker Image (push) Successful in 46s
- app/cmd/flag.go: 新增 MysqlDSNFlag(env MYSQL_DSN)
- start/reset: 读取并传给 model.Init
- model.Init 改为三选一:MySQL > PostgreSQL > SQLite
- 新增 initMysql():连接池参数对齐 Postgres 那套(10/100、30m 生命周期)
- order.go: return_url / notify_url 从 TEXT 改 VARCHAR(1024)
  MySQL 8 不允许 TEXT 列带 DEFAULT(Error 1101),改 varchar 三库通用

实测(真 mysql:8.0 容器):6 张表全部建出,bep_order 列类型符合预期
2026-11-24 19:58:08 +08:00
sylearn c592d3fb7a fix: fold truncate matching into has_prefix
Per review, drop the separate truncate mode and use its logic for
has_prefix instead. Order amounts are stored without trailing zeros
(1.50 as "1.5"), so the plain string prefix check let the 1.5 order
claim a 1.51 payment meant for a concurrent order on the same address.
Truncate the received amount to the larger of the atom precision and
the order's own decimals, then compare exactly: overpayment below the
atom precision still matches, underpayment and overpayment of a full
atom no longer do.
2026-11-01 22:49:44 +09:00
sylearn 5cb1d6f099 feat: add truncate amount match mode
Truncate the received amount to the atom precision before an exact comparison, so overpayment below the atom precision still matches while concurrent orders on one address (1.50, 1.51, ...) never claim each other's payments.
2026-10-31 23:45:49 +09:00
sylearnandClaude Opus 5.5 014bb8e12b feat(solana): reconcile expired orders against token account history
Block scanning gives every slot one chance. A skipped or abandoned slot,
a restart, or an incomplete lookback range loses a payment for good, and
nothing finds it again.

Once a Solana order has been expired for a minute (up to two hours), look
it up once in the receiving token accounts' own history:

- token accounts: the wallet's associated token account, derived locally,
  plus any other account from getTokenAccountsByOwner when the node
  supports it (publicnode's free tier rejects that method);
- getSignaturesForAddress back to the order's creation time, keeping
  successful signatures inside the order window that no order has used;
- getTransaction, parsed with parseTransaction and checked with the
  existing orderTransferMatch. A match is marked confirming and then
  follows the normal confirm and callback flow.

RPC errors leave the order for the next round. Cost: a few RPC calls per
expired Solana order plus one getTransaction per candidate payment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 13:41:36 +08:00
v03413 d36d34fe04 fix: 订单 URL 字段改为 text
return_url/notify_url 原为 varchar(255),超长时 PostgreSQL 写入订单报错 (SQLSTATE 22001),由 AutoMigrate 自动变更列类型。

Fix #234
2026-10-15 18:07:53 +08:00
betaxab 7eb0263193 fix: Fixed the issue of dropped orders on the TON blockchain
fix: Set "lookbackDone" only after the lookback has truly completed.
misc: Move TON address validation to utils.
2026-07-24 03:57:58 +08:00
v03413 b321da7bba feat: add checkout network ordering 2026-07-15 10:14:56 +08:00
long2ice efd1ce348a fix: use match_address when locking exclusive wallets
LockTradeAddress queried bep_order with match_addr (wallet column),
causing Error 1054 and breaking exclusive address checks.
2026-07-14 01:11:03 +08:00
v03413 43c579198a fix: remove order fingerprint index 2026-07-08 17:45:24 +08:00
v03413 e180b52c9a Merge branch 'refs/heads/main' into Fingerprint
# Conflicts:
#	app/handler/epusdt/epusdt.go
#	app/model/order.go
#	app/model/trade.go
2026-07-08 17:38:16 +08:00
v03413 3ca46e7fb9 fix: enforce fingerprint checks on payments 2026-07-08 17:32:11 +08:00
v03413 8076cd4b75 refactor: remove MySQL support and add migrations 2026-07-08 15:47:40 +08:00
v03413 e5e847f18f feat: always allow payment type reselect 2026-07-08 10:45:51 +08:00
v03413 54e73e48e4 fix: filter empty TronGrid API keys 2026-07-08 09:22:52 +08:00
v03413 451da12e09 feat: add client fingerprint checks for orders 2026-07-08 09:20:29 +08:00
betaxab 1f92306b03 fix: wallet.go: Pre-initialize MatchAddr = Address to prevent issues: #213 2026-06-27 19:32:26 +08:00
betaxab 79982c935f fix: order model: add default:0 value to fix #211 2026-06-26 13:17:50 +08:00
betaxab aafbac7b7b feat: Add the ability to reselect order trade types 2026-06-24 00:51:20 +08:00
v03413 2edf26857e feat: add configurable order lookback hours 2026-06-21 16:23:55 +08:00
v03413 13d3fad174 refactor: move block api package to core 2026-06-21 01:30:04 +08:00
v03413 5e598cd2f3 feat: add unified checkout template 2026-06-21 01:24:12 +08:00
v03413 c350868195 perf: set Coingecko request user agent 2026-06-19 01:35:14 +08:00
v03413 d458ef7ca3 feat: add API-backed block lookback 2026-06-19 01:33:56 +08:00
狼哥 9ac18ade71 Add LangGe checkout template mode 2026-06-17 03:28:59 -07:00
Jason.li 1e52f40a6c Merge origin/main into payment reconciliation fix 2026-06-07 14:40:38 +08:00
Jason.li f28ae2aa8d fix(solana): reconcile missed token payments
Add a Solana reconciliation task that backfills recent waiting, expired, and failed orders by scanning token accounts, signatures, and parsed transactions for matching SPL transfers.

Reuse shared order matching for realtime transfer handling, return DB errors from MarkConfirming, and keep confirming orders eligible when the on-chain payment timestamp was inside the order window even if final confirmation happens after expiry.
2026-06-07 12:51:23 +08:00
v03413 2bf1406566 feat: rename TON native coin to GRAM
ref: https://t.me/toncoin/2384
ref: https://ton.vote/EQDQvywF226NXojPky_9gwbCz0FPoygqY11bGl03SONNBs5V/proposal/EQAv-VS2OM80SYLB0ouRWRcpFg4J0L-egUf1-utF-OJ6h0rK
2026-06-03 15:25:41 +08:00
v03413 94440de2d3 feat: 增加支持自定义主页跳转
feat: https://github.com/v03413/BEpusdt/issues/197
2026-06-02 21:46:07 +08:00
v03413 ea113e6e90 feat: 增加支持 Ton 区块链网络扫块
新增交易类型 ton.toncoin usdt.ton
close: https://github.com/v03413/BEpusdt/pull/192
2026-06-02 21:03:19 +08:00
betaxab cb5aed93c6 perf: add order notify retry index 2026-05-02 17:18:05 +08:00
v03413 94ba4b7c5b perf: remove default currency limit setting in BuildOrder
fix: https://github.com/v03413/BEpusdt/issues/178
2026-04-25 21:15:30 +08:00
v03413 6ccd93a161 feat: 增加支持历史汇率自动清理 2026-04-16 10:57:57 +08:00
v03413 2edf71dee1 feat: 增加支持自定义Topic 路径前缀 2026-04-15 21:44:34 +08:00
v03413 c4d5e20c7a feat: 实现交易监听 MQTT服务器广播 2026-04-15 14:58:24 +08:00
v03413 30eb6659d8 feat: 实现钱包地址独占模式 & 安全优化 2026-04-14 13:36:54 +08:00
v03413 f866db9f1b feat: 配置支持多个 trongrid key
多个用半角符逗号隔开,使用的时候随机抽取
feat: https://github.com/v03413/BEpusdt/issues/171
2026-04-07 14:05:34 +08:00
v03413 8c4ead0169 fix: ensure Datetime uses local time zone 2026-02-27 15:20:34 +08:00
v03413 9e7707588f perf: remove hardcoded secret 2026-02-27 14:22:29 +08:00
v03413 0db728dc52 fix: synchronize BuildOrder correctly 2026-02-27 14:00:54 +08:00
v03413 6a2f3b6d6e feat: add PostgreSQL database support 2026-02-26 14:51:53 +08:00
v03413 0ed85860fc feat: add block offset confirmation feature
resolved: https://github.com/v03413/BEpusdt/issues/160
2026-02-22 22:11:38 +08:00
v03413 e7e1cae418 refactor: streamline request host handling and adjust url paths
解决后台创建订单,在某些反代服务器下无法识别 scheme 问题 && 调整部分路由;既然已经做到了这一步,后期可考虑直接将两个收银台合并,无论是逻辑还是界面
2026-02-22 19:47:29 +08:00
betaxab 7d926f4dae fix: rebuild order should include the crypto and rate param
fix: GetTxUrl prevents cases where the URL is empty
2026-02-20 17:58:36 +08:00
betaxab cd656eb455 feat: Methods API blacklist mode 2026-02-19 11:53:55 +08:00
betaxab 13388f197d feat: admin: order/create api 2026-02-19 02:55:30 +08:00
betaxab a9a94a1413 feat: Complete the backend support for the checkout cashier 2026-02-18 18:18:39 +08:00
betaxab 8478d47abf feat: Add Update order API 2026-02-18 18:18:27 +08:00
betaxab a3c2693417 feat: Add Order creation API 2026-02-18 18:17:49 +08:00
betaxab ec98e9d54b feat: add Methods API 2026-02-17 02:49:42 +08:00
betaxab a0e5cc2790 perf: trade: Get Crypto from Trade instead of querying it again 2026-02-13 20:38:13 +08:00