Current section
8 Versions
Jump to
Current section
8 Versions
Compare versions
4
files changed
+11
additions
-5
deletions
| @@ -1,7 +1,7 @@ | |
| 1 1 | {<<"links">>, |
| 2 2 | [{<<"GitHub">>,<<"https://github.com/RujiraNetwork/rujira_ex">>}]}. |
| 3 3 | {<<"name">>,<<"rujira_ex">>}. |
| 4 | - {<<"version">>,<<"0.0.4">>}. |
| 4 | + {<<"version">>,<<"0.0.5">>}. |
| 5 5 | {<<"description">>,<<"Domain library for Rujira">>}. |
| 6 6 | {<<"elixir">>,<<"~> 1.18">>}. |
| 7 7 | {<<"files">>, |
| @@ -220,10 +220,16 @@ defmodule Rujira.Fin.Pair do | |
| 220 220 | |
| 221 221 | defp oracle_from_config(%{"chain" => chain, "symbol" => symbol}) do |
| 222 222 | id = String.upcase(chain) <> "." <> symbol |
| 223 | - {:ok, %Oracle{id: id, symbol: id, asset: Assets.from_string(id)}} |
| 223 | + asset = Assets.from_string(id) |
| 224 | + {:ok, %Oracle{id: id, ticker: asset.ticker, asset: asset}} |
| 225 | + end |
| 226 | + |
| 227 | + defp oracle_from_config(ticker) when is_binary(ticker) do |
| 228 | + {:ok, %Oracle{id: ticker, ticker: ticker, asset: nil}} |
| 224 229 | end |
| 225 230 | |
| 226 231 | defp oracle_from_config(nil), do: {:ok, nil} |
| 232 | + defp oracle_from_config(_), do: {:ok, nil} |
| 227 233 | |
| 228 234 | defp mm_tvl(mm) do |
| 229 235 | with {:ok, %Deployments.Target{module: module}} <- Deployments.from_address(mm), |
| @@ -2,12 +2,12 @@ defmodule Rujira.Thorchain.Oracle do | |
| 2 2 | @moduledoc """ |
| 3 3 | Oracle struct for Thorchain Enshrined Oracle data. |
| 4 4 | """ |
| 5 | - defstruct id: nil, asset: nil, symbol: nil, price: nil |
| 5 | + defstruct id: nil, asset: nil, ticker: nil, price: nil |
| 6 6 | |
| 7 7 | @type t :: %__MODULE__{ |
| 8 8 | id: String.t(), |
| 9 9 | asset: Rujira.Assets.Asset.t() | nil, |
| 10 | - symbol: String.t(), |
| 10 | + ticker: String.t(), |
| 11 11 | price: Decimal.t() | nil |
| 12 12 | } |
| 13 13 | end |
| @@ -1,7 +1,7 @@ | |
| 1 1 | defmodule RujiraEx.MixProject do |
| 2 2 | use Mix.Project |
| 3 3 | |
| 4 | - @version "0.0.4" |
| 4 | + @version "0.0.5" |
| 5 5 | @source_url "https://github.com/RujiraNetwork/rujira_ex" |
| 6 6 | |
| 7 7 | def project do |