support usdc (#1439)

This commit is contained in:
woodser 2024-11-25 10:48:27 -05:00 committed by GitHub
parent bf452c91da
commit c9cf5351c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 5 deletions

View file

@ -201,6 +201,7 @@ public class CurrencyUtil {
result.add(new CryptoCurrency("ETH", "Ether"));
result.add(new CryptoCurrency("LTC", "Litecoin"));
result.add(new CryptoCurrency("USDT-ERC20", "Tether USD (ERC20)"));
result.add(new CryptoCurrency("USDC-ERC20", "USD Coin (ERC20)"));
result.sort(TradeCurrency::compareTo);
return result;
}
@ -328,13 +329,14 @@ public class CurrencyUtil {
private static boolean isCryptoCurrencyBase(String currencyCode) {
if (currencyCode == null) return false;
currencyCode = currencyCode.toUpperCase();
return currencyCode.equals("USDT");
return currencyCode.equals("USDT") || currencyCode.equals("USDC");
}
public static String getCurrencyCodeBase(String currencyCode) {
if (currencyCode == null) return null;
currencyCode = currencyCode.toUpperCase();
if (currencyCode.contains("USDT")) return "USDT";
if (currencyCode.contains("USDC")) return "USDC";
return currencyCode;
}