View Source Radixir.Config (radixir v0.0.4)

Configuration helpers.

Link to this section Summary

Functions

Fetches the username / password at specified index.

Fetches core api url.

Fetches gateway api url.

Fetches mnemonic.

Fetches the network being used.

Fetches the network's native token rri.

Fetches passwords.

Fetches system api url.

Specifies whether or not the testnet is being used.

Fetches usernames.

Link to this section Types

@type error_message() :: String.t()
@type mnemonic() :: String.t()
@type password() :: String.t()
@type url() :: String.t()
@type username() :: String.t()

Link to this section Functions

@spec auth(non_neg_integer()) ::
  {:ok, username(), password()} | {:error, error_message()}

Fetches the username / password at specified index.

example

Example

If the following usernames and passwords are exported as follows:

export USERNAMES='admin, superadmin, metrics'
export PASSWORDS='funny cats very Jack 21!, harry Kack love h39! LW, monitor Kat darrel 23 Jack!'

then auth(0) would return {:ok, "admin", "funny cats very Jack 21!"}

@spec core_api_url() :: {:ok, url()} | {:error, error_message()}

Fetches core api url.

@spec gateway_api_url() :: {:ok, url()} | {:error, error_message()}

Fetches gateway api url.

@spec mnemonic() :: {:ok, mnemonic()} | {:error, error_message()}

Fetches mnemonic.

@spec network() :: String.t()

Fetches the network being used.

note

Note

The two possibilities are stokenet or mainnet.

Link to this function

network_native_token_rri()

View Source
@spec network_native_token_rri() :: String.t()

Fetches the network's native token rri.

note

Note

The two possibilities are xrd_rr1qy5wfsfh for mainnet or xrd_tr1qyf0x76s for stokenet.

@spec passwords() :: {:ok, [password()]} | {:error, error_message()}

Fetches passwords.

note

Note

See .envrc.example for required format of passwords string.

@spec system_api_url() :: {:ok, url()} | {:error, error_message()}

Fetches system api url.

@spec testnet?() :: boolean()

Specifies whether or not the testnet is being used.

@spec usernames() :: {:ok, [username()]} | {:error, error_message()}

Fetches usernames.

note

Note

See .envrc.example for required format of usernames string.