gethomepage / homepage

A highly customizable homepage (or startpage / application dashboard) with Docker and service API integrations.
https://gethomepage.dev
GNU General Public License v3.0
19.71k stars 1.18k forks source link

[Bug] Coinmarketcap Widget using non-unique key #1683

Closed insunaa closed 1 year ago

insunaa commented 1 year ago

Description

The Coinmarketcap widget doesn't work when using a symbol that's used for multiple different currencies, since unlike the slugs the symbols aren't unique. In the best case an incorrect currency result is returned, in the worst case a result filled with null values is returned, leading to the following error image

Steps to reproduce

Create a Coinmarketcap Service Widget In the symbols array add UNI or XCH UNI will cause the error message in the screenshot. XCH will display the incorrect currency (ClearingHouse instead of Chia)

homepage version

v0.6.21 (3e01fc1, Jun 12, 2023)

Installation method

Docker

Configuration

- Money:
  - Kraken:
      icon: /icons/Kraken-Symbol.png
      href: https://www.kraken.com/prices/bitcoin
      widget:
        type: coinmarketcap
        currency: EUR
        symbols: [BTC, ETH, LTC, DOGE, UNI, XCH]
        defaultinterval: "1h"
        key: API_KEY

Container Logs

No response

Browser Logs

No response

Troubleshooting

N/A since the error comes from requesting incorrect/unclear data from the upstream API endpoint

Other

Using slugs:

