diff --git a/assets/src/main/java/haveno/asset/coins/Dobbscoin.java b/assets/src/main/java/haveno/asset/coins/Dobbscoin.java new file mode 100644 index 000000000..440856cb2 --- /dev/null +++ b/assets/src/main/java/haveno/asset/coins/Dobbscoin.java @@ -0,0 +1,33 @@ +/* + * This file is part of Haveno. + * + * Haveno is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. + */ + +package haveno.asset.coins; + +import haveno.asset.Base58AddressValidator; +import haveno.asset.Coin; +import haveno.asset.NetworkParametersAdapter; + +/** + * Dobbscoin (BOB). Base58Check addresses with the same version bytes as Bitcoin + * (P2PKH 0, P2SH 5), so a well-formed Bitcoin address also passes this check: + * the UI must warn traders to paste a Dobbscoin address only. + */ +public class Dobbscoin extends Coin { + + public Dobbscoin() { + super("Dobbscoin", "BOB", new Base58AddressValidator(new DobbscoinMainNetParams()), Network.MAINNET); + } + + public static class DobbscoinMainNetParams extends NetworkParametersAdapter { + public DobbscoinMainNetParams() { + this.addressHeader = 0; + this.p2shHeader = 5; + } + } +} diff --git a/assets/src/main/resources/META-INF/services/haveno.asset.Asset b/assets/src/main/resources/META-INF/services/haveno.asset.Asset index 626b9a6fd..2a733f11c 100644 --- a/assets/src/main/resources/META-INF/services/haveno.asset.Asset +++ b/assets/src/main/resources/META-INF/services/haveno.asset.Asset @@ -2,18 +2,5 @@ # Contents are sorted according to the output of `sort --ignore-case --dictionary-order`. # See haveno.asset.Asset and haveno.asset.AssetRegistry for further details. # See https://haveno.exchange/list-asset for complete instructions. -haveno.asset.coins.Bitcoin$Mainnet -haveno.asset.coins.BitcoinCash -haveno.asset.coins.Cardano -haveno.asset.coins.Dogecoin -haveno.asset.coins.Ether -haveno.asset.coins.Litecoin +haveno.asset.coins.Dobbscoin haveno.asset.coins.Monero -haveno.asset.coins.Ripple -haveno.asset.coins.Solana -haveno.asset.coins.Tron -haveno.asset.coins.Zcash -haveno.asset.tokens.TetherUSDERC20 -haveno.asset.tokens.TetherUSDTRC20 -haveno.asset.tokens.USDCoinERC20 -haveno.asset.tokens.DaiStablecoinERC20 \ No newline at end of file diff --git a/assets/src/test/java/haveno/asset/coins/DobbscoinTest.java b/assets/src/test/java/haveno/asset/coins/DobbscoinTest.java new file mode 100644 index 000000000..5146747d5 --- /dev/null +++ b/assets/src/test/java/haveno/asset/coins/DobbscoinTest.java @@ -0,0 +1,27 @@ +package haveno.asset.coins; + +import haveno.asset.AbstractAssetTest; + +import org.junit.jupiter.api.Test; + +public class DobbscoinTest extends AbstractAssetTest { + + public DobbscoinTest() { + super(new Dobbscoin()); + } + + @Test + public void testValidAddresses() { + assertValidAddress("1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2"); + assertValidAddress("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"); + assertValidAddress("3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy"); + } + + @Test + public void testInvalidAddresses() { + assertInvalidAddress("1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN3"); + assertInvalidAddress("DDWUYQ3GfMDj8hkx8cbnAMYkTzzAunAQxg"); + assertInvalidAddress("1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2#"); + assertInvalidAddress(""); + } +} diff --git a/common/src/main/java/haveno/common/app/Version.java b/common/src/main/java/haveno/common/app/Version.java index 6e6b7e178..a894f897f 100644 --- a/common/src/main/java/haveno/common/app/Version.java +++ b/common/src/main/java/haveno/common/app/Version.java @@ -121,7 +121,7 @@ public class Version { // The version no. for the objects sent over the network. A change will break the serialization of old objects. // If objects are used for both network and database the network version is applied. - public static final String P2P_NETWORK_VERSION = "A"; + public static final String P2P_NETWORK_VERSION = "D"; // HavenoBOB: never mix with the public network // The version no. of the serialized data stored to disc. A change will break the serialization of old objects. // VERSION = 0.5.0 -> LOCAL_DB_VERSION = 1 diff --git a/core/src/main/java/haveno/core/alert/AlertManager.java b/core/src/main/java/haveno/core/alert/AlertManager.java index 410dd4c33..d5b73951d 100644 --- a/core/src/main/java/haveno/core/alert/AlertManager.java +++ b/core/src/main/java/haveno/core/alert/AlertManager.java @@ -103,11 +103,10 @@ public class AlertManager { "024baabdba90e7cc0dc4626ef73ea9d722ea7085d1104491da8c76f28187513492"); case XMR_STAGENET: return List.of( - "03aa23e062afa0dda465f46986f8aa8d0374ad3e3f256141b05681dcb1e39c3859", - "02d3beb1293ca2ca14e6d42ca8bd18089a62aac62fd6bb23923ee6ead46ac60fba", - "0374dd70f3fa6e47ec5ab97932e1cec6233e98e6ae3129036b17118650c44fd3de"); + "029e3cd49ee6c21d82fa2af1ecb672b07ee7be1a919bbb8ce8f841462e6244f79c"); // HavenoBOB stagenet (2026-11-21) case XMR_MAINNET: - return List.of(); + return List.of( + "02545c4a2052a2d3e17efaa515066b31f1fea5b8f366180a0bf5eacae6735cf387"); // HavenoBOB mainnet (2026-11-22) default: throw new RuntimeException("Unhandled base currency network: " + Config.baseCurrencyNetwork()); } diff --git a/core/src/main/java/haveno/core/alert/PrivateNotificationManager.java b/core/src/main/java/haveno/core/alert/PrivateNotificationManager.java index e8e463a55..0a7dac812 100644 --- a/core/src/main/java/haveno/core/alert/PrivateNotificationManager.java +++ b/core/src/main/java/haveno/core/alert/PrivateNotificationManager.java @@ -106,11 +106,10 @@ public class PrivateNotificationManager implements MessageListener { "024baabdba90e7cc0dc4626ef73ea9d722ea7085d1104491da8c76f28187513492"); case XMR_STAGENET: return List.of( - "03aa23e062afa0dda465f46986f8aa8d0374ad3e3f256141b05681dcb1e39c3859", - "02d3beb1293ca2ca14e6d42ca8bd18089a62aac62fd6bb23923ee6ead46ac60fba", - "0374dd70f3fa6e47ec5ab97932e1cec6233e98e6ae3129036b17118650c44fd3de"); + "029e3cd49ee6c21d82fa2af1ecb672b07ee7be1a919bbb8ce8f841462e6244f79c"); // HavenoBOB stagenet (2026-11-21) case XMR_MAINNET: - return List.of(); + return List.of( + "02545c4a2052a2d3e17efaa515066b31f1fea5b8f366180a0bf5eacae6735cf387"); // HavenoBOB mainnet (2026-11-22) default: throw new RuntimeException("Unhandled base currency network: " + Config.baseCurrencyNetwork()); } diff --git a/core/src/main/java/haveno/core/api/CoreDisputeAgentsService.java b/core/src/main/java/haveno/core/api/CoreDisputeAgentsService.java index a133ac735..c7197eee4 100644 --- a/core/src/main/java/haveno/core/api/CoreDisputeAgentsService.java +++ b/core/src/main/java/haveno/core/api/CoreDisputeAgentsService.java @@ -179,7 +179,8 @@ class CoreDisputeAgentsService { null, null); runOnUserThread(() -> arbitratorManager.addDisputeAgent(arbitrator, () -> { - if (!arbitratorManager.getDisputeAgentByNodeAddress(nodeAddress).isPresent()) errorMessageHandler.handleErrorMessage("could not register arbitrator"); + // HavenoBOB fix: look up by the address the agent was stored under (its onion), not localhost:nodePort. + if (!arbitratorManager.getDisputeAgentByNodeAddress(arbitrator.getNodeAddress()).isPresent()) errorMessageHandler.handleErrorMessage("could not register arbitrator"); else resultHandler.handleResult(); }, errorMessageHandler), errorMessageHandler); } diff --git a/core/src/main/java/haveno/core/app/HavenoExecutable.java b/core/src/main/java/haveno/core/app/HavenoExecutable.java index 6c2fa0619..a46596abf 100644 --- a/core/src/main/java/haveno/core/app/HavenoExecutable.java +++ b/core/src/main/java/haveno/core/app/HavenoExecutable.java @@ -87,7 +87,7 @@ public abstract class HavenoExecutable implements GracefulShutDownHandler, Haven // TODO: regular expression is used to parse application name for the flatpak manifest, a more stable approach would be nice // Don't edit the next line unless you're only editing in between the quotes. - public static final String DEFAULT_APP_NAME = "Haveno"; + public static final String DEFAULT_APP_NAME = "HavenoBOB"; public static final int EXIT_SUCCESS = 0; public static final int EXIT_FAILURE = 1; diff --git a/core/src/main/java/haveno/core/filter/FilterManager.java b/core/src/main/java/haveno/core/filter/FilterManager.java index 30587bdb2..1b3972a31 100644 --- a/core/src/main/java/haveno/core/filter/FilterManager.java +++ b/core/src/main/java/haveno/core/filter/FilterManager.java @@ -131,11 +131,10 @@ public class FilterManager { "026eeec3c119dd6d537249d74e5752a642dd2c3cc5b6a9b44588eb58344f29b519"); case XMR_STAGENET: return List.of( - "03aa23e062afa0dda465f46986f8aa8d0374ad3e3f256141b05681dcb1e39c3859", - "02d3beb1293ca2ca14e6d42ca8bd18089a62aac62fd6bb23923ee6ead46ac60fba", - "0374dd70f3fa6e47ec5ab97932e1cec6233e98e6ae3129036b17118650c44fd3de"); + "029c3be5805bdf602e113752ed186c47940be7a317319886c6353b4572a1a1fc13"); // HavenoBOB stagenet (2026-11-21) case XMR_MAINNET: - return List.of(); + return List.of( + "03b524910d27bf8cc444a01502f033ef32e894f08c1d26f6f2620c49fa59665618"); // HavenoBOB mainnet (2026-11-22) default: throw new RuntimeException("Unhandled base currency network: " + Config.baseCurrencyNetwork()); } diff --git a/core/src/main/java/haveno/core/locale/CurrencyUtil.java b/core/src/main/java/haveno/core/locale/CurrencyUtil.java index eee572125..00ba8a6d5 100644 --- a/core/src/main/java/haveno/core/locale/CurrencyUtil.java +++ b/core/src/main/java/haveno/core/locale/CurrencyUtil.java @@ -195,16 +195,9 @@ public class CurrencyUtil { } public static List getMainCryptoCurrencies() { + // HavenoBOB: Dobbscoin is the only asset traded on this network final List result = new ArrayList<>(); - result.add(new CryptoCurrency("BTC", "Bitcoin")); - result.add(new CryptoCurrency("BCH", "Bitcoin Cash")); - result.add(new CryptoCurrency("ETH", "Ether")); - result.add(new CryptoCurrency("LTC", "Litecoin")); - result.add(new CryptoCurrency("DAI-ERC20", "Dai Stablecoin")); - result.add(new CryptoCurrency("USDT-ERC20", "Tether USD")); - result.add(new CryptoCurrency("USDT-TRC20", "Tether USD")); - result.add(new CryptoCurrency("USDC-ERC20", "USD Coin")); - result.sort(TradeCurrency::compareTo); + result.add(new CryptoCurrency("BOB", "Dobbscoin")); return result; } @@ -390,6 +383,9 @@ public class CurrencyUtil { return new TraditionalCurrency("EUR"); Currency currency = Currency.getInstance(new Locale(LanguageUtil.getDefaultLanguage(), countryCode)); + // HavenoBOB: "BOB" is Dobbscoin on this network. The Bolivian boliviano has the same ISO code and must never + // appear as a currency here, or the two get confused (wrong name, and a saved preference that cannot be loaded). + if ("BOB".equals(currency.getCurrencyCode())) return new TraditionalCurrency("USD"); return new TraditionalCurrency(currency.getCurrencyCode()); } diff --git a/core/src/main/java/haveno/core/provider/ProvidersRepository.java b/core/src/main/java/haveno/core/provider/ProvidersRepository.java index e87910c84..fe944f94f 100644 --- a/core/src/main/java/haveno/core/provider/ProvidersRepository.java +++ b/core/src/main/java/haveno/core/provider/ProvidersRepository.java @@ -50,10 +50,11 @@ import lombok.extern.slf4j.Slf4j; public class ProvidersRepository { private static final String DEFAULT_LOCAL_NODE = "http://localhost:8078/"; + // HavenoBOB: this network's own price feed (Dobbscoin from the wBOB/xDAI pool, XMR from public markets). + // The ordinary Haveno price nodes carry no Dobbscoin price, so they are not used. private static final List DEFAULT_NODES = Arrays.asList( - "http://lrrgpezvdrbpoqvkavzobmj7dr2otxc5x6wgktrw337bk6mxsvfp5yid.onion/", // Cake - "http://agorise7ae5g7lkqp7r7qddsyzskft7cqhgguwkadbqamtsrap5onead.onion/", // Agorise - "http://glex4bepv2jqa7imsd5k4pqec7lyubbwzj27tlxnoydl63fmsttmroqd.onion/" // Glex + "http://5k2xyespxi2igchryfqvw73dmjn2lmjm2vztftmjox5b3jdibwghcwqd.onion/havenobob/price/", + "https://endciv.subgenius.vip/havenobob/price/" ); private final Config config; diff --git a/core/src/main/java/haveno/core/provider/price/PriceProvider.java b/core/src/main/java/haveno/core/provider/price/PriceProvider.java index 7367ac54d..423f0b0a5 100644 --- a/core/src/main/java/haveno/core/provider/price/PriceProvider.java +++ b/core/src/main/java/haveno/core/provider/price/PriceProvider.java @@ -66,6 +66,9 @@ public class PriceProvider extends HttpClientProvider { counterCurrencyCode = temp; } counterCurrencyCode = CurrencyUtil.getCurrencyCodeBase(counterCurrencyCode); + // HavenoBOB: the ordinary Haveno price index reports the Bolivian boliviano under the code "BOB". + // Take a Dobbscoin price only from this network's own feed, which marks its entries. + if ("BOB".equalsIgnoreCase(counterCurrencyCode) && !"HAVENOBOB".equals(treeMap.get("provider"))) return; double price = (Double) treeMap.get("price"); if (isInverted) price = BigDecimal.ONE.divide(BigDecimal.valueOf(price), 10, RoundingMode.HALF_UP).doubleValue(); // XMR is always base currency, so invert price if applicable long timestampMs = MathUtils.doubleToLong((Double) treeMap.get("timestampMs")); diff --git a/core/src/main/java/haveno/core/support/dispute/arbitration/arbitrator/ArbitratorManager.java b/core/src/main/java/haveno/core/support/dispute/arbitration/arbitrator/ArbitratorManager.java index 30fe0be18..7ad70e36b 100644 --- a/core/src/main/java/haveno/core/support/dispute/arbitration/arbitrator/ArbitratorManager.java +++ b/core/src/main/java/haveno/core/support/dispute/arbitration/arbitrator/ArbitratorManager.java @@ -67,18 +67,10 @@ public class ArbitratorManager extends DisputeAgentManager { "026eeec3c119dd6d537249d74e5752a642dd2c3cc5b6a9b44588eb58344f29b519"); case XMR_STAGENET: return List.of( - "03bb559ce207a4deb51d4c705076c95b85ad8581d35936b2a422dcb504eaf7cdb0", - "026c581ad773d987e6bd10785ac7f7e0e64864aedeb8bce5af37046de812a37854", - "025b058c9f2c60d839669dbfa5578cf5a8117d60e6b70e2f0946f8a691273c6a36", - "036c7d3f4bf05ef39b9d1b0a5d453a18210de36220c3d83cd16e59bd6132b037ad", - "030f7122a10ff73cd73808bddace95be77a94189c8a0eb24586265e125ce5ce6b9", - "03aa23e062afa0dda465f46986f8aa8d0374ad3e3f256141b05681dcb1e39c3859", - "02d3beb1293ca2ca14e6d42ca8bd18089a62aac62fd6bb23923ee6ead46ac60fba", - "03fa0f38f27bdd324db6f933f7e57851dadf3b911e4db6b19dd0950492c4525a31", - "02a1a458df5acf4ab08fdca748e28f33a955a30854c8c1a831ee733dca7f0d2fcd", - "0374dd70f3fa6e47ec5ab97932e1cec6233e98e6ae3129036b17118650c44fd3de"); + "03394182d7f31c55b1dd8dd87811f102d58f6cc82eadd150fded4262b6cb6cc45e"); // HavenoBOB stagenet (2026-11-21) case XMR_MAINNET: - return List.of(); + return List.of( + "023f25ea190bfad6ff223bbd6b9c44ce026d33021e69e956fe4ba6f2664323a99e"); // HavenoBOB mainnet (2026-11-22) default: throw new RuntimeException("Unhandled base currency network: " + Config.baseCurrencyNetwork()); } diff --git a/core/src/main/java/haveno/core/user/Preferences.java b/core/src/main/java/haveno/core/user/Preferences.java index 1051e24e7..f9448a183 100644 --- a/core/src/main/java/haveno/core/user/Preferences.java +++ b/core/src/main/java/haveno/core/user/Preferences.java @@ -18,7 +18,6 @@ package haveno.core.user; import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; import com.google.inject.Inject; import com.google.inject.Singleton; import com.google.inject.name.Named; @@ -231,10 +230,27 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid prefPayload = persisted; GlobalSettings.setLocale(new Locale(prefPayload.getUserLanguage(), prefPayload.getUserCountry().code)); GlobalSettings.setUseAnimations(prefPayload.isUseAnimations()); - TradeCurrency preferredTradeCurrency = checkNotNull(prefPayload.getPreferredTradeCurrency(), "preferredTradeCurrency must not be null"); + // HavenoBOB: a profile saved by an earlier build could hold a preferred currency that no longer loads + // (the Bolivian boliviano shares the code BOB). Fall back to Dobbscoin instead of refusing to start. + TradeCurrency preferredTradeCurrency = prefPayload.getPreferredTradeCurrency(); + if (preferredTradeCurrency == null || !"BOB".equals(preferredTradeCurrency.getCode()) || !(preferredTradeCurrency instanceof CryptoCurrency)) { + preferredTradeCurrency = new CryptoCurrency("BOB", "Dobbscoin"); + prefPayload.setPreferredTradeCurrency(preferredTradeCurrency); + } setPreferredTradeCurrency(preferredTradeCurrency); - setTraditionalCurrencies(prefPayload.getTraditionalCurrencies()); - setCryptoCurrencies(prefPayload.getCryptoCurrencies()); + // HavenoBOB: this network trades Dobbscoin only. Drop national currencies and other coins that an + // earlier build saved in the profile, so they stop appearing in Settings and the price list. + // Clear the saved lists themselves, not only the on-screen ones: setting an already empty on-screen list to + // empty raises no change event, so the saved list would keep its national currencies and other screens + // (the Market tab, the price selector) would go on showing them. + List savedCryptos = new ArrayList<>(); + for (CryptoCurrency c : prefPayload.getCryptoCurrencies()) if ("BOB".equals(c.getCode())) savedCryptos.add(c); + if (savedCryptos.isEmpty()) savedCryptos.add(new CryptoCurrency("BOB", "Dobbscoin")); + prefPayload.getTraditionalCurrencies().clear(); + prefPayload.getCryptoCurrencies().clear(); + prefPayload.getCryptoCurrencies().addAll(savedCryptos); + setTraditionalCurrencies(new ArrayList<>()); + setCryptoCurrencies(savedCryptos); GlobalSettings.setDefaultTradeCurrency(preferredTradeCurrency); // If a user has updated and the field was not set and get set to 0 by protobuf @@ -270,8 +286,12 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid log.warn("Could not determine currency for country {} [{}]", prefPayload.getUserCountry().code, ia.toString()); } + // HavenoBOB: this network trades XMR against Dobbscoin only, so (BOB) is the default currency + preferredTradeCurrency = new CryptoCurrency("BOB", "Dobbscoin"); + prefPayload.setPreferredTradeCurrency(preferredTradeCurrency); - setTraditionalCurrencies(CurrencyUtil.getMainFiatCurrencies()); + // HavenoBOB: no fiat in the displayed currencies; the network filter bans every fiat payment method + setTraditionalCurrencies(new ArrayList<>()); setCryptoCurrencies(CurrencyUtil.getMainCryptoCurrencies()); BaseCurrencyNetwork baseCurrencyNetwork = Config.baseCurrencyNetwork(); @@ -286,8 +306,10 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid prefPayload.setOfferBookChartScreenCurrencyCode(preferredTradeCurrency.getCode()); prefPayload.setTradeChartsScreenCurrencyCode(preferredTradeCurrency.getCode()); - prefPayload.setBuyScreenFiatCurrencyCode(preferredTradeCurrency.getCode()); - prefPayload.setSellScreenFiatCurrencyCode(preferredTradeCurrency.getCode()); + prefPayload.setBuyScreenCryptoCurrencyCode(preferredTradeCurrency.getCode()); + prefPayload.setBuyScreenOfferBookSubTabIndex(1); // HavenoBOB: open on the crypto tab + prefPayload.setSellScreenOfferBookSubTabIndex(1); + prefPayload.setSellScreenCryptoCurrencyCode(preferredTradeCurrency.getCode()); GlobalSettings.setDefaultTradeCurrency(preferredTradeCurrency); setupPreferences(); } @@ -321,7 +343,7 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid getBlockChainExplorer().name.length() == 0) { setBlockChainExplorer(xmrExplorers.get(0)); } - tradeCurrenciesAsObservable.addAll(prefPayload.getTraditionalCurrencies()); + // HavenoBOB: national currencies are never trade currencies on this network tradeCurrenciesAsObservable.addAll(prefPayload.getCryptoCurrencies()); dontShowAgainMapAsObservable.putAll(getDontShowAgainMap()); diff --git a/core/src/main/java/haveno/core/xmr/nodes/XmrNodes.java b/core/src/main/java/haveno/core/xmr/nodes/XmrNodes.java index 98e079a93..8f94bf12a 100644 --- a/core/src/main/java/haveno/core/xmr/nodes/XmrNodes.java +++ b/core/src/main/java/haveno/core/xmr/nodes/XmrNodes.java @@ -88,6 +88,14 @@ public class XmrNodes { ); case XMR_MAINNET: return Arrays.asList( + // HavenoBOB: provided nodes, so a new user's wallet does not start on a third-party node. + // The app falls back to the public list below when none of these answers. + // Do NOT add 127.0.0.1 here as well: it is already in the public list, and the same address twice makes + // the wallet refuse to start ("Connection already exists") for any profile that uses the public list. + // Priority 1 (the best), ahead of every public node (2), so a profile set to "public nodes" + // still prefers this network's own relay whenever it answers. + new XmrNode(MoneroNodesOption.PROVIDED, null, null, "endciv.subgenius.vip", 18089, 1, "@HavenoBOB", "https"), + new XmrNode(MoneroNodesOption.PROVIDED, null, "3bmfxt7opv2i6vrsl23qj3gn3m6ppnbwutnkpemsctuhhc3y6b62wzyd.onion", null, 18089, 2, "@HavenoBOB"), new XmrNode(MoneroNodesOption.PUBLIC, null, null, "127.0.0.1", 18081, 1, "@local"), new XmrNode(MoneroNodesOption.PUBLIC, null, null, "xmr-node.cakewallet.com", 18081, 2, "@cakewallet"), new XmrNode(MoneroNodesOption.PUBLIC, null, null, "p2pmd.xmrvsbeast.com", 18081, 2, "@xmrvsbeast"), diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 8d8ae64a5..df09f044b 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -420,10 +420,10 @@ popup.warning.tradeLimitDueAccountAgeRestriction.seller.exceedsUnsignedBuyLimit= offerbook.warning.wrongTradeProtocol=That offer requires a different protocol version as the one used in your version of the software.\n\nPlease check if you have the latest version installed, otherwise the user who created the offer has used an older version.\n\nUsers cannot trade with an incompatible trade protocol version. offerbook.warning.userIgnored=You have added that user's onion address to your ignore list. -offerbook.warning.offerBlocked=That offer was blocked by the Haveno developers.\nProbably there is an unhandled bug causing issues when taking that offer. -offerbook.warning.currencyBanned=The currency used in that offer was blocked by the Haveno developers.\nPlease visit the Haveno Forum for more information. -offerbook.warning.paymentMethodBanned=The payment method used in that offer was blocked by the Haveno developers.\nPlease visit the Haveno Forum for more information. -offerbook.warning.nodeBlocked=The onion address of that trader was blocked by the Haveno developers.\nProbably there is an unhandled bug causing issues when taking offers from that trader. +offerbook.warning.offerBlocked=That offer is blocked on this network by whoever runs it.\nThere is probably a known problem with taking that offer. +offerbook.warning.currencyBanned=That currency is not traded on this network. HavenoBOB trades Dobbscoin (BOB) for Monero only. +offerbook.warning.paymentMethodBanned=That kind of account cannot be used on this network.\nUse an ordinary Dobbscoin (BOB) account. If yours was set up for instant trading (one hour), add a new Dobbscoin account and use that one. +offerbook.warning.nodeBlocked=The onion address of that trader is blocked on this network by whoever runs it.\nThere is probably a known problem with taking offers from that trader. offerbook.warning.requireUpdateToNewVersion=Your version of Haveno is not compatible for trading anymore.\n\ Please update to the latest Haveno version. offerbook.warning.offerWasAlreadyUsedInTrade=You cannot take this offer because you already took it earlier. \ @@ -630,7 +630,7 @@ portfolio.closedTrades.deviation.help=Percentage price deviation from market portfolio.pending.unconfirmedTooLong=Deposit transactions on trade {0} are still unconfirmed after {1} hours. \ Check the deposit transactions using a blockchain explorer; if they are confirmed but not displayed as \ confirmed in Haveno, try restarting Haveno.\n\n\ - If the problem persists, contact Haveno support [HYPERLINK:https://matrix.to/#/#haveno:monero.social]. + If the problem persists, ask whoever runs this network. portfolio.pending.syncing=Syncing wallet portfolio.pending.syncing.blockRemaining=Syncing wallet · 1 block left @@ -712,21 +712,21 @@ portfolio.pending.step5_seller.received=You have received tradeFeedbackWindow.title=Trade completed successfully! tradeFeedbackWindow.subtitle=Thanks for trading on Haveno tradeFeedbackWindow.feedback.title=Share your experience -tradeFeedbackWindow.feedback.body=We'd love to hear how it went. Your feedback helps us improve Haveno. +tradeFeedbackWindow.feedback.body=We'd love to hear how it went. tradeFeedbackWindow.support.title=Questions or problems? -tradeFeedbackWindow.support.body=Get in touch with other users and contributors in the Haveno community. -tradeFeedbackWindow.support.link=Chat with us on Matrix +tradeFeedbackWindow.support.body=HavenoBOB is an independent network. It is not run by the Haveno project. +tradeFeedbackWindow.support.link= tradeFeedbackWindow.done=Done supportInfoWindow.title=How support works -supportInfoWindow.subtitle=Haveno is not a company, so it handles disputes differently. +supportInfoWindow.subtitle=HavenoBOB is not a company, so it handles disputes differently. supportInfoWindow.chat.title=Resolve it together supportInfoWindow.chat.body=Trade partners can message each other in secure chat on the trade screen to work things out directly. supportInfoWindow.arbitration.title=Arbitration when needed -supportInfoWindow.arbitration.body=If chat isn't enough, a neutral arbitrator reviews the trade and decides a fair payout of the funds. +supportInfoWindow.arbitration.body=If the two of you can't settle it in chat, open a dispute. Whoever runs this network holds the third key. They look at what actually happened on both chains and release the funds to whoever is right. supportInfoWindow.community.title=Need help? -supportInfoWindow.community.body=Connect with other users and contributors in the Haveno community. -supportInfoWindow.community.link=Chat with us on Matrix +supportInfoWindow.community.body=HavenoBOB is an independent network. It is not run by the Haveno project. +supportInfoWindow.community.link= supportInfoWindow.gotIt=Got it portfolio.pending.role=My role @@ -746,7 +746,7 @@ portfolio.pending.mediationResult.error.depositTxNull=The deposit transaction is trade to failed trades. portfolio.pending.error.depositTxNotConfirmed=The deposit transactions are not confirmed and available. You cannot open an arbitration dispute \ with a pending deposit transaction. Please wait until both deposit transasctions are confirmed and available.\n\n\ - For further help, please contact Haveno support in our Matrix chatroom. + For further help, ask whoever runs this network. portfolio.pending.support.headline.getHelp=Need help? portfolio.pending.support.button.getHelp=Open trader chat @@ -1060,7 +1060,7 @@ setting.preferences.deviationToLarge=Values higher than {0}% are not allowed. setting.preferences.txFee=BSQ Withdrawal transaction fee (satoshis/vbyte) setting.preferences.useCustomValue=Use custom value setting.preferences.ignorePeers=Ignored peers [onion address:port] -setting.preferences.currenciesInList=Currencies in market price feed list +setting.preferences.currenciesInList=Currency setting.preferences.prefCurrency=Preferred currency setting.preferences.displayTraditional=Display traditional currencies setting.preferences.noTraditional=There are no traditional currencies selected @@ -1643,7 +1643,7 @@ tacWindow.agree=Agree and continue tacWindow.disagree=Reject and quit tacWindow.risk.headline=Understand the risks -tacWindow.risk.subtitle=Please read the following information carefully. +tacWindow.risk.subtitle=This is Pinkproofing: The Slackrobatics a free program performs so the Conspiracy's lawyers have nothing to grab.\nEvery word below is true.\nRead it once like you mean it.\n tacWindow.risk.p2p.title=Decentralized peer-to-peer software tacWindow.risk.p2p.body=Trades are conducted directly between users. The software project and its contributors, as such, do not control user funds and cannot guarantee that trades will complete successfully or that losses can be recovered. tacWindow.risk.financial.title=Financial, technical, and regulatory risks @@ -1678,7 +1678,7 @@ tacWindow.legal.back=Back startupWizard.next=Next startupWizard.skipPassword=Skip -startupWizard.start=Start Haveno +startupWizard.start=Start HavenoBOB startupWizard.finishing=Setting up... startupWizard.mode.headline=Get started @@ -1835,7 +1835,7 @@ You can download it at: [HYPERLINK:https://haveno.exchange/downloads].\n\n\ Please restart the application. popup.warning.startupFailed.twoInstances=Haveno is already running. You cannot run two instances of Haveno. popup.warning.noTradingAccountSetup.headline=You have not setup a trading account -popup.warning.noTradingAccountSetup.msg=You need to setup a national currency or cryptocurrency account before you can create an offer.\nDo you want to setup an account? +popup.warning.noTradingAccountSetup.msg=You need to set up a Dobbscoin (BOB) account before you can create an offer. It is only the address you want (BOB) paid to.\nDo you want to set one up now? popup.warning.noArbitratorsAvailable=There are no arbitrators available. popup.warning.notFullyConnected=You need to wait until you are fully connected to the network.\nThat might take up to about 2 minutes at startup. popup.warning.notSufficientConnectionsToXmrNetwork=You need to wait until you have at least {0} connections to the Monero network. @@ -1892,12 +1892,12 @@ popup.privateNotification.headline=Important private notification! popup.shutDownInProgress.headline=Shut down in progress popup.shutDownInProgress.msg=Shutting down application can take a few seconds.\nPlease don't interrupt this process. -welcomeWindow.mainnet.headline=Welcome to Haveno! -welcomeWindow.mainnet.subtitle=Private, decentralized trading built on Monero -welcomeWindow.mainnet.trade.title=Trade Monero, peer to peer -welcomeWindow.mainnet.trade.body=Buy and sell Monero for fiat or other cryptocurrencies, directly with other people. No middleman, private by design. +welcomeWindow.mainnet.headline=Welcome to HavenoBOB! +welcomeWindow.mainnet.subtitle=A Haveno network for trading Monero and Dobbscoin (BOB) +welcomeWindow.mainnet.trade.title=Trade Monero for (BOB), peer to peer +welcomeWindow.mainnet.trade.body=Buy and sell Dobbscoin (BOB) for Monero, directly with the other person. No company holds your money. Trade funds are locked by three keys: yours, the other trader's and the network arbitrator's. Any two can release them. If the arbitrator is also your trading partner, you are trusting that person. welcomeWindow.mainnet.start.title=Get started in two steps -welcomeWindow.mainnet.start.body=Create a payment account, then make or take an offer. +welcomeWindow.mainnet.start.body=Create a payment account, then make or take an offer. Paste a Dobbscoin address, never a Bitcoin one: they look the same. welcomeWindow.stagenet.headline=Welcome to the Haveno test instance! welcomeWindow.stagenet.subtitle=A test network for trying Haveno without real money welcomeWindow.stagenet.trade.title=Test Haveno's protocol @@ -1905,9 +1905,9 @@ welcomeWindow.stagenet.trade.body=Everything works like the real app, just with welcomeWindow.stagenet.start.title=Get started welcomeWindow.stagenet.start.body=Create a payment account, then make or take an offer. welcomeWindow.stagenet.warning=This is a test instance. Do not use real money! -welcomeWindow.support.title=We're here to help -welcomeWindow.support.body=Questions or problems? Reach out to the Haveno community anytime. -welcomeWindow.support.link=Chat with us on Matrix +welcomeWindow.support.title=An independent network +welcomeWindow.support.body=HavenoBOB is an independent network built on the open-source Haveno software, with Dobbscoin (BOB) added. It is not run by the Haveno project, so please do not ask the Haveno project for help with it. Do not take anyone's word for what this build does: its source is public. Read it, or build it yourself. +welcomeWindow.support.link=Read the source welcomeWindow.gotIt=Got it popup.info.multiplePaymentAccounts.headline=Multiple payment accounts available diff --git a/core/src/main/resources/xmr_mainnet.seednodes b/core/src/main/resources/xmr_mainnet.seednodes index 3f81fa048..065845028 100644 --- a/core/src/main/resources/xmr_mainnet.seednodes +++ b/core/src/main/resources/xmr_mainnet.seednodes @@ -1,2 +1,4 @@ # nodeaddress.onion:port [(@owner,@backup)] -placeholder.onion:8000 (@placeholder) \ No newline at end of file +# HavenoBOB mainnet (EndCiv network), 2026-11-22 +vhjptspljj5f54llpo3iz5orl7cjzbbvzp4q63govlx77hfk4t3hvhid.onion:2002 (@EndCiv) +hzdlp4oif3pnj5waxlddh3ue72ycmvbipqzy2zi3w7ry32cjs2ihekyd.onion:2003 (@EndCiv) diff --git a/core/src/main/resources/xmr_stagenet.seednodes b/core/src/main/resources/xmr_stagenet.seednodes index 14a139daa..2b846ed47 100644 --- a/core/src/main/resources/xmr_stagenet.seednodes +++ b/core/src/main/resources/xmr_stagenet.seednodes @@ -1,3 +1,4 @@ # nodeaddress.onion:port [(@owner)] -dl57jitswby4yhzpqpu7pwq6iyqg2x6vkio73araparbftlqoqxhvqad.onion:2002 (@devtest1) -3cqlkowdu766sto5wrdqpntpsi7kezwkkakc532i6jeiyu7hha726ead.onion:3003 (@devtest1) +# HavenoBOB stagenet (EndCiv network PoC), 2026-11-21 +gdo5aanvpb44hyssp4ede37nvk46nfh66adqlc2et56zbntdqvxapxad.onion:3002 (@EndCiv) +cvevucpiagqnk6udbwouttvw4jqxqwkflddvmtaitdbtxy5qkpwhmdid.onion:3003 (@EndCiv) diff --git a/desktop/package/linux/Haveno.AppDir/.DirIcon b/desktop/package/linux/Haveno.AppDir/.DirIcon deleted file mode 120000 index 37b10e398..000000000 --- a/desktop/package/linux/Haveno.AppDir/.DirIcon +++ /dev/null @@ -1 +0,0 @@ -../haveno.png \ No newline at end of file diff --git a/desktop/package/linux/Haveno.AppDir/exchange.haveno.Haveno.desktop b/desktop/package/linux/Haveno.AppDir/exchange.haveno.Haveno.desktop deleted file mode 120000 index 3507a5b0f..000000000 --- a/desktop/package/linux/Haveno.AppDir/exchange.haveno.Haveno.desktop +++ /dev/null @@ -1 +0,0 @@ -../Haveno.desktop \ No newline at end of file diff --git a/desktop/package/linux/Haveno.AppDir/exchange.haveno.Haveno.svg b/desktop/package/linux/Haveno.AppDir/exchange.haveno.Haveno.svg deleted file mode 120000 index 3fe12c49f..000000000 --- a/desktop/package/linux/Haveno.AppDir/exchange.haveno.Haveno.svg +++ /dev/null @@ -1 +0,0 @@ -../haveno.svg \ No newline at end of file diff --git a/desktop/package/linux/HavenoBOB.AppDir/.DirIcon b/desktop/package/linux/HavenoBOB.AppDir/.DirIcon new file mode 120000 index 000000000..5b51cc659 --- /dev/null +++ b/desktop/package/linux/HavenoBOB.AppDir/.DirIcon @@ -0,0 +1 @@ +havenobob.png \ No newline at end of file diff --git a/desktop/package/linux/HavenoBOB.AppDir/havenobob.desktop b/desktop/package/linux/HavenoBOB.AppDir/havenobob.desktop new file mode 100644 index 000000000..750c71011 --- /dev/null +++ b/desktop/package/linux/HavenoBOB.AppDir/havenobob.desktop @@ -0,0 +1,14 @@ +[Desktop Entry] +Comment=A decentralized, Tor-based, P2P Monero exchange network. +Exec=sh -c "PATH=\"\\$HOME/.local/bin:\\$PATH\"; bin/HavenoBOB %u" +GenericName[en_US]=Monero Exchange +GenericName=Monero Exchange +Icon=havenobob +Categories=Office;Finance;Java;P2P; +Name[en_US]=HavenoBOB +Name=HavenoBOB +Terminal=false +Type=Application +MimeType= +X-AppImage-Name=HavenoBOB +StartupWMClass=HavenoBOB diff --git a/desktop/package/linux/jpackage.deb/Haveno.desktop b/desktop/package/linux/jpackage.deb/HavenoBOB.desktop similarity index 57% rename from desktop/package/linux/jpackage.deb/Haveno.desktop rename to desktop/package/linux/jpackage.deb/HavenoBOB.desktop index a12d14902..84d110b1c 100644 --- a/desktop/package/linux/jpackage.deb/Haveno.desktop +++ b/desktop/package/linux/jpackage.deb/HavenoBOB.desktop @@ -1,9 +1,9 @@ [Desktop Entry] -Name=Haveno -GenericName=Monero Exchange +Name=HavenoBOB +GenericName=Monero / Dobbscoin Exchange Comment=A decentralized monero exchange network. -Exec=/opt/haveno/bin/Haveno -Icon=/opt/haveno/lib/Haveno.png +Exec=/opt/havenobob/bin/HavenoBOB +Icon=/opt/havenobob/lib/HavenoBOB.png Terminal=false Type=Application Categories=Network diff --git a/desktop/package/package.gradle b/desktop/package/package.gradle index 5e3a1ae13..7117e1bb5 100644 --- a/desktop/package/package.gradle +++ b/desktop/package/package.gradle @@ -245,8 +245,11 @@ task packageInstallers { // Remove the -SNAPSHOT suffix from the version string (originally defined in build.gradle) // Having it in would have resulted in an invalid version property for several platforms (mac, linux/rpm) - String appVersion = version.replaceAll("-SNAPSHOT", "") - println "Packaging Haveno version ${appVersion}" + // HavenoBOB: the PACKAGE version. Bump the third number for EVERY published build: Windows Installer refuses + // to install over a package with the same version (error 1638, and it does so silently). + // The app inside still reports the upstream Haveno version it is built from. + String appVersion = "1.13.10" + println "Packaging HavenoBOB version ${appVersion}" // zip jar lib for Raspberry Pi only on macOS as there are path issues on Windows and it is only needed once // for the release @@ -257,8 +260,8 @@ task packageInstallers { } //String appDescription = 'A decentralized monero exchange network.' - String appCopyright = '© 2026 Haveno' - String appNameAndVendor = 'Haveno' + String appCopyright = '(c) 2026 HavenoBOB (a fork of Haveno)' + String appNameAndVendor = 'HavenoBOB' String commonOpts = new String( // Generic options @@ -277,17 +280,18 @@ task packageInstallers { " --main-jar ${mainJarName}" + " --main-class haveno.desktop.app.HavenoAppMain" + rootProject.ext.havenoDesktopJpackageOpts + - " --arguments --baseCurrencyNetwork=XMR_STAGENET" + " --arguments --baseCurrencyNetwork=XMR_MAINNET" // Note: -Djdk.module.illegalAccess=deny breaks Guice reflection (UI won't load) ) if (Os.isFamily(Os.FAMILY_WINDOWS)) { String windowsOpts = new String( - " --icon \"${project(':desktop').projectDir}/package/windows/Haveno.ico\"" + + " --icon \"${project(':desktop').projectDir}/package/windows/HavenoBOB.ico\"" + " --resource-dir \"${project(':desktop').projectDir}/package/windows\"" + " --win-dir-chooser" + " --win-per-user-install" + " --win-menu" + + " --win-menu-group HavenoBOB" + " --win-shortcut" ) @@ -306,7 +310,7 @@ task packageInstallers { " --icon ${project(':desktop').projectDir}/package/linux/icon.png" + // This defines the first part of the resulting packages (the application name) // deb requires lowercase letters, therefore the application name is written in lowercase - " --linux-package-name haveno" + + " --linux-package-name havenobob" + // This represents the linux package version (revision) // By convention, this is part of the deb/rpm package names, in addition to the software version @@ -347,8 +351,8 @@ task packageInstallers { String osKey = getJavaBinariesDownloadURLs.property('osKey') - File appDir = new File("${jpackageTempDir}/Haveno") - File templateAppDir = new File("${project(':desktop').projectDir}/package/linux/Haveno.AppDir") + File appDir = new File("${jpackageTempDir}/${appNameAndVendor}") + File templateAppDir = new File("${project(':desktop').projectDir}/package/linux/HavenoBOB.AppDir") File jpackDir = appDir appDir.mkdirs() @@ -383,11 +387,11 @@ task packageInstallers { project.exec { workingDir appDir - commandLine 'ln', '-s', 'bin/Haveno', 'AppRun' + commandLine 'ln', '-s', "bin/${appNameAndVendor}", 'AppRun' } project.exec { - commandLine "${AppImageToolBinary}", appDir, "${binariesFolderPath}/haveno_${appVersion}.AppImage" + commandLine "${AppImageToolBinary}", appDir, "${binariesFolderPath}/havenobob_${appVersion}.AppImage" } } else { println "Your platform does not support AppImageTool ${AppImageToolVersion}" diff --git a/desktop/src/main/java/haveno/desktop/app/StartupWizardCurrencyStep.java b/desktop/src/main/java/haveno/desktop/app/StartupWizardCurrencyStep.java index ee5e108fd..9066c8e11 100644 --- a/desktop/src/main/java/haveno/desktop/app/StartupWizardCurrencyStep.java +++ b/desktop/src/main/java/haveno/desktop/app/StartupWizardCurrencyStep.java @@ -18,11 +18,9 @@ package haveno.desktop.app; import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon; -import haveno.core.locale.CountryUtil; import haveno.core.locale.CurrencyUtil; import haveno.core.locale.Res; import haveno.core.locale.TradeCurrency; -import haveno.core.locale.TraditionalCurrency; import haveno.desktop.components.AutoTooltipLabel; import java.util.ArrayList; import java.util.function.BooleanSupplier; @@ -84,14 +82,8 @@ public class StartupWizardCurrencyStep implements StartupWizard.Step { noMatches.getStyleClass().add("startup-wizard-footer-label"); currencyListView.setPlaceholder(noMatches); - // preselect the currency of the system locale's country, or USD if unavailable - TradeCurrency defaultCurrency = new TraditionalCurrency("USD"); - try { - TradeCurrency localeCurrency = CurrencyUtil.getCurrencyByCountryCode(CountryUtil.getDefaultCountry().code); - if (filteredCurrencies.contains(localeCurrency)) defaultCurrency = localeCurrency; - } catch (IllegalArgumentException e) { - } - currencyListView.getSelectionModel().select(defaultCurrency); + // HavenoBOB: nothing is preselected. The app's default currency is Dobbscoin (set in Preferences); + // this list holds only national currencies, and a selection here would replace that default. searchField.setPromptText(Res.get("startupWizard.currency.search")); searchField.getStyleClass().add("login-password-field"); diff --git a/desktop/src/main/java/haveno/desktop/components/SlackSpotTicker.java b/desktop/src/main/java/haveno/desktop/components/SlackSpotTicker.java new file mode 100644 index 000000000..566a66961 --- /dev/null +++ b/desktop/src/main/java/haveno/desktop/components/SlackSpotTicker.java @@ -0,0 +1,157 @@ +/* + * This file is part of HavenoBOB, a fork of Haveno. + * + * Haveno is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. + * + * Haveno is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public + * License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Haveno. If not, see . + */ + +package haveno.desktop.components; + +import haveno.core.locale.GlobalSettings; +import haveno.core.provider.price.MarketPrice; +import haveno.core.provider.price.PriceFeedService; +import javafx.animation.Animation; +import javafx.animation.KeyFrame; +import javafx.animation.Timeline; +import javafx.geometry.Pos; +import javafx.scene.control.Label; +import javafx.scene.layout.HBox; +import javafx.scene.layout.Pane; +import javafx.scene.shape.Rectangle; +import javafx.util.Duration; + +import java.util.Locale; + +/** + * The Slack Spot ticker: a bullion-dealer style price tape for Dobbscoin across the top of the window. + * (BOB) in dollars is derived from the two prices the network's price feed publishes: + * dollars per XMR divided by (BOB) per XMR. + */ +public class SlackSpotTicker extends Pane { + public static final double HEIGHT = 44; + private static final String BASE = "-fx-font-family: 'IBM Plex Mono', 'Consolas', 'DejaVu Sans Mono', monospace; " + + "-fx-font-size: 20px; -fx-font-weight: bold; "; + private static final String GOLD = BASE + "-fx-text-fill: #f5c542;"; + private static final String WHITE = BASE + "-fx-text-fill: #f2f2f2;"; + private static final String RED = BASE + "-fx-text-fill: #ff4d3d;"; + private static final String GREEN = BASE + "-fx-text-fill: #3ddc84;"; + private static final String DIM = BASE + "-fx-text-fill: #8a8a8a;"; + private static final int COPIES = 4; // enough copies of the tape to fill a wide window end to end + private static final String[] SLOGANS = { + "PRAISE \"BOB\"!", + "BUY LOW. SELL HIGH.", + "GET SLACK OR GET OUT.", + "ETERNAL SALVATION OR TRIPLE YOUR MONEY BACK", + "PULL THE WOOL OVER YOUR OWN EYES", + "THE CONSPIRACY HATES THIS TICKER", + "YOU'LL PAY TO KNOW WHAT YOU REALLY THINK", + "TOO MUCH IS ALWAYS BETTER THAN NOT ENOUGH", + "X-DAY IS COMING. ARE YOUR SLACK RESERVES IN ORDER?", + "NOT FINANCIAL ADVICE. NOT EVEN ADVICE.", + }; + + private final PriceFeedService priceFeedService; + private final HBox tape = new HBox(16); + private double x; + private double openingBobUsd; + private int slogan; + + public SlackSpotTicker(PriceFeedService priceFeedService) { + this.priceFeedService = priceFeedService; + setId("slack-spot-ticker"); + setMinHeight(HEIGHT); + setPrefHeight(HEIGHT); + setMaxHeight(HEIGHT); + setStyle("-fx-background-color: #0b0b0b; -fx-border-color: transparent transparent #f5c542 transparent; -fx-border-width: 0 0 2 0;"); + Rectangle clip = new Rectangle(); + clip.widthProperty().bind(widthProperty()); + clip.heightProperty().bind(heightProperty()); + setClip(clip); + tape.setAlignment(Pos.CENTER_LEFT); + tape.setLayoutY(8); + tape.setLayoutX(12); + getChildren().add(tape); + refresh(); + + Timeline poll = new Timeline(new KeyFrame(Duration.seconds(5), e -> refresh())); + poll.setCycleCount(Animation.INDEFINITE); + poll.play(); + + if (GlobalSettings.getUseAnimations()) { + x = 12; + Timeline scroll = new Timeline(new KeyFrame(Duration.millis(40), e -> { + x -= 1.6; + // each copy carries a different slogan, so wrap by the real width of the first copy + double firstWidth = tape.getChildren().isEmpty() ? 0 : ((HBox) tape.getChildren().get(0)).getWidth(); + double oneCopy = firstWidth + tape.getSpacing(); + if (firstWidth > 0 && x < -oneCopy) { + x += oneCopy; + slogan = (slogan + 1) % SLOGANS.length; + refresh(); + } + tape.setLayoutX(x); + })); + scroll.setCycleCount(Animation.INDEFINITE); + scroll.play(); + } + } + + private static Label label(String text, String style) { + Label label = new Label(text); + label.setStyle(style); + return label; + } + + private static double recentPrice(MarketPrice marketPrice) { + return marketPrice != null && marketPrice.isRecentPriceAvailable() ? marketPrice.getPrice() : 0; + } + + private void refresh() { + tape.getChildren().clear(); + boolean scrolling = GlobalSettings.getUseAnimations(); + for (int i = 0; i < (scrolling ? COPIES : 1); i++) addCopy(SLOGANS[(slogan + i) % SLOGANS.length]); + } + + private void addCopy(String sloganText) { + HBox copy = new HBox(16); + copy.setAlignment(Pos.CENTER_LEFT); + tape.getChildren().add(copy); + double usdPerXmr = recentPrice(priceFeedService.getMarketPrice("USD")); + double bobPerXmr = recentPrice(priceFeedService.getMarketPrice("BOB")); + copy.getChildren().add(label("SLACK SPOT", RED)); + if (usdPerXmr > 0 && bobPerXmr > 0) { + double bobUsd = usdPerXmr / bobPerXmr; + if (openingBobUsd == 0) openingBobUsd = bobUsd; + double change = (bobUsd - openingBobUsd) / openingBobUsd * 100; + copy.getChildren().add(label("(BOB)", GOLD)); + copy.getChildren().add(label(String.format(Locale.US, "$%.6f", bobUsd), WHITE)); + if (Math.abs(change) < 0.005) copy.getChildren().add(label("— 0.00%", DIM)); + else if (change > 0) copy.getChildren().add(label(String.format(Locale.US, "▲ +%.2f%%", change), GREEN)); + else copy.getChildren().add(label(String.format(Locale.US, "▼ %.2f%%", change), RED)); + copy.getChildren().add(label("•", DIM)); + copy.getChildren().add(label("1 XMR =", GOLD)); + copy.getChildren().add(label(String.format(Locale.US, "%,.0f (BOB)", bobPerXmr), WHITE)); + copy.getChildren().add(label("•", DIM)); + copy.getChildren().add(label("XMR", GOLD)); + copy.getChildren().add(label(String.format(Locale.US, "$%,.2f", usdPerXmr), WHITE)); + copy.getChildren().add(label("•", DIM)); + copy.getChildren().add(label("$1 =", GOLD)); + copy.getChildren().add(label(String.format(Locale.US, "%,.1f (BOB)", 1 / bobUsd), WHITE)); + } else { + copy.getChildren().add(label("waiting for the price feed", DIM)); + } + copy.getChildren().add(label("•", DIM)); + copy.getChildren().add(label(sloganText, GOLD)); + copy.getChildren().add(label("\u2022", DIM)); + } +} diff --git a/desktop/src/main/java/haveno/desktop/components/paymentmethods/AssetsForm.java b/desktop/src/main/java/haveno/desktop/components/paymentmethods/AssetsForm.java index 1dc003cb1..e49b11972 100644 --- a/desktop/src/main/java/haveno/desktop/components/paymentmethods/AssetsForm.java +++ b/desktop/src/main/java/haveno/desktop/components/paymentmethods/AssetsForm.java @@ -108,6 +108,10 @@ public class AssetsForm extends PaymentMethodForm { tradeInstantCheckBox.setPadding(new Insets(0, 40, 0, 0)); gridPane.getChildren().add(tradeInstantCheckBox); + // HavenoBOB: the network filter bans the instant (one hour) kind of account, because Dobbscoin is sent and + // confirmed by hand. Do not offer a box that creates an account no offer can be made from. + tradeInstantCheckBox.setVisible(false); + tradeInstantCheckBox.setManaged(false); addressInputTextField = FormBuilder.addInputTextField(gridPane, ++gridRow, Res.get("payment.crypto.address")); diff --git a/desktop/src/main/java/haveno/desktop/main/MainView.java b/desktop/src/main/java/haveno/desktop/main/MainView.java index b1e9103dd..b270921a1 100644 --- a/desktop/src/main/java/haveno/desktop/main/MainView.java +++ b/desktop/src/main/java/haveno/desktop/main/MainView.java @@ -301,7 +301,7 @@ public class MainView extends InitializableView { setId("nav-secondary-container"); setLeftAnchor(this, 0d); setRightAnchor(this, 0d); - setTopAnchor(this, 82d); // nav height + content-pane top gap; underline must meet the subtab divider + setTopAnchor(this, 82d + haveno.desktop.components.SlackSpotTicker.HEIGHT); // ticker + nav height + content-pane top gap; underline must meet the subtab divider }}; secondaryNavContainer.setPickOnBounds(false); secondaryNavContainer.getChildren().add(secondaryNav); @@ -310,11 +310,17 @@ public class MainView extends InitializableView { getStyleClass().add("content-pane"); setLeftAnchor(this, 0d); setRightAnchor(this, 0d); - setTopAnchor(this, 66d); + setTopAnchor(this, 66d + haveno.desktop.components.SlackSpotTicker.HEIGHT); setBottomAnchor(this, 0d); }}; - AnchorPane applicationContainer = new AnchorPane(contentContainer, navPane, secondaryNavContainer) {{ + // HavenoBOB: the Slack Spot ticker sits directly under the blue title bar + haveno.desktop.components.SlackSpotTicker slackSpotTicker = new haveno.desktop.components.SlackSpotTicker(model.getPriceFeedService()); + setLeftAnchor(slackSpotTicker, 0d); + setRightAnchor(slackSpotTicker, 0d); + setTopAnchor(slackSpotTicker, 66d); + + AnchorPane applicationContainer = new AnchorPane(contentContainer, navPane, slackSpotTicker, secondaryNavContainer) {{ setId("application-container"); }}; @@ -579,7 +585,7 @@ public class MainView extends InitializableView { private void updateMarketPriceLabel(Label label) { if (model.getIsPriceAvailable().get()) { if (model.getIsExternallyProvidedPrice().get()) { - label.setText(Res.get("mainView.marketPriceWithProvider.label", "Haveno Price Index")); + label.setText(Res.get("mainView.marketPriceWithProvider.label", "Slack Spot")); label.setTooltip(new Tooltip(getPriceProviderTooltipString())); } else { label.setText(Res.get("mainView.marketPrice.havenoInternalPrice")); @@ -599,7 +605,7 @@ public class MainView extends InitializableView { MarketPrice selectedMarketPrice = model.getPriceFeedService().getMarketPrice(selectedCurrencyCode); return Res.get("mainView.marketPrice.tooltip", - "Haveno Price Index for " + selectedCurrencyCode, + "Slack Spot (the wBOB pool price) for " + selectedCurrencyCode, "", selectedMarketPrice != null ? DisplayUtils.formatTime(new Date(selectedMarketPrice.getTimestampMs())) : Res.get("shared.na"), model.getPriceFeedService().getProviderNodeAddress()); diff --git a/desktop/src/main/java/haveno/desktop/main/account/AccountView.java b/desktop/src/main/java/haveno/desktop/main/account/AccountView.java index 8feeb3e8e..fbbf1ac55 100644 --- a/desktop/src/main/java/haveno/desktop/main/account/AccountView.java +++ b/desktop/src/main/java/haveno/desktop/main/account/AccountView.java @@ -88,6 +88,9 @@ public class AccountView extends ActivatableView { root.setTabClosingPolicy(TabPane.TabClosingPolicy.ALL_TABS); + // HavenoBOB: this network has no national-currency trading, so that tab is not shown + root.getTabs().remove(traditionalAccountsTab); + traditionalAccountsTab.setText(Res.get("account.menu.paymentAccount")); cryptoAccountsTab.setText(Res.get("account.menu.altCoinsAccountView")); passwordTab.setText(Res.get("account.menu.password")); @@ -105,6 +108,9 @@ public class AccountView extends ActivatableView { navigation.navigateTo(MainView.class, AccountView.class, TraditionalAccountsView.class); } else if (signingTab == null && viewPath.get(2).equals(SigningView.class)) { navigation.navigateTo(MainView.class, AccountView.class, TraditionalAccountsView.class); + } else if (viewPath.get(2).equals(TraditionalAccountsView.class)) { + // HavenoBOB: every "set up an account" path ends at the cryptocurrency accounts + navigation.navigateTo(MainView.class, AccountView.class, CryptoAccountsView.class); } else { loadView(viewPath.tip()); } diff --git a/desktop/src/main/java/haveno/desktop/main/market/trades/TradesChartsViewModel.java b/desktop/src/main/java/haveno/desktop/main/market/trades/TradesChartsViewModel.java index 8432325f7..0501f70b1 100644 --- a/desktop/src/main/java/haveno/desktop/main/market/trades/TradesChartsViewModel.java +++ b/desktop/src/main/java/haveno/desktop/main/market/trades/TradesChartsViewModel.java @@ -61,7 +61,8 @@ import java.util.stream.Collectors; class TradesChartsViewModel extends ActivatableViewModel { static final int MAX_TICKS = 90; private static final int TAB_INDEX = 2; - private static final List SHOW_ALL_FLAGS = List.of(GUIUtil.SHOW_ALL_FLAG, GUIUtil.SHOW_FIAT_FLAG, GUIUtil.SHOW_CRYPTO_FLAG); + // HavenoBOB: one coin, so no separate "Fiat trades" and "Crypto trades" entries + private static final List SHOW_ALL_FLAGS = List.of(GUIUtil.SHOW_ALL_FLAG); /////////////////////////////////////////////////////////////////////////////////////////// // Enum diff --git a/desktop/src/main/java/haveno/desktop/main/offer/OfferView.java b/desktop/src/main/java/haveno/desktop/main/offer/OfferView.java index a662bab51..6203eb6d3 100644 --- a/desktop/src/main/java/haveno/desktop/main/offer/OfferView.java +++ b/desktop/src/main/java/haveno/desktop/main/offer/OfferView.java @@ -293,7 +293,8 @@ public abstract class OfferView extends ActivatableView { cryptoOfferBookTab.setClosable(false); otherOfferBookTab = new Tab(Res.get("shared.other")); otherOfferBookTab.setClosable(false); - tabPane.getTabs().addAll(fiatOfferBookTab, cryptoOfferBookTab, otherOfferBookTab); + // HavenoBOB: only the crypto tab is shown; this network trades XMR against Dobbscoin only + tabPane.getTabs().addAll(cryptoOfferBookTab); } if (viewClass == FiatOfferBookView.class) { fiatOfferBookView = (FiatOfferBookView) viewLoader.load(FiatOfferBookView.class); diff --git a/desktop/src/main/java/haveno/desktop/main/overlays/windows/HeroInfoWindow.java b/desktop/src/main/java/haveno/desktop/main/overlays/windows/HeroInfoWindow.java index 6bfbf29a9..9176a2d29 100644 --- a/desktop/src/main/java/haveno/desktop/main/overlays/windows/HeroInfoWindow.java +++ b/desktop/src/main/java/haveno/desktop/main/overlays/windows/HeroInfoWindow.java @@ -42,7 +42,7 @@ public abstract class HeroInfoWindow> extends Overla protected Label headerTitle; - protected static final String MATRIX_URL = "https://matrix.to/#/#haveno:monero.social"; + protected static final String MATRIX_URL = "https://endciv.subgenius.vip/havenobob/source/"; // accent style classes; the window accent is set via addContent, per-row accents via createFeatureRow protected static final String ACCENT_PRIMARY = "hero-accent-primary"; diff --git a/desktop/src/main/java/haveno/desktop/main/overlays/windows/SupportInfoWindow.java b/desktop/src/main/java/haveno/desktop/main/overlays/windows/SupportInfoWindow.java index c17ba792f..c29c89ba2 100644 --- a/desktop/src/main/java/haveno/desktop/main/overlays/windows/SupportInfoWindow.java +++ b/desktop/src/main/java/haveno/desktop/main/overlays/windows/SupportInfoWindow.java @@ -53,6 +53,6 @@ public class SupportInfoWindow extends HeroInfoWindow { ACCENT_ORANGE, Res.get("supportInfoWindow.community.title"), Res.get("supportInfoWindow.community.body"), - Res.get("supportInfoWindow.community.link"), MATRIX_URL)); + null, MATRIX_URL)); } } diff --git a/desktop/src/main/java/haveno/desktop/main/overlays/windows/TradeFeedbackWindow.java b/desktop/src/main/java/haveno/desktop/main/overlays/windows/TradeFeedbackWindow.java index 409cb66c8..49c4db895 100644 --- a/desktop/src/main/java/haveno/desktop/main/overlays/windows/TradeFeedbackWindow.java +++ b/desktop/src/main/java/haveno/desktop/main/overlays/windows/TradeFeedbackWindow.java @@ -53,6 +53,6 @@ public class TradeFeedbackWindow extends HeroInfoWindow { ACCENT_PURPLE, Res.get("tradeFeedbackWindow.support.title"), Res.get("tradeFeedbackWindow.support.body"), - Res.get("tradeFeedbackWindow.support.link"), MATRIX_URL)); + null, MATRIX_URL)); } } diff --git a/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/steps/TradeStepView.java b/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/steps/TradeStepView.java index 14c6ed8b5..c10e34624 100644 --- a/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/steps/TradeStepView.java +++ b/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/steps/TradeStepView.java @@ -51,7 +51,6 @@ import haveno.desktop.util.Layout; import javafx.geometry.Pos; import javafx.scene.control.Button; import javafx.scene.control.ContentDisplay; -import javafx.scene.control.Hyperlink; import javafx.scene.control.ScrollPane; import javafx.scene.control.TextField; import javafx.scene.control.TextArea; @@ -596,11 +595,7 @@ public abstract class TradeStepView extends VBox { helpLabel.getStyleClass().add("trade-secondary"); helpPane.getChildren().add(helpLabel); } - Hyperlink communityHelp = new Hyperlink(Res.get("supportInfoWindow.community.link")); - communityHelp.setWrapText(true); - communityHelp.getStyleClass().add("trade-community-link"); - communityHelp.setOnAction(event -> GUIUtil.openWebPage("https://matrix.to/#/#haveno:monero.social")); - helpPane.getChildren().add(communityHelp); + // HavenoBOB: no community link (independent network, nothing personal in the app) helpPane.getStyleClass().add("trade-help"); sidebar.getChildren().addAll(deadlinePane, depositsPane, helpPane); } diff --git a/desktop/src/main/java/haveno/desktop/main/settings/preferences/PreferencesView.java b/desktop/src/main/java/haveno/desktop/main/settings/preferences/PreferencesView.java index 45f8746e4..9a8287900 100644 --- a/desktop/src/main/java/haveno/desktop/main/settings/preferences/PreferencesView.java +++ b/desktop/src/main/java/haveno/desktop/main/settings/preferences/PreferencesView.java @@ -439,6 +439,9 @@ public class PreferencesView extends ActivatableViewAndModel, VBox> cryptoCurrenciesTuple = addTopLabelListView(currenciesGridPane, displayCurrenciesGridRowIndex, Res.get("setting.preferences.displayCryptos")); - GridPane.setColumnIndex(cryptoCurrenciesTuple.third, 1); + GridPane.setColumnIndex(cryptoCurrenciesTuple.third, 0); GridPane.setRowSpan(cryptoCurrenciesTuple.third, listRowSpan); GridPane.setValignment(cryptoCurrenciesTuple.third, VPos.TOP); - GridPane.setMargin(cryptoCurrenciesTuple.third, new Insets(10, 0, 0, 20)); + GridPane.setMargin(cryptoCurrenciesTuple.third, new Insets(10, 0, 0, 0)); cryptoCurrenciesListView = cryptoCurrenciesTuple.second; cryptoCurrenciesListView.getStyleClass().add("preferences-currency-list"); cryptoCurrenciesListView.setMinHeight(7 * listCellHeight + 10); @@ -556,6 +559,8 @@ public class PreferencesView extends ActivatableViewAndModel() { @Override protected void updateItem(final TraditionalCurrency item, boolean empty) { @@ -582,11 +587,14 @@ public class PreferencesView extends ActivatableViewAndModel() { @Override protected void updateItem(final CryptoCurrency item, boolean empty) {