Address-formatting-enhancements-MWEB (#2189)

* apply formatting to address book and MWEB

* fix wallet type exception

* Update cw_core/lib/wallet_type.dart [skip ci]

* Update lib/src/screens/contact/contact_list_page.dart [skip ci]

* Update lib/src/screens/contact/contact_list_page.dart [skip ci]

* Update lib/utils/address_formatter.dart [skip ci]

* Update lib/utils/address_formatter.dart [skip ci]

* Update lib/utils/address_formatter.dart

---------

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
Serhii 2025-04-11 20:51:30 +03:00 committed by GitHub
parent 2f28ea3fb7
commit a7376c3225
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 173 additions and 84 deletions

View file

@ -247,3 +247,38 @@ CryptoCurrency walletTypeToCryptoCurrency(WalletType type, {bool isTestnet = fal
'Unexpected wallet type: ${type.toString()} for CryptoCurrency walletTypeToCryptoCurrency');
}
}
WalletType? cryptoCurrencyToWalletType(CryptoCurrency type) {
switch (type) {
case CryptoCurrency.xmr:
return WalletType.monero;
case CryptoCurrency.btc:
return WalletType.bitcoin;
case CryptoCurrency.ltc:
return WalletType.litecoin;
case CryptoCurrency.xhv:
return WalletType.haven;
case CryptoCurrency.eth:
return WalletType.ethereum;
case CryptoCurrency.bch:
return WalletType.bitcoinCash;
case CryptoCurrency.nano:
return WalletType.nano;
case CryptoCurrency.banano:
return WalletType.banano;
case CryptoCurrency.maticpoly:
return WalletType.polygon;
case CryptoCurrency.sol:
return WalletType.solana;
case CryptoCurrency.trx:
return WalletType.tron;
case CryptoCurrency.wow:
return WalletType.wownero;
case CryptoCurrency.zano:
return WalletType.zano;
case CryptoCurrency.dcr:
return WalletType.decred;
default:
return null;
}
}