From d0827dd39e660bc30152f67d3bfbf41450ed4ba6 Mon Sep 17 00:00:00 2001 From: Serhii Date: Fri, 27 Jun 2025 15:47:34 +0300 Subject: [PATCH] add USDT Binance Smart Chain (BSC) support (#2341) --- assets/images/usdtbsc_icon.png | Bin 0 -> 920 bytes cw_core/lib/crypto_currency.dart | 4 +++- .../provider/thorchain_exchange.provider.dart | 3 ++- .../provider/trocador_exchange_provider.dart | 2 ++ 4 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 assets/images/usdtbsc_icon.png diff --git a/assets/images/usdtbsc_icon.png b/assets/images/usdtbsc_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..9f2cda2370168aaad92eeec449730458b6df7d2a GIT binary patch literal 920 zcmV;J184k+P)pF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H110_jB zK~y-6t(0GEQ*{)_Kc~Gb_omsDvMSwN0wl_iWjstLi((TJd72L<4Iv>IU?yZ~OAI7N z5oLx!B$>l`sV_t&nTaOyWSm6tWuYO9*xwP8<7#q-7?A8PwMwMYWX*n_pV0Tj%vUdzzXu&4GZ|^&i-})wwl4|KPV& z%Kuj`S6fxG>LxOo;~rGstMotR^DWGEbxp;0?8xREM}C@|6gT$s^tAq6C`flpOYVMG z*L1yQ&99n7+(7j#BA){S@U&@WuFcHce}818>1H~;*))vYrnHVNoz?Bj zTFKQheW-kCEcOi|`+*`rAr#{Dph><2SNj&3ob@m{>)~qOBKZ=W9yC#v(KTDHx;c^9 zhw7m3j|orh_dj^tM~Q@&TfRJOaO#qUDhS&7Sl|lu4ZzuO>dbD06AxLN-gNrzNB;>} uX~E#ePQ`mnL|+C_mEQ%Ye{ODe2;d)xgHl-NOT0?}0000 with Serializable implemen CryptoCurrency.zano, CryptoCurrency.ton, CryptoCurrency.flip, - CryptoCurrency.deuro + CryptoCurrency.deuro, + CryptoCurrency.usdtbsc, ]; static const havenCurrencies = [ @@ -233,6 +234,7 @@ class CryptoCurrency extends EnumerableItem with Serializable implemen static const zano = CryptoCurrency(title: 'ZANO', tag: 'ZANO', fullName: 'Zano', raw: 96, name: 'zano', iconPath: 'assets/images/zano_icon.png', decimals: 12); static const flip = CryptoCurrency(title: 'FLIP', tag: 'ETH', fullName: 'Chainflip', raw: 97, name: 'flip', iconPath: 'assets/images/flip_icon.png', decimals: 18); static const deuro = CryptoCurrency(title: 'DEURO', tag: 'ETH', fullName: 'Decentralized Euro', raw: 98, name: 'deuro', iconPath: 'assets/images/deuro_icon.png', decimals: 18); + static const usdtbsc = CryptoCurrency(title: 'USDT', tag: 'BSC', fullName: 'USDT Binance coin', raw: 99, name: 'usdtbsc', iconPath: 'assets/images/usdtbsc_icon.png', decimals: 18); static final Map _rawCurrencyMap = [...all, ...havenCurrencies].fold>({}, (acc, item) { diff --git a/lib/exchange/provider/thorchain_exchange.provider.dart b/lib/exchange/provider/thorchain_exchange.provider.dart index 0cdb2a423..16246abac 100644 --- a/lib/exchange/provider/thorchain_exchange.provider.dart +++ b/lib/exchange/provider/thorchain_exchange.provider.dart @@ -23,6 +23,7 @@ class ThorChainExchangeProvider extends ExchangeProvider { // CryptoCurrency.eth, CryptoCurrency.ltc, CryptoCurrency.bch, + CryptoCurrency.usdtbsc, // CryptoCurrency.aave, // CryptoCurrency.dai, // CryptoCurrency.gusd, @@ -259,7 +260,7 @@ class ThorChainExchangeProvider extends ExchangeProvider { } String _normalizeCurrency(CryptoCurrency currency) { - final networkTitle = currency.tag == 'ETH' ? 'ETH' : currency.title; + final networkTitle = currency.tag == 'ETH' ? 'ETH' : currency.tag ?? currency.title; return '$networkTitle.${currency.title}'; } diff --git a/lib/exchange/provider/trocador_exchange_provider.dart b/lib/exchange/provider/trocador_exchange_provider.dart index f3a70b912..cdb0efba8 100644 --- a/lib/exchange/provider/trocador_exchange_provider.dart +++ b/lib/exchange/provider/trocador_exchange_provider.dart @@ -347,6 +347,8 @@ class TrocadorExchangeProvider extends ExchangeProvider { return 'TRC20'; case 'LN': return 'Lightning'; + case 'BSC': + return 'BEP20'; default: return tag.toLowerCase(); }