Files
hash-wallet/lib/reactions/wallet_utils.dart
T
8af85351e9 feat: redesign for CurrencyPicker and FiatPicker, introduce recents and currency groupings (#3248)
* Redesign for CurrencyPicker and FiatPicker, introduce recents and currency groupings

* chore: cleanup

* refactor: switch recents to previously completed trades, specify stables to be displayed, fix scrollable and adjust badge

* refactor: switch recents to previously completed trades, specify stables to be displayed, fix scrollable, adjust badge, add fiat and multinetwork currency pickers to buy and sell flows

* fresh set of changes and fixes for new currency picker flow

* add chain label to items on search and smooth pop

* add chain pill and label to xstocks

* properly filter search results

* shorten chain pill name for BSC tokens

* Review fixes

* cleanups

* safe pop

---------

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
2026-06-03 16:38:16 +02:00

74 lines
1.7 KiB
Dart

import 'package:cw_core/wallet_type.dart';
bool isBIP39Wallet(WalletType walletType) {
switch (walletType) {
case WalletType.ethereum:
case WalletType.polygon:
case WalletType.base:
case WalletType.arbitrum:
case WalletType.bsc:
case WalletType.solana:
case WalletType.tron:
case WalletType.bitcoin:
case WalletType.litecoin:
case WalletType.bitcoinCash:
case WalletType.nano:
case WalletType.banano:
case WalletType.monero:
case WalletType.dogecoin:
case WalletType.zcash:
return true;
case WalletType.wownero:
case WalletType.haven:
case WalletType.zano:
case WalletType.decred:
case WalletType.none:
return false;
}
}
bool isElectrumWallet(WalletType walletType) {
switch (walletType) {
case WalletType.bitcoin:
case WalletType.litecoin:
case WalletType.bitcoinCash:
return true;
default:
return false;
}
}
bool hasTokens(WalletType walletType) {
switch (walletType) {
case WalletType.ethereum:
case WalletType.polygon:
case WalletType.solana:
case WalletType.tron:
case WalletType.zano:
case WalletType.base:
case WalletType.arbitrum:
case WalletType.bsc:
return true;
default:
return false;
}
}
String tokenStandardFor(WalletType walletType) {
switch (walletType) {
case WalletType.ethereum:
case WalletType.polygon:
case WalletType.arbitrum:
case WalletType.base:
return 'ERC-20';
case WalletType.bsc:
return 'BEP-20';
case WalletType.solana:
return 'SPL';
case WalletType.tron:
return 'TRC-20';
default:
return walletTypeToString(walletType);
}
}