2021-04-12 18:22:22 +00:00
|
|
|
import 'package:cake_wallet/buy/buy_amount.dart';
|
|
|
|
import 'package:cake_wallet/buy/order.dart';
|
2021-12-24 12:37:24 +00:00
|
|
|
import 'package:cw_core/wallet_base.dart';
|
2023-12-28 19:20:59 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2021-04-12 18:22:22 +00:00
|
|
|
|
|
|
|
abstract class BuyProvider {
|
2023-12-28 19:20:59 +00:00
|
|
|
BuyProvider({
|
|
|
|
required this.wallet,
|
|
|
|
required this.isTestEnvironment,
|
|
|
|
});
|
2021-04-12 18:22:22 +00:00
|
|
|
|
|
|
|
final WalletBase wallet;
|
|
|
|
final bool isTestEnvironment;
|
|
|
|
|
|
|
|
String get title;
|
|
|
|
|
2023-12-28 19:20:59 +00:00
|
|
|
String get buyOptionDescription;
|
|
|
|
|
|
|
|
String get sellOptionDescription;
|
|
|
|
|
|
|
|
String get lightIcon;
|
|
|
|
|
|
|
|
String get darkIcon;
|
2021-04-12 18:22:22 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
String toString() => title;
|
|
|
|
|
2023-12-28 19:20:59 +00:00
|
|
|
Future<void> launchProvider(BuildContext context, bool? isBuyAction);
|
|
|
|
|
|
|
|
Future<String> requestUrl(String amount, String sourceCurrency) => throw UnimplementedError();
|
|
|
|
|
|
|
|
Future<Order> findOrderById(String id) => throw UnimplementedError();
|
|
|
|
|
|
|
|
Future<BuyAmount> calculateAmount(String amount, String sourceCurrency) => throw UnimplementedError();
|
|
|
|
}
|