Liking cljdoc? Tell your friends :D

commensura.currency.rates

Live currency exchange rates from CurrencyFreaks (USD base). The machinery behind the generated commensura.currency unit fns: fetch (cached, TTL) → an exact code -> USD-value mapping → a unit.

Live-only: rates aren't shipped (they're volatile and proprietary), so this needs the user's own key — set CURRENCYFREAKS_API_KEY (a free tier exists). A missing key or a fetch failure throws. Rates are kept exact (rationals); each currency is worth (usd-value code) · dollar.

Live currency exchange rates from CurrencyFreaks (USD base). The machinery behind the generated
`commensura.currency` unit fns: fetch (cached, TTL) → an exact `code -> USD-value` mapping → a unit.

Live-only: rates aren't shipped (they're volatile and proprietary), so this needs the user's own
key — set `CURRENCYFREAKS_API_KEY` (a free tier exists). A missing key or a fetch failure throws.
Rates are kept exact (rationals); each currency is worth `(usd-value code) · dollar`.
raw docstring

ofclj

(of code)
(of code amount)

The current currency unit for code, or amount of it — what the generated commensura.currency fns delegate to. Also the way to reach a code that has no generated var.

The current currency unit for `code`, or `amount` of it — what the generated `commensura.currency`
fns delegate to. Also the way to reach a code that has no generated var.
sourceraw docstring

ratesclj

The current {code -> rate} map (units of code per 1 USD), cached with a TTL via core.memoize. The memoized fn is the seam — with-redefs it in tests; a live fetch happens at most once per ttl-ms.

The current `{code -> rate}` map (units of `code` per 1 USD), cached with a TTL via core.memoize.
The memoized fn is the seam — `with-redefs` it in tests; a live fetch happens at most once per `ttl-ms`.
sourceraw docstring

supported?clj

(supported? nm)

Is nm a supported currency code?

Is `nm` a supported currency code?
sourceraw docstring

ttl-msclj

Rate-cache TTL in ms (default 12h). CurrencyFreaks' free tier is daily / 1,000 calls a month, so a long TTL keeps well under quota; redefine it if you have a faster paid plan.

Rate-cache TTL in ms (default 12h). CurrencyFreaks' free tier is daily / 1,000 calls a month, so a
long TTL keeps well under quota; redefine it if you have a faster paid plan.
sourceraw docstring

unitclj

(unit code)

A currency Unit for code — callable, worth (usd-value code) · dollar, dims {:currency 1}. Minted fresh each call (the rate is live).

A currency Unit for `code` — callable, worth `(usd-value code) · dollar`, dims `{:currency 1}`.
Minted fresh each call (the rate is live).
sourceraw docstring

usd-valueclj

(usd-value code)

The USD value of one unit of code (= 1 / rate). USD is 1 without a fetch.

The USD value of one unit of `code` (= 1 / rate). `USD` is 1 without a fetch.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close