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
Allow create asset factory
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
account_migrate(itx, opts) View Source
acquire_asset(itx, opts) View Source
approve_withdraw(itx, opts) View Source
checkin(opts) View Source
Allow user to checkin to get reward
create_asset(itx, opts) View Source
create_asset_factory(moniker, factory, opts) View Source
Allow create asset factory
create_wallet(req, conn_name \\ "")
View Source
create_wallet(Keyword.t(), String.t() | atom()) ::
ForgeAbi.WalletInfo.t() | {:error, term()}
create_wallet(Keyword.t(), String.t() | atom()) :: ForgeAbi.WalletInfo.t() | {:error, term()}
declare(itx, opts) View Source
declare_node(req, name \\ "", opts \\ [])
View Source
declare_node(ForgeAbi.RequestDeclareNode.t(), String.t() | atom(), Keyword.t()) ::
ForgeAbi.WalletInfo.t() | {:error, term()}
declare_node(ForgeAbi.RequestDeclareNode.t(), String.t() | atom(), Keyword.t()) :: ForgeAbi.WalletInfo.t() | {:error, term()}
delegate(itx, opts) View Source
deposit_token(itx, opts) View Source
finalize_consume_asset(tx, opts)
View Source
finalize_consume_asset(ForgeAbi.Transaction.t(), Keyword.t()) ::
{:error, any()} | ForgeAbi.Transaction.t()
finalize_consume_asset(ForgeAbi.Transaction.t(), Keyword.t()) :: {:error, any()} | ForgeAbi.Transaction.t()
finalize_create_wallet(tx, opts)
View Source
finalize_create_wallet(ForgeAbi.Transaction.t(), Keyword.t()) ::
{:error, any()} | ForgeAbi.Transaction.t()
finalize_create_wallet(ForgeAbi.Transaction.t(), Keyword.t()) :: {:error, any()} | ForgeAbi.Transaction.t()
finalize_declare(tx, opts)
View Source
finalize_declare(ForgeAbi.Transaction.t(), Keyword.t()) ::
{:error, any()} | ForgeAbi.Transaction.t()
finalize_declare(ForgeAbi.Transaction.t(), Keyword.t()) :: {:error, any()} | ForgeAbi.Transaction.t()
finalize_declare_node(tx, opts)
View Source
finalize_declare_node(ForgeAbi.Transaction.t(), Keyword.t()) ::
{:error, any()} | ForgeAbi.Transaction.t()
finalize_declare_node(ForgeAbi.Transaction.t(), Keyword.t()) :: {:error, any()} | ForgeAbi.Transaction.t()
finalize_exchange(tx, opts)
View Source
finalize_exchange(ForgeAbi.Transaction.t(), Keyword.t()) ::
{:error, any()} | ForgeAbi.Transaction.t()
finalize_exchange(ForgeAbi.Transaction.t(), Keyword.t()) :: {:error, any()} | ForgeAbi.Transaction.t()
finalize_revoke_withdraw(tx, opts)
View Source
finalize_revoke_withdraw(ForgeAbi.Transaction.t(), Keyword.t()) ::
{:error, any()} | ForgeAbi.Transaction.t()
finalize_revoke_withdraw(ForgeAbi.Transaction.t(), Keyword.t()) :: {:error, any()} | ForgeAbi.Transaction.t()
finalize_withdraw_token(tx, opts)
View Source
finalize_withdraw_token(ForgeAbi.Transaction.t(), Keyword.t()) ::
{:error, any()} | ForgeAbi.Transaction.t()
finalize_withdraw_token(ForgeAbi.Transaction.t(), Keyword.t()) :: {:error, any()} | ForgeAbi.Transaction.t()
get_account_state(reqs, name \\ "", opts \\ [])
View Source
get_account_state(
ForgeAbi.RequestGetAccountState.t()
| [ForgeAbi.RequestGetAccountState.t()]
| Keyword.t()
| [Keyword.t()],
String.t() | atom(),
Keyword.t()
) ::
ForgeAbi.AccountState.t()
| nil
| [ForgeAbi.AccountState.t()]
| {:error, term()}
get_account_state( ForgeAbi.RequestGetAccountState.t() | [ForgeAbi.RequestGetAccountState.t()] | Keyword.t() | [Keyword.t()], String.t() | atom(), Keyword.t() ) :: ForgeAbi.AccountState.t() | nil | [ForgeAbi.AccountState.t()] | {:error, term()}
get_address(hash) View Source
get_asset_state(reqs, name \\ "", opts \\ [])
View Source
get_asset_state(
ForgeAbi.RequestGetAssetState.t()
| [ForgeAbi.RequestGetAssetState.t()]
| Keyword.t()
| [Keyword.t()],
String.t() | atom(),
Keyword.t()
) :: ForgeAbi.AssetState.t() | [ForgeAbi.AssetState.t()] | {:error, term()}
get_asset_state( ForgeAbi.RequestGetAssetState.t() | [ForgeAbi.RequestGetAssetState.t()] | Keyword.t() | [Keyword.t()], String.t() | atom(), Keyword.t() ) :: ForgeAbi.AssetState.t() | [ForgeAbi.AssetState.t()] | {:error, term()}
get_block(reqs, name \\ "", opts \\ [])
View Source
get_block(
ForgeAbi.RequestGetBlock.t()
| [ForgeAbi.RequestGetBlock.t()]
| Keyword.t()
| [Keyword.t()],
String.t() | atom(),
Keyword.t()
) :: ForgeAbi.BlockInfo.t() | [ForgeAbi.BlockInfo.t()] | {:error, term()}
get_block( ForgeAbi.RequestGetBlock.t() | [ForgeAbi.RequestGetBlock.t()] | Keyword.t() | [Keyword.t()], String.t() | atom(), Keyword.t() ) :: ForgeAbi.BlockInfo.t() | [ForgeAbi.BlockInfo.t()] | {:error, term()}
get_blocks(req, name \\ "", opts \\ [])
View Source
get_blocks(
ForgeAbi.RequestGetBlocks.t() | Keyword.t(),
String.t() | atom(),
Keyword.t()
) :: {[ForgeAbi.BlockInfoSimple.t()], ForgeAbi.PageInfo.t()} | {:error, term()}
get_blocks( ForgeAbi.RequestGetBlocks.t() | Keyword.t(), String.t() | atom(), Keyword.t() ) :: {[ForgeAbi.BlockInfoSimple.t()], ForgeAbi.PageInfo.t()} | {:error, term()}
get_chain_info(name \\ "", opts \\ [])
View Source
get_chain_info(String.t() | atom(), Keyword.t()) ::
ForgeAbi.ChainInfo.t() | {:error, term()}
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
}
get_config(req, name \\ "", opts \\ []) View Source
get_delegate_state(reqs, name \\ "", opts \\ [])
View Source
get_delegate_state(
ForgeAbi.RequestGetDelegateState.t()
| [ForgeAbi.RequestGetDelegateState.t()]
| Keyword.t()
| [Keyword.t()],
String.t() | atom(),
Keyword.t()
) ::
ForgeAbi.DelegateState.t() | [ForgeAbi.DelegateState.t()] | {:error, term()}
get_delegate_state( ForgeAbi.RequestGetDelegateState.t() | [ForgeAbi.RequestGetDelegateState.t()] | Keyword.t() | [Keyword.t()], String.t() | atom(), Keyword.t() ) :: ForgeAbi.DelegateState.t() | [ForgeAbi.DelegateState.t()] | {:error, term()}
get_forge_state(name \\ "", opts \\ [])
View Source
get_forge_state(String.t() | atom(), Keyword.t()) ::
ForgeAbi.ForgeState.t() | {:error, term()}
get_forge_state(String.t() | atom(), Keyword.t()) :: ForgeAbi.ForgeState.t() | {:error, term()}
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()}
get_forge_stats( ForgeAbi.RequestGetForgeStats.t() | Keyword.t(), String.t() | atom(), Keyword.t() ) :: ForgeAbi.ForgeStats.t() | {:error, term()}
get_health_status(req, name \\ "", opts \\ []) View Source
get_net_info(name \\ "", opts \\ [])
View Source
get_net_info(String.t() | atom(), Keyword.t()) ::
ForgeAbi.NetInfo.t() | {:error, term()}
get_net_info(String.t() | atom(), Keyword.t()) :: ForgeAbi.NetInfo.t() | {:error, term()}
get_node_info(name \\ "", opts \\ [])
View Source
get_node_info(String.t() | atom(), Keyword.t()) ::
ForgeAbi.NodeInfo.t() | {:error, term()}
get_node_info(String.t() | atom(), Keyword.t()) :: ForgeAbi.NodeInfo.t() | {:error, term()}
get_nonce(address, name \\ "", app_hash \\ "")
View Source
get_nonce(String.t(), String.t() | atom(), String.t()) :: non_neg_integer()
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.
get_swap_state(reqs, name \\ "", opts \\ [])
View Source
get_swap_state(
ForgeAbi.RequestGetSwapState.t()
| [ForgeAbi.RequestGetSwapState.t()]
| Keyword.t()
| [Keyword.t()],
String.t() | atom(),
Keyword.t()
) :: ForgeAbi.SwapState.t() | [ForgeAbi.SwapState.t()] | {:error, term()}
get_swap_state( ForgeAbi.RequestGetSwapState.t() | [ForgeAbi.RequestGetSwapState.t()] | Keyword.t() | [Keyword.t()], String.t() | atom(), Keyword.t() ) :: ForgeAbi.SwapState.t() | [ForgeAbi.SwapState.t()] | {:error, term()}
get_swap_statistics(req, name \\ "", opts \\ []) View Source
get_tx(reqs, name \\ "", opts \\ [])
View Source
get_tx(
ForgeAbi.RequestGetTx.t()
| [ForgeAbi.RequestGetTx.t()]
| Keyword.t()
| [Keyword.t()],
String.t() | atom(),
Keyword.t()
) ::
ForgeAbi.TransactionInfo.t()
| [ForgeAbi.TransactionInfo.t()]
| {:error, term()}
get_tx( ForgeAbi.RequestGetTx.t() | [ForgeAbi.RequestGetTx.t()] | Keyword.t() | [Keyword.t()], String.t() | atom(), Keyword.t() ) :: ForgeAbi.TransactionInfo.t() | [ForgeAbi.TransactionInfo.t()] | {:error, term()}
get_unconfirmed_txs(req, name \\ "", opts \\ [])
View Source
get_unconfirmed_txs(
ForgeAbi.RequestGetUnconfirmedTxs.t() | Keyword.t(),
String.t() | atom(),
Keyword.t()
) :: {ForgeAbi.UnconfirmedTxs.t(), ForgeAbi.PageInfo.t()} | {:error, term()}
get_unconfirmed_txs( ForgeAbi.RequestGetUnconfirmedTxs.t() | Keyword.t(), String.t() | atom(), Keyword.t() ) :: {ForgeAbi.UnconfirmedTxs.t(), ForgeAbi.PageInfo.t()} | {:error, term()}
get_validators_info(name \\ "", opts \\ [])
View Source
get_validators_info(String.t() | atom(), Keyword.t()) ::
ForgeAbi.ValidatorsInfo.t() | {:error, term()}
get_validators_info(String.t() | atom(), Keyword.t()) :: ForgeAbi.ValidatorsInfo.t() | {:error, term()}
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()}
list_account( ForgeAbi.RequestListAccount.t() | Keyword.t(), String.t() | atom(), Keyword.t() ) :: ForgeAbi.IndexedAccountState.t() | nil | {:error, term()}
list_asset_transactions(req, name \\ "", opts \\ [])
View Source
list_asset_transactions(
ForgeAbi.RequestListAssetTransactions.t() | Keyword.t(),
String.t() | atom(),
Keyword.t()
) ::
{[ForgeAbi.IndexedTransaction.t()], ForgeAbi.PageInfo.t()} | {:error, term()}
list_asset_transactions( ForgeAbi.RequestListAssetTransactions.t() | Keyword.t(), String.t() | atom(), Keyword.t() ) :: {[ForgeAbi.IndexedTransaction.t()], ForgeAbi.PageInfo.t()} | {:error, term()}
list_assets(req, name \\ "", opts \\ [])
View Source
list_assets(
ForgeAbi.RequestListAssets.t() | Keyword.t(),
String.t() | atom(),
Keyword.t()
) ::
{[ForgeAbi.IndexedAssetState.t()], ForgeAbi.PageInfo.t()} | {:error, term()}
list_assets( ForgeAbi.RequestListAssets.t() | Keyword.t(), String.t() | atom(), Keyword.t() ) :: {[ForgeAbi.IndexedAssetState.t()], ForgeAbi.PageInfo.t()} | {:error, term()}
list_blocks(req, name \\ "", opts \\ [])
View Source
list_blocks(
ForgeAbi.RequestListBlocks.t() | Keyword.t(),
String.t() | atom(),
Keyword.t()
) :: {[ForgeAbi.IndexedBlock.t()], ForgeAbi.PageInfo.t()} | {:error, term()}
list_blocks( ForgeAbi.RequestListBlocks.t() | Keyword.t(), String.t() | atom(), Keyword.t() ) :: {[ForgeAbi.IndexedBlock.t()], ForgeAbi.PageInfo.t()} | {:error, term()}
list_swap(req, name \\ "", opts \\ [])
View Source
list_swap(
ForgeAbi.RequestListSwap.t() | Keyword.t(),
String.t() | atom(),
Keyword.t()
) :: {[ForgeAbi.SwapState.t()], ForgeAbi.PageInfo.t()} | {:error, term()}
list_swap( ForgeAbi.RequestListSwap.t() | Keyword.t(), String.t() | atom(), Keyword.t() ) :: {[ForgeAbi.SwapState.t()], ForgeAbi.PageInfo.t()} | {:error, term()}
list_top_accounts(req, name \\ "", opts \\ [])
View Source
list_top_accounts(
ForgeAbi.RequestListTopAccounts.t() | Keyword.t(),
String.t() | atom(),
Keyword.t()
) ::
{[ForgeAbi.IndexedAccountState.t()], ForgeAbi.PageInfo.t()} | {:error, term()}
list_top_accounts( ForgeAbi.RequestListTopAccounts.t() | Keyword.t(), String.t() | atom(), Keyword.t() ) :: {[ForgeAbi.IndexedAccountState.t()], ForgeAbi.PageInfo.t()} | {:error, term()}
list_transactions(req, name \\ "", opts \\ [])
View Source
list_transactions(
ForgeAbi.RequestListTransactions.t() | Keyword.t(),
String.t() | atom(),
Keyword.t()
) ::
{[ForgeAbi.IndexedTransaction.t()], ForgeAbi.PageInfo.t()} | {:error, term()}
list_transactions( ForgeAbi.RequestListTransactions.t() | Keyword.t(), String.t() | atom(), Keyword.t() ) :: {[ForgeAbi.IndexedTransaction.t()], ForgeAbi.PageInfo.t()} | {:error, term()}
multisig(req, conn_name \\ "")
View Source
multisig(Keyword.t(), String.t()) :: ForgeAbi.Transaction.t() | {:error, term()}
multisig(Keyword.t(), String.t()) :: ForgeAbi.Transaction.t() | {:error, term()}
poke(itx, opts) View Source
prepare_consume_asset(itx, opts) View Source
prepare_create_wallet(req, conn_name \\ "")
View Source
prepare_create_wallet(Keyword.t(), String.t() | atom()) ::
{ForgeAbi.WalletInfo.t(), ForgeAbi.Transaction.t()} | {:error, term()}
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.
prepare_declare(itx, opts) View Source
prepare_declare_node(req, name \\ "", opts \\ []) View Source
prepare_exchange(itx, opts) View Source
prepare_revoke_withdraw(itx, opts) View Source
prepare_withdraw_token(itx, opts) View Source
refuel(opts) View Source
Allow user to refuel
refuel(itx, opts) View Source
retrieve_swap(itx, opts) View Source
revoke_delegate(itx, opts) View Source
revoke_swap(itx, opts) View Source
search(req, name \\ "", opts \\ [])
View Source
search(
ForgeAbi.RequestSearch.t() | Keyword.t(),
String.t() | atom(),
Keyword.t()
) :: [ForgeAbi.Transaction.t()] | {:error, term()}
search( ForgeAbi.RequestSearch.t() | Keyword.t(), String.t() | atom(), Keyword.t() ) :: [ForgeAbi.Transaction.t()] | {:error, term()}
send_tx(req, name \\ "", opts \\ []) View Source
setup_swap(itx, opts) View Source
subscribe(req, name \\ "", opts \\ [])
View Source
subscribe(
ForgeAbi.RequestSubscribe.t() | Keyword.t(),
String.t() | atom(),
Keyword.t()
) :: [ForgeAbi.ResponseSubscribe.t()] | {:error, term()}
subscribe( ForgeAbi.RequestSubscribe.t() | Keyword.t(), String.t() | atom(), Keyword.t() ) :: [ForgeAbi.ResponseSubscribe.t()] | {:error, term()}
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
transfer(itx, opts) View Source
unsubscribe(req, name \\ "", opts \\ [])
View Source
unsubscribe(ForgeAbi.RequestUnsubscribe.t(), String.t() | atom(), Keyword.t()) ::
ForgeAbi.ResponseUnsubscribe.t() | {:error, term()}
unsubscribe(ForgeAbi.RequestUnsubscribe.t(), String.t() | atom(), Keyword.t()) :: ForgeAbi.ResponseUnsubscribe.t() | {:error, term()}