From ea49a1eda49c84714a6b885778f6ce279374b3dd Mon Sep 17 00:00:00 2001 From: Vitaliy Vlasov Date: Tue, 3 Apr 2018 11:06:18 +0300 Subject: [PATCH] Add documentation to eth-gasstation-gas-price fn --- src/clj/commiteth/eth/core.clj | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/clj/commiteth/eth/core.clj b/src/clj/commiteth/eth/core.clj index 757cbab..4db60c1 100644 --- a/src/clj/commiteth/eth/core.clj +++ b/src/clj/commiteth/eth/core.clj @@ -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