mirror of
https://github.com/GMWalletApp/epusdt.git
synced 2026-07-07 10:16:15 +00:00
feat: add Aptos USDT/USDC payment support
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user