ForgeSdk v1.0.6 ForgeSdk.Rpc View Source
The very simple version of the RPC
Link to this section Summary
Functions
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
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
activate_protocol(itx, opts) View Source
Link to this function
approve_withdraw(itx, opts) View Source
Link to this function
checkin(opts) View Source
Link to this function
create_asset(itx, opts) View Source
Link to this function
create_asset_factory(moniker, factory, opts) View Source
Link to this function
create_wallet(req, conn_name \\ "")
View Source
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()}
Link to this function
deactivate_protocol(itx, opts) View Source
Link to this function
declare(itx, opts) View Source
Link to this function
declare_node(req, name \\ "", 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()}
Link to this function
delegate(itx, opts) View Source
Link to this function
deploy_protocol(itx, opts) View Source
Link to this function
deposit_token(itx, opts) View Source
Link to this function
finalize_consume_asset(tx, opts) View Source
Link to this function
finalize_create_wallet(tx, opts)
View Source
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()
Link to this function
finalize_declare(tx, opts) View Source
Link to this function
finalize_declare_node(tx, opts)
View Source
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()
Link to this function
finalize_exchange(tx, opts) View Source
Link to this function
finalize_revoke_withdraw(itx, opts) View Source
Link to this function
finalize_withdraw_token(itx, opts) View Source
Link to this function
get_account_state(reqs, name \\ "", opts \\ [])
View Source
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()}
Link to this function
get_address(hash) View Source
Link to this function
get_asset_state(reqs, name \\ "", opts \\ [])
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()}
Link to this function
get_block(reqs, name \\ "", opts \\ [])
View Source
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()}
Link to this function
get_blocks(req, name \\ "", opts \\ [])
View Source
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()}
Link to this function
get_chain_info(name \\ "", opts \\ [])
View Source
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
}
Link to this function
get_config(req, name \\ "", opts \\ []) View Source
Link to this function
get_delegate_state(reqs, 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()}
Link to this function
get_forge_state(name \\ "", opts \\ [])
View Source
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()}
Link to this function
get_forge_stats(req, name \\ "", opts \\ [])
View Source
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()}
Link to this function
get_health_status(req, name \\ "", opts \\ []) View Source
Link to this function
get_net_info(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()}
Link to this function
get_node_info(name \\ "", opts \\ [])
View Source
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()}
Link to this function
get_nonce(address, name \\ "", app_hash \\ "")
View Source
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.
Link to this function
get_protocol_state(reqs, name \\ "", opts \\ [])
View Source
get_protocol_state(reqs, name \\ "", opts \\ [])
View Source
get_protocol_state(
ForgeAbi.RequestGetProtocolState.t()
| [ForgeAbi.RequestGetProtocolState.t()]
| Keyword.t()
| [Keyword.t()],
String.t() | atom(),
Keyword.t()
) ::
ForgeAbi.ProtocolState.t() | [ForgeAbi.ProtocolState.t()] | {:error, term()}
get_protocol_state( ForgeAbi.RequestGetProtocolState.t() | [ForgeAbi.RequestGetProtocolState.t()] | Keyword.t() | [Keyword.t()], String.t() | atom(), Keyword.t() ) :: ForgeAbi.ProtocolState.t() | [ForgeAbi.ProtocolState.t()] | {:error, term()}
Link to this function
get_stake_state(reqs, name \\ "", opts \\ [])
View Source
get_stake_state(reqs, name \\ "", opts \\ [])
View Source
get_stake_state(
ForgeAbi.RequestGetStakeState.t()
| [ForgeAbi.RequestGetStakeState.t()]
| Keyword.t()
| [Keyword.t()],
String.t() | atom(),
Keyword.t()
) :: ForgeAbi.StakeState.t() | [ForgeAbi.StakeState.t()] | {:error, term()}
get_stake_state( ForgeAbi.RequestGetStakeState.t() | [ForgeAbi.RequestGetStakeState.t()] | Keyword.t() | [Keyword.t()], String.t() | atom(), Keyword.t() ) :: ForgeAbi.StakeState.t() | [ForgeAbi.StakeState.t()] | {:error, term()}
Link to this function
get_swap_state(reqs, name \\ "", opts \\ [])
View Source
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()}
Link to this function
get_swap_statistics(req, name \\ "", opts \\ []) View Source
Link to this function
get_tx(reqs, 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()}
Link to this function
get_unconfirmed_txs(req, name \\ "", opts \\ [])
View Source
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()}
Link to this function
get_validators_info(name \\ "", opts \\ [])
View Source
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()}
Link to this function
list_account(req, name \\ "", opts \\ [])
View Source
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()}
Link to this function
list_asset_transactions(req, name \\ "", opts \\ [])
View Source
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()}
Link to this function
list_assets(req, name \\ "", opts \\ [])
View Source
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()}
Link to this function
list_blocks(req, name \\ "", opts \\ [])
View Source
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()}
Link to this function
list_stakes(req, name \\ "", opts \\ [])
View Source
list_stakes(req, name \\ "", opts \\ [])
View Source
list_stakes(
ForgeAbi.RequestListStakes.t() | Keyword.t(),
String.t() | atom(),
Keyword.t()
) ::
{[ForgeAbi.IndexedStakeState.t()], ForgeAbi.PageInfo.t()} | {:error, term()}
list_stakes( ForgeAbi.RequestListStakes.t() | Keyword.t(), String.t() | atom(), Keyword.t() ) :: {[ForgeAbi.IndexedStakeState.t()], ForgeAbi.PageInfo.t()} | {:error, term()}
Link to this function
list_swap(req, name \\ "", opts \\ [])
View Source
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()}
Link to this function
list_top_accounts(req, name \\ "", opts \\ [])
View Source
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()}
Link to this function
list_transactions(req, name \\ "", opts \\ [])
View Source
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()}
Link to this function
multisig(req, conn_name \\ "")
View Source
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()}
Link to this function
poke(itx, opts) View Source
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(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.
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
Link to this function
refuel(itx, opts) View Source
Link to this function
retrieve_swap(itx, opts) View Source
Link to this function
revoke_delegate(itx, opts) View Source
Link to this function
revoke_swap(itx, opts) View Source
Link to this function
search(req, name \\ "", 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()}
Link to this function
send_tx(req, name \\ "", opts \\ []) View Source
Link to this function
setup_swap(itx, opts) View Source
Link to this function
stake(itx, opts) View Source
Link to this function
stake_for_node(address, value, opts) View Source
Link to this function
subscribe(req, name \\ "", 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
Link to this function
transfer(itx, opts) View Source
Link to this function
unsubscribe(req, name \\ "", 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()}
Link to this function
update_asset(itx, opts) View Source
Link to this function
update_validator(itx, opts) View Source
Link to this function