mirror of
https://github.com/GMWalletApp/epusdt.git
synced 2026-07-07 18:26:16 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user