ForgeSdk v1.1.4 ForgeSdk.Rpc View Source

The very simple version of the RPC

Link to this section Summary

Functions

Allow user to checkin to get reward

Retrieve Chain information

Retrieve the nonce for an address, usually used for filling the nonce field of a Tx

Supported optionas:

  • type: ForgeAbi.WalletType
  • moniker: The moniker for the wallet to create.
  • issuer: The address of the issuer

Allow user to refuel

Subscribe to a specific topic. User must first create their own channel for this

Link to this section Functions

Link to this function

account_migrate(itx, opts) View Source

Link to this function

acquire_asset(itx, opts) View Source

Link to this function

approve_withdraw(itx, opts) View Source

Link to this function

checkin(opts) View Source
checkin(Keyword.t()) :: String.t() | {:error, term()}

Allow user to checkin to get reward

Link to this function

create_asset_factory(moniker, factory, opts) View Source
create_asset_factory(String.t(), map(), Keyword.t()) :: String.t()

Allow create asset factory

Link to this function

create_wallet(req, conn_name \\ "") View Source
create_wallet(Keyword.t(), String.t() | atom()) ::
  ForgeAbi.WalletInfo.t() | {:error, term()}

Link to this function

declare_node(req, name \\ "", opts \\ []) View Source
declare_node(ForgeAbi.RequestDeclareNode.t(), String.t() | atom(), Keyword.t()) ::
  ForgeAbi.WalletInfo.t() | {:error, term()}

Link to this function

deposit_token(itx, opts) View Source

Link to this function

finalize_consume_asset(tx, opts) View Source
finalize_consume_asset(ForgeAbi.Transaction.t(), Keyword.t()) ::
  {:error, any()} | ForgeAbi.Transaction.t()

Link to this function

finalize_create_wallet(tx, opts) View Source
finalize_create_wallet(ForgeAbi.Transaction.t(), Keyword.t()) ::
  {:error, any()} | ForgeAbi.Transaction.t()

Link to this function

finalize_declare(tx, opts) View Source
finalize_declare(ForgeAbi.Transaction.t(), Keyword.t()) ::
  {:error, any()} | ForgeAbi.Transaction.t()

Link to this function

finalize_declare_node(tx, opts) View Source
finalize_declare_node(ForgeAbi.Transaction.t(), Keyword.t()) ::
  {:error, any()} | ForgeAbi.Transaction.t()

Link to this function

finalize_exchange(tx, opts) View Source
finalize_exchange(ForgeAbi.Transaction.t(), Keyword.t()) ::
  {:error, any()} | ForgeAbi.Transaction.t()

Link to this function

finalize_revoke_withdraw(tx, opts) View Source
finalize_revoke_withdraw(ForgeAbi.Transaction.t(), Keyword.t()) ::
  {:error, any()} | ForgeAbi.Transaction.t()

Link to this function

finalize_withdraw_token(tx, opts) View Source
finalize_withdraw_token(ForgeAbi.Transaction.t(), Keyword.t()) ::
  {:error, any()} | ForgeAbi.Transaction.t()

Link to this function

get_account_state(reqs, name \\ "", opts \\ []) View Source

Link to this function

get_address(hash) View Source
get_address(String.t()) :: String.t() | nil

Link to this function

get_asset_state(reqs, name \\ "", opts \\ []) View Source

Link to this function

get_block(reqs, name \\ "", opts \\ []) View Source

Link to this function

get_blocks(req, name \\ "", opts \\ []) View Source

Link to this function

get_chain_info(name \\ "", opts \\ []) View Source
get_chain_info(String.t() | atom(), Keyword.t()) ::
  ForgeAbi.ChainInfo.t() | {:error, term()}

Retrieve Chain information.

iex> ForgeSdk.get_chain_info() %ForgeAbi.ChainInfo{

address: "DC3ACE418CBD079C564E4D511EE55558B8D67DB3",
app_hash: "1DC64B35F1E539798E722E87270678F7D0B2EA2E046938F0384F4D4D0D73EA56",
block_hash: "155E0733D724AC9814261DEB8E039E1F11048C2635A62F4E84B65D77A94BCCF3",
block_height: 6,
block_time: %Google.Protobuf.Timestamp{nanos: 0, seconds: 1545964437},
id: "335edc03d91161caff9267a107a213cbabb954eb",
moniker: "forge",
network: "1",
synced: true,
version: "0.27.3",
voting_power: 10

}

Link to this function

get_config(req, name \\ "", opts \\ []) View Source
get_config(
  ForgeAbi.RequestGetConfig.t() | Keyword.t(),
  String.t() | atom(),
  Keyword.t()
) :: String.t() | {:error, term()}

Link to this function

get_delegate_state(reqs, name \\ "", opts \\ []) View Source

Link to this function

get_forge_state(name \\ "", opts \\ []) View Source
get_forge_state(String.t() | atom(), Keyword.t()) ::
  ForgeAbi.ForgeState.t() | {:error, term()}

Link to this function

