mirror of
https://github.com/GMWalletApp/epusdt.git
synced 2026-07-07 18:26:16 +00:00
feat: add Aptos USDT/USDC payment support
This commit is contained in:
@@ -54,6 +54,11 @@ func normalizeOrderAddressByNetwork(network, address string) string {
|
||||
return normalized
|
||||
}
|
||||
return address
|
||||
case mdb.NetworkAptos:
|
||||
if normalized, err := addressutil.NormalizeMoveAddress(address); err == nil {
|
||||
return normalized
|
||||
}
|
||||
return address
|
||||
default:
|
||||
return address
|
||||
}
|
||||
@@ -67,6 +72,17 @@ func ensureEnabledOrderAsset(network, token string) (*mdb.ChainToken, error) {
|
||||
if tokenRow == nil || tokenRow.ID == 0 {
|
||||
return nil, constant.SupportedAssetNotFound
|
||||
}
|
||||
if tokenRow.Network == mdb.NetworkAptos {
|
||||
switch NormalizeAptosPaymentSymbol(tokenRow.Symbol) {
|
||||
case "USDT", "USDC":
|
||||
default:
|
||||
return nil, constant.SupportedAssetNotFound
|
||||
}
|
||||
}
|
||||
contractAddress := strings.TrimSpace(tokenRow.ContractAddress)
|
||||
if tokenRow.Network == mdb.NetworkAptos && contractAddress == "" {
|
||||
return nil, constant.SupportedAssetNotFound
|
||||
}
|
||||
return tokenRow, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user