feat: add multi-network payment support

- Redesign payment UI with a two-step flow (select coin/network → pay)
  - Add wallet address validation in Telegram bot
  - Rename NetworkEthereum constant from "eth" to "ethereum"
This commit is contained in:
line-6000
2026-04-13 03:52:45 +08:00
parent 32ca778735
commit 5e4d5dfae4
16 changed files with 1459 additions and 827 deletions
+11
View File
@@ -6,6 +6,7 @@ import (
"strings"
"github.com/btcsuite/btcutil/base58"
"github.com/gagliardetto/solana-go"
)
// isValidEthereumAddress 校验 0x + 20 字节十六进制(主网收款)。
@@ -44,3 +45,13 @@ func isValidTronAddress(addr string) bool {
return string(checksum) == string(hash2[:4])
}
// isValidSolanaAddress 校验 Solana Base58 地址是否合法(32 字节公钥)。
func isValidSolanaAddress(addr string) bool {
addr = strings.TrimSpace(addr)
if len(addr) < 32 || len(addr) > 44 {
return false
}
_, err := solana.PublicKeyFromBase58(addr)
return err == nil
}