mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-23 06:38:35 +02:00
Estimated fee rates.
This commit is contained in:
@@ -97,7 +97,8 @@ abstract class SendViewModelBase with Store {
|
||||
}
|
||||
}
|
||||
|
||||
final fee = _wallet.calculateEstimatedFee(_settingsStore.priority[_wallet.type], amount);
|
||||
final fee = _wallet.calculateEstimatedFee(
|
||||
_settingsStore.priority[_wallet.type], amount);
|
||||
|
||||
if (_wallet is BitcoinWallet) {
|
||||
return bitcoinAmountToDouble(amount: fee);
|
||||
@@ -298,7 +299,8 @@ abstract class SendViewModelBase with Store {
|
||||
final amount = !sendAll ? _amount : null;
|
||||
final priority = _settingsStore.priority[_wallet.type];
|
||||
|
||||
return BitcoinTransactionCredentials(address, amount, priority as BitcoinTransactionPriority);
|
||||
return BitcoinTransactionCredentials(
|
||||
address, amount, priority as BitcoinTransactionPriority);
|
||||
case WalletType.monero:
|
||||
final amount = !sendAll ? _amount : null;
|
||||
final priority = _settingsStore.priority[_wallet.type];
|
||||
@@ -345,4 +347,16 @@ abstract class SendViewModelBase with Store {
|
||||
|
||||
void removeTemplate({Template template}) =>
|
||||
_sendTemplateStore.remove(template: template);
|
||||
|
||||
String displayFeeRate(dynamic priority) {
|
||||
final _priority = priority as TransactionPriority;
|
||||
final wallet = _wallet;
|
||||
|
||||
if (wallet is BitcoinWallet) {
|
||||
final rate = wallet.feeRate(_priority);
|
||||
return '${priority.toString()} ($rate sat/byte)';
|
||||
}
|
||||
|
||||
return priority.toString();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user