Forge v0.4.1 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) View Source
info(String.t()) :: Forge.AccountState.t()

Retrieve the account info of the address

Create a new eth-like wallet

Retrieve the current nonce of the address

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