2021-04-12 18:22:22 +00:00
|
|
|
import 'package:cake_wallet/buy/buy_amount.dart';
|
|
|
|
import 'package:cake_wallet/buy/buy_provider_description.dart';
|
|
|
|
import 'package:cake_wallet/buy/order.dart';
|
2021-12-24 12:37:24 +00:00
|
|
|
import 'package:cw_core/wallet_base.dart';
|
|
|
|
import 'package:cw_core/wallet_type.dart';
|
2021-04-12 18:22:22 +00:00
|
|
|
|
|
|
|
abstract class BuyProvider {
|
|
|
|
BuyProvider({this.wallet, this.isTestEnvironment});
|
|
|
|
|
|
|
|
final WalletBase wallet;
|
|
|
|
final bool isTestEnvironment;
|
|
|
|
|
|
|
|
String get title;
|
|
|
|
BuyProviderDescription get description;
|
2021-04-13 18:40:44 +00:00
|
|
|
String get trackUrl;
|
2021-04-12 18:22:22 +00:00
|
|
|
|
|
|
|
WalletType get walletType => wallet.type;
|
2021-07-13 05:46:34 +00:00
|
|
|
String get walletAddress => wallet.walletAddresses.address;
|
2021-04-12 18:22:22 +00:00
|
|
|
String get walletId => wallet.id;
|
|
|
|
|
|
|
|
@override
|
|
|
|
String toString() => title;
|
|
|
|
|
|
|
|
Future<String> requestUrl(String amount, String sourceCurrency);
|
|
|
|
Future<Order> findOrderById(String id);
|
|
|
|
Future<BuyAmount> calculateAmount(String amount, String sourceCurrency);
|
|
|
|
}
|