mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-24 11:36:21 +00:00
914565eb72
* buy_provider_types refactoring * refactor MoonPay and sell option flow * dfx sell flow * add default sell provider flow * localization * Update other_settings_page.dart * [skip ci] update localization * [skip ci] providers fixes * [skip ci] ui fixes * refactor sell and buy flow * handle dfx availability by country * PR fixes
35 lines
891 B
Dart
35 lines
891 B
Dart
import 'package:cake_wallet/buy/buy_amount.dart';
|
|
import 'package:cake_wallet/buy/order.dart';
|
|
import 'package:cw_core/wallet_base.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
abstract class BuyProvider {
|
|
BuyProvider({
|
|
required this.wallet,
|
|
required this.isTestEnvironment,
|
|
});
|
|
|
|
final WalletBase wallet;
|
|
final bool isTestEnvironment;
|
|
|
|
String get title;
|
|
|
|
String get buyOptionDescription;
|
|
|
|
String get sellOptionDescription;
|
|
|
|
String get lightIcon;
|
|
|
|
String get darkIcon;
|
|
|
|
@override
|
|
String toString() => title;
|
|
|
|
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();
|
|
}
|