import 'package:cake_wallet/entities/fiat_currency.dart'; import 'package:cw_core/crypto_currency.dart'; class TradePair { TradePair({required this.from, required this.to}); final T from; final U to; } List> supportedCryptoToFiatPairs({ required List notSupportedCrypto, required List notSupportedFiat, }) { final supportedCrypto = CryptoCurrency.all.where((crypto) => !notSupportedCrypto.contains(crypto)).toList(); final supportedFiat = FiatCurrency.all.where((fiat) => !notSupportedFiat.contains(fiat)).toList(); return supportedCrypto .expand((crypto) => supportedFiat .map((fiat) => TradePair(from: crypto, to: fiat))) .toList(); } List> supportedFiatToCryptoPairs({ required List notSupportedFiat, required List notSupportedCrypto, }) { final supportedFiat = FiatCurrency.all.where((fiat) => !notSupportedFiat.contains(fiat)).toList(); final supportedCrypto = CryptoCurrency.all.where((crypto) => !notSupportedCrypto.contains(crypto)).toList(); return supportedFiat .expand((fiat) => supportedCrypto .map((crypto) => TradePair(from: fiat, to: crypto))) .toList(); }