Module

Ctl.Internal.QueryM.Ogmios.Mempool.JsonRpc2

Provides basics types and operations for working with JSON RPC protocol used by Ogmios

#JsonRpc2Call

newtype JsonRpc2Call (i :: Type) (o :: Type)

A wrapper for tying arguments and response types to request building.

#JsonRpc2Request

type JsonRpc2Request (a :: Type) = { id :: String, jsonrpc :: String, method :: String, params :: a }

Structure of all json rpc2.0 websocket requests

#buildRequest

buildRequest :: forall (i :: Type) (o :: Type). JsonRpc2Call i o -> i -> Effect { body :: Aeson, id :: String }

Create a JsonRpc2 request body and id

#mkCallType

mkCallType :: forall (a :: Type) (i :: Type) (o :: Type). EncodeAeson (JsonRpc2Request a) => { jsonrpc :: String } -> { method :: String, params :: i -> a } -> JsonRpc2Call i o

Creates a "jsonrpc call" which ties together request input and response output types along with a way to create a request object.

#parseJsonRpc2ResponseId

parseJsonRpc2ResponseId :: Aeson -> Either JsonDecodeError String

Parse just ID from the response

Modules