2020-06-01 18:13:56 +00:00
|
|
|
import 'package:flutter/foundation.dart';
|
2020-08-25 16:32:40 +00:00
|
|
|
import 'package:cake_wallet/core/pending_transaction.dart';
|
2020-06-20 07:10:00 +00:00
|
|
|
import 'package:cake_wallet/core/transaction_history.dart';
|
2020-08-25 16:32:40 +00:00
|
|
|
import 'package:cake_wallet/src/domain/common/transaction_priority.dart';
|
2020-07-06 20:09:03 +00:00
|
|
|
import 'package:cake_wallet/src/domain/common/crypto_currency.dart';
|
|
|
|
import 'package:cake_wallet/src/domain/common/sync_status.dart';
|
2020-06-01 18:13:56 +00:00
|
|
|
import 'package:cake_wallet/src/domain/common/node.dart';
|
2020-06-20 07:10:00 +00:00
|
|
|
import 'package:cake_wallet/src/domain/common/wallet_type.dart';
|
2020-06-01 18:13:56 +00:00
|
|
|
|
|
|
|
abstract class WalletBase<BalaceType> {
|
2020-06-20 07:10:00 +00:00
|
|
|
WalletType type;
|
2020-06-01 18:13:56 +00:00
|
|
|
|
2020-07-06 20:09:03 +00:00
|
|
|
CryptoCurrency currency;
|
|
|
|
|
2020-06-20 07:10:00 +00:00
|
|
|
String get name;
|
2020-06-01 18:13:56 +00:00
|
|
|
|
|
|
|
String address;
|
|
|
|
|
|
|
|
BalaceType balance;
|
|
|
|
|
2020-07-06 20:09:03 +00:00
|
|
|
SyncStatus syncStatus;
|
|
|
|
|
|
|
|
String get seed;
|
|
|
|
|
|
|
|
Object get keys;
|
|
|
|
|
2020-06-20 07:10:00 +00:00
|
|
|
TransactionHistoryBase transactionHistory;
|
|
|
|
|
2020-07-06 20:09:03 +00:00
|
|
|
String get id => walletTypeToString(type).toLowerCase() + '_' + name;
|
|
|
|
|
2020-06-01 18:13:56 +00:00
|
|
|
Future<void> connectToNode({@required Node node});
|
2020-06-20 07:10:00 +00:00
|
|
|
|
2020-06-01 18:13:56 +00:00
|
|
|
Future<void> startSync();
|
2020-06-20 07:10:00 +00:00
|
|
|
|
2020-08-25 16:32:40 +00:00
|
|
|
Future<PendingTransaction> createTransaction(Object credentials);
|
|
|
|
|
|
|
|
double calculateEstimatedFee(TransactionPriority priority);
|
2020-06-20 07:10:00 +00:00
|
|
|
|
2020-06-01 18:13:56 +00:00
|
|
|
Future<void> save();
|
2020-06-20 07:10:00 +00:00
|
|
|
}
|