mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-01 12:04:21 +01:00
TMP
This commit is contained in:
@@ -13,10 +13,10 @@ class AmountValidator extends TextValidator {
|
||||
static String _pattern(WalletType type) {
|
||||
switch (type) {
|
||||
case WalletType.monero:
|
||||
return '^([0-9]+([.][0-9]{0,12})?|[.][0-9]{1,12})\$';
|
||||
return '^([0-9]+([.\,][0-9]{0,12})?|[.\,][0-9]{1,12})\$';
|
||||
case WalletType.bitcoin:
|
||||
// FIXME: Incorrect pattern for bitcoin
|
||||
return '^([0-9]+([.][0-9]{0,12})?|[.][0-9]{1,12})\$';
|
||||
return '^([0-9]+([.\,][0-9]{0,12})?|[.\,][0-9]{1,12})\$';
|
||||
default:
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
mixin PendingTransaction {
|
||||
String get amountFormatted;
|
||||
String get feeFormatted;
|
||||
|
||||
Future<void> commit();
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:mobx/mobx.dart';
|
||||
import 'package:cake_wallet/src/domain/common/transaction_info.dart';
|
||||
|
||||
@@ -5,7 +6,7 @@ abstract class TransactionHistoryBase<TransactionType extends TransactionInfo> {
|
||||
TransactionHistoryBase() : _isUpdating = false;
|
||||
|
||||
@observable
|
||||
ObservableList<TransactionType> transactions;
|
||||
ObservableMap<String, TransactionType> transactions;
|
||||
|
||||
bool _isUpdating;
|
||||
|
||||
@@ -24,5 +25,15 @@ abstract class TransactionHistoryBase<TransactionType extends TransactionInfo> {
|
||||
}
|
||||
}
|
||||
|
||||
Future<List<TransactionType>> fetchTransactions();
|
||||
}
|
||||
void updateAsync({void Function() onFinished}) {
|
||||
fetchTransactionsAsync(
|
||||
(transaction) => transactions[transaction.id] = transaction,
|
||||
onFinished: onFinished);
|
||||
}
|
||||
|
||||
void fetchTransactionsAsync(
|
||||
void Function(TransactionType transaction) onTransactionLoaded,
|
||||
{void Function() onFinished});
|
||||
|
||||
Future<Map<String, TransactionType>> fetchTransactions();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:cake_wallet/core/pending_transaction.dart';
|
||||
import 'package:cake_wallet/core/transaction_history.dart';
|
||||
import 'package:cake_wallet/src/domain/common/transaction_priority.dart';
|
||||
import 'package:cake_wallet/src/domain/common/crypto_currency.dart';
|
||||
import 'package:cake_wallet/src/domain/common/sync_status.dart';
|
||||
import 'package:cake_wallet/src/domain/common/node.dart';
|
||||
@@ -30,7 +32,9 @@ abstract class WalletBase<BalaceType> {
|
||||
|
||||
Future<void> startSync();
|
||||
|
||||
Future<void> createTransaction(Object credentials);
|
||||
Future<PendingTransaction> createTransaction(Object credentials);
|
||||
|
||||
double calculateEstimatedFee(TransactionPriority priority);
|
||||
|
||||
Future<void> save();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user