EosjsAuthWrapper (EosjsAuthWrapper v0.1.7) 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
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"]}}}
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"}}
Verify signature.
Returns {:ok, true}
Examples
iex> EosjsAuthWrapper.verify("some sighnature", "this is a phrase", "some_valid_pub_key")
{:ok, false}