| 1 | import 'package:cake_wallet/exchange/exchange_provider_description.dart'; |
| 2 | import 'package:cake_wallet/exchange/limits.dart'; |
| 3 | import 'package:cake_wallet/exchange/trade.dart'; |
| 4 | import 'package:cake_wallet/exchange/trade_request.dart'; |
| 5 | import 'package:cw_core/crypto_currency.dart'; |
| 6 | |
| 7 | abstract class ExchangeProvider { |
| 8 | ExchangeProvider(); |
| 9 | |
| 10 | String get title; |
| 11 | |
| 12 | ExchangeProviderDescription get description; |
| 13 | |
| 14 | bool get isAvailable; |
| 15 | |
| 16 | bool get isEnabled; |
| 17 | |
| 18 | bool get supportsFixedRate; |
| 19 | |
| 20 | bool get supportsOnionAddress => false; |
| 21 | |
| 22 | bool get supportsMemoOrDestinationTag => true; |
| 23 | |
| 24 | @override |
| 25 | String toString() => title; |
| 26 | |
| 27 | Future<Limits?> fetchLimits( |
| 28 | {required CryptoCurrency from, required CryptoCurrency to, required bool isFixedRateMode}); |
| 29 | |
| 30 | Future<Trade> createTrade( |
| 31 | {required TradeRequest request, required bool isFixedRateMode, required bool isSendAll}); |
| 32 | |
| 33 | Future<Trade> findTradeById({required String id}); |
| 34 | |
| 35 | Future<double> fetchRate( |
| 36 | {required CryptoCurrency from, |
| 37 | required CryptoCurrency to, |
| 38 | required double amount, |
| 39 | required bool isFixedRateMode, |
| 40 | required bool isReceiveAmount}); |
| 41 | |
| 42 | Future<bool> checkIsAvailable(); |
| 43 | } |