Proto commits in decred/dcrdata

These 4 commits are when the Protocol Buffers files have changed:

Commit:923cb4f
Author:Philemon Ukane
Committer:GitHub

multi: add support for DCR-USDT pair on `/markets` view (#2002) * multi: add support for DCR-USDT pair on `/markets` view - Add Mexc exchange `DCR-USDT` pair. - Add Binance `DCR-USDT` pair. - Fix minor bugs Breaking Changes: 1. `ratesproto`: Rate messages are no longer `DCR-BTC` only, a new `currencyPair` field indicates which market rate is sent. 
`ExchangeSubscription` field changed from `btcIndex` to `index`. 2. `exchanges`: Aggregated chart data has been removed. This is because combining usdt and btc market bids and asks is not ideal and serves very little purpose. Each market has its own chart. 3. Renamed three fields on `exchanges.ExchangeBotState`: - `btc_index` -> `index` - `dcr_btc_exchanges` -> `dcr_exchanges` (this field now returns a nested map of supported markets) - `btc_indices` -> `indices` (this field now returns a nested map of supported indices) 4. Affected API Endpoints: - `/exchangerate` (`exchanges.ExchangeRates.Exchanges` json field returns a nested map of support markets) - `/exchanges` (returns modified `exchanges.ExchangeBotState`)

The documentation is generated from this commit.

Commit:e2619e4
Author:Jonathan Chappelow
Committer:GitHub

dcrdata v6 module reorganization and treasury TODOs This nukes most of the old dcrdata modules and reorganizes large portions of the source. There are now 4 modules that are imported by another cmd/dcrdata module: - root module - db/dcrpg module - gov module - exchanges module The dcrdata main package is moved into cmd/dcrdata, and several packages only usable by the app (middleware, explorer, api (but not api/types), etc.) are put under that module as well. This also has some basic but incomplete handing for the three new treasury types, and lots of TODOs. The inputs and outputs of the Treasurybase, Treasury Spend, and Treasury Add txn types are not handled properly yet. The /block page also needs 3 new txn categories. The new vote version with a final nulldata output (e.g. https://testnet.dcrdata.org/tx/abde4c69df11cd0bce45a1ad729801afd75b270a05f55ae68defc3f910ab8c02) should also have special handling, such as deciding the treasury vote's position on a particular tspend.

Commit:060e98c
Author:buck54321
Committer:Jonathan Chappelow

multi: more exchange data Adds order book and candlestick data to the `exchanges` package. Order book data is refreshed with price data. Candlestick data is also fetched at the same time as price data, but only once a new candlestick should be ready. `ExchangeBot` manages a cache of JSON-encoded byte-slices of the new data, so access the data with `QuickSticks` and `QuickDepth` rather than directly through the `ExchangeState`. On the front end, a new `market` page displays a market overview. Adds a volume chart and an order book scatter plot. Also drops `cacheKey`, using the request URL as the key instead. * live websocket updates Small refactor of the websocket loop. Added `Change` field to the `WebsocketExchangeUpdate`. Minor JS fixes. * fix ExchangeState copy-project implementation. other minor fixes. * use unix stamp in API responses Binance parameters adjusted to pull more data. Bittrex candlesticks added. Rudimentary outlier filtering in market controller. Data is refreshed only if tab has focus or once focus is regained. * use pagevisibility api instead of focus and blur

Commit:b26f6a3
Author:buck54321
Committer:Jonathan Chappelow

Central server for exchange rate data This creates a central server for exchange rate data. For load-balanced backends, a central server for exchange data is needed. Dcrrates runs an ExchangeBot and takes subscriptions from gRPC clients, pushing updates when they are received. The Dcrrates server requires TLS, and will auto-generate a self-signed certificate if one is neither provided or already exists in the application directory. There is a script, `runprotoc.sh`, to generate the gRPC definition files from the proto file using `protoc`. This is only needed if the proto file is modified. ExchangeBot itself has been updated with an option to get exchange data from dcrrates instead of directly from the APIs. Note that the `ExchangeBot.IsUpdated` method has been removed. It was only used in `exchanges_test.go`, and the tests have been updated to accommodate both modes of operation. DCRRates server will log exchange updates at Info level. Alternate DNS addresses for the TLS certificate can be added with a configuration parameter `altdnsnames`. A list of the certificate's DNS and IP addresses are printed when a certificate is created. The default application directory name is changed to `dcrutil.AppDataDir("dcrrates", false)`. Leading tildes are expanded. Log level configuration option for to the DCRRates server. ExchangeBotConfig.MasterBot defaults to "localhost" and "7778" for host and server if one is provided without the other.