Add documentation to eth-gasstation-gas-price fn

This commit is contained in:
Vitaliy Vlasov 2018-04-03 11:06:18 +03:00 committed by Tetiana Churikova
parent 7e98c6c816
commit ea49a1eda4
1 changed files with 5 additions and 0 deletions

View File

@ -74,7 +74,12 @@
signed (TransactionEncoder/signMessage tx (creds))
hex-string (Numeric/toHexString signed)]
hex-string))
(defn eth-gasstation-gas-price
"Get max of average and average_calc from gas station and use that
as gas price. average_calc is computed from a larger time period than average,
so the idea is to account for both temporary dips (when average_calc > average)
and temporary rises (average_calc < average) of gas price"
[]
(let [data (json-api-request "https://ethgasstation.info/json/ethgasAPI.json")
avg-price (max