feat: add Aptos USDT/USDC payment support

This commit is contained in:
line-6000
2026-06-20 11:08:19 +08:00
parent 79ca1730cd
commit de96a5d3e7
32 changed files with 2331 additions and 16 deletions
@@ -44,6 +44,13 @@ func buildSupportedAssets() ([]response.NetworkTokenSupport, error) {
}
symbols := make([]string, 0, len(tokens))
for _, t := range tokens {
contractAddress := strings.TrimSpace(t.ContractAddress)
if network == mdb.NetworkAptos && !aptosPublicPaymentToken(t.Symbol) {
continue
}
if network == mdb.NetworkAptos && contractAddress == "" {
continue
}
sym := strings.ToUpper(strings.TrimSpace(t.Symbol))
if sym == "" {
continue
@@ -68,6 +75,15 @@ func buildSupportedAssets() ([]response.NetworkTokenSupport, error) {
return supports, nil
}
func aptosPublicPaymentToken(symbol string) bool {
switch strings.ToUpper(strings.TrimSpace(symbol)) {
case "USDT", "USDC":
return true
default:
return false
}
}
// GetPublicConfig returns payment/site config consumed by cashier/frontends.
// The public route returns brand/site display config plus non-sensitive
// epay/okpay knobs, while the authenticated admin route also includes OkPay