Triple.Cryptos (triple v1.0.0)

Copy Markdown View Source

Cryptocurrency lookups by slug.

Summary

Functions

Fetches a cryptocurrency by its slug (e.g. "bitcoin" for BTC).

Same as fetch/2, but raises instead of returning {:error, _}.

Functions

fetch(config, slug)

@spec fetch(Triple.Config.t(), String.t()) ::
  {:ok, Triple.Types.Crypto.t()} | {:error, Triple.Error.t()}

Fetches a cryptocurrency by its slug (e.g. "bitcoin" for BTC).

Examples

Triple.Cryptos.fetch(client, "bitcoin")
#=> {:ok, %Triple.Types.Crypto{symbol: "BTC", ...}}

fetch!(config, slug)

Same as fetch/2, but raises instead of returning {:error, _}.