Commit Graph

98 Commits

Author SHA1 Message Date
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
Martin Boehm
c913a022ef Add get balance history for xpub 2019-12-03 16:02:20 +01:00
Martin Boehm
62208b9634 Add aggregation to balance history 2019-11-29 19:26:20 +01:00
Martin Boehm
bf3d822b87 Add filter from-to to balance history 2019-11-25 18:34:33 +01:00
Martin Boehm
6cfb881a04 Add GetBalanceHistory for an address of bitcoin type 2019-11-04 10:55:00 +01:00
Vladyslav Burzakovskyy
4224aab5f2 Implement the "feestats" endpoint (#250) 2019-08-07 13:13:45 +02:00
Martin Boehm
4ba0769433 Add "ping" message to the websocket interface #238 2019-07-19 14:59:03 +02:00
Martin Boehm
104f6f9a9d Add boolean flag isAddress vin and vout in API #209 2019-06-19 14:16:06 +02:00
Martin Boehm
bf461d0737 Add "gap" parameter to websocket "getAccountInfo" method #206 2019-06-18 12:21:22 +02:00
Martin Boehm
6447cdb1b7 Switch from TREZOR to Trezor according to new design guidelines #201 2019-06-17 15:39:35 +02:00
Martin Boehm
6f603e2424 Add prefix to socketio and websocket test names 2019-05-27 12:24:25 +02:00
Martin Boehm
6ec0175937 Refactor totalTokens to usedTokens in API 2019-05-27 12:24:25 +02:00
Martin Boehm
42d3ecdd41 Add test of websocket interface 2019-05-27 12:24:25 +02:00
Martin Boehm
749e534a26 Improve API requests when blockbook in sync with backend 2019-05-27 12:24:25 +02:00
Martin Boehm
917840d6b2 Stop indexing OP_RETURN scripts 2019-05-27 12:24:24 +02:00
Martin Boehm
b348a53664 Make all API fields camelCase 2019-05-27 12:24:24 +02:00
Martin Boehm
4435dbbfb4 Pass correct blockchain object to mempool 2019-04-03 22:08:32 +02:00
Martin Boehm
ce3c7c5e66 Extract mempool interface from blockchain 2019-03-25 16:43:57 +01:00
Martin Boehm
df952ffb05 Update api.GetBlock to support ethereum type coins 2019-03-21 09:36:18 +01:00
Martin Boehm
846b20c795 Unify processing of query parameters in address and xpub api 2019-03-18 18:23:03 +01:00
Martin Boehm
1c35c632cb Add tokens to return level choice to websocket interface 2019-03-01 15:25:16 +01:00
Martin Boehm
593247c364 Fix public interface xpub test 2019-02-13 18:34:31 +01:00
Martin Boehm
b8672a0fff Add public interface test for xpub functionality 2019-02-13 18:10:29 +01:00
Martin Boehm
266b0575b6 Highlight xpub addresses in explorer 2019-02-04 16:53:49 +01:00
Martin Boehm
b593643f63 Return Coinbase from API and Websocket interface 2019-01-17 20:30:18 +01:00
Martin Boehm
3ca593aff1 Handle error tx not found #94 2019-01-10 16:39:36 +01:00
Martin Boehm
2c3af5129e Generalize tokens instead of ERC20 tokens in API 2019-01-07 15:45:00 +01:00
Martin Boehm
97e0844a4b Update references to forked btcd, btcutil and bchutil libraries 2019-01-04 14:05:51 +01:00
Martin Boehm
ab077d882c Update references to forked btcd, btcutil and bchutil libraries 2019-01-04 13:47:28 +01:00
Martin Boehm
81e105dd4f Refactor tx api 2018-12-19 13:59:18 +01:00
Martin Boehm
a04b2b67b5 Filter address transactions by height from-to and contract 2018-12-14 16:42:35 +01:00
Martin Boehm
e9e6b472b6 Keep api v1 as compatible with blockbook 0.1.x, add api v2 2018-12-13 14:31:34 +01:00
Martin Boehm
70559ab9e0 Update api.GetAddress to return more ethereum specific data 2018-12-06 13:14:46 +01:00
Martin Boehm
0e1725321d Fix public_test 2018-12-05 12:02:41 +01:00
Martin Boehm
8886256d0b Implement index v3 for ethereum type coin 2018-11-23 22:16:32 +01:00
Martin Boehm
4448c57ba8 Introduce BitcoinType and EthereumType distinction of blockchains 2018-11-15 16:16:01 +01:00
Martin Boehm
8bf5837b26 Implement address utxo api call #83 2018-11-14 14:46:42 +01:00
Martin Boehm
d7b1c9e09a Return spent output flag in apiTx 2018-10-26 15:52:12 +02:00
Martin Boehm
77c64e97b6 Add apiSendTx via POST request 2018-10-25 19:40:07 +02:00
Martin Boehm
d1176e17d1 Implement apiSendTx and apiEstimateFee 2018-10-25 18:26:51 +02:00
Martin Boehm
4422661918 Implement Send Transaction in explorer 2018-10-22 15:41:27 +02:00
Martin Boehm
c6316ca10f Remove public server test dependecy on locale settings 2018-10-19 16:46:06 +02:00
Martin Boehm
017c6b3736 Add socket.io unit tests 2018-10-19 16:37:49 +02:00
Martin Boehm
c852214407 Complete explorer/api unit tests 2018-10-19 16:37:49 +02:00
Martin Boehm
9fd647014a Add test explorerAddress, explorerSpendingTx, explorerBlocks 2018-10-19 16:37:48 +02:00
Martin Boehm
a6dce9f770 Add unit test for explorerTx, explorerBlock, explorerIndex 2018-10-19 16:37:48 +02:00
Martin Boehm
cc11ae1e57 Setup public http server test 2018-10-19 16:37:48 +02:00