Commit Graph

1520 Commits

Author SHA1 Message Date
Vladyslav Burzakovskyy
c7730de36a docs/api: remove "gap" parameter, add "groupBy" example response 2020-01-08 17:57:47 +01:00
Vladyslav Burzakovskyy
2399f245e4 docs/api: document the fiatRates and balanceHistory endpoints 2020-01-08 17:57:47 +01:00
Vladyslav Burzakovskyy
7f992e9eb8 test-websocket.html: add "groupBy" parameter to getBalanceHistory 2020-01-08 17:57:47 +01:00
Martin
5a604441b4 Fix formatting 2020-01-08 17:57:47 +01:00
Martin
20459a2f46 Fix groupBy parameter parsing 2020-01-08 17:57:47 +01:00
Vladyslav Burzakovskyy
94977dc5ef balanceHistory: fix groupBy parameter initialization 2020-01-08 17:57:47 +01:00
Vladyslav Burzakovskyy
6919055e30 balanceHistory: sanitize the groupBy parameter in websocket API 2020-01-08 17:57:47 +01:00
Vladyslav Burzakovskyy
918e032bfe balanceHistory: add "groupBy" parameter 2020-01-08 17:57:47 +01:00
Vladyslav Burzakovskyy
d162348d36 fiatRates: update tests according to 9045a9ef64b43b73accb3dc7306791bc56f1dbde 2020-01-08 17:57:47 +01:00
Vladyslav Burzakovskyy
db8e0938df fiatRates: rename "data_timestamp" field to "ts" 2020-01-08 17:57:47 +01:00
Vladyslav Burzakovskyy
9cec5424e7 fiatRates: fields to camelCase, update output format and tests 2020-01-08 17:57:47 +01:00
Vladyslav Burzakovskyy
c58b1538d6 fiatRates: timestamps as int64, errors as -1, update field names and tests 2020-01-08 17:57:47 +01:00
Vladyslav Burzakovskyy
bc0e95f174 websocket: make allFiatRates parameter string a constant 2020-01-08 17:57:47 +01:00
Vladyslav Burzakovskyy
bef572c494 FiatRates: store rates as float64 instead of json.Number 2020-01-08 17:57:47 +01:00
Vladyslav Burzakovskyy
14c64410f7 FiatRates: change input & output time values to Unix timestamps
make currency parameter optional, return all rates if it's empty

update tests
2020-01-08 17:57:47 +01:00
Martin Boehm
f2ff7985b1 Improve explorer responsiveness 2020-01-04 00:57:17 +01:00
random.zebra
b7a430574f PIVX (+testnet): Bump backend 3.1.1 -> 4.0.0 (#340)
* PIVX: bump to 4.0.0

* PIVX: remove AccCheckpoint in block version 7

ref https://github.com/PIVX-Project/PIVX/pull/1022

* PIVX: Test block v7 in pivxparser_test
2020-01-03 12:45:40 +01:00
Martin Boehm
1ed7b3f2d9 Fix repeated utxos (unconfirmed and confirmed) #275 2020-01-03 11:53:49 +01:00
Martin Boehm
35c9da1ce8 Improve explorer navbar responsiveness, update copyright year #327, #343 2020-01-02 17:29:14 +01:00
Martin
1ce7bc1406
Merge pull request #337 from trezor/balanceHistory
Add API for account balance history #307
2019-12-18 00:05:34 +01:00
Martin Boehm
225ac85a2a Add optional fiat rate to balance history 2019-12-18 00:02:24 +01:00
Martin Boehm
0340cef13c Fix linting errors 2019-12-17 15:37:09 +01:00
Martin Boehm
15e2c0bf41 Add websocket method getBalanceHistory 2019-12-17 14:37:24 +01:00
Martin Boehm
1cec22ecba Merge branch 'master' into balanceHistory 2019-12-17 11:52:33 +01:00
Vladyslav Burzakovskyy
f6111af5da 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 10:40:02 +01:00
Jan Hrnko
e2b34afb9c bch (+testnet): Bump backend 0.20.7 -> 0.20.8 2019-12-11 14:20:11 +01:00
Jan Hrnko
81ca37e51f dash (+testnet): Bump backend 0.14.0.4 -> 0.14.0.5 2019-12-10 22:53:40 +01:00
Jan Hrnko
beeddef239 nmc: Bump backend 0.19.0 -> 0.19.0.1 2019-12-10 22:53:40 +01:00
Jan Hrnko
cd3cad423a nmc: Bump backend 0.18.0 -> 0.19.0 2019-12-10 22:53:40 +01:00
Jan Hrnko
3ac22a7571 eth (+testnet): Bump backend 1.9.8 -> 1.9.9 2019-12-10 22:53:40 +01:00
thebevrishot
76beadef8b Bump Zcoin to 0.13.8.8 2019-12-10 22:53:40 +01:00
Jan Hrnko
0a177d554c bch (+testnet): Bump backend 0.20.6 -> 0.20.7 2019-12-10 22:53:40 +01:00
Jan Hrnko
5c4f1d2674 eth (+testnet): Bump backend 1.9.7 -> 1.9.8 2019-12-10 22:53:40 +01:00
Jan Hrnko
684712680f btc (+testnet): Bump backend 0.18.1 -> 0.19.0.1 2019-12-10 22:53:40 +01:00
Jan Hrnko
5c7b1c9a0c dash (+testnet): Bump backend 0.14.0.3 -> 0.14.0.4 2019-12-10 22:53:40 +01:00
Jan Hrnko
80aa7bc4a4 dash (+testnet): Bump backend 0.14.0.4 -> 0.14.0.5 2019-12-10 22:52:16 +01:00
Jan Hrnko
d092c42e21 nmc: Bump backend 0.19.0 -> 0.19.0.1 2019-12-10 21:20:52 +01:00
Martin Boehm
6f294a6241 Add get balance history for ethereum type coins 2019-12-10 21:08:27 +01:00
Jan Hrnko
2a818d8780 nmc: Bump backend 0.18.0 -> 0.19.0 2019-12-07 12:05:31 +01:00
Jan Hrnko
f09b8ef683 eth (+testnet): Bump backend 1.9.8 -> 1.9.9 2019-12-06 14:06:21 +01:00
Martin Boehm
c913a022ef Add get balance history for xpub 2019-12-03 16:02:20 +01:00
thebevrishot
630ef1d308 Bump Zcoin to 0.13.8.8 2019-12-03 11:40:59 +01:00
Jan Hrnko
f94878b234 bch (+testnet): Bump backend 0.20.6 -> 0.20.7 2019-11-30 18:40:31 +01:00
Martin Boehm
62208b9634 Add aggregation to balance history 2019-11-29 19:26:20 +01:00
Jan Hrnko
b3367f8f8c eth (+testnet): Bump backend 1.9.7 -> 1.9.8 2019-11-28 19:10:27 +01:00
Martin Boehm
bf3d822b87 Add filter from-to to balance history 2019-11-25 18:34:33 +01:00
Jan Hrnko
0baf02c6b8 btc (+testnet): Bump backend 0.18.1 -> 0.19.0.1 2019-11-25 00:39:27 +01:00
Jan Hrnko
0f4f71d2b0 dash (+testnet): Bump backend 0.14.0.3 -> 0.14.0.4 2019-11-24 18:28:53 +01:00
Martin Boehm
da714b5299 Fix error message informing about missing Ethereum xpub support #314 2019-11-23 14:34:53 +01:00
Martin Boehm
5600e0d30a Fix formatting/linting issues 2019-11-23 14:34:53 +01:00