{"status":{"timestamp":"2023-07-13T22:16:42.377Z","error_code":0,"error_message":null,"elapsed":28,"credit_count":1,"notice":null},"data":{"1":{"id":1,"name":"Bitcoin","symbol":"BTC","slug":"bitcoin","num_market_pairs":10341,"date_added":"2010-07-13T00:00:00.000Z","tags":["mineable","pow","sha-256","store-of-value","state-channel","coinbase-ventures-portfolio","three-arrows-capital-portfolio","polychain-capital-portfolio","binance-labs-portfolio","blockchain-capital-portfolio","boostvc-portfolio","cms-holdings-portfolio","dcg-portfolio","dragonfly-capital-portfolio","electric-capital-portfolio","fabric-ventures-portfolio","framework-ventures-portfolio","galaxy-digital-portfolio","huobi-capital-portfolio","alameda-research-portfolio","a16z-portfolio","1confirmation-portfolio","winklevoss-capital-portfolio","usv-portfolio","placeholder-ventures-portfolio","pantera-capital-portfolio","multicoin-capital-portfolio","paradigm-portfolio","bitcoin-ecosystem"],"max_supply":21000000,"circulating_supply":19428593,"total_supply":19428593,"is_active":1,"infinite_supply":false,"platform":null,"cmc_rank":1,"is_fiat":0,"self_reported_circulating_supply":null,"self_reported_market_cap":null,"tvl_ratio":null,"last_updated":"2023-07-13T22:15:00.000Z","quote":{"EUR":{"price":27898.72343480109,"volume_24h":20425055439.690533,"volume_change_24h":54.7707,"percent_change_1h":0.48963016,"percent_change_24h":3.15302367,"percent_change_7d":3.69291319,"percent_change_30d":21.24018434,"percent_change_60d":16.32330737,"percent_change_90d":2.8623076,"market_cap":542032942834.3124,"market_cap_dominance":48.7896,"fully_diluted_market_cap":585873192130.8253,"tvl":null,"last_updated":"2023-07-13T22:16:04.000Z"}}},"2":{"id":2,"name":"Litecoin","symbol":"LTC","slug":"litecoin","num_market_pairs":945,"date_added":"2013-04-28T00:00:00.000Z","tags":["mineable","pow","scrypt","medium-of-exchange"],"max_supply":84000000,"circulating_supply":73355189.22743528,"total_supply":84000000,"is_active":1,"infinite_supply":false,"platform":null,"cmc_rank":11,"is_fiat":0,"self_reported_circulating_supply":null,"self_reported_market_cap":null,"tvl_ratio":null,"last_updated":"2023-07-13T22:15:00.000Z","quote":{"EUR":{"price":89.1581490972592,"volume_24h":1073889632.5121913,"volume_change_24h":133.1567,"percent_change_1h":-0.18180352,"percent_change_24h":4.17705888,"percent_change_7d":2.43953509,"percent_change_30d":29.56016714,"percent_change_60d":20.75446383,"percent_change_90d":3.91652304,"market_cap":6540212898.197336,"market_cap_dominance":0.5886,"fully_diluted_market_cap":7489284524.172494,"tvl":null,"last_updated":"2023-07-13T22:16:04.000Z"}}},"74":{"id":74,"name":"Dogecoin","symbol":"DOGE","slug":"dogecoin","num_market_pairs":742,"date_added":"2013-12-15T00:00:00.000Z","tags":["mineable","pow","scrypt","medium-of-exchange","memes","payments","doggone-doggerel","bnb-chain"],"max_supply":null,"circulating_supply":140161176383.70526,"total_supply":140161176383.70526,"is_active":1,"infinite_supply":true,"platform":null,"cmc_rank":9,"is_fiat":0,"self_reported_circulating_supply":null,"self_reported_market_cap":null,"tvl_ratio":null,"last_updated":"2023-07-13T22:15:00.000Z","quote":{"EUR":{"price":0.06190187407821252,"volume_24h":523020734.0297845,"volume_change_24h":274.9425,"percent_change_1h":0.42141814,"percent_change_24h":7.7288942,"percent_change_7d":5.40368493,"percent_change_30d":12.82001666,"percent_change_60d":-3.26985066,"percent_change_90d":-21.63397823,"market_cap":8676239491.158258,"market_cap_dominance":0.7808,"fully_diluted_market_cap":8676239491.156628,"tvl":null,"last_updated":"2023-07-13T22:16:04.000Z"}}},"1027":{"id":1027,"name":"Ethereum","symbol":"ETH","slug":"ethereum","num_market_pairs":7112,"date_added":"2015-08-07T00:00:00.000Z","tags":["pos","smart-contracts","ethereum-ecosystem","coinbase-ventures-portfolio","three-arrows-capital-portfolio","polychain-capital-portfolio","binance-labs-portfolio","blockchain-capital-portfolio","boostvc-portfolio","cms-holdings-portfolio","dcg-portfolio","dragonfly-capital-portfolio","electric-capital-portfolio","fabric-ventures-portfolio","framework-ventures-portfolio","hashkey-capital-portfolio","kenetic-capital-portfolio","huobi-capital-portfolio","alameda-research-portfolio","a16z-portfolio","1confirmation-portfolio","winklevoss-capital-portfolio","usv-portfolio","placeholder-ventures-portfolio","pantera-capital-portfolio","multicoin-capital-portfolio","paradigm-portfolio","injective-ecosystem","layer-1"],"max_supply":null,"circulating_supply":120206568.7334131,"total_supply":120206568.7334131,"is_active":1,"infinite_supply":true,"platform":null,"cmc_rank":2,"is_fiat":0,"self_reported_circulating_supply":null,"self_reported_market_cap":null,"tvl_ratio":null,"last_updated":"2023-07-13T22:15:00.000Z","quote":{"EUR":{"price":1769.2396124222003,"volume_24h":9564610406.83179,"volume_change_24h":69.1793,"percent_change_1h":0.42413922,"percent_change_24h":6.15822432,"percent_change_7d":6.10527644,"percent_change_30d":14.35929659,"percent_change_60d":10.3768738,"percent_change_90d":-5.56779389,"market_cap":212674223076.50638,"market_cap_dominance":19.1433,"fully_diluted_market_cap":212674223076.50467,"tvl":null,"last_updated":"2023-07-13T22:16:04.000Z"}}},"7083":{"id":7083,"name":"Uniswap","symbol":"UNI","slug":"uniswap","num_market_pairs":730,"date_added":"2020-09-17T00:00:00.000Z","tags":["decentralized-exchange-dex-token","defi","dao","yield-farming","amm","coinbase-ventures-portfolio","three-arrows-capital-portfolio","governance","blockchain-capital-portfolio","defiance-capital-portfolio","alameda-research-portfolio","a16z-portfolio","pantera-capital-portfolio","parafi-capital","paradigm-portfolio","arbitrum-ecosytem","injective-ecosystem","optimism-ecosystem"],"max_supply":1000000000,"circulating_supply":577501036,"total_supply":1000000000,"platform":{"id":1027,"name":"Ethereum","symbol":"ETH","slug":"ethereum"},"is_active":1,"infinite_supply":false,"cmc_rank":25,"is_fiat":0,"self_reported_circulating_supply":null,"self_reported_market_cap":null,"tvl_ratio":0.82177164,"last_updated":"2023-07-13T22:15:00.000Z","quote":{"EUR":{"price":5.111393098762887,"volume_24h":84660959.36169854,"volume_change_24h":79.8266,"percent_change_1h":0.90052881,"percent_change_24h":9.85374576,"percent_change_7d":6.4939452,"percent_change_30d":34.39887402,"percent_change_60d":11.90081714,"percent_change_90d":-8.72103515,"market_cap":2951834809.938818,"market_cap_dominance":0.2657,"fully_diluted_market_cap":5111393098.760432,"tvl":3592037831.05827,"last_updated":"2023-07-13T22:16:04.000Z"}}},"9258":{"id":9258,"name":"Chia","symbol":"XCH","slug":"chia-network","num_market_pairs":51,"date_added":"2021-04-16T00:00:00.000Z","tags":[],"max_supply":null,"circulating_supply":7879702,"total_supply":28879702,"is_active":1,"infinite_supply":false,"platform":null,"cmc_rank":114,"is_fiat":0,"self_reported_circulating_supply":7879702,"self_reported_market_cap":271312269.51302224,"tvl_ratio":null,"last_updated":"2023-07-13T22:15:00.000Z","quote":{"EUR":{"price":30.663990907873437,"volume_24h":2549341.3097532596,"volume_change_24h":-8.8686,"percent_change_1h":0.29775203,"percent_change_24h":1.82795896,"percent_change_7d":3.98893312,"percent_change_30d":8.31905414,"percent_change_60d":-6.45836347,"percent_change_90d":-27.21412817,"market_cap":241623110.48475215,"market_cap_dominance":0.0217,"fully_diluted_market_cap":885566919.5467325,"tvl":null,"last_updated":"2023-07-13T22:16:04.000Z"}}}}}

