mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-01 09:57:46 +00:00
c50eeee58b
* Add 'Exchange provider picker' Save user selections * Save user's exchange providers selection * Add text for selected providers availability * Fix selected providers not updating * Load limits based on highest maximum in the selected providers * Change received and deposit amount to be the best value from the selected providers * Add provider name next to Trade ID Set selected provider based on amount calculated * Grey out providers who doesn't support selected currency pair * Fix disabled providers * Add Provider logo in Confirm Screen * Only choose a provider if it satisfies its limits * Fix amount validation * Fix typo in error message * Add a queue of possible exchange providers sorted by the best rate to try next if one failed * Fix string locale typo * Add Localization for other languages * Add Placeholder text when there are no providers selected * Check Exchange provider availability before creating a trade * Fix "Fixed Rate" changing unconditionally * Enable "convert to" field regardless of the provider * Remove "Choose one" from providers picker * Merge Master * Fix Conflicts with master * Add missing isEnabled field in simple swap provider
28 lines
1 KiB
Dart
28 lines
1 KiB
Dart
import 'package:flutter/foundation.dart';
|
|
import 'package:cw_core/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';
|
|
|
|
abstract class ExchangeProvider {
|
|
ExchangeProvider({this.pairList});
|
|
|
|
String get title;
|
|
List<ExchangePair> pairList;
|
|
ExchangeProviderDescription description;
|
|
bool get isAvailable;
|
|
bool get isEnabled;
|
|
|
|
@override
|
|
String toString() => title;
|
|
|
|
Future<Limits> fetchLimits(
|
|
{CryptoCurrency from, CryptoCurrency to, bool isFixedRateMode});
|
|
Future<Trade> createTrade({TradeRequest request, bool isFixedRateMode});
|
|
Future<Trade> findTradeById({@required String id});
|
|
Future<double> calculateAmount({CryptoCurrency from, CryptoCurrency to,
|
|
double amount, bool isFixedRateMode, bool isReceiveAmount});
|
|
Future<bool> checkIsAvailable();
|
|
}
|