ForgeSdk v1.0.7 ForgeSdk.Util View Source

Get configuration, server setup, etc.

Link to this section Summary

Functions

Upon initialization, forge client can call this function to make a gRPC connection to forge node

Get the gRPC connection channel

Get the configuration for the conn

Generate address for asset. We only use itx.data to generate asset address. Thus same itx.data would be treated as duplicate asset

Generate delegation address. Use sender's address + receiver's address as pseudo public key. Use ed25519 as pseudo key type. Use sha3 and base58 by default

Convert datetime or iso8601 datetime string to google protobuf timestamp

Generate stake address. Use sender's address + receiver's address as pseudo public key. Use ed25519 as pseudo key type. Use sha3 and base58 by default

Generate address for tx

Link to this section Functions

Link to this function

connect(host, opts) View Source
connect(String.t(), Keyword.t()) ::
  :ignore | {:error, any()} | {:ok, pid()} | {:ok, pid(), any()}

Upon initialization, forge client can call this function to make a gRPC connection to forge node.

Link to this function

get_conn(name \\ "") View Source
get_conn(String.t() | atom()) :: ForgeSdk.Conn.t()

Get the gRPC connection channel.

Link to this function

get_conn_state(name \\ "") View Source
get_conn_state(String.t() | atom()) :: ForgeSdk.Conn.t()

Link to this function

get_parsed_config(name \\ "") View Source
get_parsed_config(String.t() | atom()) :: String.t()

Get the configuration for the conn.

Link to this function

to_asset_address(itx) View Source
to_asset_address(map()) :: String.t()

Generate address for asset. We only use itx.data to generate asset address. Thus same itx.data would be treated as duplicate asset.

Link to this function

to_delegate_address(addr1, addr2) View Source
to_delegate_address(String.t(), String.t()) :: String.t()

Generate delegation address. Use sender's address + receiver's address as pseudo public key. Use ed25519 as pseudo key type. Use sha3 and base58 by default.

Convert datetime or iso8601 datetime string to google protobuf timestamp.

Link to this function

to_stake_address(addr1, addr2) View Source
to_stake_address(String.t(), String.t()) :: String.t()

Generate stake address. Use sender's address + receiver's address as pseudo public key. Use ed25519 as pseudo key type. Use sha3 and base58 by default.

Link to this function

to_swap_address(hash) View Source
to_swap_address(String.t()) :: String.t()

Link to this function

to_tether_address(hash) View Source
to_tether_address(String.t()) :: String.t()

Link to this function

to_tx_address(itx) View Source
to_tx_address(map()) :: String.t()

Generate address for tx.

Link to this function

token_to_unit(n, name \\ "") View Source

Link to this function

unit_to_token(v, name \\ "") View Source