Using symbols:

{"status":{"timestamp":"2023-07-13T22:17:32.752Z","error_code":0,"error_message":null,"elapsed":48,"credit_count":1,"notice":null},"data":{"BTC":{"id":1,"name":"Bitcoin","symbol":"BTC","slug":"bitcoin","num_market_pairs":10341,"date_added":"2010-07-13T00:00:00.000Z","tags":["mineable","pow","sha-256","store-of-value","state-channel","coinbase-ventures-portfolio","three-arrows-capital-portfolio","polychain-capital-portfolio","binance-labs-portfolio","blockchain-capital-portfolio","boostvc-portfolio","cms-holdings-portfolio","dcg-portfolio","dragonfly-capital-portfolio","electric-capital-portfolio","fabric-ventures-portfolio","framework-ventures-portfolio","galaxy-digital-portfolio","huobi-capital-portfolio","alameda-research-portfolio","a16z-portfolio","1confirmation-portfolio","winklevoss-capital-portfolio","usv-portfolio","placeholder-ventures-portfolio","pantera-capital-portfolio","multicoin-capital-portfolio","paradigm-portfolio","bitcoin-ecosystem"],"max_supply":21000000,"circulating_supply":19428593,"total_supply":19428593,"is_active":1,"infinite_supply":false,"platform":null,"cmc_rank":1,"is_fiat":0,"self_reported_circulating_supply":null,"self_reported_market_cap":null,"tvl_ratio":null,"last_updated":"2023-07-13T22:16:00.000Z","quote":{"EUR":{"price":27900.151285402775,"volume_24h":20429781082.58331,"volume_change_24h":54.8326,"percent_change_1h":0.31120345,"percent_change_24h":3.17801166,"percent_change_7d":3.71318574,"percent_change_30d":21.24547701,"percent_change_60d":16.33291937,"percent_change_90d":2.86811675,"market_cap":542060683962.51733,"market_cap_dominance":48.7921,"fully_diluted_market_cap":585903176993.46,"tvl":null,"last_updated":"2023-07-13T22:16:04.000Z"}}},"DOGE":{"id":74,"name":"Dogecoin","symbol":"DOGE","slug":"dogecoin","num_market_pairs":742,"date_added":"2013-12-15T00:00:00.000Z","tags":["mineable","pow","scrypt","medium-of-exchange","memes","payments","doggone-doggerel","bnb-chain"],"max_supply":null,"circulating_supply":140161176383.70526,"total_supply":140161176383.70526,"is_active":1,"infinite_supply":true,"platform":null,"cmc_rank":9,"is_fiat":0,"self_reported_circulating_supply":null,"self_reported_market_cap":null,"tvl_ratio":null,"last_updated":"2023-07-13T22:16:00.000Z","quote":{"EUR":{"price":0.06191351935682589,"volume_24h":523298951.0063085,"volume_change_24h":275.2447,"percent_change_1h":0.45795413,"percent_change_24h":7.77635193,"percent_change_7d":5.48044861,"percent_change_30d":12.86680825,"percent_change_60d":-3.26532801,"percent_change_90d":-21.58809845,"market_cap":8677871707.108023,"market_cap_dominance":0.781,"fully_diluted_market_cap":8677871707.107649,"tvl":null,"last_updated":"2023-07-13T22:16:04.000Z"}}},"ETH":{"id":1027,"name":"Ethereum","symbol":"ETH","slug":"ethereum","num_market_pairs":7112,"date_added":"2015-08-07T00:00:00.000Z","tags":["pos","smart-contracts","ethereum-ecosystem","coinbase-ventures-portfolio","three-arrows-capital-portfolio","polychain-capital-portfolio","binance-labs-portfolio","blockchain-capital-portfolio","boostvc-portfolio","cms-holdings-portfolio","dcg-portfolio","dragonfly-capital-portfolio","electric-capital-portfolio","fabric-ventures-portfolio","framework-ventures-portfolio","hashkey-capital-portfolio","kenetic-capital-portfolio","huobi-capital-portfolio","alameda-research-portfolio","a16z-portfolio","1confirmation-portfolio","winklevoss-capital-portfolio","usv-portfolio","placeholder-ventures-portfolio","pantera-capital-portfolio","multicoin-capital-portfolio","paradigm-portfolio","injective-ecosystem","layer-1"],"max_supply":null,"circulating_supply":120206568.7334131,"total_supply":120206568.7334131,"is_active":1,"infinite_supply":true,"platform":null,"cmc_rank":2,"is_fiat":0,"self_reported_circulating_supply":null,"self_reported_market_cap":null,"tvl_ratio":null,"last_updated":"2023-07-13T22:16:00.000Z","quote":{"EUR":{"price":1769.2386921050615,"volume_24h":9563680386.528065,"volume_change_24h":69.1972,"percent_change_1h":0.30645564,"percent_change_24h":6.18974982,"percent_change_7d":6.10583834,"percent_change_30d":14.36275895,"percent_change_60d":10.36856702,"percent_change_90d":-5.56053306,"market_cap":212674112448.34097,"market_cap_dominance":19.1433,"fully_diluted_market_cap":212674112448.34167,"tvl":null,"last_updated":"2023-07-13T22:16:04.000Z"}}},"LTC":{"id":2,"name":"Litecoin","symbol":"LTC","slug":"litecoin","num_market_pairs":945,"date_added":"2013-04-28T00:00:00.000Z","tags":["mineable","pow","scrypt","medium-of-exchange"],"max_supply":84000000,"circulating_supply":73355189.22743528,"total_supply":84000000,"is_active":1,"infinite_supply":false,"platform":null,"cmc_rank":11,"is_fiat":0,"self_reported_circulating_supply":null,"self_reported_market_cap":null,"tvl_ratio":null,"last_updated":"2023-07-13T22:16:00.000Z","quote":{"EUR":{"price":89.17224061759666,"volume_24h":1074579037.8317137,"volume_change_24h":133.3119,"percent_change_1h":-0.12599902,"percent_change_24h":4.18146242,"percent_change_7d":2.48735746,"percent_change_30d":29.62867367,"percent_change_60d":20.73562656,"percent_change_90d":3.87129621,"market_cap":6541246584.338192,"market_cap_dominance":0.5887,"fully_diluted_market_cap":7490468211.880375,"tvl":null,"last_updated":"2023-07-13T22:16:04.000Z"}}},"UNI":{"id":126,"name":"UniteCoin","symbol":"UNI","slug":"unitecoin","num_market_pairs":null,"date_added":"2014-04-16T00:00:00.000Z","tags":["mineable"],"max_supply":null,"circulating_supply":null,"total_supply":null,"is_active":0,"infinite_supply":false,"platform":null,"cmc_rank":null,"is_fiat":0,"self_reported_circulating_supply":null,"self_reported_market_cap":null,"tvl_ratio":null,"last_updated":"2023-07-13T22:17:32.752Z","quote":{"EUR":{"price":0,"volume_24h":null,"volume_change_24h":null,"percent_change_1h":null,"percent_change_24h":null,"percent_change_7d":null,"percent_change_30d":null,"percent_change_60d":null,"percent_change_90d":null,"market_cap":null,"market_cap_dominance":null,"fully_diluted_market_cap":0,"tvl":null,"last_updated":"2023-07-13T22:16:04.000Z"}}},"XCH":{"id":652,"name":"ClearingHouse","symbol":"XCH","slug":"clearinghouse","num_market_pairs":0,"date_added":"2014-10-04T00:00:00.000Z","tags":[],"max_supply":null,"circulating_supply":103807696.513561,"total_supply":103807696.513561,"is_active":0,"infinite_supply":false,"platform":null,"cmc_rank":null,"is_fiat":0,"self_reported_circulating_supply":null,"self_reported_market_cap":null,"tvl_ratio":null,"last_updated":"2016-06-05T05:49:13.000Z","quote":{"EUR":{"price":0.00018000241264000066,"volume_24h":0,"volume_change_24h":0,"percent_change_1h":0,"percent_change_24h":0,"percent_change_7d":0,"percent_change_30d":0,"percent_change_60d":0,"percent_change_90d":0,"market_cap":18685.635823041965,"market_cap_dominance":0,"fully_diluted_market_cap":0,"tvl":null,"last_updated":"2023-07-13T22:16:04.000Z"}}}}}

API Key in the Configuration is a placeholder and does not represent the real API key that I use, which is working as confirmed by manually sending the exact same request with curl

Before submitting, I have made sure to

shamoon commented 1 year ago

I added the ability to specify slug in #1684 since crypto does dumb things like allow non-unique symbols

github-actions[bot] commented 9 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns.