diff --git a/cmd/explorer/main.go b/cmd/explorer/main.go index 2b895442e3..55b3ff6b2a 100644 --- a/cmd/explorer/main.go +++ b/cmd/explorer/main.go @@ -345,6 +345,7 @@ func main() { router.HandleFunc("/api/healthz-loadbalancer", handlers.ApiHealthzLoadbalancer).Methods("GET", "HEAD") logrus.Infof("initializing prices") + price.Init(utils.Config.Chain.ClConfig.DepositChainID, utils.Config.Eth1ErigonEndpoint, utils.Config.Frontend.ClCurrency, utils.Config.Frontend.ElCurrency) logrus.Infof("prices initialized") diff --git a/db/bigtable_eth1.go b/db/bigtable_eth1.go index 82de36981b..06ee54e6d3 100644 --- a/db/bigtable_eth1.go +++ b/db/bigtable_eth1.go @@ -1988,7 +1988,7 @@ func (bigtable *Bigtable) GetIndexedEth1Transaction(txHash []byte) (*types.Eth1T } } -func (bigtable *Bigtable) GetAddressTransactionsTableData(address []byte, pageToken string) (*types.DataTableResponse, error) { +func (bigtable *Bigtable) GetAddressTransactionsTableData(address []byte, pageToken string, currency string) (*types.DataTableResponse, error) { tmr := time.AfterFunc(REPORT_TIMEOUT, func() { logger.WithFields(logrus.Fields{ @@ -2033,7 +2033,7 @@ func (bigtable *Bigtable) GetAddressTransactionsTableData(address []byte, pageTo utils.FormatAddressWithLimitsInAddressPageTable(address, t.From, fromName, false, digitLimitInAddressPagesTable, nameLimitInAddressPagesTable, true), utils.FormatInOutSelf(address, t.From, t.To), utils.FormatAddressWithLimitsInAddressPageTable(address, t.To, toName, false, digitLimitInAddressPagesTable, nameLimitInAddressPagesTable, true), - utils.FormatAmount(new(big.Int).SetBytes(t.Value), utils.Config.Frontend.ElCurrency, 6), + utils.FormatAmount(new(big.Int).SetBytes(t.Value), currency, 6), } } @@ -2103,7 +2103,7 @@ func (bigtable *Bigtable) GetEth1BlocksForAddress(prefix string, limit int64) ([ return data, indexes[len(indexes)-1], nil } -func (bigtable *Bigtable) GetAddressBlocksMinedTableData(address string, pageToken string) (*types.DataTableResponse, error) { +func (bigtable *Bigtable) GetAddressBlocksMinedTableData(address string, pageToken string, currency string) (*types.DataTableResponse, error) { tmr := time.AfterFunc(REPORT_TIMEOUT, func() { logger.WithFields(logrus.Fields{ @@ -2130,7 +2130,7 @@ func (bigtable *Bigtable) GetAddressBlocksMinedTableData(address string, pageTok utils.FormatBlockNumber(b.Number), utils.FormatTimestamp(b.Time.AsTime().Unix()), utils.FormatBlockUsage(b.GasUsed, b.GasLimit), - utils.FormatAmount(reward, utils.Config.Frontend.ElCurrency, 6), + utils.FormatAmount(reward, currency, 6), } } @@ -2200,7 +2200,7 @@ func (bigtable *Bigtable) GetEth1UnclesForAddress(prefix string, limit int64) ([ return data, indexes[len(indexes)-1], nil } -func (bigtable *Bigtable) GetAddressUnclesMinedTableData(address string, pageToken string) (*types.DataTableResponse, error) { +func (bigtable *Bigtable) GetAddressUnclesMinedTableData(address string, pageToken string, currency string) (*types.DataTableResponse, error) { tmr := time.AfterFunc(REPORT_TIMEOUT, func() { logger.WithFields(logrus.Fields{ @@ -2225,7 +2225,7 @@ func (bigtable *Bigtable) GetAddressUnclesMinedTableData(address string, pageTok utils.FormatBlockNumber(u.Number), utils.FormatTimestamp(u.Time.AsTime().Unix()), utils.FormatDifficulty(new(big.Int).SetBytes(u.Difficulty)), - utils.FormatAmount(new(big.Int).SetBytes(u.Reward), utils.Config.Frontend.ElCurrency, 6), + utils.FormatAmount(new(big.Int).SetBytes(u.Reward), currency, 6), } } @@ -2411,7 +2411,7 @@ func (bigtable *Bigtable) GetEth1ItxForAddress(prefix string, limit int64) ([]*t return data, indexes[len(indexes)-1], nil } -func (bigtable *Bigtable) GetAddressInternalTableData(address []byte, pageToken string) (*types.DataTableResponse, error) { +func (bigtable *Bigtable) GetAddressInternalTableData(address []byte, pageToken string, currency string) (*types.DataTableResponse, error) { tmr := time.AfterFunc(REPORT_TIMEOUT, func() { logger.WithFields(logrus.Fields{ @@ -2454,7 +2454,7 @@ func (bigtable *Bigtable) GetAddressInternalTableData(address []byte, pageToken utils.FormatAddressWithLimitsInAddressPageTable(address, t.From, fromName, false, digitLimitInAddressPagesTable, nameLimitInAddressPagesTable, true), utils.FormatInOutSelf(address, t.From, t.To), utils.FormatAddressWithLimitsInAddressPageTable(address, t.To, toName, false, digitLimitInAddressPagesTable, nameLimitInAddressPagesTable, true), - utils.FormatAmount(new(big.Int).SetBytes(t.Value), utils.Config.Frontend.ElCurrency, 6), + utils.FormatAmount(new(big.Int).SetBytes(t.Value), currency, 6), t.Type, } } diff --git a/handlers/common.go b/handlers/common.go index 6e0ae2ca0e..b0e30cfc05 100644 --- a/handlers/common.go +++ b/handlers/common.go @@ -494,7 +494,13 @@ func GetCurrency(r *http.Request) string { return cookie.Value } } - return utils.Config.Frontend.MainCurrency + // here, the user did not select a currency to visualize the amounts, so we choose one by default + if utils.Config.Frontend.MainCurrency != "GNO" { + return utils.Config.Frontend.MainCurrency + } else { + // if the network is Gnosis, we show amounts in xDAI by default + return utils.Config.Frontend.ElCurrency + } } func GetCurrencySymbol(r *http.Request) string { diff --git a/handlers/eth1Account.go b/handlers/eth1Account.go index db4a64ef91..220ef326be 100644 --- a/handlers/eth1Account.go +++ b/handlers/eth1Account.go @@ -83,7 +83,7 @@ func Eth1Address(w http.ResponseWriter, r *http.Request) { }) g.Go(func() error { var err error - txns, err = db.BigtableClient.GetAddressTransactionsTableData(addressBytes, "") + txns, err = db.BigtableClient.GetAddressTransactionsTableData(addressBytes, "", currency) if err != nil { return fmt.Errorf("GetAddressTransactionsTableData: %w", err) } @@ -99,7 +99,7 @@ func Eth1Address(w http.ResponseWriter, r *http.Request) { }) g.Go(func() error { var err error - internal, err = db.BigtableClient.GetAddressInternalTableData(addressBytes, "") + internal, err = db.BigtableClient.GetAddressInternalTableData(addressBytes, "", currency) if err != nil { return fmt.Errorf("GetAddressInternalTableData: %w", err) } @@ -131,7 +131,7 @@ func Eth1Address(w http.ResponseWriter, r *http.Request) { }) g.Go(func() error { var err error - blocksMined, err = db.BigtableClient.GetAddressBlocksMinedTableData(address, "") + blocksMined, err = db.BigtableClient.GetAddressBlocksMinedTableData(address, "", currency) if err != nil { return fmt.Errorf("GetAddressBlocksMinedTableData: %w", err) } @@ -139,7 +139,7 @@ func Eth1Address(w http.ResponseWriter, r *http.Request) { }) g.Go(func() error { var err error - unclesMined, err = db.BigtableClient.GetAddressUnclesMinedTableData(address, "") + unclesMined, err = db.BigtableClient.GetAddressUnclesMinedTableData(address, "", currency) if err != nil { return fmt.Errorf("GetAddressUnclesMinedTableData: %w", err) } @@ -282,7 +282,7 @@ func Eth1AddressTransactions(w http.ResponseWriter, r *http.Request) { pageToken := q.Get("pageToken") - data, err := db.BigtableClient.GetAddressTransactionsTableData(addressBytes, pageToken) + data, err := db.BigtableClient.GetAddressTransactionsTableData(addressBytes, pageToken, GetCurrency(r)) if err != nil { utils.LogError(err, "error getting eth1 tx table data", 0, errFields) } @@ -310,7 +310,7 @@ func Eth1AddressBlocksMined(w http.ResponseWriter, r *http.Request) { pageToken := q.Get("pageToken") - data, err := db.BigtableClient.GetAddressBlocksMinedTableData(address, pageToken) + data, err := db.BigtableClient.GetAddressBlocksMinedTableData(address, pageToken, GetCurrency(r)) if err != nil { utils.LogError(err, "error getting eth1 blocks mined table data", 0, errFields) } @@ -337,7 +337,7 @@ func Eth1AddressUnclesMined(w http.ResponseWriter, r *http.Request) { pageToken := q.Get("pageToken") - data, err := db.BigtableClient.GetAddressUnclesMinedTableData(address, pageToken) + data, err := db.BigtableClient.GetAddressUnclesMinedTableData(address, pageToken, GetCurrency(r)) if err != nil { utils.LogError(err, "error getting eth1 uncles mined data", 0, errFields) } @@ -353,7 +353,6 @@ func Eth1AddressUnclesMined(w http.ResponseWriter, r *http.Request) { func Eth1AddressWithdrawals(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") - currency := GetCurrency(r) q := r.URL.Query() address, err := lowerAddressFromRequest(w, r) if err != nil { @@ -363,7 +362,7 @@ func Eth1AddressWithdrawals(w http.ResponseWriter, r *http.Request) { errFields := map[string]interface{}{ "route": r.URL.String()} - data, err := db.GetAddressWithdrawalTableData(common.HexToAddress(address).Bytes(), q.Get("pageToken"), currency) + data, err := db.GetAddressWithdrawalTableData(common.HexToAddress(address).Bytes(), q.Get("pageToken"), GetCurrency(r)) if err != nil { utils.LogError(err, "error getting address withdrawals data", 0, errFields) http.Error(w, "Internal server error", http.StatusInternalServerError) @@ -419,7 +418,7 @@ func Eth1AddressInternalTransactions(w http.ResponseWriter, r *http.Request) { "route": r.URL.String()} pageToken := q.Get("pageToken") - data, err := db.BigtableClient.GetAddressInternalTableData(addressBytes, pageToken) + data, err := db.BigtableClient.GetAddressInternalTableData(addressBytes, pageToken, GetCurrency(r)) if err != nil { utils.LogError(err, "error getting eth1 internal tx table data", 0, errFields) } diff --git a/handlers/eth1Blocks.go b/handlers/eth1Blocks.go index b735dbe80e..d54908e252 100644 --- a/handlers/eth1Blocks.go +++ b/handlers/eth1Blocks.go @@ -63,7 +63,7 @@ func Eth1BlocksData(w http.ResponseWriter, r *http.Request) { length = 100 } - data, err := getEth1BlocksTableData(draw, start, length, recordsTotal) + data, err := getEth1BlocksTableData(draw, start, length, recordsTotal, GetCurrency(r)) if err != nil { utils.LogError(err, "error getting eth1 block table data", 0) } @@ -128,7 +128,7 @@ func Eth1BlocksHighest(w http.ResponseWriter, r *http.Request) { w.Write([]byte(fmt.Sprintf("%d", services.LatestEth1BlockNumber()))) } -func getEth1BlocksTableData(draw, start, length, recordsTotal uint64) (*types.DataTableResponse, error) { +func getEth1BlocksTableData(draw, start, length, recordsTotal uint64, currency string) (*types.DataTableResponse, error) { if recordsTotal == 0 { recordsTotal = services.LatestEth1BlockNumber() + 1 // +1 to include block 0 } @@ -234,8 +234,8 @@ func getEth1BlocksTableData(draw, start, length, recordsTotal uint64) (*types.Da template.HTML(fmt.Sprintf(`%v
%.2f%% (%+.2f%%)`, utils.FormatAddCommas(b.GetGasUsed()), float64(int64(float64(b.GetGasUsed())/float64(b.GetGasLimit())*10000.0))/100.0, float64(int64(((float64(b.GetGasUsed())-gasHalf)/gasHalf)*10000.0))/100.0)), // Gas Used utils.FormatAddCommas(b.GetGasLimit()), // Gas Limit utils.FormatAmountFormatted(baseFee, "GWei", 5, 4, true, true, true), // Base Fee - utils.FormatAmountFormatted(new(big.Int).Add(utils.Eth1BlockReward(blockNumber, b.GetDifficulty()), new(big.Int).Add(txReward, new(big.Int).SetBytes(b.GetUncleReward()))), utils.Config.Frontend.ElCurrency, 5, 4, true, true, true), // Reward - fmt.Sprintf(`%v
%.2f%%`, utils.FormatAmountFormatted(burned, utils.Config.Frontend.ElCurrency, 5, 4, true, true, false), float64(int64(burnedPercentage*10000.0))/100.0), // Burned Fees + utils.FormatAmountFormatted(new(big.Int).Add(utils.Eth1BlockReward(blockNumber, b.GetDifficulty()), new(big.Int).Add(txReward, new(big.Int).SetBytes(b.GetUncleReward()))), currency, 5, 4, true, true, true), // Reward + fmt.Sprintf(`%v
%.2f%%`, utils.FormatAmountFormatted(burned, currency, 5, 4, true, true, false), float64(int64(burnedPercentage*10000.0))/100.0), // Burned Fees } } diff --git a/handlers/eth1Transactions.go b/handlers/eth1Transactions.go index 296e217668..4f191d43b8 100644 --- a/handlers/eth1Transactions.go +++ b/handlers/eth1Transactions.go @@ -28,7 +28,7 @@ func Eth1Transactions(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/html") data := InitPageData(w, r, "blockchain", "/eth1transactions", "Transactions", templateFiles) - data.Data = getTransactionDataStartingWithPageToken("") + data.Data = getTransactionDataStartingWithPageToken("", GetCurrency(r)) if handleTemplateError(w, r, "eth1Transactions.go", "Eth1Transactions", "", eth1TransactionsTemplate.ExecuteTemplate(w, "layout", data)) != nil { return // an error has occurred and was processed @@ -38,14 +38,14 @@ func Eth1Transactions(w http.ResponseWriter, r *http.Request) { func Eth1TransactionsData(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") - err := json.NewEncoder(w).Encode(getTransactionDataStartingWithPageToken(r.URL.Query().Get("pageToken"))) + err := json.NewEncoder(w).Encode(getTransactionDataStartingWithPageToken(r.URL.Query().Get("pageToken"), GetCurrency(r))) if err != nil { logger.Errorf("error enconding json response for %v route: %v", r.URL.String(), err) http.Error(w, "Internal server error", http.StatusInternalServerError) } } -func getTransactionDataStartingWithPageToken(pageToken string) *types.DataTableResponse { +func getTransactionDataStartingWithPageToken(pageToken string, currency string) *types.DataTableResponse { pageTokenId := uint64(0) { if len(pageToken) > 0 { @@ -118,8 +118,8 @@ func getTransactionDataStartingWithPageToken(pageToken string) *types.DataTableR utils.FormatTimestamp(b.GetTime().AsTime().Unix()), utils.FormatAddressWithLimits(v.GetFrom(), names[string(v.GetFrom())], false, "address", visibleDigitsForHash+5, 18, true), toText, - utils.FormatAmountFormatted(new(big.Int).SetBytes(v.GetValue()), utils.Config.Frontend.ElCurrency, 8, 4, true, true, false), - utils.FormatAmountFormatted(db.CalculateTxFeeFromTransaction(v, new(big.Int).SetBytes(b.GetBaseFee())), utils.Config.Frontend.ElCurrency, 8, 4, true, true, false), + utils.FormatAmountFormatted(new(big.Int).SetBytes(v.GetValue()), currency, 8, 4, true, true, false), + utils.FormatAmountFormatted(db.CalculateTxFeeFromTransaction(v, new(big.Int).SetBytes(b.GetBaseFee())), currency, 8, 4, true, true, false), }) return nil }) diff --git a/handlers/mempoolView.go b/handlers/mempoolView.go index 2f2817c17b..17f60d3f62 100644 --- a/handlers/mempoolView.go +++ b/handlers/mempoolView.go @@ -13,7 +13,7 @@ import ( func MempoolView(w http.ResponseWriter, r *http.Request) { mempool := services.LatestMempoolTransactions() - formatedData := formatToTable(mempool) + formatedData := formatToTable(mempool, GetCurrency(r)) templateFiles := append(layoutTemplateFiles, "mempoolview.html") var mempoolViewTemplate = templates.GetTemplate(templateFiles...) @@ -38,33 +38,33 @@ func _isContractCreation(tx *common.Address) string { // This Function formats each Transaction into Html string. // This makes all calculations faster, reducing browser's rendering time. -func formatToTable(content *types.RawMempoolResponse) *types.DataTableResponse { +func formatToTable(content *types.RawMempoolResponse, currency string) *types.DataTableResponse { dataTable := &types.DataTableResponse{} for _, txs := range content.Pending { for _, tx := range txs { - dataTable.Data = append(dataTable.Data, toTableDataRow(tx)) + dataTable.Data = append(dataTable.Data, toTableDataRow(tx, currency)) } } for _, txs := range content.BaseFee { for _, tx := range txs { - dataTable.Data = append(dataTable.Data, toTableDataRow(tx)) + dataTable.Data = append(dataTable.Data, toTableDataRow(tx, currency)) } } for _, txs := range content.Queued { for _, tx := range txs { - dataTable.Data = append(dataTable.Data, toTableDataRow(tx)) + dataTable.Data = append(dataTable.Data, toTableDataRow(tx, currency)) } } return dataTable } -func toTableDataRow(tx *types.RawMempoolTransaction) []interface{} { +func toTableDataRow(tx *types.RawMempoolTransaction, currency string) []interface{} { return []any{ utils.FormatAddressWithLimits(tx.Hash.Bytes(), "", false, "tx", 15, 18, true), utils.FormatAddressAll(tx.From.Bytes(), "", false, "address", int(12), int(12), true), _isContractCreation(tx.To), - utils.FormatAmount((*big.Int)(tx.Value), utils.Config.Frontend.ElCurrency, 5), + utils.FormatAmount((*big.Int)(tx.Value), currency, 5), utils.FormatAddCommasFormatted(float64(tx.Gas.ToInt().Int64()), 0), utils.FormatAmountFormatted(tx.GasPrice.ToInt(), "GWei", 5, 0, true, true, false), tx.Nonce.ToInt(), diff --git a/handlers/slot.go b/handlers/slot.go index 8a5d2ff110..835590064d 100644 --- a/handlers/slot.go +++ b/handlers/slot.go @@ -677,6 +677,7 @@ func BlockTransactionsData(w http.ResponseWriter, r *http.Request) { return } + currency := GetCurrency(r) data := make([]*transactionsData, len(transactions.Txs)) for i, v := range transactions.Txs { methodFormatted := `Transfer` @@ -688,8 +689,8 @@ func BlockTransactionsData(w http.ResponseWriter, r *http.Request) { Method: methodFormatted, FromFormatted: v.FromFormatted, ToFormatted: v.ToFormatted, - Value: utils.FormatAmountFormatted(v.Value, utils.Config.Frontend.ElCurrency, 5, 0, true, true, false), - Fee: utils.FormatAmountFormatted(v.Fee, utils.Config.Frontend.ElCurrency, 5, 0, true, true, false), + Value: utils.FormatAmountFormatted(v.Value, currency, 5, 0, true, true, false), + Fee: utils.FormatAmountFormatted(v.Fee, currency, 5, 0, true, true, false), GasPrice: utils.FormatAmountFormatted(v.GasPrice, "GWei", 5, 0, true, true, false), } } diff --git a/handlers/withdrawals.go b/handlers/withdrawals.go index 01ac65a6ca..29f05b3358 100644 --- a/handlers/withdrawals.go +++ b/handlers/withdrawals.go @@ -179,11 +179,6 @@ func WithdrawalsTableData(draw uint64, search string, length, start uint64, orde filteredCount = withdrawalCount } - formatCurrency := currency - if currency == "ETH" { - formatCurrency = "Ether" - } - var err error names := make(map[string]string) for _, v := range withdrawals { @@ -203,7 +198,7 @@ func WithdrawalsTableData(draw uint64, search string, length, start uint64, orde utils.FormatValidator(w.ValidatorIndex), utils.FormatTimestamp(utils.SlotToTime(w.Slot).Unix()), utils.FormatAddressWithLimits(w.Address, names[string(w.Address)], false, "address", visibleDigitsForHash+5, 18, true), - utils.FormatAmount(new(big.Int).Mul(new(big.Int).SetUint64(w.Amount), big.NewInt(1e9)), formatCurrency, 6), + utils.FormatAmount(new(big.Int).Mul(new(big.Int).SetUint64(w.Amount), big.NewInt(1e9)), currency, 6), } } diff --git a/local-deployment/network-params.json b/local-deployment/network-params.json index 90e419ad9c..a24a04b7a3 100644 --- a/local-deployment/network-params.json +++ b/local-deployment/network-params.json @@ -29,4 +29,4 @@ "start_tx_spammer": true, "start_blob_spammer": false } - \ No newline at end of file + diff --git a/price/price.go b/price/price.go index 20a4b585af..a6cacb021b 100644 --- a/price/price.go +++ b/price/price.go @@ -63,9 +63,10 @@ func Init(chainId uint64, eth1Endpoint, clCurrencyParam, elCurrencyParam string) switch chainId { case 1, 100: default: + setPrice(clCurrency, "USD", 2000.0) setPrice(elCurrency, elCurrency, 1) setPrice(clCurrency, clCurrency, 1) - availableCurrencies = []string{clCurrency, elCurrency} + availableCurrencies = []string{"ETH", "USD"} logger.Warnf("chainId not supported for fetching prices: %v", chainId) runOnce.Do(func() { runOnceWg.Done() }) return @@ -73,9 +74,7 @@ func Init(chainId uint64, eth1Endpoint, clCurrencyParam, elCurrencyParam string) clCurrency = clCurrencyParam elCurrency = elCurrencyParam - if elCurrency == "xDAI" { - elCurrency = "DAI" - } + calcPairs[elCurrency] = true calcPairs[clCurrency] = true @@ -123,7 +122,7 @@ func Init(chainId uint64, eth1Endpoint, clCurrencyParam, elCurrencyParam string) case 100: // see: https://docs.chain.link/data-feeds/price-feeds/addresses/?network=gnosis-chain feedAddrs["GNO/USD"] = "0x22441d81416430A54336aB28765abd31a792Ad37" - feedAddrs["DAI/USD"] = "0x678df3415fc31947dA4324eC63212874be5a82f8" + feedAddrs["xDAI/USD"] = "0x678df3415fc31947dA4324eC63212874be5a82f8" feedAddrs["EUR/USD"] = "0xab70BCB260073d036d1660201e9d5405F5829b7a" feedAddrs["JPY/USD"] = "0x2AfB993C670C01e9dA1550c58e8039C1D8b8A317" // feedAddrs["CHFUSD"] = "0xFb00261Af80ADb1629D3869E377ae1EEC7bE659F" @@ -136,7 +135,7 @@ func Init(chainId uint64, eth1Endpoint, clCurrencyParam, elCurrencyParam string) calcPairs["GNO"] = true - availableCurrencies = []string{"GNO", "mGNO", "DAI", "ETH", "USD", "EUR", "JPY"} + availableCurrencies = []string{"GNO", "mGNO", "xDAI", "ETH", "USD", "EUR", "JPY"} default: logger.Fatalf("unsupported chainId %v", chainId) } @@ -226,12 +225,6 @@ func GetPrice(a, b string) float64 { runOnceWg.Wait() pricesMu.Lock() defer pricesMu.Unlock() - if a == "xDAI" { - a = "DAI" - } - if b == "xDAI" { - b = "DAI" - } price, exists := prices[a+"/"+b] if !exists { logrus.WithFields(logrus.Fields{"pair": a + "/" + b}).Warnf("price pair not found") diff --git a/static/img/DAI.svg b/static/img/xDAI.svg similarity index 100% rename from static/img/DAI.svg rename to static/img/xDAI.svg diff --git a/templates/eth1tx.html b/templates/eth1tx.html index a233b14ae8..bb52accc1f 100644 --- a/templates/eth1tx.html +++ b/templates/eth1tx.html @@ -225,18 +225,22 @@

Value:
{{ formatBytesAmount .Value config.Frontend.ElCurrency 8 }} - - {{ formatElCurrency .Value $.Rates.SelectedCurrency 2 true false false false }} - + {{ if ne $.Rates.SelectedCurrency config.Frontend.ElCurrency }} + + {{ formatElCurrency .Value $.Rates.SelectedCurrency 2 true false false false }} + + {{ end }}
Transaction Fee:
{{ formatBytesAmount .Gas.TxFee config.Frontend.ElCurrency 8 }} - - {{ formatElCurrency .Gas.TxFee $.Rates.SelectedCurrency 2 true false false false }} - + {{ if ne $.Rates.SelectedCurrency config.Frontend.ElCurrency }} + + {{ formatElCurrency .Gas.TxFee $.Rates.SelectedCurrency 2 true false false false }} + + {{ end }}
diff --git a/templates/execution/block.html b/templates/execution/block.html index d229f421ed..52a6ebeca7 100644 --- a/templates/execution/block.html +++ b/templates/execution/block.html @@ -64,16 +64,16 @@

Reward:
- {{ formatAmount .Reward config.Frontend.ElCurrency 5 }} + {{ formatAmount .Reward $.Rates.SelectedCurrency 5 }} {{ if gt (bigIntCmp .MevReward 0) 0 }} + - {{ formatAmount .MevReward config.Frontend.ElCurrency 5 }} + {{ formatAmount .MevReward $.Rates.SelectedCurrency 5 }} {{ end }}
Tx Fees:
-
{{ formatAmount .TxFees config.Frontend.ElCurrency 5 }}
+
{{ formatAmount .TxFees $.Rates.SelectedCurrency 5 }}
Gas Usage:
@@ -105,7 +105,7 @@

Burned fees:
-
{{ formatAmount .BurnedFees config.Frontend.ElCurrency 5 }}
+
{{ formatAmount .BurnedFees $.Rates.SelectedCurrency 5 }}
Extra:
@@ -127,7 +127,7 @@

- {{ template "execution_transactions" . }} + {{ template "execution_transactions" $ }}
@@ -147,7 +147,7 @@

{{ .Number }} {{ subUI64 $.Data.Number .Number }} {{ .MinerFormatted }} - {{ formatAmount .Reward config.Frontend.ElCurrency 5 }} + {{ formatAmount .Reward $.Rates.SelectedCurrency 5 }} {{ .Extra }} {{ end }} diff --git a/templates/layout.html b/templates/layout.html index 0d4e31065a..0b9367f53e 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -160,25 +160,23 @@

- {{ if .Mainnet }} -