Commit Graph

217 Commits

Author SHA1 Message Date
Martin Boehm
66023becd6 Increase xpub cache, reduce logging 2021-05-21 00:24:57 +02:00
Martin Boehm
8f3106d009 Return filtered token balance in case of an empty account #566 2021-03-04 16:17:47 +01:00
Martin Boehm
7e54336e0c Return info about backend in websocket getInfo request 2021-01-21 10:31:04 +01:00
Martin Boehm
fc267ed2f4 Return for mempool transactions coinSpecificData #522 2020-12-04 11:57:11 +01:00
hewigovens
5534372e7c
[Zcash] Expose zcash consensus info (#508) 2020-11-12 19:56:41 +01:00
Martin Boehm
fc25200ff8 Fix ineffassign errors 2020-11-12 15:41:51 +01:00
Martin Boehm
17c9080135 Include eth transactions in unknown status into balance history 2020-07-30 16:02:08 +02:00
Martin Boehm
994567aed9 Add fee value to unspent transactions balance 2020-05-26 23:21:25 +02:00
Martin Boehm
0a3ea6e225 Send websocket notification on new tx for input addresses 2020-05-24 17:58:29 +02:00
Martin Boehm
01d8e48e73 Unconfirmed eth balance not being updated #408 2020-05-21 18:05:16 +02:00
Martin Boehm
ff607bc334 Check ERC20 contract balance if no transactions were done for address 2020-05-21 18:05:16 +02:00
Martin Boehm
dd2dc6b2ee Add sentToSelf to BalanceHistory 2020-05-21 18:05:16 +02:00
Martin Boehm
ee3217aba8 Use common.JSONNumber instead of json.Number 2020-05-10 00:14:14 +02:00
hewigovens
3ba7289587 Add data field to EthereumSpecific 2020-05-09 21:43:33 +02:00
David Hill
13527bda06 build: go module support 2020-03-05 11:54:42 -05:00
Martin Boehm
fd4181d03f Alter logging of a possible db inconsitency in addresses column 2020-02-24 23:11:46 +01:00
Martin Boehm
273b880245 Add load address by serialized address descriptor 2020-02-24 23:11:46 +01:00
Vladyslav Burzakovskyy
82debaa50e balanceHistory: remove empty currencies from the list, fix typo 2020-01-28 12:48:40 +01:00
Martin Boehm
95ac05b280 Improve error logging related to utxo requests 2020-01-22 16:38:29 +01:00
Vladyslav Burzakovskyy
f0ccab3e01 getFiatRatesForTimestamps: remove empty currencies from the currency slice 2020-01-22 15:26:12 +01:00
Vladyslav Burzakovskyy
4b63b483e4 fiatRates: always return rates as a map, even if the ticker is unavailable 2020-01-22 15:26:12 +01:00
Vladyslav Burzakovskyy
4ca66f3b1d fiatRates: accept an array of strings everywhere and return all available rates if it's empty 2020-01-22 15:26:12 +01:00
Vladyslav Burzakovskyy
4b564510e0 balanceHistory: return all currencies if the "currency" parameter is empty 2020-01-22 15:26:12 +01:00
Vladyslav Burzakovskyy
171b7f9b9d balanceHistory: accept a list of currencies, update tests 2020-01-22 15:26:12 +01:00
Vladyslav Burzakovskyy
6f06b549df balanceHistory: accept Unix timestamps instead of a date string 2020-01-22 15:26:12 +01:00
Vladyslav Burzakovskyy
729c35334a worker.go: use the correct data timestamp for getFiatRatesTickersList 2020-01-22 15:26:12 +01:00
Vladyslav Burzakovskyy
918e032bfe balanceHistory: add "groupBy" parameter 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
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
1ed7b3f2d9 Fix repeated utxos (unconfirmed and confirmed) #275 2020-01-03 11:53:49 +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
Martin Boehm
6f294a6241 Add get balance history for ethereum type coins 2019-12-10 21:08:27 +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
Martin Boehm
1c192f6d0b Fix invalid BlockHeight for unconfirmed transactions #301 2019-10-09 14:49:06 +02:00
Martin Boehm
3a8da67752 Fix linting errors 2019-08-21 23:11:50 +02:00
Vladyslav Burzakovskyy
4224aab5f2 Implement the "feestats" endpoint (#250) 2019-08-07 13:13:45 +02:00
Martin Boehm
d01fc3d914 Detect RBF transactions in explorer and API #237 2019-07-30 16:43:13 +02:00
Martin Boehm
39f2c73f3e Add coinbase flag (boolean) to UTXO response #236 2019-07-23 12:52:18 +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
701348c96d Remove hardcoded xpub length #203 2019-06-17 18:43:13 +02:00
Martin Boehm
34e5599362 Try to reconnect ethereum RPC in case of network failure 2019-06-10 13:48:46 +02:00
Martin Boehm
d26995a1e4 Show blockbook status in case of backend error 2019-06-05 13:29:06 +02:00
Martin Boehm
5c2b9f763e Fix get mempool txs for xpub 2019-06-03 12:50:45 +02:00
Martin Boehm
6ec0175937 Refactor totalTokens to usedTokens in API 2019-05-27 12:24:25 +02:00
Martin Boehm
8cd94070ce Return error when loading not existing block in ETH #176 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
9e98a4eb39 Improve performance of utxo indexing 2019-05-27 12:24:25 +02:00
Martin Boehm
ce0529c130 Use utxo index in API 2019-05-27 12:24:24 +02:00
Martin Boehm
90d7a7f2da Bump required index version to 5 2019-05-27 12:24:24 +02:00
Martin Boehm
984618a0ed Add option to compute fee statistics for chosen blocks 2019-05-27 12:24:24 +02:00
Martin Boehm
0312db4d9d Fix formatting/linting errors 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
629e07e6a4 Trim packr tos link 2019-05-03 14:50:08 +02:00
Martin Boehm
b64d76d8f9 Show first seen date of mempool transaction in explorer 2019-04-03 14:09:27 +02:00
Martin Boehm
987aec47f9 Show mempool content in explorer 2019-04-02 11:39:38 +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
6784ecd6b3 Fix api.Block json serialization 2019-03-20 17:49:21 +01:00
Martin Boehm
1d8389bb2c Return utxos by sorted by desceding block height 2019-03-20 17:32:10 +01:00
Martin Boehm
efca04a3fb Correctly count unconfirmed txs in api GetXpub 2019-03-06 18:48:15 +01:00
Martin Boehm
3df1cc81ed Correctly count unconfirmed txs in api GetAddress and GetXpub 2019-03-06 17:23:06 +01:00
Martin Boehm
3d10d9c2c5 Ensure ordering of address and xpub txs in the same block 2019-03-05 13:48:11 +01:00
Martin Boehm
1c35c632cb Add tokens to return level choice to websocket interface 2019-03-01 15:25:16 +01:00
Martin Boehm
dda96b4a8f Merge branch 'xpub' 2019-03-01 11:12:40 +01:00
Martin Boehm
7b590d9958 Unify AccountDetails levels in GetAccount and GetXpub api calls 2019-02-28 15:07:07 +01:00
Martin Boehm
46001a9fa5 Evict old cached xpubs 2019-02-26 16:27:28 +01:00
Martin Boehm
e1eadda6bf Make upper limit for gap in xpub address derivation 2019-02-25 14:09:24 +01:00
Martin Boehm
347e1d5967 Load ETH account balance also for accounts without any transactions #125 2019-02-19 20:16:16 +01:00
Martin Boehm
0546a2609d Count xpub transactions regardless of filter 2019-02-13 19:43:16 +01:00
Martin Boehm
f3ec1e6b77 Return unique transactions from GetXpubAddress 2019-02-13 17:57:30 +01:00
Martin Boehm
4846af9f60 Control token detail level returned by xpub api 2019-02-12 15:15:10 +01:00
Martin Boehm
63fb910ecb Add xpub handling to websocket interface 2019-02-11 11:54:34 +01:00
Martin Boehm
6b0a4960fd Get utxo for xpub 2019-02-08 15:50:37 +01:00
Martin Boehm
273436f109 Include mempool transactions in GetAddressForXpub 2019-02-08 00:42:38 +01:00
Martin Boehm
1ca4a0cfc7 Process mempool txs in api.GetAddress even for Basic level of details 2019-02-07 17:28:45 +01:00
Martin Boehm
ae332547ba Fix loading of txids for xpub 2019-02-06 17:35:10 +01:00
Martin Boehm
64c8ae9a62 Estimate full derivation path from xpub 2019-02-05 20:47:54 +01:00
Martin Boehm
266b0575b6 Highlight xpub addresses in explorer 2019-02-04 16:53:49 +01:00
Martin Boehm
9d3cd3b3e9 Implement loading of transactions in GetAddressForXpub - WIP 2019-02-03 23:42:44 +01:00
Martin Boehm
57b40ad6dc Hide xpub addresses with zero balance in explorer by default 2019-01-31 15:04:09 +01:00
Martin Boehm
8f1f1c87ac Modify the discovery of xpub addresses 2019-01-31 08:30:18 +01:00
Martin Boehm
225830d3e9 Implement GetAddressForXpub and xpub explorer view - WIP 2019-01-30 17:56:15 +01:00
Martin Boehm
171e15c9f7 Fix unit test build tags 2019-01-23 16:34:35 +01:00
Martin Boehm
b593643f63 Return Coinbase from API and Websocket interface 2019-01-17 20:30:18 +01:00
Martin Boehm
d1f30e27cf Handle nil amounts in socket.io interface 2019-01-17 19:58:59 +01:00
Martin Boehm
1c29283bf0 Add getAccountUtxo method to websocket interface 2019-01-14 17:12:33 +01:00
Martin Boehm
210652328f Avoid showing already confirmed txs as mempool txs 2019-01-13 23:32:28 +01:00
Martin Boehm
f109513464 Add handling of unknown inputs in api.GetTransaction 2019-01-10 17:24:29 +01:00
Martin Boehm
3ca593aff1 Handle error tx not found #94 2019-01-10 16:39:36 +01:00
Martin Boehm
8c4fcf4441 Stop indexing contracts of ETH zero address 2019-01-10 12:38:16 +01:00
Martin Boehm
00c1fd6661 Limit number of found transactions for address by page size 2019-01-09 11:48:19 +01:00