diff --git a/src/clj/commiteth/util/crypto_fiat_value.clj b/src/clj/commiteth/util/crypto_fiat_value.clj new file mode 100644 index 0000000..642bbcb --- /dev/null +++ b/src/clj/commiteth/util/crypto_fiat_value.clj @@ -0,0 +1,14 @@ +(ns commiteth.util.crypto-fiat-value + (:require [clj-http.client :as http] + [clojure.data.json :as json])) + + +(defn get-token-usd-price [token] + (let [url (str "https://api.cryptonator.com/api/ticker/" + token + "-usd") + m (->> (http/get url) + (:body) + (json/read-str))] + (-> (get-in m ["ticker" "price"]) + (read-string))))