View Source Kadena.Chainweb.Type behaviour (Kadena v0.19.0)

Specifies the contracts to build the Chainweb types for endpoints.

Link to this section Summary

Link to this section Types

@type attrs() :: map() | struct() | Keyword.t() | list() | String.t()
@type error() :: {:error, Keyword.t()}
@type json() :: String.t()
@type resource() :: struct()

Link to this section Callbacks

@callback new(attrs()) :: resource() | error()
Link to this callback

to_json!(resource)

View Source (optional)
@callback to_json!(resource()) :: json()