OpenNodex v0.3.6 OpenNodex.Event View Source

Documentation for OpenNodex.Event.

Link to this section Summary

Functions

Checks the validity of the order hash for the event and api_key

Convenience method to convert a map to an %Event{}

Computes the order hash (in base 16) for the event and api_key

Link to this section Functions

Link to this function

check_validity(event, api_key) View Source

Checks the validity of the order hash for the event and api_key.

## Examples

  iex> event = %OpenNodex.Event{
  ...>   id: "abbacadabba-d123-456a-baba-99bfdcfb16a1",
  ...>   hashed_order: "df873d17dd8b6335db232ed1c242d4df91b0dbe3b3f2baba67e7d38c43b8370c"
  ...> }
  iex> OpenNodex.Event.check_validity(event, "abbacadabba")
  true

Convenience method to convert a map to an %Event{}.

Link to this function

order_hash(event, api_key) View Source

Computes the order hash (in base 16) for the event and api_key.

Examples

iex> event = %OpenNodex.Event{id: "abbacadabba-d123-456a-baba-99bfdcfb16a1"}
iex> OpenNodex.Event.order_hash(event, "abbacadabba")
"df873d17dd8b6335db232ed1c242d4df91b0dbe3b3f2baba67e7d38c43b8370c"