View Source Yggdrasil.Subscriber.Adapter.Icon.Message (ICON 2.0 SDK v0.2.3)

This module defines functions to deal with ICON 2.0 websocket messages.

When a connection is established with the ICON 2.0 websocket, we need to send a text frame with a JSON payload to state our intention. There are two channels:

  • :block for receiving both ticks on every block and event logs specific to the events we're filtering.
  • :event for receiving updates for a specific event log.

Link to this section Summary

Types

t()

Message.

Functions

Decodes an incoming message from the ICON 2.0 websocket.

Encodes a request for the ICON 2.0 websocket. It receives the height and the channel to build the request.

Link to this section Types

Link to this section Functions

Link to this function

decode(channel, notification)

View Source
@spec decode(Yggdrasil.Channel.t(), map()) ::
  :ok | {:ok, [t()]} | {:error, Icon.Schema.Error.t()}

Decodes an incoming message from the ICON 2.0 websocket.

Encodes a request for the ICON 2.0 websocket. It receives the height and the channel to build the request.