fix(aptos): drive token support and RPC routing from config

This commit is contained in:
line-6000
2026-06-20 14:17:42 +08:00
parent de96a5d3e7
commit 8216c91739
11 changed files with 355 additions and 121 deletions
@@ -10,6 +10,7 @@ import (
"github.com/GMWalletApp/epusdt/model/data"
"github.com/GMWalletApp/epusdt/model/mdb"
"github.com/GMWalletApp/epusdt/model/response"
"github.com/GMWalletApp/epusdt/model/service"
"github.com/GMWalletApp/epusdt/util/constant"
"github.com/labstack/echo/v4"
)
@@ -44,11 +45,7 @@ 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 == "" {
if !service.ChainTokenReadyForPayment(t) {
continue
}
sym := strings.ToUpper(strings.TrimSpace(t.Symbol))
@@ -75,15 +72,6 @@ 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