mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-24 06:48:38 +02:00
dynamic max fee rate value (#1395)
This commit is contained in:
@@ -166,6 +166,13 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
|
||||
return null;
|
||||
}
|
||||
|
||||
int? get maxCustomFeeRate {
|
||||
if (wallet.type == WalletType.bitcoin) {
|
||||
return bitcoin!.getMaxCustomFeeRate(wallet);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@computed
|
||||
int get customBitcoinFeeRate => _settingsStore.customBitcoinFeeRate;
|
||||
|
||||
|
||||
@@ -140,6 +140,13 @@ abstract class OtherSettingsViewModelBase with Store {
|
||||
return customItem != null ? priorities.indexOf(customItem) : null;
|
||||
}
|
||||
|
||||
int? get maxCustomFeeRate {
|
||||
if (_wallet.type == WalletType.bitcoin) {
|
||||
return bitcoin!.getMaxCustomFeeRate(_wallet);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@action
|
||||
ProviderType onBuyProviderTypeSelected(ProviderType buyProviderType) =>
|
||||
_settingsStore.defaultBuyProviders[walletType] = buyProviderType;
|
||||
|
||||
@@ -348,12 +348,14 @@ abstract class TransactionDetailsViewModelBase with Store {
|
||||
final customItem = priorities.firstWhereOrNull(
|
||||
(element) => element == sendViewModel.bitcoinTransactionPriorityCustom);
|
||||
final customItemIndex = customItem != null ? priorities.indexOf(customItem) : null;
|
||||
final maxCustomFeeRate = sendViewModel.maxCustomFeeRate?.toDouble();
|
||||
|
||||
RBFListItems.add(StandardPickerListItem(
|
||||
title: S.current.estimated_new_fee,
|
||||
value: bitcoin!.formatterBitcoinAmountToString(amount: newFee) + ' ${walletTypeToCryptoCurrency(wallet.type)}',
|
||||
items: priorityForWalletType(wallet.type),
|
||||
customValue: settingsStore.customBitcoinFeeRate.toDouble(),
|
||||
maxValue: maxCustomFeeRate,
|
||||
selectedIdx: selectedItem,
|
||||
customItemIndex: customItemIndex ?? 0,
|
||||
displayItem: (dynamic priority, double sliderValue) =>
|
||||
|
||||
Reference in New Issue
Block a user