cake_wallet/lib/buy/buy_provider.dart
Serhii 914565eb72
CW-539-DFX-off-ramp-sell-provider (#1229)
* 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
2023-12-28 21:20:59 +02:00

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();
}