Currently Rink separately downloads and parses BTC stats as json and ECB stats as xml.
This change replaces that with a unified endpoint that sends definitions directly in a format Rink understands, which means that there is no need for an XML parser in Rink anymore.
Adds Serialize + Deserialize to DefEntry. This requires converting several enum variants because serde is annoying like that.
Adds a /data/currency.json endpoint in rink-web that coalesces data from blockchain.info and ECB into DefEntry json format.
Removes the code for BTC/ECB parsing from rink-core.
Uses the new rink-web endpoint from the CLI.
Pros
Fewer dependencies in rink-core.
Fewer requests made by Rink CLI.
Fewer requests made against these third party APIs (as now only rink-web instances will, and as far as I know there is only 1).
No longer directly hitting third party APIs.
If blockchain.info ceases to exist like BTC-e did then I can fix it in rink-web and old versions of Rink will continue working.
Easier to add more frequently-updating data sources in the future.
Cons
I have to maintain https://rinkcalc.app/data/currency.json indefinitely. (I guess it's time for a status page and email alerts.)
Adds more code in the path that could possibly fail.
Data processing code is written in Typescript now.
Bonus
price of bitcoin, hashrate of bitcoin, total of bitcoin properties now exist.
Currently Rink separately downloads and parses BTC stats as json and ECB stats as xml.
This change replaces that with a unified endpoint that sends definitions directly in a format Rink understands, which means that there is no need for an XML parser in Rink anymore.
DefEntry
. This requires converting several enum variants because serde is annoying like that./data/currency.json
endpoint in rink-web that coalesces data from blockchain.info and ECB into DefEntry json format.Pros
Cons
https://rinkcalc.app/data/currency.json
indefinitely. (I guess it's time for a status page and email alerts.)Bonus
price of bitcoin
,hashrate of bitcoin
,total of bitcoin
properties now exist.