mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2026-08-09 16:24:53 +00:00
show fiat fee amount
This commit is contained in:
@@ -21,7 +21,7 @@ public class Bip39 implements KeystoreMnemonicImport {
|
||||
|
||||
@Override
|
||||
public String getKeystoreImportDescription() {
|
||||
return "Import your 12 to 24 word mnemonic and optional passphrase";
|
||||
return "Import or generate your 12 to 24 word mnemonic and optional passphrase";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -73,6 +73,9 @@ public class SendController extends WalletFormController implements Initializabl
|
||||
@FXML
|
||||
private ComboBox<BitcoinUnit> feeAmountUnit;
|
||||
|
||||
@FXML
|
||||
private FiatLabel fiatFeeAmount;
|
||||
|
||||
@FXML
|
||||
private FeeRatesChart feeRatesChart;
|
||||
|
||||
@@ -115,6 +118,12 @@ public class SendController extends WalletFormController implements Initializabl
|
||||
@Override
|
||||
public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
|
||||
userFeeSet.set(true);
|
||||
if(newValue.isEmpty()) {
|
||||
fiatFeeAmount.setText("");
|
||||
} else {
|
||||
setFiatFeeAmount(AppController.getFiatCurrencyExchangeRate(), getFeeValueSats());
|
||||
}
|
||||
|
||||
setTargetBlocks(getTargetBlocks());
|
||||
updateTransaction();
|
||||
}
|
||||
@@ -390,6 +399,7 @@ public class SendController extends WalletFormController implements Initializabl
|
||||
df.setMaximumFractionDigits(8);
|
||||
fee.setText(df.format(feeAmountUnit.getValue().getValue(feeValue)));
|
||||
fee.textProperty().addListener(feeListener);
|
||||
setFiatFeeAmount(AppController.getFiatCurrencyExchangeRate(), feeValue);
|
||||
}
|
||||
|
||||
private Integer getTargetBlocks() {
|
||||
@@ -468,6 +478,12 @@ public class SendController extends WalletFormController implements Initializabl
|
||||
}
|
||||
}
|
||||
|
||||
private void setFiatFeeAmount(CurrencyRate currencyRate, Long amount) {
|
||||
if(amount != null && currencyRate != null && currencyRate.isAvailable()) {
|
||||
fiatFeeAmount.set(currencyRate, amount);
|
||||
}
|
||||
}
|
||||
|
||||
private long getRecipientDustThreshold() {
|
||||
Address address;
|
||||
try {
|
||||
@@ -569,5 +585,6 @@ public class SendController extends WalletFormController implements Initializabl
|
||||
@Subscribe
|
||||
public void exchangeRatesUpdated(ExchangeRatesUpdatedEvent event) {
|
||||
setFiatAmount(event.getCurrencyRate(), getRecipientValueSats());
|
||||
setFiatFeeAmount(event.getCurrencyRate(), getFeeValueSats());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user