mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-30 06:48:49 +01:00
Upstream reformatted its whole tree in 16ddc0837. Matching it removes
formatting from the conflict surface of this and every later sync.
70 lines
2.2 KiB
Dart
70 lines
2.2 KiB
Dart
import 'package:hash_wallet/buy/buy_amount.dart';
|
|
import 'package:hash_wallet/buy/buy_quote.dart';
|
|
import 'package:hash_wallet/order/order.dart';
|
|
import 'package:hash_wallet/buy/pairs_utils.dart';
|
|
import 'package:hash_wallet/buy/payment_method.dart';
|
|
import 'package:hash_wallet/entities/fiat_currency.dart';
|
|
import 'package:hash_wallet/view_model/hardware_wallet/hardware_wallet_view_model.dart';
|
|
import 'package:cw_core/crypto_currency.dart';
|
|
import 'package:cw_core/wallet_base.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
abstract class BuyProvider {
|
|
BuyProvider(
|
|
{required this.wallet,
|
|
required this.isTestEnvironment,
|
|
required this.hardwareWalletVM,
|
|
required this.supportedCryptoList,
|
|
required this.supportedFiatList});
|
|
|
|
final WalletBase wallet;
|
|
final bool isTestEnvironment;
|
|
final HardwareWalletViewModel? hardwareWalletVM;
|
|
final List<TradePair<dynamic, dynamic>> supportedCryptoList;
|
|
final List<TradePair<dynamic, dynamic>> supportedFiatList;
|
|
|
|
String get title;
|
|
|
|
String get providerDescription;
|
|
|
|
String get lightIcon;
|
|
|
|
String get darkIcon;
|
|
|
|
bool get isAggregator;
|
|
|
|
@override
|
|
String toString() => title;
|
|
|
|
Future<void>? launchProvider(
|
|
{required BuildContext context,
|
|
required Quote quote,
|
|
required double amount,
|
|
required bool isBuyAction,
|
|
required String cryptoCurrencyAddress,
|
|
String? countryCode}) =>
|
|
null;
|
|
|
|
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();
|
|
|
|
Future<List<PaymentMethod>> getAvailablePaymentTypes(
|
|
String fiatCurrency, CryptoCurrency cryptoCurrency, bool isBuyAction) async =>
|
|
[];
|
|
|
|
Future<List<Quote>?> fetchQuote(
|
|
{required CryptoCurrency cryptoCurrency,
|
|
required FiatCurrency fiatCurrency,
|
|
required double amount,
|
|
required bool isBuyAction,
|
|
required String walletAddress,
|
|
PaymentType? paymentType,
|
|
String? customPaymentMethodType,
|
|
String? countryCode}) async =>
|
|
null;
|
|
}
|