EosjsAuthWrapper (EosjsAuthWrapper v0.1.6) View Source

API for invoking EOSJS-ECC functions

Link to this section Summary

Functions

Fetch account associated with the public key.

Fetch account info.

Generate signature.

Verify signature.

Link to this section Functions

Link to this function

get_account_from_pub_key(pub_key)

View Source

Fetch account associated with the public key.

Returns {:ok, %{"ok" => %{"account_names" => ["nertnertn123"]}}}

Examples

iex> EosjsAuthWrapper.get_account_from_pub_key("some_valid_pub_key")
{:ok, %{"ok" => %{"account_names" => ["nertnertn123"]}}}
Link to this function

get_account_info(account)

View Source

Fetch account info.

Returns {:ok, %{"ok" => %{"account_name" => "nertnertn123", ...}}}

Examples

iex> EosjsAuthWrapper.get_account_info("testtest1234")
{:ok, %{"ok" => %{"account_name" => "nertnertn123", ...}}}

Generate signature.

Returns {:ok, %{"signature" => sign}}

Examples

iex> EosjsAuthWrapper.sign("this is a phrase", "some_valid_secret_key")
{:ok, %{"signature" => "SIG_K1_K9czKUnnXcrsVHoADF979AFMRfdq3h9pFZuR8Y5u7zHdVrXZLDwkvsP4fKkN2vPW1tHSNJP8eBjo23u4o31e809f2k"}}
Link to this function

verify(sign, phrase, pub_key)

View Source

Verify signature.

Returns {:ok, true}

Examples

iex> EosjsAuthWrapper.verify("some sighnature", "this is a phrase", "some_valid_pub_key")
{:ok, false}