Forge v0.7.2 Forge.Wallet View Source

Wallet client

Link to this section Summary

Types

t()

Ethereum-compatible wallet. It contains keys as folows

Functions

Retrieve the current balance of the address

Retrieve the chain info

Retrieve the account info of the address

Create a new eth-like wallet

Retrieve the current nonce of the address

Transfer token from one address to another

Link to this section Types

Link to this type t() View Source
t() :: %{private_key: String.t(), public_key: String.t(), address: String.t()}

Ethereum-compatible wallet. It contains keys as folows:

  • :private_key: Base16 encoded private key.
  • :public_key: Base16 encoded public key.
  • :address: wallet address.

Link to this section Functions

Retrieve the current balance of the address

Link to this function chain_info() View Source
chain_info() :: map()

Retrieve the chain info

Link to this function info(address, app_hash \\ "") View Source
info(String.t(), String.t() | non_neg_integer()) :: Forge.AccountState.t() | nil

Retrieve the account info of the address

Link to this function load(address, passphrase) View Source
load(binary() | map() | any(), binary()) :: :error | t()

Create a new eth-like wallet

Retrieve the current nonce of the address

Link to this function save(wallet, passphrase) View Source
save(t(), binary()) :: :ok
Link to this function transfer(map, to, total) View Source
transfer(t(), String.t(), non_neg_integer()) :: :ok | {:error, any()}

Transfer token from one address to another