diff --git a/blockbook.go b/blockbook.go index b95c26da..aac96964 100644 --- a/blockbook.go +++ b/blockbook.go @@ -677,29 +677,30 @@ func computeFeeStats(stopCompute chan os.Signal, blockFrom, blockTo int, db *db. return err } -func initDownloaders(db *db.RocksDB, chain bchain.BlockChain, configfile string) { - data, err := ioutil.ReadFile(configfile) +func initDownloaders(db *db.RocksDB, chain bchain.BlockChain, configFile string) { + data, err := ioutil.ReadFile(configFile) if err != nil { - glog.Errorf("Error reading file %v, %v", configfile, err) + glog.Errorf("Error reading file %v, %v", configFile, err) return } var config struct { - FiatRates string `json:"fiat_rates"` - FiatRatesParams string `json:"fiat_rates_params"` - FourByteSignatures string `json:"fourByteSignatures"` + FiatRates string `json:"fiat_rates"` + FiatRatesParams string `json:"fiat_rates_params"` + FiatRatesVsCurrencies string `json:"fiat_rates_vs_currencies"` + FourByteSignatures string `json:"fourByteSignatures"` } err = json.Unmarshal(data, &config) if err != nil { - glog.Errorf("Error parsing config file %v, %v", configfile, err) + glog.Errorf("Error parsing config file %v, %v", configFile, err) return } if config.FiatRates == "" || config.FiatRatesParams == "" { - glog.Infof("FiatRates config (%v) is empty, not downloading fiat rates", configfile) + glog.Infof("FiatRates config (%v) is empty, not downloading fiat rates", configFile) } else { - fiatRates, err := fiat.NewFiatRatesDownloader(db, config.FiatRates, config.FiatRatesParams, onNewFiatRatesTicker) + fiatRates, err := fiat.NewFiatRatesDownloader(db, config.FiatRates, config.FiatRatesParams, config.FiatRatesVsCurrencies, onNewFiatRatesTicker) if err != nil { glog.Errorf("NewFiatRatesDownloader Init error: %v", err) } else { diff --git a/configs/coins/bcash.json b/configs/coins/bcash.json index ac048c70..537c0425 100644 --- a/configs/coins/bcash.json +++ b/configs/coins/bcash.json @@ -56,6 +56,7 @@ "slip44": 145, "additional_params": { "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"bitcoin-cash\", \"periodSeconds\": 900}" } } diff --git a/configs/coins/bgold.json b/configs/coins/bgold.json index cdd03842..e5afbb5f 100644 --- a/configs/coins/bgold.json +++ b/configs/coins/bgold.json @@ -252,6 +252,7 @@ "slip44": 156, "additional_params": { "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"bitcoin-gold\", \"periodSeconds\": 900}" } } diff --git a/configs/coins/bitcoin.json b/configs/coins/bitcoin.json index d1ad69ac..996b5f1e 100644 --- a/configs/coins/bitcoin.json +++ b/configs/coins/bitcoin.json @@ -66,6 +66,7 @@ "alternative_estimate_fee": "whatthefee-disabled", "alternative_estimate_fee_params": "{\"url\": \"https://whatthefee.io/data.json\", \"periodSeconds\": 60}", "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"bitcoin\", \"periodSeconds\": 900}" } } diff --git a/configs/coins/bitcore.json b/configs/coins/bitcore.json index a835b65e..193ee7d2 100644 --- a/configs/coins/bitcore.json +++ b/configs/coins/bitcore.json @@ -60,6 +60,7 @@ "block_addresses_to_keep": 300, "additional_params": { "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"bitcore\", \"periodSeconds\": 900}" } } diff --git a/configs/coins/dash.json b/configs/coins/dash.json index 2e955f02..9b4dc6d2 100644 --- a/configs/coins/dash.json +++ b/configs/coins/dash.json @@ -58,6 +58,7 @@ "slip44": 5, "additional_params": { "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"dash\", \"periodSeconds\": 900}" } } diff --git a/configs/coins/digibyte.json b/configs/coins/digibyte.json index f82fc3e5..0c66750f 100644 --- a/configs/coins/digibyte.json +++ b/configs/coins/digibyte.json @@ -59,6 +59,7 @@ "slip44": 20, "additional_params": { "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"digibyte\", \"periodSeconds\": 900}" } } diff --git a/configs/coins/dogecoin.json b/configs/coins/dogecoin.json index 0ad5a87a..5b824842 100644 --- a/configs/coins/dogecoin.json +++ b/configs/coins/dogecoin.json @@ -67,6 +67,7 @@ "slip44": 3, "additional_params": { "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"dogecoin\", \"periodSeconds\": 900}" } } diff --git a/configs/coins/ecash.json b/configs/coins/ecash.json index e9f967b5..562bb01b 100644 --- a/configs/coins/ecash.json +++ b/configs/coins/ecash.json @@ -60,6 +60,7 @@ "slip44": 899, "additional_params": { "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ecash\", \"periodSeconds\": 900}" } } diff --git a/configs/coins/ethereum-classic.json b/configs/coins/ethereum-classic.json index 6dd3c561..456fe9fc 100644 --- a/configs/coins/ethereum-classic.json +++ b/configs/coins/ethereum-classic.json @@ -54,6 +54,7 @@ "mempoolTxTimeoutHours": 48, "queryBackendOnMempoolResync": true, "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum-classic\", \"periodSeconds\": 900}", "fourByteSignatures": "https://www.4byte.directory/api/v1/signatures/" } diff --git a/configs/coins/ethereum.json b/configs/coins/ethereum.json index 120cc9ee..395868ae 100644 --- a/configs/coins/ethereum.json +++ b/configs/coins/ethereum.json @@ -61,6 +61,7 @@ "mempoolTxTimeoutHours": 48, "queryBackendOnMempoolResync": false, "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}" } } diff --git a/configs/coins/ethereum_archive.json b/configs/coins/ethereum_archive.json index 1d93dd36..3c73486a 100644 --- a/configs/coins/ethereum_archive.json +++ b/configs/coins/ethereum_archive.json @@ -63,6 +63,7 @@ "processInternalTransactions": true, "queryBackendOnMempoolResync": false, "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"ethereum\",\"platformIdentifier\": \"ethereum\",\"platformVsCurrency\": \"eth\",\"periodSeconds\": 900}", "fourByteSignatures": "https://www.4byte.directory/api/v1/signatures/" } diff --git a/configs/coins/fujicoin.json b/configs/coins/fujicoin.json index ce2d086d..c3188e66 100644 --- a/configs/coins/fujicoin.json +++ b/configs/coins/fujicoin.json @@ -27,9 +27,7 @@ "verification_type": "sha256", "verification_source": "8aa699f3fbd6681391b90f744a25155d21a94f5ca63d6cc3b85172f3aca6e2a0", "extract_command": "tar -C backend --strip 1 -xf", - "exclude_files": [ - "bin/fujicoin-qt" - ], + "exclude_files": ["bin/fujicoin-qt"], "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/bin/fujicoind -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/*.log", "postinst_script_template": "", @@ -61,6 +59,7 @@ "slip44": 75, "additional_params": { "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"fujicoin\", \"periodSeconds\": 600}" } } @@ -69,4 +68,4 @@ "package_maintainer": "Motty", "package_maintainer_email": "fujicoin@gmail.com" } -} \ No newline at end of file +} diff --git a/configs/coins/groestlcoin.json b/configs/coins/groestlcoin.json index a11f913a..5fdfd42b 100644 --- a/configs/coins/groestlcoin.json +++ b/configs/coins/groestlcoin.json @@ -60,6 +60,7 @@ "slip44": 17, "additional_params": { "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"groestlcoin\", \"periodSeconds\": 900}" } } diff --git a/configs/coins/groestlcoin_regtest.json b/configs/coins/groestlcoin_regtest.json index e34d9736..c85b30bf 100644 --- a/configs/coins/groestlcoin_regtest.json +++ b/configs/coins/groestlcoin_regtest.json @@ -27,9 +27,7 @@ "verification_type": "sha256", "verification_source": "4b69743190e2697d7b7772bf6f63cde595d590ff6664abf15a7201dab2a6098b", "extract_command": "tar -C backend --strip 1 -xf", - "exclude_files": [ - "bin/groestlcoin-qt" - ], + "exclude_files": ["bin/groestlcoin-qt"], "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/bin/groestlcoind -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/regtest/*.log", "postinst_script_template": "", @@ -65,11 +63,7 @@ "xpub_magic": 70617039, "xpub_magic_segwit_p2sh": 71979618, "xpub_magic_segwit_native": 73342198, - "slip44": 1, - "additional_params": { - "fiat_rates": "coingecko", - "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"groestlcoin\", \"periodSeconds\": 60}" - } + "slip44": 1 } }, "meta": { diff --git a/configs/coins/groestlcoin_signet.json b/configs/coins/groestlcoin_signet.json index 9919b6ea..7859a690 100644 --- a/configs/coins/groestlcoin_signet.json +++ b/configs/coins/groestlcoin_signet.json @@ -27,9 +27,7 @@ "verification_type": "sha256", "verification_source": "4b69743190e2697d7b7772bf6f63cde595d590ff6664abf15a7201dab2a6098b", "extract_command": "tar -C backend --strip 1 -xf", - "exclude_files": [ - "bin/groestlcoin-qt" - ], + "exclude_files": ["bin/groestlcoin-qt"], "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/bin/groestlcoind -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/signet/*.log", "postinst_script_template": "", @@ -59,11 +57,7 @@ "xpub_magic": 70617039, "xpub_magic_segwit_p2sh": 71979618, "xpub_magic_segwit_native": 73342198, - "slip44": 1, - "additional_params": { - "fiat_rates": "coingecko", - "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"groestlcoin\", \"periodSeconds\": 60}" - } + "slip44": 1 } }, "meta": { diff --git a/configs/coins/groestlcoin_testnet.json b/configs/coins/groestlcoin_testnet.json index a4d2139d..05a67c25 100644 --- a/configs/coins/groestlcoin_testnet.json +++ b/configs/coins/groestlcoin_testnet.json @@ -27,9 +27,7 @@ "verification_type": "sha256", "verification_source": "4b69743190e2697d7b7772bf6f63cde595d590ff6664abf15a7201dab2a6098b", "extract_command": "tar -C backend --strip 1 -xf", - "exclude_files": [ - "bin/groestlcoin-qt" - ], + "exclude_files": ["bin/groestlcoin-qt"], "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/bin/groestlcoind -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid", "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/testnet3/*.log", "postinst_script_template": "", @@ -59,11 +57,7 @@ "xpub_magic": 70617039, "xpub_magic_segwit_p2sh": 71979618, "xpub_magic_segwit_native": 73342198, - "slip44": 1, - "additional_params": { - "fiat_rates": "coingecko", - "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"groestlcoin\", \"periodSeconds\": 60}" - } + "slip44": 1 } }, "meta": { diff --git a/configs/coins/litecoin.json b/configs/coins/litecoin.json index 7483d264..f965e4e8 100644 --- a/configs/coins/litecoin.json +++ b/configs/coins/litecoin.json @@ -65,6 +65,7 @@ "slip44": 2, "additional_params": { "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"litecoin\", \"periodSeconds\": 900}" } } diff --git a/configs/coins/monacoin.json b/configs/coins/monacoin.json index 6b274e9a..7cf2715a 100644 --- a/configs/coins/monacoin.json +++ b/configs/coins/monacoin.json @@ -59,6 +59,7 @@ "slip44": 22, "additional_params": { "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"monacoin\", \"periodSeconds\": 900}" } } diff --git a/configs/coins/namecoin.json b/configs/coins/namecoin.json index aff9fc08..d9675283 100644 --- a/configs/coins/namecoin.json +++ b/configs/coins/namecoin.json @@ -62,6 +62,7 @@ "slip44": 7, "additional_params": { "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"namecoin\", \"periodSeconds\": 900}" } } diff --git a/configs/coins/omotenashicoin.json b/configs/coins/omotenashicoin.json index 52a9a7f4..4a27eab5 100644 --- a/configs/coins/omotenashicoin.json +++ b/configs/coins/omotenashicoin.json @@ -57,6 +57,7 @@ "slip44": 341, "additional_params": { "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"omotenashicoin\", \"periodSeconds\": 900}" } } diff --git a/configs/coins/omotenashicoin_testnet.json b/configs/coins/omotenashicoin_testnet.json index bd14828f..993d3abe 100644 --- a/configs/coins/omotenashicoin_testnet.json +++ b/configs/coins/omotenashicoin_testnet.json @@ -1,70 +1,64 @@ { - "coin": { - "name": "Omotenashicoin Testnet", - "shortcut": "tMTNS", - "label": "Omotenashicoin Testnet", - "alias": "omotenashicoin_testnet" - }, - "ports": { - "blockbook_internal": 19089, - "blockbook_public": 19189, - "backend_rpc": 18089, - "backend_message_queue": 48389 - }, - "ipc": { - "rpc_url_template": "http://127.0.0.1:{{.Ports.BackendRPC}}", - "rpc_user": "rpc", - "rpc_pass": "mtnsrpc", - "rpc_timeout": 25, - "message_queue_binding_template": "tcp://127.0.0.1:{{.Ports.BackendMessageQueue}}" - }, - "backend": { - "package_name": "backend-mtns-testnet", - "package_revision": "satoshilabs-1", - "system_user": "mtns", - "version": "1.7.3", - "binary_url": "https://github.com/omotenashicoin-project/OmotenashiCoin-HDwalletbinaries/raw/master/stable/omotenashicoin-x86_64-linux-gnu.tar.gz", - "verification_type": "", - "verification_source": "", - "extract_command": "tar -C backend --strip 1 -xf", - "exclude_files": [ - "bin/omotenashicoin-qt" - ], - "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/bin/omotenashicoind -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid", - "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/testnet4/*.log", - "postinst_script_template": "", - "service_type": "forking", - "service_additional_params_template": "", - "protect_memory": true, - "mainnet": false, - "server_config_file": "bitcoin_like.conf", - "client_config_file": "bitcoin_like_client.conf", - "additional_params": { - "whitelist": "127.0.0.1" - } - }, - "blockbook": { - "package_name": "blockbook-mtns-testnet", - "system_user": "blockbook-mtns", - "internal_binding_template": ":{{.Ports.BlockbookInternal}}", - "public_binding_template": ":{{.Ports.BlockbookPublic}}", - "explorer_url": "", - "additional_params": "", - "block_chain": { - "parse": true, - "mempool_workers": 8, - "mempool_sub_workers": 2, - "block_addresses_to_keep": 300, - "xpub_magic": 70544129, - "slip44": 1, - "additional_params": { - "fiat_rates": "coingecko", - "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"omotenashicoin\", \"periodSeconds\": 60}" - } - } - }, - "meta": { - "package_maintainer": "omotenashicoin dev", - "package_maintainer_email": "git@omotenashicoin.site" - } + "coin": { + "name": "Omotenashicoin Testnet", + "shortcut": "tMTNS", + "label": "Omotenashicoin Testnet", + "alias": "omotenashicoin_testnet" + }, + "ports": { + "blockbook_internal": 19089, + "blockbook_public": 19189, + "backend_rpc": 18089, + "backend_message_queue": 48389 + }, + "ipc": { + "rpc_url_template": "http://127.0.0.1:{{.Ports.BackendRPC}}", + "rpc_user": "rpc", + "rpc_pass": "mtnsrpc", + "rpc_timeout": 25, + "message_queue_binding_template": "tcp://127.0.0.1:{{.Ports.BackendMessageQueue}}" + }, + "backend": { + "package_name": "backend-mtns-testnet", + "package_revision": "satoshilabs-1", + "system_user": "mtns", + "version": "1.7.3", + "binary_url": "https://github.com/omotenashicoin-project/OmotenashiCoin-HDwalletbinaries/raw/master/stable/omotenashicoin-x86_64-linux-gnu.tar.gz", + "verification_type": "", + "verification_source": "", + "extract_command": "tar -C backend --strip 1 -xf", + "exclude_files": ["bin/omotenashicoin-qt"], + "exec_command_template": "{{.Env.BackendInstallPath}}/{{.Coin.Alias}}/bin/omotenashicoind -datadir={{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend -conf={{.Env.BackendInstallPath}}/{{.Coin.Alias}}/{{.Coin.Alias}}.conf -pid=/run/{{.Coin.Alias}}/{{.Coin.Alias}}.pid", + "logrotate_files_template": "{{.Env.BackendDataPath}}/{{.Coin.Alias}}/backend/testnet4/*.log", + "postinst_script_template": "", + "service_type": "forking", + "service_additional_params_template": "", + "protect_memory": true, + "mainnet": false, + "server_config_file": "bitcoin_like.conf", + "client_config_file": "bitcoin_like_client.conf", + "additional_params": { + "whitelist": "127.0.0.1" + } + }, + "blockbook": { + "package_name": "blockbook-mtns-testnet", + "system_user": "blockbook-mtns", + "internal_binding_template": ":{{.Ports.BlockbookInternal}}", + "public_binding_template": ":{{.Ports.BlockbookPublic}}", + "explorer_url": "", + "additional_params": "", + "block_chain": { + "parse": true, + "mempool_workers": 8, + "mempool_sub_workers": 2, + "block_addresses_to_keep": 300, + "xpub_magic": 70544129, + "slip44": 1 + } + }, + "meta": { + "package_maintainer": "omotenashicoin dev", + "package_maintainer_email": "git@omotenashicoin.site" + } } diff --git a/configs/coins/trezarcoin.json b/configs/coins/trezarcoin.json index e20cccf7..83fe5e54 100644 --- a/configs/coins/trezarcoin.json +++ b/configs/coins/trezarcoin.json @@ -57,6 +57,7 @@ "slip44": 232, "additional_params": { "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"trezarcoin\", \"periodSeconds\": 900}" } } diff --git a/configs/coins/vertcoin.json b/configs/coins/vertcoin.json index 74726839..23a34365 100644 --- a/configs/coins/vertcoin.json +++ b/configs/coins/vertcoin.json @@ -59,6 +59,7 @@ "slip44": 28, "additional_params": { "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"vertcoin\", \"periodSeconds\": 900}" } } diff --git a/configs/coins/zcash.json b/configs/coins/zcash.json index eae0ecd9..21ad17b2 100644 --- a/configs/coins/zcash.json +++ b/configs/coins/zcash.json @@ -57,6 +57,7 @@ "slip44": 133, "additional_params": { "fiat_rates": "coingecko", + "fiat_rates_vs_currencies": "AED,ARS,AUD,BDT,BHD,BMD,BRL,CAD,CHF,CLP,CNY,CZK,DKK,EUR,GBP,HKD,HUF,IDR,ILS,INR,JPY,KRW,KWD,LKR,MMK,MXN,MYR,NGN,NOK,NZD,PHP,PKR,PLN,RUB,SAR,SEK,SGD,THB,TRY,TWD,UAH,USD,VEF,VND,ZAR,BTC,ETH", "fiat_rates_params": "{\"url\": \"https://api.coingecko.com/api/v3\", \"coin\": \"zcash\", \"periodSeconds\": 900}" } } diff --git a/fiat/coingecko.go b/fiat/coingecko.go index a1f4c47b..aa72835a 100644 --- a/fiat/coingecko.go +++ b/fiat/coingecko.go @@ -18,17 +18,18 @@ import ( // Coingecko is a structure that implements RatesDownloaderInterface type Coingecko struct { - url string - coin string - platformIdentifier string - platformVsCurrency string - httpTimeoutSeconds time.Duration - throttlingDelay time.Duration - timeFormat string - httpClient *http.Client - db *db.RocksDB - updatingCurrent bool - updatingTokens bool + url string + coin string + platformIdentifier string + platformVsCurrency string + allowedVsCurrencies map[string]struct{} + httpTimeout time.Duration + throttlingDelay time.Duration + timeFormat string + httpClient *http.Client + db *db.RocksDB + updatingCurrent bool + updatingTokens bool } // simpleSupportedVSCurrencies https://api.coingecko.com/api/v3/simple/supported_vs_currencies @@ -50,21 +51,28 @@ type marketChartPrices struct { } // NewCoinGeckoDownloader creates a coingecko structure that implements the RatesDownloaderInterface -func NewCoinGeckoDownloader(db *db.RocksDB, url string, coin string, platformIdentifier string, platformVsCurrency string, timeFormat string, throttleDown bool) RatesDownloaderInterface { +func NewCoinGeckoDownloader(db *db.RocksDB, url string, coin string, platformIdentifier string, platformVsCurrency string, allowedVsCurrencies string, timeFormat string, throttleDown bool) RatesDownloaderInterface { var throttlingDelayMs int if throttleDown { throttlingDelayMs = 100 } - httpTimeoutSeconds := 15 * time.Second + httpTimeout := 15 * time.Second + allowedVsCurrenciesMap := make(map[string]struct{}) + if len(allowedVsCurrencies) > 0 { + for _, c := range strings.Split(strings.ToLower(allowedVsCurrencies), ",") { + allowedVsCurrenciesMap[c] = struct{}{} + } + } return &Coingecko{ - url: url, - coin: coin, - platformIdentifier: platformIdentifier, - platformVsCurrency: platformVsCurrency, - httpTimeoutSeconds: httpTimeoutSeconds, - timeFormat: timeFormat, + url: url, + coin: coin, + platformIdentifier: platformIdentifier, + platformVsCurrency: platformVsCurrency, + allowedVsCurrencies: allowedVsCurrenciesMap, + httpTimeout: httpTimeout, + timeFormat: timeFormat, httpClient: &http.Client{ - Timeout: httpTimeoutSeconds, + Timeout: httpTimeout, }, db: db, throttlingDelay: time.Duration(throttlingDelayMs) * time.Millisecond, @@ -123,7 +131,16 @@ func (cg *Coingecko) simpleSupportedVSCurrencies() (simpleSupportedVSCurrencies, if err != nil { return nil, err } - return data, nil + if len(cg.allowedVsCurrencies) == 0 { + return data, nil + } + filtered := make([]string, 0, len(cg.allowedVsCurrencies)) + for _, c := range data { + if _, found := cg.allowedVsCurrencies[c]; found { + filtered = append(filtered, c) + } + } + return filtered, nil } // SimplePrice /simple/price Multiple ID and Currency (ids, vs_currencies) diff --git a/fiat/fiat_rates.go b/fiat/fiat_rates.go index d78db9b8..ee92ea9c 100644 --- a/fiat/fiat_rates.go +++ b/fiat/fiat_rates.go @@ -33,7 +33,7 @@ type RatesDownloader struct { } // NewFiatRatesDownloader initializes the downloader for FiatRates API. -func NewFiatRatesDownloader(db *db.RocksDB, apiType string, params string, callback OnNewFiatRatesTicker) (*RatesDownloader, error) { +func NewFiatRatesDownloader(db *db.RocksDB, apiType string, params string, allowedVsCurrencies string, callback OnNewFiatRatesTicker) (*RatesDownloader, error) { var rd = &RatesDownloader{} type fiatRatesParams struct { URL string `json:"url"` @@ -65,7 +65,7 @@ func NewFiatRatesDownloader(db *db.RocksDB, apiType string, params string, callb // a small hack - in tests the callback is not used, therefore there is no delay slowing the test throttle = false } - rd.downloader = NewCoinGeckoDownloader(db, rdParams.URL, rdParams.Coin, rdParams.PlatformIdentifier, rdParams.PlatformVsCurrency, rd.timeFormat, throttle) + rd.downloader = NewCoinGeckoDownloader(db, rdParams.URL, rdParams.Coin, rdParams.PlatformIdentifier, rdParams.PlatformVsCurrency, allowedVsCurrencies, rd.timeFormat, throttle) if is != nil { is.HasFiatRates = true is.HasTokenFiatRates = rd.downloadTokens diff --git a/fiat/fiat_rates_test.go b/fiat/fiat_rates_test.go index d1fdd983..417c960b 100644 --- a/fiat/fiat_rates_test.go +++ b/fiat/fiat_rates_test.go @@ -148,7 +148,7 @@ func TestFiatRates(t *testing.T) { t.Fatalf("Error parsing FiatRates config - empty parameter") return } - fiatRates, err := NewFiatRatesDownloader(d, config.FiatRates, config.FiatRatesParams, nil) + fiatRates, err := NewFiatRatesDownloader(d, config.FiatRates, config.FiatRatesParams, "", nil) if err != nil { t.Fatalf("FiatRates init error: %v", err) } diff --git a/server/public.go b/server/public.go index 8147db9c..28481087 100644 --- a/server/public.go +++ b/server/public.go @@ -15,6 +15,7 @@ import ( "regexp" "runtime" "runtime/debug" + "sort" "strconv" "strings" "time" @@ -373,6 +374,11 @@ func (s *PublicServer) newTemplateData(r *http.Request) *TemplateData { t.SecondaryCoin = strings.ToUpper(secondary) t.CurrentSecondaryCoinRate = float64(ticker.Rates[secondary]) t.CurrentTicker = ticker + t.SecondaryCurrencies = make([]string, 0, len(ticker.Rates)) + for k := range ticker.Rates { + t.SecondaryCurrencies = append(t.SecondaryCurrencies, strings.ToUpper(k)) + } + sort.Strings(t.SecondaryCurrencies) // sort to get deterministic results t.UseSecondaryCoin, _ = strconv.ParseBool(r.URL.Query().Get("use_secondary")) if !t.UseSecondaryCoin { t.UseSecondaryCoin = cookieUseSecondary @@ -501,6 +507,7 @@ type TemplateData struct { UseSecondaryCoin bool CurrentSecondaryCoinRate float64 CurrentTicker *common.CurrencyRatesTicker + SecondaryCurrencies []string TxDate string TxSecondaryCoinRate float64 TxTicker *common.CurrencyRatesTicker @@ -724,6 +731,13 @@ func appendAmountWrapperSpan(rv *strings.Builder, primary, symbol, classes strin rv.WriteString(`">`) } +func formatSecondaryAmount(a float64, td *TemplateData) string { + if td.SecondaryCoin == "BTC" || td.SecondaryCoin == "ETH" { + return strconv.FormatFloat(a, 'f', 6, 64) + } + return strconv.FormatFloat(a, 'f', 2, 64) +} + func (s *PublicServer) amountSpan(a *api.Amount, td *TemplateData, classes string) template.HTML { primary := s.formatAmount(a) var rv strings.Builder @@ -732,7 +746,7 @@ func (s *PublicServer) amountSpan(a *api.Amount, td *TemplateData, classes strin if td.SecondaryCoin != "" { p, err := strconv.ParseFloat(primary, 64) if err == nil { - currentSecondary := strconv.FormatFloat(p*td.CurrentSecondaryCoinRate, 'f', 2, 64) + currentSecondary := formatSecondaryAmount(p*td.CurrentSecondaryCoinRate, td) txSecondary := "" // if tx is specified, compute secondary amount is at the time of tx and amount with current rate is returned with class "csec-amt" if td.Tx != nil { @@ -748,7 +762,7 @@ func (s *PublicServer) amountSpan(a *api.Amount, td *TemplateData, classes strin } } if td.TxSecondaryCoinRate != 0 { - txSecondary = strconv.FormatFloat(p*td.TxSecondaryCoinRate, 'f', 2, 64) + txSecondary = formatSecondaryAmount(p*td.TxSecondaryCoinRate, td) } } if txSecondary != "" { @@ -798,13 +812,13 @@ func (s *PublicServer) tokenAmountSpan(t *api.TokenTransfer, td *TemplateData, c if found { base := p * baseRate currentBase = strconv.FormatFloat(base, 'f', 6, 64) - currentSecondary = strconv.FormatFloat(base*td.CurrentSecondaryCoinRate, 'f', 2, 64) + currentSecondary = formatSecondaryAmount(base*td.CurrentSecondaryCoinRate, td) } baseRate, found = s.api.GetContractBaseRate(td.TxTicker, t.Contract, td.Tx.Blocktime) if found { base := p * baseRate txBase = strconv.FormatFloat(base, 'f', 6, 64) - txSecondary = strconv.FormatFloat(base*td.TxSecondaryCoinRate, 'f', 2, 64) + txSecondary = formatSecondaryAmount(base*td.TxSecondaryCoinRate, td) } } if txBase != "" { @@ -843,7 +857,7 @@ func (s *PublicServer) formattedAmountSpan(a *api.Amount, d int, symbol string, func (s *PublicServer) summaryValuesSpan(baseValue float64, secondaryValue float64, td *TemplateData) template.HTML { var rv strings.Builder if secondaryValue > 0 { - appendAmountSpan(&rv, "", strconv.FormatFloat(secondaryValue, 'f', 2, 64), td.SecondaryCoin, "") + appendAmountSpan(&rv, "", formatSecondaryAmount(secondaryValue, td), td.SecondaryCoin, "") if baseValue > 0 && s.chainParser.GetChainType() == bchain.ChainEthereumType { rv.WriteString(`(`) appendAmountSpan(&rv, "", strconv.FormatFloat(baseValue, 'f', 6, 64), td.CoinShortcut, "") diff --git a/server/public_ethereumtype_test.go b/server/public_ethereumtype_test.go index 92731f90..6d87cf86 100644 --- a/server/public_ethereumtype_test.go +++ b/server/public_ethereumtype_test.go @@ -24,7 +24,7 @@ func httpTestsEthereumType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Address address7b.eth

0x7B62EB7fe80350DC7EC945C0B73242cb9877FB1b

0.000000000123450123 FAKE

Confirmed
Balance0.000000000123450123 FAKE
Transactions2
Non-contract Transactions0
Internal Transactions0
Nonce123
ContractQuantityValueTransfers#
Contract 130.000000001000123013 S131
Contract 740.001000123074 S741
ContractTokensTransfers#
Contract 20511

Transactions

ERC721 Token Transfers
`, + `Trezor Fake Coin Explorer

Address address7b.eth

0x7B62EB7fe80350DC7EC945C0B73242cb9877FB1b

0.000000000123450123 FAKE

Confirmed
Balance0.000000000123450123 FAKE
Transactions2
Non-contract Transactions0
Internal Transactions0
Nonce123
ContractQuantityValueTransfers#
Contract 130.000000001000123013 S131
Contract 740.001000123074 S741
ContractTokensTransfers#
Contract 20511

Transactions

ERC721 Token Transfers
`, }, }, { @@ -33,7 +33,7 @@ func httpTestsEthereumType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Address

0x5Dc6288b35E0807A3d6fEB89b3a2Ff4aB773168e

0.000000000123450093 FAKE

Confirmed
Balance0.000000000123450093 FAKE
Transactions1
Non-contract Transactions1
Internal Transactions0
Nonce93
ContractTokensTransfers#
Contract 1111 S111 of ID 1776, 10 S111 of ID 18981

Transactions

0x5Dc6288b35E0807A3d6fEB89b3a2Ff4aB773168e
 
0 FAKE
ERC1155 Token Transfers
 
0x5Dc6288b35E0807A3d6fEB89b3a2Ff4aB773168e
1 S111 of ID 1776, 10 S111 of ID 1898
`, + `Trezor Fake Coin Explorer

Address

0x5Dc6288b35E0807A3d6fEB89b3a2Ff4aB773168e

0.000000000123450093 FAKE

Confirmed
Balance0.000000000123450093 FAKE
Transactions1
Non-contract Transactions1
Internal Transactions0
Nonce93
ContractTokensTransfers#
Contract 1111 S111 of ID 1776, 10 S111 of ID 18981

Transactions

0x5Dc6288b35E0807A3d6fEB89b3a2Ff4aB773168e
 
0 FAKE
ERC1155 Token Transfers
 
0x5Dc6288b35E0807A3d6fEB89b3a2Ff4aB773168e
1 S111 of ID 1776, 10 S111 of ID 1898
`, }, }, { @@ -42,7 +42,7 @@ func httpTestsEthereumType(t *testing.T, ts *httptest.Server) { status: http.StatusOK, contentType: "text/html; charset=utf-8", body: []string{ - `Trezor Fake Coin Explorer

Transaction

0xa9cd088aba2131000da6f38a33c20169baee476218deea6b78720700b895b101
In BlockUnconfirmed
StatusSuccess
Value0 FAKE
Gas Used / Limit52025 / 78037
Gas Price0.00000004 FAKE (40 Gwei)
Fees0.002081 FAKE
RBFON
ERC20 Token Transfers
Input Data

0xa9059cbb000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f00000000000000000000000000000000000000000000021e19e0c9bab2400000
transfer(address, uint256)
#TypeData
0address0x555Ee11FBDDc0E49A9bAB358A8941AD95fFDB48f
1uint25610000000000000000000000
Raw Transaction
`, + `Trezor Fake Coin Explorer

Transaction

0xa9cd088aba2131000da6f38a33c20169baee476218deea6b78720700b895b101
In BlockUnconfirmed
StatusSuccess
Value0 FAKE
Gas Used / Limit52025 / 78037
Gas Price0.00000004 FAKE (40 Gwei)
Fees0.002081 FAKE
RBFON
ERC20 Token Transfers
Input Data

0xa9059cbb000000000000000000000000555ee11fbddc0e49a9bab358a8941ad95ffdb48f00000000000000000000000000000000000000000000021e19e0c9bab2400000
transfer(address, uint256)
#TypeData
0address0x555Ee11FBDDc0E49A9bAB358A8941AD95fFDB48f
1uint25610000000000000000000000
Raw Transaction
`, }, }, { name: "explorerTokenDetail " + dbtestdata.EthAddr7b, diff --git a/static/css/main.css b/static/css/main.css index 18c1fe34..8af83979 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -38,7 +38,7 @@ select { } #header { - position: absolute; + position: fixed; top: 0; left: 0; width: 100%; @@ -46,10 +46,18 @@ select { padding-bottom: 0; padding-top: 0; background-color: white; - border: 0; + border-bottom: 1px solid #f6f6f6; z-index: 10; } +#header a { + color: var(--bs-navbar-brand-color); +} + +#header a:hover { + color: var(--bs-navbar-brand-hover-color); +} + #header .navbar { --bs-navbar-padding-y: 0.7rem; } @@ -63,6 +71,23 @@ select { min-height: 50px; } +#header .btn.dropdown-toggle { + padding-right: 0; +} + +#header .dropdown-menu { + --bs-dropdown-min-width: 13rem; +} + +#header .dropdown-menu[data-bs-popper] { + left: initial; + right: 0; +} + +#header .dropdown-menu.show { + display: flex; +} + .form-control:focus { outline: 0; box-shadow: none; @@ -77,7 +102,6 @@ select { .badge { vertical-align: middle; - filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.15)); text-transform: uppercase; letter-spacing: 0.15em; --bs-badge-padding-x: 0.8rem; @@ -478,19 +502,18 @@ span.btn-paging:hover { } .txerror { - background-color: #c51f13a0; - color: white !important; + color: #c51f13; } .txerror a, .txerror .txvalue { - color: white; + color: #c51f13; } .txerror .copyable::before, .txerror .copied::before { - /* turn svg stroke to white */ - filter: hue-rotate(180deg) brightness(1000%) contrast(100%); + /* turn svg stroke to red */ + filter: invert(86%) sepia(43%) saturate(732%) hue-rotate(367deg) brightness(84%); } .tx-amt .amt:hover, @@ -619,6 +642,11 @@ span.btn-paging:hover { min-height: 40px; } + #header .dropdown-menu[data-bs-popper] { + left: 0; + right: initial; + } + .trezor-logo { top: 10px; } diff --git a/static/templates/base.html b/static/templates/base.html index 723488d1..1ecce68e 100644 --- a/static/templates/base.html +++ b/static/templates/base.html @@ -48,6 +48,12 @@ + + {{end}} diff --git a/static/templates/index.html b/static/templates/index.html index 305c3f01..451c8c9d 100644 --- a/static/templates/index.html +++ b/static/templates/index.html @@ -143,4 +143,5 @@ {{$bb.About}} +{{if .SecondaryCoin}}Exchange rates provided by Coingecko.{{end}} {{end}} \ No newline at end of file diff --git a/static/templates/txdetail_ethereumtype.html b/static/templates/txdetail_ethereumtype.html index 58646f8a..3d2281c1 100644 --- a/static/templates/txdetail_ethereumtype.html +++ b/static/templates/txdetail_ethereumtype.html @@ -1,17 +1,17 @@ {{define "txdetail"}}{{$cs := .CoinShortcut}}{{$addr := .AddrStr}}{{$tx := .Tx}}{{$data := .}}
-
-
+
+
{{$tx.Txid}} {{if $tx.Rbf}} RBF{{end}}
{{if $tx.Blocktime}}
{{if $tx.Confirmations}}mined{{else}}first seen{{end}} {{unixTimeSpan $tx.Blocktime}}
{{end}} + {{if eq $tx.EthereumSpecific.Status 0}}
Failed{{if $tx.EthereumSpecific.Error}}{{$tx.EthereumSpecific.Error}}{{end}}
{{end}} {{if $tx.EthereumSpecific.ParsedData}} {{if $tx.EthereumSpecific.ParsedData.Name}}
{{$tx.EthereumSpecific.ParsedData.Name}}{{if $tx.EthereumSpecific.ParsedData.MethodId}} ({{$tx.EthereumSpecific.ParsedData.MethodId}}){{end}}
{{else}} {{if $tx.EthereumSpecific.ParsedData.MethodId}}
{{$tx.EthereumSpecific.ParsedData.MethodId}}
{{end}} {{end}} {{end}} - {{if eq $tx.EthereumSpecific.Status 0}}
Failed{{if $tx.EthereumSpecific.Error}}{{$tx.EthereumSpecific.Error}}{{end}}
{{end}}
@@ -184,12 +184,12 @@ {{end}}