Merge pull request #3634 from bodymindarts/coin-formatter-interface

Coin formatter interface
This commit is contained in:
Florian Reimair 2019-11-20 10:28:35 +01:00 committed by GitHub
commit 8025cc10a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
167 changed files with 635 additions and 508 deletions

View file

@ -30,6 +30,9 @@ import bisq.core.proto.network.CoreNetworkProtoResolver;
import bisq.core.proto.persistable.CorePersistenceProtoResolver;
import bisq.core.trade.TradeModule;
import bisq.core.user.Preferences;
import bisq.core.util.FormattingUtils;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.coin.ImmutableCoinFormatter;
import bisq.network.crypto.EncryptionServiceModule;
import bisq.network.p2p.P2PModule;
@ -70,6 +73,9 @@ public class CoreModule extends AppModule {
File storageDir = new File(environment.getRequiredProperty(Storage.STORAGE_DIR));
bind(File.class).annotatedWith(named(Storage.STORAGE_DIR)).toInstance(storageDir);
CoinFormatter btcFormatter = new ImmutableCoinFormatter(BisqEnvironment.getParameters().getMonetaryFormat());
bind(CoinFormatter.class).annotatedWith(named(FormattingUtils.BTC_FORMATTER_KEY)).toInstance(btcFormatter);
File keyStorageDir = new File(environment.getRequiredProperty(KeyStorage.KEY_STORAGE_DIR));
bind(File.class).annotatedWith(named(KeyStorage.KEY_STORAGE_DIR)).toInstance(keyStorageDir);

View file

@ -60,7 +60,8 @@ import bisq.core.trade.statistics.AssetTradeActivityCheck;
import bisq.core.trade.statistics.TradeStatisticsManager;
import bisq.core.user.Preferences;
import bisq.core.user.User;
import bisq.core.util.BSFormatter;
import bisq.core.util.FormattingUtils;
import bisq.core.util.coin.CoinFormatter;
import bisq.network.crypto.DecryptedDataTuple;
import bisq.network.crypto.EncryptionService;
@ -82,6 +83,7 @@ import bisq.common.util.Utilities;
import org.bitcoinj.core.Coin;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import com.google.common.net.InetAddresses;
@ -184,7 +186,7 @@ public class BisqSetup {
private final AssetService assetService;
private final TorSetup torSetup;
private final TradeLimits tradeLimits;
private final BSFormatter formatter;
private final CoinFormatter formatter;
@Setter
@Nullable
private Consumer<Runnable> displayTacHandler;
@ -270,7 +272,7 @@ public class BisqSetup {
AssetService assetService,
TorSetup torSetup,
TradeLimits tradeLimits,
BSFormatter formatter) {
@Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter formatter) {
this.p2PNetworkSetup = p2PNetworkSetup;

View file

@ -22,14 +22,15 @@ import bisq.core.btc.setup.WalletsSetup;
import bisq.core.btc.wallet.WalletsManager;
import bisq.core.locale.Res;
import bisq.core.user.Preferences;
import bisq.core.util.BSFormatter;
import bisq.core.util.FormattingUtils;
import bisq.core.util.coin.CoinFormatter;
import org.bitcoinj.core.VersionMessage;
import org.bitcoinj.store.BlockStoreException;
import org.bitcoinj.store.ChainFileLockedException;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import org.fxmisc.easybind.EasyBind;
@ -59,7 +60,7 @@ public class WalletAppSetup {
private final WalletsSetup walletsSetup;
private final BisqEnvironment bisqEnvironment;
private final Preferences preferences;
private final BSFormatter formatter;
private final CoinFormatter formatter;
@SuppressWarnings("FieldCanBeLocal")
private MonadicBinding<String> btcInfoBinding;
@ -84,7 +85,7 @@ public class WalletAppSetup {
WalletsSetup walletsSetup,
BisqEnvironment bisqEnvironment,
Preferences preferences,
BSFormatter formatter) {
@Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter formatter) {
this.walletsManager = walletsManager;
this.walletsSetup = walletsSetup;
this.bisqEnvironment = bisqEnvironment;

View file

@ -38,7 +38,7 @@ import bisq.core.dao.state.model.governance.RemoveAssetProposal;
import bisq.core.locale.CurrencyUtil;
import bisq.core.trade.statistics.TradeStatistics2;
import bisq.core.trade.statistics.TradeStatisticsManager;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import bisq.common.Timer;
import bisq.common.UserThread;

View file

@ -28,7 +28,7 @@ import bisq.core.dao.state.DaoStateService;
import bisq.core.dao.state.model.governance.ChangeParamProposal;
import bisq.core.dao.state.model.governance.Proposal;
import bisq.core.locale.Res;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import bisq.core.util.validation.BtcAddressValidator;
import bisq.core.util.validation.InputValidator;

View file

@ -20,8 +20,8 @@ package bisq.core.dao.presentation;
import bisq.core.dao.DaoFacade;
import bisq.core.dao.state.model.governance.DaoPhase;
import bisq.core.locale.Res;
import bisq.core.util.BSFormatter;
import bisq.core.util.FormattingUtils;
import bisq.core.util.coin.CoinFormatter;
import java.text.SimpleDateFormat;
@ -33,7 +33,7 @@ import java.util.Locale;
*/
public class DaoUtil {
public static String getNextPhaseDuration(int height, DaoPhase.Phase phase, DaoFacade daoFacade, BSFormatter formatter) {
public static String getNextPhaseDuration(int height, DaoPhase.Phase phase, DaoFacade daoFacade, CoinFormatter formatter) {
final int currentCycleDuration = daoFacade.getCurrentCycleDuration();
long start = daoFacade.getFirstBlockOfPhaseForDisplay(height, phase) + currentCycleDuration;
long end = daoFacade.getLastBlockOfPhaseForDisplay(height, phase) + currentCycleDuration;
@ -47,7 +47,7 @@ public class DaoUtil {
return Res.get("dao.cycle.phaseDurationWithoutBlocks", start, end, startDateTime, endDateTime);
}
public static String getPhaseDuration(int height, DaoPhase.Phase phase, DaoFacade daoFacade, BSFormatter formatter) {
public static String getPhaseDuration(int height, DaoPhase.Phase phase, DaoFacade daoFacade, CoinFormatter formatter) {
long start = daoFacade.getFirstBlockOfPhaseForDisplay(height, phase);
long end = daoFacade.getLastBlockOfPhaseForDisplay(height, phase);
long duration = daoFacade.getDurationForPhaseForDisplay(phase);

View file

@ -35,7 +35,7 @@ import bisq.core.dao.state.model.governance.EvaluatedProposal;
import bisq.core.dao.state.model.governance.Issuance;
import bisq.core.dao.state.model.governance.IssuanceType;
import bisq.core.dao.state.model.governance.ParamChange;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import bisq.core.util.ParsingUtils;
import org.bitcoinj.core.Coin;

View file

@ -30,8 +30,8 @@ import bisq.core.offer.OfferPayload;
import bisq.core.provider.price.MarketPrice;
import bisq.core.provider.price.PriceFeedService;
import bisq.core.user.User;
import bisq.core.util.BSFormatter;
import bisq.core.util.FormattingUtils;
import bisq.core.util.coin.CoinFormatter;
import bisq.common.crypto.KeyRing;
import bisq.common.util.MathUtils;
@ -39,6 +39,7 @@ import bisq.common.util.MathUtils;
import org.bitcoinj.utils.Fiat;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import java.util.List;
@ -54,11 +55,11 @@ public class MarketAlerts {
private final User user;
private final PriceFeedService priceFeedService;
private final KeyRing keyRing;
private final BSFormatter formatter;
private final CoinFormatter formatter;
@Inject
public MarketAlerts(OfferBookService offerBookService, MobileNotificationService mobileNotificationService,
User user, PriceFeedService priceFeedService, KeyRing keyRing, BSFormatter formatter) {
User user, PriceFeedService priceFeedService, KeyRing keyRing, @Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter formatter) {
this.offerBookService = offerBookService;
this.mobileNotificationService = mobileNotificationService;
this.user = user;

View file

@ -26,7 +26,6 @@ import bisq.core.notifications.MobileNotificationService;
import bisq.core.provider.price.MarketPrice;
import bisq.core.provider.price.PriceFeedService;
import bisq.core.user.User;
import bisq.core.util.BSFormatter;
import bisq.core.util.FormattingUtils;
import bisq.common.util.MathUtils;
@ -44,14 +43,12 @@ public class PriceAlert {
private final PriceFeedService priceFeedService;
private final MobileNotificationService mobileNotificationService;
private final User user;
private final BSFormatter formatter;
@Inject
public PriceAlert(PriceFeedService priceFeedService, MobileNotificationService mobileNotificationService, User user, BSFormatter formatter) {
public PriceAlert(PriceFeedService priceFeedService, MobileNotificationService mobileNotificationService, User user) {
this.priceFeedService = priceFeedService;
this.user = user;
this.mobileNotificationService = mobileNotificationService;
this.formatter = formatter;
}
public void onAllServicesInitialized() {

View file

@ -34,7 +34,7 @@ import bisq.core.provider.price.PriceFeedService;
import bisq.core.trade.statistics.ReferralIdService;
import bisq.core.user.Preferences;
import bisq.core.user.User;
import bisq.core.util.CoinUtil;
import bisq.core.util.coin.CoinUtil;
import bisq.network.p2p.NodeAddress;
import bisq.network.p2p.P2PService;

View file

@ -32,8 +32,8 @@ import bisq.core.provider.price.MarketPrice;
import bisq.core.provider.price.PriceFeedService;
import bisq.core.trade.statistics.ReferralIdService;
import bisq.core.user.Preferences;
import bisq.core.util.BsqFormatter;
import bisq.core.util.CoinUtil;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.coin.CoinUtil;
import bisq.network.p2p.P2PService;
@ -281,7 +281,7 @@ public class OfferUtil {
public static Optional<Volume> getFeeInUserFiatCurrency(Coin makerFee, boolean isCurrencyForMakerFeeBtc,
Preferences preferences, PriceFeedService priceFeedService,
BsqFormatter bsqFormatter) {
CoinFormatter bsqFormatter) {
String countryCode = preferences.getUserCountry().code;
String userCurrencyCode = CurrencyUtil.getCurrencyByCountryCode(countryCode).getCode();
return getFeeInUserFiatCurrency(makerFee,
@ -293,7 +293,7 @@ public class OfferUtil {
public static Optional<Volume> getFeeInUserFiatCurrency(Coin makerFee, boolean isCurrencyForMakerFeeBtc,
String userCurrencyCode, PriceFeedService priceFeedService,
BsqFormatter bsqFormatter) {
CoinFormatter bsqFormatter) {
// We use the users currency derived from his selected country.
// We don't use the preferredTradeCurrency from preferences as that can be also set to an altcoin.

View file

@ -18,9 +18,11 @@
package bisq.core.presentation;
import bisq.core.btc.Balances;
import bisq.core.util.BSFormatter;
import bisq.core.util.FormattingUtils;
import bisq.core.util.coin.CoinFormatter;
import javax.inject.Inject;
import javax.inject.Named;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
@ -38,7 +40,7 @@ public class BalancePresentation {
private final StringProperty lockedBalance = new SimpleStringProperty();
@Inject
public BalancePresentation(Balances balances, BSFormatter formatter) {
public BalancePresentation(Balances balances, @Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter formatter) {
balances.getAvailableBalance().addListener((observable, oldValue, newValue) -> {
String value = formatter.formatCoinWithCode(newValue);
// If we get full precision the BTC postfix breaks layout so we omit it

View file

@ -31,6 +31,8 @@ import org.jetbrains.annotations.NotNull;
@Slf4j
public class FormattingUtils {
public static final String BTC_FORMATTER_KEY = "BTC";
public final static String RANGE_SEPARATOR = " - ";
private static final MonetaryFormat fiatPriceFormat = new MonetaryFormat().shift(0).minDecimals(4).repeatOptionalDecimals(0, 0);

View file

@ -1,6 +1,7 @@
package bisq.core.util;
import bisq.core.monetary.Price;
import bisq.core.util.coin.CoinFormatter;
import bisq.common.util.MathUtils;
@ -13,8 +14,8 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class ParsingUtils {
public static Coin parseToCoin(String input, BSFormatter bsFormatter) {
return parseToCoin(input, bsFormatter.getMonetaryFormat());
public static Coin parseToCoin(String input, CoinFormatter coinFormatter) {
return parseToCoin(input, coinFormatter.getMonetaryFormat());
}
public static Coin parseToCoin(String input, MonetaryFormat coinFormat) {

View file

@ -15,7 +15,7 @@
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.core.util;
package bisq.core.util.coin;
import bisq.core.app.BisqEnvironment;
import bisq.core.dao.governance.param.Param;
@ -23,6 +23,8 @@ import bisq.core.dao.governance.proposal.ProposalValidationException;
import bisq.core.locale.GlobalSettings;
import bisq.core.locale.Res;
import bisq.core.provider.price.MarketPrice;
import bisq.core.util.FormattingUtils;
import bisq.core.util.ParsingUtils;
import bisq.core.util.validation.BtcAddressValidator;
import bisq.core.util.validation.InputValidator;
@ -42,11 +44,25 @@ import java.text.NumberFormat;
import java.util.Locale;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
@Slf4j
@Singleton
public class BsqFormatter extends BSFormatter {
public class BsqFormatter implements CoinFormatter {
private final ImmutableCoinFormatter immutableCoinFormatter;
// We don't support localized formatting. Format is always using "." as decimal mark and no grouping separator.
// Input of "," as decimal mark (like in german locale) will be replaced with ".".
// Input of a group separator (1,123,45) lead to an validation error.
// Note: BtcFormat was intended to be used, but it lead to many problems (automatic format to mBit,
// no way to remove grouping separator). It seems to be not optimal for user input formatting.
@Getter
private MonetaryFormat monetaryFormat;
@SuppressWarnings("PointlessBooleanExpression")
private static final boolean useBsqAddressFormat = true || !DevEnv.isDevMode();
private final String prefix = "B";
@ -56,12 +72,13 @@ public class BsqFormatter extends BSFormatter {
@Inject
public BsqFormatter() {
super();
this.monetaryFormat = BisqEnvironment.getParameters().getMonetaryFormat();
this.immutableCoinFormatter = new ImmutableCoinFormatter(BisqEnvironment.getParameters().getMonetaryFormat());
GlobalSettings.localeProperty().addListener((observable, oldValue, newValue) -> setFormatter(newValue));
setFormatter(GlobalSettings.getLocale());
GlobalSettings.localeProperty().addListener((observable, oldValue, newValue) -> switchLocale(newValue));
switchLocale(GlobalSettings.getLocale());
btcCoinFormat = super.monetaryFormat;
btcCoinFormat = monetaryFormat;
final String baseCurrencyCode = BisqEnvironment.getBaseCurrencyNetwork().getCurrencyCode();
switch (baseCurrencyCode) {
@ -75,7 +92,7 @@ public class BsqFormatter extends BSFormatter {
amountFormat.setMinimumFractionDigits(2);
}
private void setFormatter(Locale locale) {
private void switchLocale(Locale locale) {
amountFormat = (DecimalFormat) NumberFormat.getNumberInstance(locale);
amountFormat.setMinimumFractionDigits(2);
amountFormat.setMaximumFractionDigits(2);
@ -142,7 +159,7 @@ public class BsqFormatter extends BSFormatter {
return FormattingUtils.formatCoinWithCode(coin, btcCoinFormat);
}
public String formatBTC(Coin coin) {
private String formatBTC(Coin coin) {
return FormattingUtils.formatCoin(coin.value, btcCoinFormat);
}
@ -150,22 +167,6 @@ public class BsqFormatter extends BSFormatter {
return ParsingUtils.parseToCoin(input, btcCoinFormat);
}
public void validateBtcInput(String input) throws ProposalValidationException {
validateCoinInput(input, btcCoinFormat);
}
public void validateBsqInput(String input) throws ProposalValidationException {
validateCoinInput(input, this.monetaryFormat);
}
private void validateCoinInput(String input, MonetaryFormat coinFormat) throws ProposalValidationException {
try {
coinFormat.parse(ParsingUtils.cleanDoubleInput(input));
} catch (Throwable t) {
throw new ProposalValidationException("Invalid format for a " + coinFormat.code() + " value");
}
}
public String formatParamValue(Param param, String value) {
switch (param.getParamType()) {
case UNDEFINED:
@ -198,7 +199,7 @@ public class BsqFormatter extends BSFormatter {
}
}
public int parseParamValueToBlocks(Param param, String inputValue) {
private int parseParamValueToBlocks(Param param, String inputValue) {
switch (param.getParamType()) {
case BLOCK:
return Integer.parseInt(inputValue);
@ -230,4 +231,28 @@ public class BsqFormatter extends BSFormatter {
return Res.get("shared.na");
}
}
public String formatCoin(Coin coin) {
return immutableCoinFormatter.formatCoin(coin);
}
@NotNull
public String formatCoin(Coin coin, int decimalPlaces) {
return immutableCoinFormatter.formatCoin(coin, decimalPlaces);
}
public String formatCoin(Coin coin,
int decimalPlaces,
boolean decimalAligned,
int maxNumberOfDigits) {
return immutableCoinFormatter.formatCoin(coin, decimalPlaces, decimalAligned, maxNumberOfDigits);
}
public String formatCoinWithCode(Coin coin) {
return immutableCoinFormatter.formatCoinWithCode(coin);
}
public String formatCoinWithCode(long value) {
return immutableCoinFormatter.formatCoinWithCode(value);
}
}

View file

@ -0,0 +1,20 @@
package bisq.core.util.coin;
import org.bitcoinj.core.Coin;
import org.jetbrains.annotations.NotNull;
public interface CoinFormatter {
String formatCoin(Coin coin);
@NotNull
String formatCoin(Coin coin, int decimalPlaces);
String formatCoin(Coin coin, int decimalPlaces, boolean decimalAligned, int maxNumberOfDigits);
String formatCoinWithCode(Coin coin);
String formatCoinWithCode(long value);
org.bitcoinj.utils.MonetaryFormat getMonetaryFormat();
}

View file

@ -15,7 +15,7 @@
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.core.util;
package bisq.core.util.coin;
import bisq.common.util.MathUtils;

View file

@ -15,52 +15,25 @@
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.core.util;
package bisq.core.util.coin;
import bisq.core.app.BisqEnvironment;
import bisq.core.locale.CurrencyUtil;
import bisq.core.locale.GlobalSettings;
import bisq.core.locale.Res;
import bisq.core.monetary.Altcoin;
import bisq.core.monetary.Price;
import bisq.core.offer.OfferPayload;
import bisq.network.p2p.NodeAddress;
import bisq.common.util.MathUtils;
import bisq.core.util.FormattingUtils;
import bisq.core.util.coin.CoinFormatter;
import org.bitcoinj.core.Coin;
import org.bitcoinj.core.Monetary;
import org.bitcoinj.utils.Fiat;
import org.bitcoinj.utils.MonetaryFormat;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.commons.lang3.time.DurationFormatUtils;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;
import java.util.stream.Collectors;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.NotNull;
@Slf4j
@Singleton
public class BSFormatter {
public class ImmutableCoinFormatter implements CoinFormatter {
// We don't support localized formatting. Format is always using "." as decimal mark and no grouping separator.
// Input of "," as decimal mark (like in german locale) will be replaced with ".".
@ -68,14 +41,11 @@ public class BSFormatter {
// Note: BtcFormat was intended to be used, but it lead to many problems (automatic format to mBit,
// no way to remove grouping separator). It seems to be not optimal for user input formatting.
@Getter
protected MonetaryFormat monetaryFormat;
// protected String currencyCode = CurrencyUtil.getDefaultFiatCurrencyAsCode();
private MonetaryFormat monetaryFormat;
@Inject
public BSFormatter() {
monetaryFormat = BisqEnvironment.getParameters().getMonetaryFormat();
public ImmutableCoinFormatter(MonetaryFormat monetaryFormat) {
this.monetaryFormat = monetaryFormat;
}
@ -83,31 +53,29 @@ public class BSFormatter {
// BTC
///////////////////////////////////////////////////////////////////////////////////////////
@Override
public String formatCoin(Coin coin) {
return formatCoin(coin, -1);
}
@Override
@NotNull
public String formatCoin(Coin coin, int decimalPlaces) {
return formatCoin(coin, decimalPlaces, false, 0);
}
@Override
public String formatCoin(Coin coin, int decimalPlaces, boolean decimalAligned, int maxNumberOfDigits) {
return FormattingUtils.formatCoin(coin, decimalPlaces, decimalAligned, maxNumberOfDigits, monetaryFormat);
}
@Override
public String formatCoinWithCode(Coin coin) {
return FormattingUtils.formatCoinWithCode(coin, monetaryFormat);
}
@Override
public String formatCoinWithCode(long value) {
return FormattingUtils.formatCoinWithCode(Coin.valueOf(value), monetaryFormat);
}
public static String getDateFromBlockHeight(long blockHeight) {
long now = new Date().getTime();
SimpleDateFormat dateFormatter = new SimpleDateFormat("dd MMM", Locale.getDefault());
SimpleDateFormat timeFormatter = new SimpleDateFormat("HH:mm", Locale.getDefault());
return FormattingUtils.formatDateTime(new Date(now + blockHeight * 10 * 60 * 1000L), dateFormatter, timeFormatter);
}
}

View file

@ -19,7 +19,7 @@ package bisq.core.dao.governance.proposal.param;
import bisq.core.dao.governance.param.Param;
import bisq.core.locale.Res;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import org.junit.Assert;
import org.junit.Before;

View file

@ -19,7 +19,7 @@ package bisq.core.dao.state;
import bisq.core.dao.state.model.DaoState;
import bisq.core.dao.state.model.blockchain.Block;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import org.bitcoinj.core.Coin;

View file

@ -17,6 +17,8 @@
package bisq.core.util;
import bisq.core.util.coin.CoinUtil;
import org.bitcoinj.core.Coin;
import org.slf4j.Logger;

View file

@ -17,7 +17,7 @@
package bisq.desktop.components;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import org.bitcoinj.core.Coin;
@ -37,7 +37,7 @@ public class BalanceTextField extends AnchorPane {
private final JFXTextField textField;
private final Effect fundedEffect = new DropShadow(BlurType.THREE_PASS_BOX, Color.GREEN, 4, 0.0, 0, 0);
private final Effect notFundedEffect = new DropShadow(BlurType.THREE_PASS_BOX, Color.ORANGERED, 4, 0.0, 0, 0);
private BSFormatter formatter;
private CoinFormatter formatter;
@Nullable
private Coin balance;
@ -60,7 +60,7 @@ public class BalanceTextField extends AnchorPane {
getChildren().addAll(textField);
}
public void setFormatter(BSFormatter formatter) {
public void setFormatter(CoinFormatter formatter) {
this.formatter = formatter;
}

View file

@ -23,7 +23,7 @@ import bisq.desktop.util.GUIUtil;
import bisq.core.btc.listeners.AddressConfidenceListener;
import bisq.core.btc.listeners.BalanceListener;
import bisq.core.btc.wallet.BtcWalletService;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import org.bitcoinj.core.Address;
import org.bitcoinj.core.Coin;
@ -56,7 +56,7 @@ public class BalanceWithConfirmationTextField extends AnchorPane {
private final Effect fundedEffect = new DropShadow(BlurType.THREE_PASS_BOX, Color.GREEN, 4, 0.0, 0, 0);
private final Effect notFundedEffect = new DropShadow(BlurType.THREE_PASS_BOX, Color.ORANGERED, 4, 0.0, 0, 0);
private BSFormatter formatter;
private CoinFormatter formatter;
///////////////////////////////////////////////////////////////////////////////////////////
@ -91,7 +91,7 @@ public class BalanceWithConfirmationTextField extends AnchorPane {
walletService.removeAddressConfidenceListener(confidenceListener);
}
public void setup(Address address, BSFormatter formatter) {
public void setup(Address address, CoinFormatter formatter) {
this.formatter = formatter;
confidenceListener = new AddressConfidenceListener(address) {
@Override

View file

@ -4,7 +4,7 @@ import bisq.core.account.witness.AccountAgeWitnessService;
import bisq.core.alert.PrivateNotificationManager;
import bisq.core.offer.Offer;
import bisq.core.user.Preferences;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.network.p2p.NodeAddress;
@ -13,7 +13,7 @@ public class PeerInfoIconSmall extends PeerInfoIcon {
String role, Offer offer,
Preferences preferences,
AccountAgeWitnessService accountAgeWitnessService,
BSFormatter formatter,
CoinFormatter formatter,
boolean useDevPrivilegeKeys) {
// We don't want to show number of trades in that case as it would be unreadable.
// Also we don't need the privateNotificationManager as no interaction will take place with this icon.

View file

@ -29,7 +29,7 @@ import bisq.core.payment.AdvancedCashAccount;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.payload.AdvancedCashAccountPayload;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import bisq.common.util.Tuple2;
@ -63,7 +63,7 @@ public class AdvancedCashForm extends PaymentMethodForm {
}
public AdvancedCashForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, AdvancedCashValidator advancedCashValidator,
InputValidator inputValidator, GridPane gridPane, int gridRow, BSFormatter formatter) {
InputValidator inputValidator, GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.advancedCashAccount = (AdvancedCashAccount) paymentAccount;
this.advancedCashValidator = advancedCashValidator;

View file

@ -25,7 +25,7 @@ import bisq.core.payment.AliPayAccount;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.payload.AliPayAccountPayload;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import javafx.scene.layout.GridPane;
@ -41,7 +41,7 @@ public class AliPayForm extends GeneralAccountNumberForm {
return gridRow;
}
public AliPayForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, AliPayValidator aliPayValidator, InputValidator inputValidator, GridPane gridPane, int gridRow, BSFormatter formatter) {
public AliPayForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, AliPayValidator aliPayValidator, InputValidator inputValidator, GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.aliPayAccount = (AliPayAccount) paymentAccount;
}

View file

@ -36,7 +36,7 @@ import bisq.core.payment.payload.AssetsAccountPayload;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.payment.validation.AltCoinAddressValidator;
import bisq.core.user.Preferences;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import bisq.common.util.Tuple3;
@ -86,7 +86,7 @@ public class AssetsForm extends PaymentMethodForm {
InputValidator inputValidator,
GridPane gridPane,
int gridRow,
BSFormatter formatter,
CoinFormatter formatter,
AssetService assetService,
FilterManager filterManager,
Preferences preferences) {

View file

@ -33,7 +33,7 @@ import bisq.core.payment.CountryBasedPaymentAccount;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.payload.BankAccountPayload;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import bisq.common.util.Tuple2;
@ -167,7 +167,7 @@ abstract class BankForm extends GeneralBankForm {
private Country selectedCountry;
BankForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, InputValidator inputValidator,
GridPane gridPane, int gridRow, BSFormatter formatter) {
GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.bankAccountPayload = (BankAccountPayload) paymentAccount.paymentAccountPayload;
}

View file

@ -34,7 +34,7 @@ import bisq.core.payment.CountryBasedPaymentAccount;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.payload.CashDepositAccountPayload;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import bisq.common.util.Tuple2;
@ -182,7 +182,7 @@ public class CashDepositForm extends GeneralBankForm {
private Country selectedCountry;
public CashDepositForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, InputValidator inputValidator,
GridPane gridPane, int gridRow, BSFormatter formatter) {
GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.cashDepositAccountPayload = (CashDepositAccountPayload) paymentAccount.paymentAccountPayload;

View file

@ -29,7 +29,7 @@ import bisq.core.payment.ChaseQuickPayAccount;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.payload.ChaseQuickPayAccountPayload;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import javafx.scene.control.TextField;
@ -53,7 +53,7 @@ public class ChaseQuickPayForm extends PaymentMethodForm {
}
public ChaseQuickPayForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, ChaseQuickPayValidator chaseQuickPayValidator,
InputValidator inputValidator, GridPane gridPane, int gridRow, BSFormatter formatter) {
InputValidator inputValidator, GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.chaseQuickPayAccount = (ChaseQuickPayAccount) paymentAccount;
this.chaseQuickPayValidator = chaseQuickPayValidator;

View file

@ -29,7 +29,7 @@ import bisq.core.payment.ClearXchangeAccount;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.payload.ClearXchangeAccountPayload;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import javafx.scene.control.TextField;
@ -52,7 +52,7 @@ public class ClearXchangeForm extends PaymentMethodForm {
return gridRow;
}
public ClearXchangeForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, ClearXchangeValidator clearXchangeValidator, InputValidator inputValidator, GridPane gridPane, int gridRow, BSFormatter formatter) {
public ClearXchangeForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, ClearXchangeValidator clearXchangeValidator, InputValidator inputValidator, GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.clearXchangeAccount = (ClearXchangeAccount) paymentAccount;
this.clearXchangeValidator = clearXchangeValidator;

View file

@ -36,7 +36,7 @@ import bisq.core.payment.F2FAccount;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.payload.F2FAccountPayload;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import bisq.common.util.Tuple2;
@ -74,7 +74,7 @@ public class F2FForm extends PaymentMethodForm {
public F2FForm(PaymentAccount paymentAccount,
AccountAgeWitnessService accountAgeWitnessService, F2FValidator f2fValidator,
InputValidator inputValidator, GridPane gridPane, int gridRow, BSFormatter formatter) {
InputValidator inputValidator, GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.f2fAccount = (F2FAccount) paymentAccount;

View file

@ -30,7 +30,7 @@ import bisq.core.payment.FasterPaymentsAccount;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.payload.FasterPaymentsAccountPayload;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import javafx.scene.control.TextField;
@ -58,7 +58,7 @@ public class FasterPaymentsForm extends PaymentMethodForm {
private InputTextField sortCodeInputTextField;
public FasterPaymentsForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, InputValidator inputValidator, GridPane gridPane,
int gridRow, BSFormatter formatter) {
int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.fasterPaymentsAccount = (FasterPaymentsAccount) paymentAccount;
}

View file

@ -8,7 +8,7 @@ import bisq.core.locale.Res;
import bisq.core.locale.TradeCurrency;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.payload.PaymentMethod;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import javafx.scene.control.TextField;
@ -22,7 +22,7 @@ public abstract class GeneralAccountNumberForm extends PaymentMethodForm {
private InputTextField accountNrInputTextField;
GeneralAccountNumberForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, InputValidator inputValidator, GridPane gridPane, int gridRow, BSFormatter formatter) {
GeneralAccountNumberForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, InputValidator inputValidator, GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
}

View file

@ -11,7 +11,7 @@ import bisq.core.locale.BankUtil;
import bisq.core.locale.Res;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.payload.CountryBasedPaymentAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import org.apache.commons.lang3.StringUtils;
@ -38,7 +38,7 @@ public abstract class GeneralBankForm extends PaymentMethodForm {
boolean accountNrInputTextFieldEdited;
public GeneralBankForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, InputValidator inputValidator, GridPane gridPane, int gridRow, BSFormatter formatter) {
public GeneralBankForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, InputValidator inputValidator, GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
}

View file

@ -10,7 +10,7 @@ import bisq.core.locale.Res;
import bisq.core.locale.TradeCurrency;
import bisq.core.payment.CountryBasedPaymentAccount;
import bisq.core.payment.PaymentAccount;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import org.apache.commons.lang3.StringUtils;
@ -45,7 +45,7 @@ public abstract class GeneralSepaForm extends PaymentMethodForm {
private ComboBox<TradeCurrency> currencyComboBox;
InputTextField ibanInputTextField;
GeneralSepaForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, InputValidator inputValidator, GridPane gridPane, int gridRow, BSFormatter formatter) {
GeneralSepaForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, InputValidator inputValidator, GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
}

View file

@ -29,7 +29,7 @@ import bisq.core.payment.HalCashAccount;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.payload.HalCashAccountPayload;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import javafx.scene.control.TextField;
@ -51,7 +51,7 @@ public class HalCashForm extends PaymentMethodForm {
}
public HalCashForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, HalCashValidator halCashValidator,
InputValidator inputValidator, GridPane gridPane, int gridRow, BSFormatter formatter) {
InputValidator inputValidator, GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.halCashAccount = (HalCashAccount) paymentAccount;
this.halCashValidator = halCashValidator;

View file

@ -29,7 +29,7 @@ import bisq.core.payment.InteracETransferAccount;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.payload.InteracETransferAccountPayload;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import javafx.scene.layout.GridPane;
@ -57,7 +57,7 @@ public class InteracETransferForm extends PaymentMethodForm {
}
public InteracETransferForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, InteracETransferValidator interacETransferValidator,
InputValidator inputValidator, GridPane gridPane, int gridRow, BSFormatter formatter) {
InputValidator inputValidator, GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.interacETransferAccount = (InteracETransferAccount) paymentAccount;
this.interacETransferValidator = interacETransferValidator;

View file

@ -36,7 +36,7 @@ import bisq.core.payment.JapanBankAccount;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.payload.JapanBankAccountPayload;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import bisq.common.util.Tuple2;
@ -96,7 +96,7 @@ public class JapanBankTransferForm extends PaymentMethodForm
AccountAgeWitnessService accountAgeWitnessService,
JapanBankTransferValidator japanBankTransferValidator,
InputValidator inputValidator, GridPane gridPane,
int gridRow, BSFormatter formatter)
int gridRow, CoinFormatter formatter)
{
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.japanBankAccount = (JapanBankAccount) paymentAccount;

View file

@ -29,7 +29,7 @@ import bisq.core.payment.MoneyBeamAccount;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.payload.MoneyBeamAccountPayload;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import javafx.scene.control.TextField;
@ -49,7 +49,7 @@ public class MoneyBeamForm extends PaymentMethodForm {
return gridRow;
}
public MoneyBeamForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, MoneyBeamValidator moneyBeamValidator, InputValidator inputValidator, GridPane gridPane, int gridRow, BSFormatter formatter) {
public MoneyBeamForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, MoneyBeamValidator moneyBeamValidator, InputValidator inputValidator, GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.account = (MoneyBeamAccount) paymentAccount;
this.validator = moneyBeamValidator;

View file

@ -32,7 +32,7 @@ import bisq.core.payment.MoneyGramAccount;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.payload.MoneyGramAccountPayload;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import bisq.common.util.Tuple2;
@ -74,7 +74,7 @@ public class MoneyGramForm extends PaymentMethodForm {
private final EmailValidator emailValidator;
public MoneyGramForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, InputValidator inputValidator,
GridPane gridPane, int gridRow, BSFormatter formatter) {
GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.moneyGramAccountPayload = (MoneyGramAccountPayload) paymentAccount.paymentAccountPayload;

View file

@ -20,7 +20,7 @@ package bisq.desktop.components.paymentmethods;
import bisq.core.account.witness.AccountAgeWitnessService;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import javafx.scene.layout.GridPane;
@ -31,7 +31,7 @@ public class NationalBankForm extends BankForm {
}
public NationalBankForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, InputValidator inputValidator,
GridPane gridPane, int gridRow, BSFormatter formatter) {
GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
}
}

View file

@ -38,7 +38,7 @@ import bisq.core.offer.OfferPayload;
import bisq.core.payment.AssetAccount;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.payload.PaymentMethod;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import bisq.common.util.Tuple3;
@ -81,7 +81,7 @@ public abstract class PaymentMethodForm {
protected final InputValidator inputValidator;
protected final GridPane gridPane;
protected int gridRow;
private final BSFormatter formatter;
private final CoinFormatter formatter;
protected final BooleanProperty allInputsValid = new SimpleBooleanProperty();
protected int gridRowFrom;
@ -90,7 +90,7 @@ public abstract class PaymentMethodForm {
protected ComboBox<TradeCurrency> currencyComboBox;
public PaymentMethodForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService,
InputValidator inputValidator, GridPane gridPane, int gridRow, BSFormatter formatter) {
InputValidator inputValidator, GridPane gridPane, int gridRow, CoinFormatter formatter) {
this.paymentAccount = paymentAccount;
this.accountAgeWitnessService = accountAgeWitnessService;
this.inputValidator = inputValidator;

View file

@ -26,7 +26,7 @@ import bisq.core.payment.PaymentAccount;
import bisq.core.payment.PerfectMoneyAccount;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.payment.payload.PerfectMoneyAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import javafx.scene.layout.GridPane;
@ -45,7 +45,7 @@ public class PerfectMoneyForm extends GeneralAccountNumberForm {
}
public PerfectMoneyForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, PerfectMoneyValidator perfectMoneyValidator, InputValidator inputValidator, GridPane gridPane, int
gridRow, BSFormatter formatter) {
gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.perfectMoneyAccount = (PerfectMoneyAccount) paymentAccount;
}

View file

@ -29,7 +29,7 @@ import bisq.core.payment.PaymentAccount;
import bisq.core.payment.PopmoneyAccount;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.payment.payload.PopmoneyAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import javafx.scene.control.TextField;
@ -51,7 +51,7 @@ public class PopmoneyForm extends PaymentMethodForm {
return gridRow;
}
public PopmoneyForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, PopmoneyValidator popmoneyValidator, InputValidator inputValidator, GridPane gridPane, int gridRow, BSFormatter formatter) {
public PopmoneyForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, PopmoneyValidator popmoneyValidator, InputValidator inputValidator, GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.account = (PopmoneyAccount) paymentAccount;
this.validator = popmoneyValidator;

View file

@ -28,7 +28,7 @@ import bisq.core.payment.PaymentAccount;
import bisq.core.payment.PromptPayAccount;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.payment.payload.PromptPayAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import javafx.scene.control.TextField;
@ -51,7 +51,7 @@ public class PromptPayForm extends PaymentMethodForm {
}
public PromptPayForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, PromptPayValidator promptPayValidator,
InputValidator inputValidator, GridPane gridPane, int gridRow, BSFormatter formatter) {
InputValidator inputValidator, GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.promptPayAccount = (PromptPayAccount) paymentAccount;
this.promptPayValidator = promptPayValidator;

View file

@ -29,7 +29,7 @@ import bisq.core.payment.PaymentAccount;
import bisq.core.payment.RevolutAccount;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.payment.payload.RevolutAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import javafx.scene.control.TextField;
@ -64,7 +64,7 @@ public class RevolutForm extends PaymentMethodForm {
public RevolutForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService,
RevolutValidator revolutValidator, InputValidator inputValidator, GridPane gridPane,
int gridRow, BSFormatter formatter) {
int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.account = (RevolutAccount) paymentAccount;
this.validator = revolutValidator;

View file

@ -20,7 +20,7 @@ package bisq.desktop.components.paymentmethods;
import bisq.core.account.witness.AccountAgeWitnessService;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import javafx.scene.layout.GridPane;
@ -32,7 +32,7 @@ public class SameBankForm extends BankForm {
}
public SameBankForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, InputValidator inputValidator,
GridPane gridPane, int gridRow, BSFormatter formatter) {
GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
}
}

View file

@ -34,7 +34,7 @@ import bisq.core.payment.PaymentAccount;
import bisq.core.payment.SepaAccount;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.payment.payload.SepaAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import javafx.scene.control.CheckBox;
@ -77,7 +77,7 @@ public class SepaForm extends GeneralSepaForm {
public SepaForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, IBANValidator ibanValidator,
BICValidator bicValidator, InputValidator inputValidator,
GridPane gridPane, int gridRow, BSFormatter formatter) {
GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.sepaAccount = (SepaAccount) paymentAccount;
this.ibanValidator = ibanValidator;

View file

@ -34,7 +34,7 @@ import bisq.core.payment.PaymentAccount;
import bisq.core.payment.SepaInstantAccount;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.payment.payload.SepaInstantAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import javafx.scene.control.CheckBox;
@ -77,7 +77,7 @@ public class SepaInstantForm extends GeneralSepaForm {
public SepaInstantForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, IBANValidator ibanValidator,
BICValidator bicValidator, InputValidator inputValidator,
GridPane gridPane, int gridRow, BSFormatter formatter) {
GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.sepaInstantAccount = (SepaInstantAccount) paymentAccount;
this.ibanValidator = ibanValidator;

View file

@ -24,7 +24,7 @@ import bisq.core.locale.Res;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.payment.payload.SpecificBanksAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import bisq.common.util.Tuple3;
@ -53,7 +53,7 @@ public class SpecificBankForm extends BankForm {
}
public SpecificBankForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, InputValidator inputValidator,
GridPane gridPane, int gridRow, BSFormatter formatter) {
GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.specificBanksAccountPayload = (SpecificBanksAccountPayload) paymentAccount.paymentAccountPayload;
}

View file

@ -29,7 +29,7 @@ import bisq.core.payment.PaymentAccount;
import bisq.core.payment.SwishAccount;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.payment.payload.SwishAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import javafx.scene.control.TextField;
@ -53,7 +53,7 @@ public class SwishForm extends PaymentMethodForm {
InputValidator inputValidator,
GridPane gridPane,
int gridRow,
BSFormatter formatter) {
CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.swishAccount = (SwishAccount) paymentAccount;
this.swishValidator = swishValidator;

View file

@ -29,7 +29,7 @@ import bisq.core.payment.PaymentAccount;
import bisq.core.payment.USPostalMoneyOrderAccount;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.payment.payload.USPostalMoneyOrderAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import javafx.scene.control.TextArea;
@ -56,7 +56,7 @@ public class USPostalMoneyOrderForm extends PaymentMethodForm {
public USPostalMoneyOrderForm(PaymentAccount paymentAccount,
AccountAgeWitnessService accountAgeWitnessService, USPostalMoneyOrderValidator usPostalMoneyOrderValidator,
InputValidator inputValidator, GridPane gridPane, int gridRow, BSFormatter formatter) {
InputValidator inputValidator, GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.usPostalMoneyOrderAccount = (USPostalMoneyOrderAccount) paymentAccount;
this.usPostalMoneyOrderValidator = usPostalMoneyOrderValidator;

View file

@ -29,7 +29,7 @@ import bisq.core.payment.PaymentAccount;
import bisq.core.payment.UpholdAccount;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.payment.payload.UpholdAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import javafx.scene.control.TextField;
@ -54,7 +54,7 @@ public class UpholdForm extends PaymentMethodForm {
public UpholdForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService,
UpholdValidator upholdValidator, InputValidator inputValidator, GridPane gridPane,
int gridRow, BSFormatter formatter) {
int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.upholdAccount = (UpholdAccount) paymentAccount;
this.upholdValidator = upholdValidator;

View file

@ -25,7 +25,7 @@ import bisq.core.payment.PaymentAccount;
import bisq.core.payment.WeChatPayAccount;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.payment.payload.WeChatPayAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import javafx.scene.layout.GridPane;
@ -41,7 +41,7 @@ public class WeChatPayForm extends GeneralAccountNumberForm {
return gridRow;
}
public WeChatPayForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, WeChatPayValidator weChatPayValidator, InputValidator inputValidator, GridPane gridPane, int gridRow, BSFormatter formatter) {
public WeChatPayForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, WeChatPayValidator weChatPayValidator, InputValidator inputValidator, GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.weChatPayAccount = (WeChatPayAccount) paymentAccount;
}

View file

@ -34,7 +34,7 @@ import bisq.core.payment.CountryBasedPaymentAccount;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.payload.PaymentAccountPayload;
import bisq.core.payment.payload.WesternUnionAccountPayload;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import bisq.common.util.Tuple2;
@ -76,7 +76,7 @@ public class WesternUnionForm extends PaymentMethodForm {
private Country selectedCountry;
public WesternUnionForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, InputValidator inputValidator,
GridPane gridPane, int gridRow, BSFormatter formatter) {
GridPane gridPane, int gridRow, CoinFormatter formatter) {
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
this.westernUnionAccountPayload = (WesternUnionAccountPayload) paymentAccount.paymentAccountPayload;

View file

@ -47,7 +47,8 @@ import bisq.core.exceptions.BisqException;
import bisq.core.locale.GlobalSettings;
import bisq.core.locale.LanguageUtil;
import bisq.core.locale.Res;
import bisq.core.util.BSFormatter;
import bisq.core.util.FormattingUtils;
import bisq.core.util.coin.CoinFormatter;
import bisq.common.Timer;
import bisq.common.UserThread;
@ -56,6 +57,7 @@ import bisq.common.util.Tuple2;
import bisq.common.util.Utilities;
import javax.inject.Inject;
import javax.inject.Named;
import com.jfoenix.controls.JFXBadge;
import com.jfoenix.controls.JFXComboBox;
@ -144,7 +146,7 @@ public class MainView extends InitializableView<StackPane, MainViewModel>
private final ViewLoader viewLoader;
private final Navigation navigation;
private final BSFormatter formatter;
private final CoinFormatter formatter;
private final ToggleGroup navButtons = new ToggleGroup();
private ChangeListener<String> walletServiceErrorMsgListener;
@ -164,7 +166,7 @@ public class MainView extends InitializableView<StackPane, MainViewModel>
CachingViewLoader viewLoader,
Navigation navigation,
Transitions transitions,
BSFormatter formatter,
@Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter formatter,
DaoStateMonitoringService daoStateMonitoringService) {
super(model);
this.viewLoader = viewLoader;

View file

@ -38,7 +38,8 @@ import bisq.core.payment.PaymentAccountFactory;
import bisq.core.payment.payload.PaymentMethod;
import bisq.core.payment.validation.AltCoinAddressValidator;
import bisq.core.user.Preferences;
import bisq.core.util.BSFormatter;
import bisq.core.util.FormattingUtils;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import bisq.asset.AltCoinAccountDisclaimer;
@ -49,6 +50,7 @@ import bisq.common.util.Tuple2;
import bisq.common.util.Tuple3;
import javax.inject.Inject;
import javax.inject.Named;
import javafx.stage.Stage;
@ -75,7 +77,7 @@ public class AltCoinAccountsView extends PaymentAccountsView<GridPane, AltCoinAc
private final AltCoinAddressValidator altCoinAddressValidator;
private final AssetService assetService;
private final FilterManager filterManager;
private final BSFormatter formatter;
private final CoinFormatter formatter;
private final Preferences preferences;
private PaymentMethodForm paymentMethodForm;
@ -90,7 +92,7 @@ public class AltCoinAccountsView extends PaymentAccountsView<GridPane, AltCoinAc
AccountAgeWitnessService accountAgeWitnessService,
AssetService assetService,
FilterManager filterManager,
BSFormatter formatter,
@Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter formatter,
Preferences preferences) {
super(model, accountAgeWitnessService);

View file

@ -86,7 +86,8 @@ import bisq.core.payment.RevolutAccount;
import bisq.core.payment.USPostalMoneyOrderAccount;
import bisq.core.payment.WesternUnionAccount;
import bisq.core.payment.payload.PaymentMethod;
import bisq.core.util.BSFormatter;
import bisq.core.util.FormattingUtils;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import bisq.common.util.Tuple2;
@ -95,6 +96,7 @@ import bisq.common.util.Tuple3;
import org.bitcoinj.core.Coin;
import javax.inject.Inject;
import javax.inject.Named;
import javafx.stage.Stage;
@ -141,7 +143,7 @@ public class FiatAccountsView extends PaymentAccountsView<GridPane, FiatAccounts
private final F2FValidator f2FValidator;
private final PromptPayValidator promptPayValidator;
private final AdvancedCashValidator advancedCashValidator;
private final BSFormatter formatter;
private final CoinFormatter formatter;
private ComboBox<PaymentMethod> paymentMethodComboBox;
private PaymentMethodForm paymentMethodForm;
private TitledGroupBg accountTitledGroupBg;
@ -171,7 +173,7 @@ public class FiatAccountsView extends PaymentAccountsView<GridPane, FiatAccounts
PromptPayValidator promptPayValidator,
AdvancedCashValidator advancedCashValidator,
AccountAgeWitnessService accountAgeWitnessService,
BSFormatter formatter) {
@Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter formatter) {
super(model, accountAgeWitnessService);
this.ibanValidator = ibanValidator;

View file

@ -26,8 +26,8 @@ import bisq.desktop.util.ImageUtil;
import bisq.core.locale.Res;
import bisq.core.notifications.alerts.market.MarketAlertFilter;
import bisq.core.notifications.alerts.market.MarketAlerts;
import bisq.core.util.BSFormatter;
import bisq.core.util.FormattingUtils;
import bisq.core.util.coin.CoinFormatter;
import bisq.common.UserThread;
@ -54,9 +54,9 @@ import lombok.extern.slf4j.Slf4j;
public class ManageMarketAlertsWindow extends Overlay<ManageMarketAlertsWindow> {
private final MarketAlerts marketAlerts;
private final BSFormatter formatter;
private final CoinFormatter formatter;
ManageMarketAlertsWindow(MarketAlerts marketAlerts, BSFormatter formatter) {
ManageMarketAlertsWindow(MarketAlerts marketAlerts, CoinFormatter formatter) {
this.marketAlerts = marketAlerts;
this.formatter = formatter;
type = Type.Attention;

View file

@ -47,9 +47,9 @@ import bisq.core.payment.PaymentAccount;
import bisq.core.provider.price.PriceFeedService;
import bisq.core.user.Preferences;
import bisq.core.user.User;
import bisq.core.util.BSFormatter;
import bisq.core.util.FormattingUtils;
import bisq.core.util.ParsingUtils;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import bisq.common.UserThread;
@ -57,6 +57,7 @@ import bisq.common.util.Tuple2;
import bisq.common.util.Tuple3;
import javax.inject.Inject;
import javax.inject.Named;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
@ -90,7 +91,7 @@ public class MobileNotificationsView extends ActivatableView<GridPane, Void> {
private final PriceFeedService priceFeedService;
private final MarketAlerts marketAlerts;
private final MobileNotificationService mobileNotificationService;
private final BSFormatter formatter;
private final CoinFormatter formatter;
private WebCamWindow webCamWindow;
private QrCodeReader qrCodeReader;
@ -127,7 +128,7 @@ public class MobileNotificationsView extends ActivatableView<GridPane, Void> {
PriceFeedService priceFeedService,
MarketAlerts marketAlerts,
MobileNotificationService mobileNotificationService,
BSFormatter formatter) {
@Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter formatter) {
super();
this.preferences = preferences;
this.user = user;

View file

@ -34,9 +34,10 @@ import bisq.core.dao.state.model.blockchain.TxOutput;
import bisq.core.dao.state.model.governance.Role;
import bisq.core.dao.state.model.governance.RoleProposal;
import bisq.core.locale.Res;
import bisq.core.util.BSFormatter;
import bisq.core.util.BsqFormatter;
import bisq.core.util.CoinUtil;
import bisq.core.util.coin.ImmutableCoinFormatter;
import bisq.core.util.coin.BsqFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.coin.CoinUtil;
import bisq.core.util.FormattingUtils;
import bisq.network.p2p.P2PService;
@ -113,14 +114,13 @@ public class BondingViewUtils {
Tuple2<Coin, Integer> miningFeeAndTxSize = daoFacade.getLockupTxMiningFeeAndTxSize(lockupAmount, lockupTime, lockupReason, hash);
Coin miningFee = miningFeeAndTxSize.first;
int txSize = miningFeeAndTxSize.second;
BSFormatter formatter = new BSFormatter();
String duration = FormattingUtils.formatDurationAsWords(lockupTime * 10 * 60 * 1000L, false, false);
new Popup<>().headLine(Res.get("dao.bond.reputation.lockup.headline"))
.confirmation(Res.get("dao.bond.reputation.lockup.details",
bsqFormatter.formatCoinWithCode(lockupAmount),
lockupTime,
duration,
formatter.formatCoinWithCode(miningFee),
bsqFormatter.formatBTCWithCode(miningFee),
CoinUtil.getFeePerByte(miningFee, txSize),
txSize / 1000d
))
@ -172,14 +172,13 @@ public class BondingViewUtils {
Tuple2<Coin, Integer> miningFeeAndTxSize = daoFacade.getUnlockTxMiningFeeAndTxSize(lockupTxId);
Coin miningFee = miningFeeAndTxSize.first;
int txSize = miningFeeAndTxSize.second;
BSFormatter formatter = new BSFormatter();
String duration = FormattingUtils.formatDurationAsWords(lockTime * 10 * 60 * 1000L, false, false);
new Popup<>().headLine(Res.get("dao.bond.reputation.unlock.headline"))
.confirmation(Res.get("dao.bond.reputation.unlock.details",
bsqFormatter.formatCoinWithCode(unlockAmount),
lockTime,
duration,
formatter.formatCoinWithCode(miningFee),
bsqFormatter.formatBTCWithCode(miningFee),
CoinUtil.getFeePerByte(miningFee, txSize),
txSize / 1000d
))

View file

@ -23,7 +23,7 @@ import bisq.core.dao.governance.bond.Bond;
import bisq.core.dao.governance.bond.BondState;
import bisq.core.dao.governance.bond.role.BondedRole;
import bisq.core.locale.Res;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import bisq.common.util.Utilities;

View file

@ -33,7 +33,7 @@ import bisq.core.dao.governance.bond.role.BondedRole;
import bisq.core.dao.governance.bond.role.BondedRolesRepository;
import bisq.core.locale.Res;
import bisq.core.user.Preferences;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import javax.inject.Inject;

View file

@ -23,7 +23,7 @@ import bisq.core.dao.governance.bond.BondState;
import bisq.core.dao.governance.bond.reputation.MyBondedReputation;
import bisq.core.dao.governance.bond.reputation.MyReputation;
import bisq.core.locale.Res;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import bisq.common.util.Utilities;

View file

@ -38,7 +38,7 @@ import bisq.core.dao.governance.bond.BondState;
import bisq.core.dao.governance.bond.reputation.MyBondedReputation;
import bisq.core.locale.Res;
import bisq.core.user.Preferences;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import bisq.core.util.ParsingUtils;
import bisq.core.util.validation.HexStringValidator;
import bisq.core.util.validation.IntegerValidator;

View file

@ -25,7 +25,7 @@ import bisq.core.dao.DaoFacade;
import bisq.core.dao.state.model.governance.BondedRoleType;
import bisq.core.dao.state.model.governance.RoleProposal;
import bisq.core.locale.Res;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import org.bitcoinj.core.Coin;

View file

@ -34,7 +34,7 @@ import bisq.core.dao.state.model.governance.BondedRoleType;
import bisq.core.dao.state.model.governance.RoleProposal;
import bisq.core.locale.Res;
import bisq.core.user.Preferences;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import javax.inject.Inject;

View file

@ -34,9 +34,10 @@ import bisq.core.dao.governance.asset.StatefulAsset;
import bisq.core.dao.governance.proposal.TxException;
import bisq.core.locale.CurrencyUtil;
import bisq.core.locale.Res;
import bisq.core.util.BSFormatter;
import bisq.core.util.BsqFormatter;
import bisq.core.util.FormattingUtils;
import bisq.core.util.coin.BsqFormatter;
import bisq.core.util.ParsingUtils;
import bisq.core.util.coin.CoinFormatter;
import bisq.common.app.DevEnv;
@ -45,6 +46,7 @@ import org.bitcoinj.core.InsufficientMoneyException;
import org.bitcoinj.core.Transaction;
import javax.inject.Inject;
import javax.inject.Named;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
@ -86,7 +88,7 @@ public class AssetFeeView extends ActivatableView<GridPane, Void> implements Bsq
private final BsqWalletService bsqWalletService;
private final BsqValidator bsqValidator;
private final AssetService assetService;
private final BSFormatter btcFormatter;
private final CoinFormatter btcFormatter;
private final ObservableList<AssetListItem> observableList = FXCollections.observableArrayList();
private final SortedList<AssetListItem> sortedList = new SortedList<>(observableList);
@ -109,7 +111,7 @@ public class AssetFeeView extends ActivatableView<GridPane, Void> implements Bsq
BsqWalletService bsqWalletService,
BsqValidator bsqValidator,
AssetService assetService,
BSFormatter btcFormatter) {
@Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter btcFormatter) {
this.bsqFormatter = bsqFormatter;
this.bsqWalletService = bsqWalletService;
this.bsqValidator = bsqValidator;

View file

@ -19,7 +19,7 @@ package bisq.desktop.main.dao.burnbsq.assetfee;
import bisq.core.dao.governance.asset.StatefulAsset;
import bisq.core.locale.Res;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import lombok.Value;

View file

@ -23,7 +23,7 @@ import bisq.core.dao.governance.proofofburn.MyProofOfBurn;
import bisq.core.dao.governance.proofofburn.ProofOfBurnService;
import bisq.core.dao.state.model.blockchain.Tx;
import bisq.core.locale.Res;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import bisq.common.util.Utilities;

View file

@ -21,7 +21,7 @@ import bisq.desktop.util.DisplayUtils;
import bisq.core.dao.governance.proofofburn.ProofOfBurnService;
import bisq.core.dao.state.model.blockchain.Tx;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import bisq.common.util.Utilities;

View file

@ -37,9 +37,10 @@ import bisq.core.dao.governance.proofofburn.ProofOfBurnService;
import bisq.core.dao.governance.proposal.TxException;
import bisq.core.locale.Res;
import bisq.core.user.Preferences;
import bisq.core.util.BSFormatter;
import bisq.core.util.BsqFormatter;
import bisq.core.util.FormattingUtils;
import bisq.core.util.coin.BsqFormatter;
import bisq.core.util.ParsingUtils;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.validation.InputValidator;
import bisq.common.app.DevEnv;
@ -49,6 +50,7 @@ import org.bitcoinj.core.InsufficientMoneyException;
import org.bitcoinj.core.Transaction;
import javax.inject.Inject;
import javax.inject.Named;
import javafx.scene.control.Button;
import javafx.scene.control.TableCell;
@ -81,7 +83,7 @@ public class ProofOfBurnView extends ActivatableView<GridPane, Void> implements
private final ProofOfBurnService proofOfBurnService;
private final MyProofOfBurnListService myProofOfBurnListService;
private final Preferences preferences;
private final BSFormatter btcFormatter;
private final CoinFormatter btcFormatter;
private final BsqFormatter bsqFormatter;
private final BsqWalletService bsqWalletService;
private final BsqValidator bsqValidator;
@ -116,7 +118,7 @@ public class ProofOfBurnView extends ActivatableView<GridPane, Void> implements
ProofOfBurnService proofOfBurnService,
MyProofOfBurnListService myProofOfBurnListService,
Preferences preferences,
BSFormatter btcFormatter) {
@Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter btcFormatter) {
this.bsqFormatter = bsqFormatter;
this.bsqWalletService = bsqWalletService;
this.bsqValidator = bsqValidator;

View file

@ -34,8 +34,7 @@ import bisq.core.provider.price.PriceFeedService;
import bisq.core.trade.statistics.TradeStatistics2;
import bisq.core.trade.statistics.TradeStatisticsManager;
import bisq.core.user.Preferences;
import bisq.core.util.BSFormatter;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import bisq.core.util.FormattingUtils;
import bisq.common.util.MathUtils;

View file

@ -31,7 +31,7 @@ import bisq.core.dao.state.model.governance.Issuance;
import bisq.core.dao.state.model.governance.IssuanceType;
import bisq.core.locale.GlobalSettings;
import bisq.core.locale.Res;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import bisq.common.util.Tuple3;

View file

@ -58,7 +58,7 @@ import bisq.core.dao.state.model.governance.Vote;
import bisq.core.locale.CurrencyUtil;
import bisq.core.locale.Res;
import bisq.core.user.Preferences;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import bisq.core.util.validation.InputValidator;
import bisq.asset.Asset;

View file

@ -30,9 +30,11 @@ import bisq.core.dao.state.DaoStateListener;
import bisq.core.dao.state.model.blockchain.Block;
import bisq.core.dao.state.model.governance.DaoPhase;
import bisq.core.locale.Res;
import bisq.core.util.BSFormatter;
import bisq.core.util.FormattingUtils;
import bisq.core.util.coin.CoinFormatter;
import javax.inject.Inject;
import javax.inject.Named;
import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane;
@ -48,7 +50,7 @@ public class GovernanceDashboardView extends ActivatableView<GridPane, Void> imp
private final DaoFacade daoFacade;
private final PeriodService periodService;
private final PhasesView phasesView;
private final BSFormatter formatter;
private final CoinFormatter formatter;
private int gridRow = 0;
private TextField currentPhaseTextField, currentBlockHeightTextField, proposalTextField, blindVoteTextField, voteRevealTextField, voteResultTextField;
@ -59,7 +61,7 @@ public class GovernanceDashboardView extends ActivatableView<GridPane, Void> imp
///////////////////////////////////////////////////////////////////////////////////////////
@Inject
public GovernanceDashboardView(DaoFacade daoFacade, PeriodService periodService, PhasesView phasesView, BSFormatter formatter) {
public GovernanceDashboardView(DaoFacade daoFacade, PeriodService periodService, PhasesView phasesView, @Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter formatter) {
this.daoFacade = daoFacade;
this.periodService = periodService;
this.phasesView = phasesView;

View file

@ -50,9 +50,10 @@ import bisq.core.dao.state.model.governance.DaoPhase;
import bisq.core.dao.state.model.governance.Proposal;
import bisq.core.dao.state.model.governance.Role;
import bisq.core.locale.Res;
import bisq.core.util.BSFormatter;
import bisq.core.util.BsqFormatter;
import bisq.core.util.FormattingUtils;
import bisq.core.util.coin.BsqFormatter;
import bisq.core.util.ParsingUtils;
import bisq.core.util.coin.CoinFormatter;
import bisq.asset.Asset;
@ -67,6 +68,7 @@ import org.bitcoinj.core.InsufficientMoneyException;
import org.bitcoinj.core.Transaction;
import javax.inject.Inject;
import javax.inject.Named;
import javafx.scene.control.Button;
import javafx.scene.control.ComboBox;
@ -108,7 +110,7 @@ public class MakeProposalView extends ActivatableView<GridPane, Void> implements
private final P2PService p2PService;
private final PhasesView phasesView;
private final ChangeParamValidator changeParamValidator;
private final BSFormatter btcFormatter;
private final CoinFormatter btcFormatter;
private final BsqFormatter bsqFormatter;
private final Navigation navigation;
private final BsqWalletService bsqWalletService;
@ -144,7 +146,7 @@ public class MakeProposalView extends ActivatableView<GridPane, Void> implements
BsqWalletService bsqWalletService,
PhasesView phasesView,
ChangeParamValidator changeParamValidator,
BSFormatter btcFormatter,
@Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter btcFormatter,
BsqFormatter bsqFormatter,
Navigation navigation) {
this.daoFacade = daoFacade;

View file

@ -25,7 +25,7 @@ import bisq.core.dao.state.model.governance.DaoPhase;
import bisq.core.dao.state.model.governance.Proposal;
import bisq.core.dao.state.model.governance.Vote;
import bisq.core.locale.Res;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import de.jensd.fx.fontawesome.AwesomeIcon;

View file

@ -53,9 +53,10 @@ import bisq.core.dao.state.model.governance.Proposal;
import bisq.core.dao.state.model.governance.Vote;
import bisq.core.locale.Res;
import bisq.core.user.Preferences;
import bisq.core.util.BSFormatter;
import bisq.core.util.BsqFormatter;
import bisq.core.util.FormattingUtils;
import bisq.core.util.coin.BsqFormatter;
import bisq.core.util.ParsingUtils;
import bisq.core.util.coin.CoinFormatter;
import bisq.common.UserThread;
import bisq.common.app.DevEnv;
@ -67,6 +68,7 @@ import org.bitcoinj.core.Coin;
import org.bitcoinj.core.InsufficientMoneyException;
import javax.inject.Inject;
import javax.inject.Named;
import com.jfoenix.controls.JFXButton;
@ -119,7 +121,7 @@ public class ProposalsView extends ActivatableView<GridPane, Void> implements Bs
private final MyBlindVoteListService myBlindVoteListService;
private final Preferences preferences;
private final BsqFormatter bsqFormatter;
private final BSFormatter btcFormatter;
private final CoinFormatter btcFormatter;
private final SelectProposalWindow selectProposalWindow;
private final ObservableList<ProposalsListItem> listItems = FXCollections.observableArrayList();
@ -170,7 +172,7 @@ public class ProposalsView extends ActivatableView<GridPane, Void> implements Bs
MyBlindVoteListService myBlindVoteListService,
Preferences preferences,
BsqFormatter bsqFormatter,
BSFormatter btcFormatter,
@Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter btcFormatter,
SelectProposalWindow selectProposalWindow) {
this.daoFacade = daoFacade;
this.bsqWalletService = bsqWalletService;

View file

@ -20,7 +20,7 @@ package bisq.desktop.main.dao.governance.result;
import bisq.core.dao.governance.proposal.IssuanceProposal;
import bisq.core.dao.state.model.governance.EvaluatedProposal;
import bisq.core.locale.Res;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import bisq.core.util.FormattingUtils;
import org.bitcoinj.core.Coin;

View file

@ -32,7 +32,7 @@ import bisq.core.dao.state.model.governance.RoleProposal;
import bisq.core.dao.state.model.governance.Vote;
import bisq.core.locale.CurrencyUtil;
import bisq.core.locale.Res;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import org.bitcoinj.core.Coin;

View file

@ -21,7 +21,7 @@ import bisq.core.dao.state.DaoStateService;
import bisq.core.dao.state.model.governance.Ballot;
import bisq.core.dao.state.model.governance.DecryptedBallotsWithMerits;
import bisq.core.dao.state.model.governance.Proposal;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import bisq.common.util.Tuple2;

View file

@ -60,7 +60,7 @@ import bisq.core.dao.state.model.governance.Role;
import bisq.core.dao.state.model.governance.RoleProposal;
import bisq.core.dao.state.model.governance.Vote;
import bisq.core.locale.Res;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import bisq.common.UserThread;
import bisq.common.util.Utilities;

View file

@ -10,7 +10,7 @@ import bisq.desktop.util.Layout;
import bisq.core.btc.wallet.BsqWalletService;
import bisq.core.locale.Res;
import bisq.core.user.Preferences;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import bisq.common.util.Tuple3;

View file

@ -27,7 +27,7 @@ import bisq.core.dao.state.DaoStateListener;
import bisq.core.dao.state.DaoStateService;
import bisq.core.dao.state.model.blockchain.Block;
import bisq.core.locale.Res;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import bisq.common.util.Tuple3;

View file

@ -26,7 +26,7 @@ import bisq.desktop.util.Layout;
import bisq.core.btc.wallet.BsqWalletService;
import bisq.core.locale.Res;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import bisq.common.app.DevEnv;
import bisq.common.util.Tuple3;

View file

@ -44,9 +44,10 @@ import bisq.core.btc.wallet.TxBroadcaster;
import bisq.core.btc.wallet.WalletsManager;
import bisq.core.dao.state.model.blockchain.TxType;
import bisq.core.locale.Res;
import bisq.core.util.BSFormatter;
import bisq.core.util.BsqFormatter;
import bisq.core.util.CoinUtil;
import bisq.core.util.FormattingUtils;
import bisq.core.util.coin.BsqFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.coin.CoinUtil;
import bisq.core.util.ParsingUtils;
import bisq.core.util.validation.BtcAddressValidator;
@ -59,6 +60,7 @@ import org.bitcoinj.core.InsufficientMoneyException;
import org.bitcoinj.core.Transaction;
import javax.inject.Inject;
import javax.inject.Named;
import javafx.scene.control.Button;
import javafx.scene.layout.GridPane;
@ -77,7 +79,7 @@ public class BsqSendView extends ActivatableView<GridPane, Void> implements BsqB
private final WalletsSetup walletsSetup;
private final P2PService p2PService;
private final BsqFormatter bsqFormatter;
private final BSFormatter btcFormatter;
private final CoinFormatter btcFormatter;
private final Navigation navigation;
private final BsqBalanceUtil bsqBalanceUtil;
private final BsqValidator bsqValidator;
@ -105,7 +107,7 @@ public class BsqSendView extends ActivatableView<GridPane, Void> implements BsqB
WalletsSetup walletsSetup,
P2PService p2PService,
BsqFormatter bsqFormatter,
BSFormatter btcFormatter,
@Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter btcFormatter,
Navigation navigation,
BsqBalanceUtil bsqBalanceUtil,
BsqValidator bsqValidator,
@ -347,8 +349,8 @@ public class BsqSendView extends ActivatableView<GridPane, Void> implements BsqB
TxType txType,
Coin miningFee,
int txSize, String address,
BSFormatter amountFormatter, // can be BSQ or BTC formatter
BSFormatter feeFormatter,
CoinFormatter amountFormatter, // can be BSQ or BTC formatter
CoinFormatter feeFormatter,
ResultHandler resultHandler) {
new Popup<>().headLine(Res.get("dao.wallet.send.sendFunds.headline"))
.confirmation(Res.get("dao.wallet.send.sendFunds.details",

View file

@ -25,7 +25,7 @@ import bisq.core.btc.wallet.WalletService;
import bisq.core.dao.DaoFacade;
import bisq.core.dao.state.model.blockchain.TxType;
import bisq.core.locale.Res;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import org.bitcoinj.core.Coin;
import org.bitcoinj.core.Transaction;

View file

@ -40,7 +40,7 @@ import bisq.core.dao.state.model.blockchain.TxType;
import bisq.core.dao.state.model.governance.IssuanceType;
import bisq.core.locale.Res;
import bisq.core.user.Preferences;
import bisq.core.util.BsqFormatter;
import bisq.core.util.coin.BsqFormatter;
import bisq.common.Timer;
import bisq.common.UserThread;

View file

@ -25,7 +25,7 @@ import bisq.core.btc.listeners.TxConfidenceListener;
import bisq.core.btc.model.AddressEntry;
import bisq.core.btc.wallet.BtcWalletService;
import bisq.core.locale.Res;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import org.bitcoinj.core.Address;
import org.bitcoinj.core.Coin;
@ -53,7 +53,7 @@ class DepositListItem {
private TxConfidenceListener txConfidenceListener;
private int numTxOutputs = 0;
public DepositListItem(AddressEntry addressEntry, BtcWalletService walletService, BSFormatter formatter) {
public DepositListItem(AddressEntry addressEntry, BtcWalletService walletService, CoinFormatter formatter) {
this.walletService = walletService;
addressString = addressEntry.getAddressString();

View file

@ -36,8 +36,9 @@ import bisq.core.btc.wallet.BtcWalletService;
import bisq.core.locale.Res;
import bisq.core.provider.fee.FeeService;
import bisq.core.user.Preferences;
import bisq.core.util.BSFormatter;
import bisq.core.util.FormattingUtils;
import bisq.core.util.ParsingUtils;
import bisq.core.util.coin.CoinFormatter;
import bisq.common.UserThread;
import bisq.common.app.DevEnv;
@ -49,6 +50,7 @@ import net.glxn.qrgen.QRCode;
import net.glxn.qrgen.image.ImageType;
import javax.inject.Inject;
import javax.inject.Named;
import javafx.fxml.FXML;
@ -106,7 +108,7 @@ public class DepositView extends ActivatableView<VBox, Void> {
private final BtcWalletService walletService;
private final Preferences preferences;
private final BSFormatter formatter;
private final CoinFormatter formatter;
private String paymentLabelString;
private final ObservableList<DepositListItem> observableList = FXCollections.observableArrayList();
private final SortedList<DepositListItem> sortedList = new SortedList<>(observableList);
@ -123,7 +125,7 @@ public class DepositView extends ActivatableView<VBox, Void> {
private DepositView(BtcWalletService walletService,
FeeService feeService,
Preferences preferences,
BSFormatter formatter) {
@Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter formatter) {
this.walletService = walletService;
this.preferences = preferences;
this.formatter = formatter;

View file

@ -25,7 +25,7 @@ import bisq.core.btc.wallet.BtcWalletService;
import bisq.core.btc.wallet.WalletService;
import bisq.core.trade.Tradable;
import bisq.core.trade.Trade;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import org.bitcoinj.core.Address;
import org.bitcoinj.core.Coin;
@ -41,13 +41,13 @@ class LockedListItem {
private final Trade trade;
private final AddressEntry addressEntry;
private final BtcWalletService btcWalletService;
private final BSFormatter formatter;
private final CoinFormatter formatter;
private final String addressString;
@Nullable
private final Address address;
private Coin balance;
public LockedListItem(Trade trade, AddressEntry addressEntry, BtcWalletService btcWalletService, BSFormatter formatter) {
public LockedListItem(Trade trade, AddressEntry addressEntry, BtcWalletService btcWalletService, CoinFormatter formatter) {
this.trade = trade;
this.addressEntry = addressEntry;
this.btcWalletService = btcWalletService;

View file

@ -37,12 +37,14 @@ import bisq.core.trade.Tradable;
import bisq.core.trade.Trade;
import bisq.core.trade.TradeManager;
import bisq.core.user.Preferences;
import bisq.core.util.BSFormatter;
import bisq.core.util.FormattingUtils;
import bisq.core.util.coin.CoinFormatter;
import org.bitcoinj.core.Coin;
import org.bitcoinj.core.Transaction;
import javax.inject.Inject;
import javax.inject.Named;
import de.jensd.fx.fontawesome.AwesomeIcon;
@ -80,7 +82,7 @@ public class LockedView extends ActivatableView<VBox, Void> {
private final TradeManager tradeManager;
private final OpenOfferManager openOfferManager;
private final Preferences preferences;
private final BSFormatter formatter;
private final CoinFormatter formatter;
private final OfferDetailsWindow offerDetailsWindow;
private final TradeDetailsWindow tradeDetailsWindow;
private final ObservableList<LockedListItem> observableList = FXCollections.observableArrayList();
@ -96,7 +98,7 @@ public class LockedView extends ActivatableView<VBox, Void> {
@Inject
private LockedView(BtcWalletService btcWalletService, TradeManager tradeManager, OpenOfferManager openOfferManager, Preferences preferences,
BSFormatter formatter, OfferDetailsWindow offerDetailsWindow, TradeDetailsWindow tradeDetailsWindow) {
@Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter formatter, OfferDetailsWindow offerDetailsWindow, TradeDetailsWindow tradeDetailsWindow) {
this.btcWalletService = btcWalletService;
this.tradeManager = tradeManager;
this.openOfferManager = openOfferManager;

View file

@ -24,7 +24,7 @@ import bisq.core.btc.model.AddressEntry;
import bisq.core.btc.wallet.BtcWalletService;
import bisq.core.offer.OpenOffer;
import bisq.core.trade.Tradable;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import org.bitcoinj.core.Address;
import org.bitcoinj.core.Coin;
@ -40,11 +40,11 @@ class ReservedListItem {
private final OpenOffer openOffer;
private final AddressEntry addressEntry;
private final BtcWalletService btcWalletService;
private final BSFormatter formatter;
private final CoinFormatter formatter;
private final String addressString;
private Coin balance;
public ReservedListItem(OpenOffer openOffer, AddressEntry addressEntry, BtcWalletService btcWalletService, BSFormatter formatter) {
public ReservedListItem(OpenOffer openOffer, AddressEntry addressEntry, BtcWalletService btcWalletService, CoinFormatter formatter) {
this.openOffer = openOffer;
this.addressEntry = addressEntry;
this.btcWalletService = btcWalletService;

View file

@ -37,12 +37,14 @@ import bisq.core.trade.Tradable;
import bisq.core.trade.Trade;
import bisq.core.trade.TradeManager;
import bisq.core.user.Preferences;
import bisq.core.util.BSFormatter;
import bisq.core.util.FormattingUtils;
import bisq.core.util.coin.CoinFormatter;
import org.bitcoinj.core.Coin;
import org.bitcoinj.core.Transaction;
import javax.inject.Inject;
import javax.inject.Named;
import de.jensd.fx.fontawesome.AwesomeIcon;
@ -80,7 +82,7 @@ public class ReservedView extends ActivatableView<VBox, Void> {
private final TradeManager tradeManager;
private final OpenOfferManager openOfferManager;
private final Preferences preferences;
private final BSFormatter formatter;
private final CoinFormatter formatter;
private final OfferDetailsWindow offerDetailsWindow;
private final TradeDetailsWindow tradeDetailsWindow;
private final ObservableList<ReservedListItem> observableList = FXCollections.observableArrayList();
@ -96,7 +98,7 @@ public class ReservedView extends ActivatableView<VBox, Void> {
@Inject
private ReservedView(BtcWalletService btcWalletService, TradeManager tradeManager, OpenOfferManager openOfferManager, Preferences preferences,
BSFormatter formatter, OfferDetailsWindow offerDetailsWindow, TradeDetailsWindow tradeDetailsWindow) {
@Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter formatter, OfferDetailsWindow offerDetailsWindow, TradeDetailsWindow tradeDetailsWindow) {
this.btcWalletService = btcWalletService;
this.tradeManager = tradeManager;
this.openOfferManager = openOfferManager;

View file

@ -21,13 +21,15 @@ import bisq.core.btc.wallet.BsqWalletService;
import bisq.core.btc.wallet.BtcWalletService;
import bisq.core.dao.DaoFacade;
import bisq.core.user.Preferences;
import bisq.core.util.BSFormatter;
import bisq.core.util.FormattingUtils;
import bisq.core.util.coin.CoinFormatter;
import bisq.common.crypto.PubKeyRing;
import org.bitcoinj.core.Transaction;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import javax.annotation.Nullable;
@ -39,7 +41,7 @@ public class TransactionListItemFactory {
private final BsqWalletService bsqWalletService;
private final DaoFacade daoFacade;
private final PubKeyRing pubKeyRing;
private final BSFormatter formatter;
private final CoinFormatter formatter;
private final Preferences preferences;
@Inject
@ -47,7 +49,7 @@ public class TransactionListItemFactory {
BsqWalletService bsqWalletService,
DaoFacade daoFacade,
PubKeyRing pubKeyRing,
BSFormatter formatter,
@Named(FormattingUtils.BTC_FORMATTER_KEY) CoinFormatter formatter,
Preferences preferences) {
this.btcWalletService = btcWalletService;
this.bsqWalletService = bsqWalletService;

View file

@ -32,7 +32,7 @@ import bisq.core.offer.Offer;
import bisq.core.offer.OpenOffer;
import bisq.core.trade.Tradable;
import bisq.core.trade.Trade;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.common.crypto.PubKeyRing;
@ -54,7 +54,7 @@ import javax.annotation.Nullable;
@Slf4j
class TransactionsListItem {
private final BtcWalletService btcWalletService;
private final BSFormatter formatter;
private final CoinFormatter formatter;
private String dateString;
private final Date date;
private final String txId;
@ -90,7 +90,7 @@ class TransactionsListItem {
TransactionAwareTradable transactionAwareTradable,
DaoFacade daoFacade,
PubKeyRing pubKeyRing,
BSFormatter formatter,
CoinFormatter formatter,
long ignoreDustThreshold) {
this.btcWalletService = btcWalletService;
this.formatter = formatter;

View file

@ -36,7 +36,7 @@ import bisq.core.offer.OpenOffer;
import bisq.core.trade.Tradable;
import bisq.core.trade.Trade;
import bisq.core.user.Preferences;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import bisq.network.p2p.P2PService;
@ -110,7 +110,7 @@ public class TransactionsView extends ActivatableView<VBox, Void> {
private final BtcWalletService btcWalletService;
private final P2PService p2PService;
private final WalletsSetup walletsSetup;
private final BSFormatter formatter;
private final CoinFormatter formatter;
private final Preferences preferences;
private final TradeDetailsWindow tradeDetailsWindow;
private final OfferDetailsWindow offerDetailsWindow;
@ -127,7 +127,7 @@ public class TransactionsView extends ActivatableView<VBox, Void> {
private TransactionsView(BtcWalletService btcWalletService,
P2PService p2PService,
WalletsSetup walletsSetup,
BSFormatter formatter,
CoinFormatter formatter,
Preferences preferences,
TradeDetailsWindow tradeDetailsWindow,
OfferDetailsWindow offerDetailsWindow,

View file

@ -23,7 +23,7 @@ import bisq.core.btc.listeners.BalanceListener;
import bisq.core.btc.model.AddressEntry;
import bisq.core.btc.wallet.BtcWalletService;
import bisq.core.locale.Res;
import bisq.core.util.BSFormatter;
import bisq.core.util.coin.CoinFormatter;
import org.bitcoinj.core.Address;
import org.bitcoinj.core.Coin;
@ -39,7 +39,7 @@ class WithdrawalListItem {
private final Label balanceLabel;
private final AddressEntry addressEntry;
private final BtcWalletService walletService;
private final BSFormatter formatter;
private final CoinFormatter formatter;
private Coin balance;
private final String addressString;
@Setter
@ -47,7 +47,7 @@ class WithdrawalListItem {
private boolean isSelected;
public WithdrawalListItem(AddressEntry addressEntry, BtcWalletService walletService,
BSFormatter formatter) {
CoinFormatter formatter) {
this.addressEntry = addressEntry;
this.walletService = walletService;
this.formatter = formatter;

Some files were not shown because too many files have changed in this diff Show more