mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-27 14:09:50 +00:00
cef3029f6f
* CW-473 Remove deprecated Exchanges * CW-473 Clean up Exchange Code * CW-473 Add Decimals to Crypto Enums * CW-473 Fix minor merge error * CW-473 Fix minor merge error * CW-473 Fix FAQ Locals * CW-473 Apply requested changes * CW-473 Show Error if Exchange Provider is not supported anymore * CW-473 Implement Requested Changes
43 lines
1.2 KiB
Dart
43 lines
1.2 KiB
Dart
import 'package:cake_wallet/exchange/exchange_pair.dart';
|
|
import 'package:cake_wallet/exchange/exchange_provider_description.dart';
|
|
import 'package:cake_wallet/exchange/limits.dart';
|
|
import 'package:cake_wallet/exchange/trade.dart';
|
|
import 'package:cake_wallet/exchange/trade_request.dart';
|
|
import 'package:cw_core/crypto_currency.dart';
|
|
|
|
abstract class ExchangeProvider {
|
|
ExchangeProvider({required this.pairList});
|
|
|
|
String get title;
|
|
|
|
List<ExchangePair> pairList;
|
|
|
|
ExchangeProviderDescription get description;
|
|
|
|
bool get isAvailable;
|
|
|
|
bool get isEnabled;
|
|
|
|
bool get supportsFixedRate;
|
|
|
|
bool get supportsOnionAddress => false;
|
|
|
|
@override
|
|
String toString() => title;
|
|
|
|
Future<Limits> fetchLimits(
|
|
{required CryptoCurrency from, required CryptoCurrency to, required bool isFixedRateMode});
|
|
|
|
Future<Trade> createTrade({required TradeRequest request, required bool isFixedRateMode});
|
|
|
|
Future<Trade> findTradeById({required String id});
|
|
|
|
Future<double> fetchRate(
|
|
{required CryptoCurrency from,
|
|
required CryptoCurrency to,
|
|
required double amount,
|
|
required bool isFixedRateMode,
|
|
required bool isReceiveAmount});
|
|
|
|
Future<bool> checkIsAvailable();
|
|
}
|