Make sats EUR amount configurable, default 54.46

Configurable via SATS_EUR_AMOUNT env var.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 10:43:48 +01:00
co-authored by Claude Opus 4.6
parent 161737d4c7
commit 6b4c8034f1
@@ -117,9 +117,12 @@
amount)) amount))
"\u2014")) "\u2014"))
(def ^:private sats-eur-amount
(double (bigdec (or (System/getenv "SATS_EUR_AMOUNT") "54.46"))))
(defn- eur-to-sats [rates] (defn- eur-to-sats [rates]
(when-let [eur-btc (get rates "EUR/BTC")] (when-let [eur-btc (get rates "EUR/BTC")]
(long (* 54 (double (bigdec eur-btc)) 100000000)))) (long (* sats-eur-amount (double (bigdec eur-btc)) 100000000))))
(defn- strike-json->html [text] (defn- strike-json->html [text]
(let [rates (json/read-str text) (let [rates (json/read-str text)