2020-01-04 19:31:52 +00:00
|
|
|
import 'package:flutter/foundation.dart';
|
2020-09-21 11:50:26 +00:00
|
|
|
import 'package:cake_wallet/entities/crypto_currency.dart';
|
|
|
|
import 'package:cake_wallet/exchange/trade_request.dart';
|
|
|
|
import 'package:cake_wallet/exchange/exchange_pair.dart';
|
|
|
|
import 'package:cake_wallet/exchange/limits.dart';
|
|
|
|
import 'package:cake_wallet/exchange/trade.dart';
|
|
|
|
import 'package:cake_wallet/exchange/exchange_provider_description.dart';
|
2020-01-04 19:31:52 +00:00
|
|
|
|
|
|
|
abstract class ExchangeProvider {
|
2020-01-08 12:26:34 +00:00
|
|
|
ExchangeProvider({this.pairList});
|
|
|
|
|
2020-01-04 19:31:52 +00:00
|
|
|
String get title;
|
|
|
|
List<ExchangePair> pairList;
|
|
|
|
ExchangeProviderDescription description;
|
2020-11-10 14:58:40 +00:00
|
|
|
bool get isAvailable;
|
2020-01-04 19:31:52 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
String toString() => title;
|
|
|
|
|
2021-02-18 19:08:52 +00:00
|
|
|
Future<Limits> fetchLimits(
|
|
|
|
{CryptoCurrency from, CryptoCurrency to, bool isFixedRateMode});
|
|
|
|
Future<Trade> createTrade({TradeRequest request, bool isFixedRateMode});
|
2020-01-04 19:31:52 +00:00
|
|
|
Future<Trade> findTradeById({@required String id});
|
2021-02-18 19:08:52 +00:00
|
|
|
Future<double> calculateAmount({CryptoCurrency from, CryptoCurrency to,
|
|
|
|
double amount, bool isFixedRateMode, bool isReceiveAmount});
|
2020-11-10 14:58:40 +00:00
|
|
|
Future<bool> checkIsAvailable();
|
2020-01-04 19:31:52 +00:00
|
|
|
}
|