View Source DiodeClient.Wallet (Diode Client v1.3.0)

Representation of an Ethereum Wallet. This struct can hold keys in three levels of completeness

  1. Full key (including private key, public key and address)
  2. Public Key (including public key and address)
  3. Address (only the 20 byte Ethereum address)

A wallet can be instantiated from any of those, but accessors for higher level components will fail when the data is not available

Summary

Types

address()

@type address() :: <<_::160>>

compressed_public_key()

@type compressed_public_key() :: <<_::264>>

private_key()

@type private_key() :: <<_::256>>

t()

@type t() ::
  {:wallet, privkey :: nil | <<_::256>>, pubkey :: nil | <<_::264>>,
   address :: <<_::160>>}

Functions

address(address)

@spec address(t()) :: {:error, nil} | {:ok, <<_::160>>}

address!(wallet)

@spec address!(t()) :: <<_::160>>

base16(wallet)

equal?(a, b)

from_address(address)

@spec from_address(<<_::160>> | integer()) :: t()

from_privkey(privkey)

@spec from_privkey(<<_::256>> | integer()) :: t()

from_pubkey(pubkey)

@spec from_pubkey(<<_::264>>) :: t()

new()

@spec new() :: t()

nick(wallet)

printable(wallet)

privkey(key)

privkey!(wallet)

privkey?(arg)

pubkey(arg)

pubkey!(wallet)

pubkey_long(arg)

pubkey_long!(wallet)

sign(wallet, msg, algo \\ :sha)

verify(wallet, msg, signature, algo \\ :sha)

wallet(args \\ [])

(macro)

wallet(record, args)

(macro)