Repository
https://github.com/not-a-bird/steem-bash
All of the changes in this update were applied in commit 05f2da
Bug Fixes
- What was the issue(s)?
- Fixed quoting around requested crypto coin tickers (made necessary by weird values used by third parties)
- Fixed strings used in fetching SBD (it's SBD* now, broken by third party (cryptocompare))
Apparently CryptoCompare added an asterisk to some of their supported currencies, for example, SBD. As a result, the single price fetch function get_price would still fetch the price of SBD via get_price SBD*, but attempts to fetch multiple feeds would fail, as was the case with balances.sh for fetching user balance information, and graphprices.sh which graphs a set of specified crypto currency values. The result is that both of these scripts broke. This actually revealed that there was another bug in functions.sh, namely, the fetched crypo price names were not being properly quoted when they were extracted from the JSON result.
- What was the solution?
The solution was to updatefunctions.sh,graphprices.sh, andbalances.shin the following ways:
Add variables for
SBD_TICKERandSTEEM_TICKER(with valuesSBD*andSTEEMrespectively,) to account for any future arbitrary changes to the tickers as used by CryptoCompare and replace all naked references to "SBD" with${SBD_TICKER}, and all naked references to "STEEM" with${STEEM_TIKER}.Ensure all invocations of
jqfor extracting ticker values from the results JSON made use of proper quoting around the respective variables. For example,graphprices.sh, for fetching the and graphing arbitrary crypto currencies used to have code like the following:echo -n " $(jq -r ".${COIN}.${CURRENCY}" <<< $PRICES)"
This function (and others) now includes code like the following:
echo -n " $(jq -r ".\"${COIN}\".\"${CURRENCY}\"" <<< $PRICES)"
New Features
New feature additions were interrupted by the seemingly innocuous bug fixes, but this commit did include the addition of the following APIs:
rpc_get_miner_queue()rpc_get_next_scheduled_hardfork()rpc_get_open_orders()rpc_get_ops_in_block()rpc_get_state()rpc_get_tags_used_by_author()
These functions were generally added by wrapping the rpc_invoke method, calling the appropriate back-end method, and preparing any arguments (which weren't very well documented at the time the implementation was completed, so it required quite a bit of trial and error.)