diff --git a/core/src/main/java/bisq/core/util/BSFormatter.java b/core/src/main/java/bisq/core/util/BSFormatter.java
index bf0db4618e..8d2501a020 100644
--- a/core/src/main/java/bisq/core/util/BSFormatter.java
+++ b/core/src/main/java/bisq/core/util/BSFormatter.java
@@ -421,6 +421,10 @@ public class BSFormatter {
}
}
+ public String formatPrice(Price price, boolean appendCurrencyCode) {
+ return formatPrice(price, fiatPriceFormat, true);
+ }
+
public String formatPrice(Price price) {
return formatPrice(price, fiatPriceFormat, false);
}
diff --git a/core/src/main/java/bisq/core/util/BsqFormatter.java b/core/src/main/java/bisq/core/util/BsqFormatter.java
index 3d3958638b..cba0117212 100644
--- a/core/src/main/java/bisq/core/util/BsqFormatter.java
+++ b/core/src/main/java/bisq/core/util/BsqFormatter.java
@@ -124,6 +124,10 @@ public class BsqFormatter extends BSFormatter {
return super.formatCoin(satoshi, coinFormat);
}
+ public String formatBSQSatoshisWithCode(long satoshi) {
+ return super.formatCoinWithCode(satoshi, coinFormat);
+ }
+
public String formatBTCSatoshis(long satoshi) {
return super.formatCoin(satoshi, btcCoinFormat);
}
diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties
index b4b43200ec..360dacb145 100644
--- a/core/src/main/resources/i18n/displayStrings.properties
+++ b/core/src/main/resources/i18n/displayStrings.properties
@@ -198,6 +198,7 @@ shared.actions=Actions
shared.buyerUpperCase=Buyer
shared.sellerUpperCase=Seller
shared.new=NEW
+shared.new=NEW
####################################################################
# UI views
@@ -1756,29 +1757,6 @@ dao.wallet.menuItem.receive=Receive
dao.wallet.menuItem.transactions=Transactions
dao.wallet.dashboard.myBalance=My wallet balance
-dao.wallet.dashboard.distribution=Distribution of all BSQ
-dao.wallet.dashboard.locked=Global state of locked BSQ
-dao.wallet.dashboard.market=Market data
-dao.wallet.dashboard.genesis=Genesis transaction
-dao.wallet.dashboard.txDetails=BSQ transactions statistics
-dao.wallet.dashboard.genesisBlockHeight=Genesis block height
-dao.wallet.dashboard.genesisTxId=Genesis transaction ID
-dao.wallet.dashboard.genesisIssueAmount=BSQ issued at genesis transaction
-dao.wallet.dashboard.compRequestIssueAmount=BSQ issued for compensation requests
-dao.wallet.dashboard.reimbursementAmount=BSQ issued for reimbursement requests
-dao.wallet.dashboard.availableAmount=Total available BSQ
-dao.wallet.dashboard.burntAmount=Burned BSQ (fees)
-dao.wallet.dashboard.totalLockedUpAmount=Locked up in bonds
-dao.wallet.dashboard.totalUnlockingAmount=Unlocking BSQ from bonds
-dao.wallet.dashboard.totalUnlockedAmount=Unlocked BSQ from bonds
-dao.wallet.dashboard.totalConfiscatedAmount=Confiscated BSQ from bonds
-dao.wallet.dashboard.allTx=No. of all BSQ transactions
-dao.wallet.dashboard.utxo=No. of all unspent transaction outputs
-dao.wallet.dashboard.compensationIssuanceTx=No. of all compensation request issuance transactions
-dao.wallet.dashboard.reimbursementIssuanceTx=No. of all reimbursement request issuance transactions
-dao.wallet.dashboard.burntTx=No. of all fee payments transactions
-dao.wallet.dashboard.price=Latest BSQ/BTC trade price (in Bisq)
-dao.wallet.dashboard.marketCap=Market capitalisation (based on trade price)
dao.wallet.receive.fundYourWallet=Your BSQ receive address
dao.wallet.receive.bsqAddress=BSQ wallet address (Fresh unused address)
@@ -1940,6 +1918,37 @@ dao.monitor.blindVote.table.hash=Hash of blind vote state
dao.monitor.blindVote.table.prev=Previous hash
dao.monitor.blindVote.table.numBlindVotes=No. blind votes
+dao.factsAndFigures.menuItem.supply=Supply
+dao.factsAndFigures.menuItem.transactions=Transactions
+
+dao.factsAndFigures.dashboard.marketPrice=Market data
+dao.factsAndFigures.dashboard.price=Latest BSQ/BTC trade price (in Bisq)
+dao.factsAndFigures.dashboard.marketCap=Market capitalisation (based on trade price)
+dao.factsAndFigures.dashboard.availableAmount=Total available BSQ
+
+dao.factsAndFigures.supply.issued=BSQ issued
+dao.factsAndFigures.supply.genesisIssueAmount=BSQ issued at genesis transaction
+dao.factsAndFigures.supply.compRequestIssueAmount=BSQ issued for compensation requests
+dao.factsAndFigures.supply.reimbursementAmount=BSQ issued for reimbursement requests
+
+dao.factsAndFigures.supply.burnt=BSQ burnt
+
+dao.factsAndFigures.supply.locked=Global state of locked BSQ
+dao.factsAndFigures.supply.totalLockedUpAmount=Locked up in bonds
+dao.factsAndFigures.supply.totalUnlockingAmount=Unlocking BSQ from bonds
+dao.factsAndFigures.supply.totalUnlockedAmount=Unlocked BSQ from bonds
+dao.factsAndFigures.supply.totalConfiscatedAmount=Confiscated BSQ from bonds
+dao.factsAndFigures.supply.burntAmount=Burned BSQ (fees)
+
+dao.factsAndFigures.transactions.genesis=Genesis transaction
+dao.factsAndFigures.transactions.genesisBlockHeight=Genesis block height
+dao.factsAndFigures.transactions.genesisTxId=Genesis transaction ID
+dao.factsAndFigures.transactions.txDetails=BSQ transactions statistics
+dao.factsAndFigures.transactions.allTx=No. of all BSQ transactions
+dao.factsAndFigures.transactions.utxo=No. of all unspent transaction outputs
+dao.factsAndFigures.transactions.compensationIssuanceTx=No. of all compensation request issuance transactions
+dao.factsAndFigures.transactions.reimbursementIssuanceTx=No. of all reimbursement request issuance transactions
+dao.factsAndFigures.transactions.burntTx=No. of all fee payments transactions
####################################################################
# Windows
diff --git a/desktop/src/main/java/bisq/desktop/main/dao/economy/EconomyView.java b/desktop/src/main/java/bisq/desktop/main/dao/economy/EconomyView.java
index b3c687a3b4..ae5ce9478c 100644
--- a/desktop/src/main/java/bisq/desktop/main/dao/economy/EconomyView.java
+++ b/desktop/src/main/java/bisq/desktop/main/dao/economy/EconomyView.java
@@ -9,7 +9,7 @@
* Bisq 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.
+ * License for more supply.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bisq. If not, see .
@@ -28,7 +28,8 @@ import bisq.desktop.components.MenuItem;
import bisq.desktop.main.MainView;
import bisq.desktop.main.dao.DaoView;
import bisq.desktop.main.dao.economy.dashboard.BsqDashboardView;
-import bisq.desktop.main.dao.economy.details.DetailsView;
+import bisq.desktop.main.dao.economy.supply.SupplyView;
+import bisq.desktop.main.dao.economy.transactions.BSQTransactionsView;
import bisq.core.locale.Res;
@@ -51,7 +52,7 @@ public class EconomyView extends ActivatableViewAndModel {
private final ViewLoader viewLoader;
private final Navigation navigation;
- private MenuItem dashboard, details;
+ private MenuItem dashboard, supply, transactions;
private Navigation.Listener listener;
@FXML
@@ -81,20 +82,24 @@ public class EconomyView extends ActivatableViewAndModel {
toggleGroup = new ToggleGroup();
List> baseNavPath = Arrays.asList(MainView.class, DaoView.class, EconomyView.class);
dashboard = new MenuItem(navigation, toggleGroup, Res.get("shared.dashboard"), BsqDashboardView.class, baseNavPath);
- details = new MenuItem(navigation, toggleGroup, Res.get("shared.details"), DetailsView.class, baseNavPath);
- leftVBox.getChildren().addAll(dashboard, details);
+ supply = new MenuItem(navigation, toggleGroup, Res.get("dao.factsAndFigures.menuItem.supply"), SupplyView.class, baseNavPath);
+ transactions = new MenuItem(navigation, toggleGroup, Res.get("dao.factsAndFigures.menuItem.transactions"), BSQTransactionsView.class, baseNavPath);
+
+ leftVBox.getChildren().addAll(dashboard, supply, transactions);
// TODO just until DAO is enabled
if (!DevEnv.isDaoActivated()) {
dashboard.setDisable(true);
- details.setDisable(true);
+ supply.setDisable(true);
+ transactions.setDisable(true);
}
}
@Override
protected void activate() {
dashboard.activate();
- details.activate();
+ supply.activate();
+ transactions.activate();
navigation.addListener(listener);
ViewPath viewPath = navigation.getCurrentPath();
@@ -116,6 +121,8 @@ public class EconomyView extends ActivatableViewAndModel {
navigation.removeListener(listener);
dashboard.deactivate();
+ supply.deactivate();
+ transactions.deactivate();
}
private void loadView(Class extends View> viewClass) {
@@ -123,6 +130,7 @@ public class EconomyView extends ActivatableViewAndModel {
content.getChildren().setAll(view.getRoot());
if (view instanceof BsqDashboardView) toggleGroup.selectToggle(dashboard);
- else if (view instanceof DetailsView) toggleGroup.selectToggle(details);
+ else if (view instanceof SupplyView) toggleGroup.selectToggle(supply);
+ else if (view instanceof BSQTransactionsView) toggleGroup.selectToggle(transactions);
}
}
diff --git a/desktop/src/main/java/bisq/desktop/main/dao/economy/dashboard/BsqDashboardView.fxml b/desktop/src/main/java/bisq/desktop/main/dao/economy/dashboard/BsqDashboardView.fxml
index b8a75b09d6..3a541a621a 100644
--- a/desktop/src/main/java/bisq/desktop/main/dao/economy/dashboard/BsqDashboardView.fxml
+++ b/desktop/src/main/java/bisq/desktop/main/dao/economy/dashboard/BsqDashboardView.fxml
@@ -27,7 +27,6 @@
xmlns:fx="http://javafx.com/fxml">
-
diff --git a/desktop/src/main/java/bisq/desktop/main/dao/economy/dashboard/BsqDashboardView.java b/desktop/src/main/java/bisq/desktop/main/dao/economy/dashboard/BsqDashboardView.java
index 21c011820c..dd6596d8b3 100644
--- a/desktop/src/main/java/bisq/desktop/main/dao/economy/dashboard/BsqDashboardView.java
+++ b/desktop/src/main/java/bisq/desktop/main/dao/economy/dashboard/BsqDashboardView.java
@@ -19,30 +19,94 @@ package bisq.desktop.main.dao.economy.dashboard;
import bisq.desktop.common.view.ActivatableView;
import bisq.desktop.common.view.FxmlView;
+import bisq.desktop.components.TitledGroupBg;
+import bisq.desktop.util.FormBuilder;
import bisq.core.dao.DaoFacade;
import bisq.core.dao.state.DaoStateListener;
+import bisq.core.dao.state.DaoStateService;
import bisq.core.dao.state.model.blockchain.Block;
+import bisq.core.dao.state.model.governance.IssuanceType;
+import bisq.core.locale.Res;
+import bisq.core.monetary.Price;
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.common.util.Tuple3;
+
+import org.bitcoinj.core.Coin;
+
import javax.inject.Inject;
+import javafx.scene.chart.AreaChart;
+import javafx.scene.chart.NumberAxis;
+import javafx.scene.chart.XYChart;
+import javafx.scene.control.Label;
+import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane;
+import javafx.scene.layout.VBox;
+
+import javafx.geometry.Insets;
+import javafx.geometry.Side;
import javafx.beans.value.ChangeListener;
+import javafx.util.StringConverter;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.OffsetDateTime;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
+import java.time.format.FormatStyle;
+import java.time.temporal.TemporalAdjuster;
+import java.time.temporal.TemporalAdjusters;
+
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.stream.Collectors;
+
+import static bisq.desktop.util.FormBuilder.addTitledGroupBg;
+import static bisq.desktop.util.FormBuilder.addTopLabelReadOnlyTextField;
+import static bisq.desktop.util.Layout.FIRST_ROW_DISTANCE;
+
+
+
+import java.sql.Date;
+
@FxmlView
public class BsqDashboardView extends ActivatableView implements DaoStateListener {
+ private static final String DAY = "day";
+ private static final Map ADJUSTERS = new HashMap<>();
+
private final DaoFacade daoFacade;
+ private final TradeStatisticsManager tradeStatisticsManager;
private final PriceFeedService priceFeedService;
+ private final DaoStateService daoStateService;
private final Preferences preferences;
private final BsqFormatter bsqFormatter;
+ private final BSFormatter btcFormatter;
private ChangeListener priceChangeListener;
+ private AreaChart bsqPriceChart;
+ private XYChart.Series seriesBSQAdded, seriesBSQBurnt;
+ private XYChart.Series seriesBSQPrice;
+
+ private TextField marketCapTextField, priceTextField, availableAmountTextField;
+
+ private Coin availableAmount;
+
+ private int gridRow = 0;
///////////////////////////////////////////////////////////////////////////////////////////
// Constructor, lifecycle
@@ -50,20 +114,52 @@ public class BsqDashboardView extends ActivatableView implements
@Inject
private BsqDashboardView(DaoFacade daoFacade,
+ TradeStatisticsManager tradeStatisticsManager,
PriceFeedService priceFeedService,
+ DaoStateService daoStateService,
Preferences preferences,
- BsqFormatter bsqFormatter) {
+ BsqFormatter bsqFormatter,
+ BSFormatter btcFormatter) {
this.daoFacade = daoFacade;
+ this.tradeStatisticsManager = tradeStatisticsManager;
this.priceFeedService = priceFeedService;
+ this.daoStateService = daoStateService;
this.preferences = preferences;
this.bsqFormatter = bsqFormatter;
+ this.btcFormatter = btcFormatter;
}
@Override
public void initialize() {
+
+ ADJUSTERS.put(DAY, TemporalAdjusters.ofDateAdjuster(d -> d));
+
+ createKPIs();
+ createChart();
+
priceChangeListener = (observable, oldValue, newValue) -> updatePrice();
}
+ private void createKPIs() {
+
+ TitledGroupBg titledGroupBg = addTitledGroupBg(root, gridRow, 5, Res.get("dao.factsAndFigures.dashboard.marketPrice"));
+ titledGroupBg.getStyleClass().add("last");
+
+ Tuple3