mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-20 06:08:34 +02:00
* Integrate SwapsXYZ * Remove print * enhance SwapsXyz EVM token swap handling * Disable fixed rate support in SwapsXyz provider * enable fixed rate swap * fix timestamp parsing * remove sender and recipient address from fetchRate * Improve SwapsXYZ trade approval logic * fix trade ID overflow * add Base chain support for swaps xyz * Update lib/view_model/exchange/exchange_trade_view_model.dart Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com> * add missing support for Base --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
46 lines
1.2 KiB
Dart
46 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, required bool isSendAll});
|
|
|
|
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();
|
|
}
|