blockbook/fiat/mock_data/13-06-2014.json

2 lines
3.4 KiB
JSON
Raw Normal View History

Add fiat rates functionality (#316) * Add initial commit for fiat rates functionality * templates.go: use bash from current user's environment * bitcoinrpc.go: add FiatRates and FiatRatesParams to config * blockbook.go: add initFiatRatesDownloader kickoff * bitcoin.json: add coingecko API URL * rockdb.go: add FindTicker and StoreTicker functions * rocksdb_test.go: add a simple test for storing and getting FiatRate tickers * rocksdb: add FindLastTicker and convertDate, make FindTicker return strings * rocksdb: add ConvertDate function and CoinGeckoTicker struct, update tests * blockbook.go, fiat: finalize the CoinGecko downloader * coingecko.go: do not stop syncing when encountered an error * rocksdb_test: fix the exported function name * worker.go: make getBlockInfoFromBlockID a public function * public.go: apiTickers kickoff * rocksdb_test: fix the unittest comment * coingecko.go: update comments * blockbook.go, fiat: reword CoinGecko -> FiatRates, fix binary search upper bound, remove assignment of goroutine call result * rename coingecko -> fiat_rates * fiat_rates: export only the necessary methods * blockbook.go: update log message * bitcoinrpc.go: remove fiatRates settings * use CurrencyRatesTicker structure everywhere, fix time format string, update tests, use UTC time * add /api/v2/tickers tests, store rates as strings (json.Number) * fiat_rates: add more tests, metrics and tickers-list endpoint, make the "currency" parameter mandatory * public, worker: move FiatRates API logic to worker.go * fiat_rates: add a future date test, fix comments, add more checks, store time as a pointer * rocksdb_test: remove unneeded code * fiat_rates: add a "ping" call to check server availability * fiat_rates: do not return empty ticker, return nil instead if not found add a test for non-existent ticker * rocksdb_test: remove Sleep from tests * worker.go: do not propagate all API errors to the client * move InitTestFiatRates from rocksdb.go to public_test.go * public.go: fix FiatRatesFindLastTicker result check * fiat_rates: mock API server responses * remove commented-out code * fiat_rates: add comment explaining what periodSeconds attribute is used for * websocket.go: implement fiatRates websocket endpoints & add tests * fiatRates: add getFiatRatesTickersList websocket endpoint & test * fiatRates: make websocket getFiatRatesByDate accept an array of dates, add more tests * fiatRates: remove getFiatRatesForBlockID from websocket endpoints * fiatRates: remove "if test", use custom startTime instead Update tests and mock data * fiatRates: finalize websocket functionality add "date" parameter to TickerList return data timestamps where needed fix sync bugs (nil timestamp, duplicate save) * fiatRates: add FiatRates configs for different coins * worker.go: make GetBlockInfoFromBlockID private again * fiatRates: wait & retry on errors, remove Ping function * websocket.go: remove incorrect comment * fiatRates: move coingecko-related code to a separate file, use interface * fiatRates: if the new rates are the same as previous, try five more times, and only then store them * coingecko: fix getting actual rates, add a timestamp parameter to get uncached responses * vertcoin_testnet.json: remove fiat rates parameters * fiat_rates: add timestamp to log message about skipping the repeating rates
2019-12-17 02:40:02 -07:00
{"id":"bitcoin","symbol":"btc","name":"Bitcoin","localization":{"en":"Bitcoin","de":"Bitcoin","es":"Bitcoin","fr":"Bitcoin","it":"Bitcoin","pl":"Bitcoin","ro":"Bitcoin","hu":"Bitcoin","nl":"Bitcoin","pt":"Bitcoin","sv":"Bitcoin","vi":"Bitcoin","tr":"Bitcoin","ru":"биткоина","ja":"ビットコイン","zh":"比特币","zh-tw":"比特幣","ko":"비트코인","ar":"بيتكوين","th":"บิตคอยน์","id":"Bitcoin"},"image":{"thumb":"https://assets.coingecko.com/coins/images/1/thumb/bitcoin.png?1547033579","small":"https://assets.coingecko.com/coins/images/1/small/bitcoin.png?1547033579"},"market_data":{"current_price":{"aud":635.4009,"bdt":46187.0412867627,"bhd":224.2182020654,"bmd":594.6833,"brl":1330.3026,"btc":1.0,"cad":645.6162,"chf":537.5144,"cny":3818.09,"dkk":3291.0056,"eur":439.2353,"gbp":350.5075,"hkd":4609.773,"idr":7056654.8237,"inr":35623.7845,"jpy":60664.7779,"krw":605273.662,"ltc":58.68544600938967,"mmk":576316.9820261401,"mxn":7774.4393,"myr":1921.5065,"nzd":689.3958,"php":26182.8705,"pln":1816.6144,"rub":20449.5057,"sek":3957.6568,"sgd":743.7241,"twd":17936.3326,"uah":6989.384186896,"usd":594.6833,"vef":3749.9319498579002,"vnd":12616057.538675,"xag":30.3811,"xau":0.4678,"xdr":388.0442,"zar":6383.9883},"market_cap":{"aud":8191238932.305,"bdt":595417933396.2369,"bhd":2890497741.0160007,"bmd":7666330027.785,"brl":17149529452.77,"btc":12891450.0,"cad":8322928961.49,"chf":6929340011.88,"cny":49220716330.5,"dkk":42425834142.12,"eur":5662379908.185,"gbp":4518549910.875,"hkd":59426658140.85,"idr":90970512826987.36,"inr":459242236692.525,"jpy":782056951058.955,"krw":7802855149989.9,"ltc":756540492.9577465,"mmk":7429561557940.883,"mxn":100223795513.985,"myr":24771004969.425,"nzd":8887311485.91,"php":337535165907.225,"pln":23418793706.88,"rub":263623780256.265,"sek":51019934754.36,"sgd":9587682048.945,"twd":231225334896.27,"uah":90103296776.16043,"usd":7666330027.785,"vef":48342060234.99562,"vnd":162639274956951.8,"xag":391656431.595,"xau":6030620.31,"xdr":5002452402.09,"zar":82298865970.035},"total_volume":{"aud":40549103.56573137,"bdt":2947498375.4849124,"bhd":14308835.723827252,"bmd":37950646.151919045,"brl":84895343.87055749,"btc":63816.5661486022,"cad":41201008.933909185,"chf":34302323.26342622,"cny":243657393.04631656,"dkk":210020676.56782028,"eur":28030488.577251133,"gbp":22368185.059331186,"hkd":294179883.5845404,"idr":450331479344.50385,"inr":2273387600.0077996,"jpy":3871417811.7456107,"krw":38626486689.029686,"ltc":3745103.647218439,"mmk":36778570806.03395,"mxn":496138019.85674256,"myr":122623946.66221909,"nzd":43994872.673268534,"php":1670900887.223535,"pln":115930093.0241033,"rub":1305017233.2102678,"sek":252564066.9706653,"sgd":47461918.22395964,"twd":1144635155.8312302,"uah":446038498.30104274,"usd":37950646.151919045,"vef":239307780.33086348,"vnd":805113470451.4246,"xag":1938817.4778172984,"xau":29853.38964431611,"xdr":24763648.357881423,"zar":407404211.6388525}},"community_data":{"facebook_likes":22450,"twitter_followers":54747,"reddit_average_posts_48h":2.449,"reddit_average_comments_48h":266.163,"reddit_subscribers":122886,"reddit_accounts_active_48h":"957.0"},"developer_data":{"forks":3894,"stars":5469,"subscribers":757,"total_issues":4332,"closed_issues":3943,"pull_requests_merged":1950,"pull_request_contributors":201,"code_additions_deletions_4_weeks":{"additions":null,"deletions":null},"commit_count_4_weeks":null},"public_interest_stats":{"alexa_rank":null,"bing_matches":null}}