get_forge_stats(req, name \\ "", opts \\ []) View Source
get_forge_stats(
  ForgeAbi.RequestGetForgeStats.t() | Keyword.t(),
  String.t() | atom(),
  Keyword.t()
) :: ForgeAbi.ForgeStats.t() | {:error, term()}

Link to this function

get_health_status(req, name \\ "", opts \\ []) View Source
get_health_status(map() | Keyword.t(), String.t() | atom(), Keyword.t()) ::
  ForgeAbi.HealthStatus.t() | {:error, term()}

Link to this function

get_net_info(name \\ "", opts \\ []) View Source
get_net_info(String.t() | atom(), Keyword.t()) ::
  ForgeAbi.NetInfo.t() | {:error, term()}

Link to this function

get_node_info(name \\ "", opts \\ []) View Source
get_node_info(String.t() | atom(), Keyword.t()) ::
  ForgeAbi.NodeInfo.t() | {:error, term()}

Link to this function

get_nonce(address, name \\ "", app_hash \\ "") View Source
get_nonce(String.t(), String.t() | atom(), String.t()) :: non_neg_integer()

Retrieve the nonce for an address, usually used for filling the nonce field of a Tx.

Link to this function

get_swap_state(reqs, name \\ "", opts \\ []) View Source

Link to this function

get_swap_statistics(req, name \\ "", opts \\ []) View Source
get_swap_statistics(
  ForgeAbi.RequestGetSwapStatistics.t() | Keyword.t(),
  String.t() | atom(),
  Keyword.t()
) :: ForgeAbi.SwapStatistics | {:error, term()}

Link to this function

get_unconfirmed_txs(req, name \\ "", opts \\ []) View Source

Link to this function

get_validators_info(name \\ "", opts \\ []) View Source
get_validators_info(String.t() | atom(), Keyword.t()) ::
  ForgeAbi.ValidatorsInfo.t() | {:error, term()}

Link to this function

list_account(req, name \\ "", opts \\ []) View Source
list_account(
  ForgeAbi.RequestListAccount.t() | Keyword.t(),
  String.t() | atom(),
  Keyword.t()
) :: ForgeAbi.IndexedAccountState.t() | nil | {:error, term()}

Link to this function

list_asset_transactions(req, name \\ "", opts \\ []) View Source

Link to this function

list_assets(req, name \\ "", opts \\ []) View Source

Link to this function

list_blocks(req, name \\ "", opts \\ []) View Source

Link to this function

list_swap(req, name \\ "", opts \\ []) View Source

Link to this function

list_top_accounts(req, name \\ "", opts \\ []) View Source

Link to this function

list_transactions(req, name \\ "", opts \\ []) View Source

Link to this function

multisig(req, conn_name \\ "") View Source
multisig(Keyword.t(), String.t()) :: ForgeAbi.Transaction.t() | {:error, term()}

Link to this function

prepare_consume_asset(itx, opts) View Source

Link to this function

prepare_create_wallet(req, conn_name \\ "") View Source
prepare_create_wallet(Keyword.t(), String.t() | atom()) ::
  {ForgeAbi.WalletInfo.t(), ForgeAbi.Transaction.t()} | {:error, term()}

Supported optionas:

  • type: ForgeAbi.WalletType
  • moniker: The moniker for the wallet to create.
  • issuer: The address of the issuer.
Link to this function

prepare_declare(itx, opts) View Source

Link to this function

prepare_declare_node(req, name \\ "", opts \\ []) View Source

Link to this function

prepare_exchange(itx, opts) View Source

Link to this function

prepare_revoke_withdraw(itx, opts) View Source

Link to this function

prepare_withdraw_token(itx, opts) View Source

Link to this function

refuel(opts) View Source
refuel(Keyword.t()) :: String.t() | {:error, term()}

Allow user to refuel

Link to this function

retrieve_swap(itx, opts) View Source

Link to this function

revoke_delegate(itx, opts) View Source

Link to this function

search(req, name \\ "", opts \\ []) View Source
search(
  ForgeAbi.RequestSearch.t() | Keyword.t(),
  String.t() | atom(),
  Keyword.t()
) :: [ForgeAbi.Transaction.t()] | {:error, term()}

Link to this function

send_tx(req, name \\ "", opts \\ []) View Source
send_tx(
  ForgeAbi.RequestSendTx.t() | Keyword.t(),
  String.t() | atom(),
  Keyword.t()
) :: String.t() | {:error, term()}

Link to this function

subscribe(req, name \\ "", opts \\ []) View Source

Subscribe to a specific topic. User must first create their own channel for this.

iex> conn = ForgeSdk.get_conn() iex> req = RequestSubscribe.new() iex> stream = ForgeSdk.subscribe(req, conn) iex> Enum.take(stream, 1) # this will return the topic id of the subscription

Link to this function

unsubscribe(req, name \\ "", opts \\ []) View Source

Link to this function

update_consensus_params(itx, opts) View Source

Link to this function

update_validator(itx, opts) View Source