web3-0.9.0.0: Web3 API for Haskell.

CopyrightAlexander Krupenkin 2016-2018
LicenseBSD3
Maintainermail@akru.me
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Network.JsonRpc.TinyClient

Contents

Description

Tiny JSON-RPC 2.0 client. Functions for implementing the client side of JSON-RPC 2.0. See http://www.jsonrpc.org/specification.

If you have monad with MonadIO, MonadThrow and MonadReader instances, it can be used as base for JSON-RPC calls.

Example:

  newtype MyMonad a = ...

  instance JsonRpc MyMonad

  foo :: Mymonad Text
  foo = remote "foo"

Arguments of function are stored into params request array.

Example:

  myMethod :: JsonRpc m => Int -> Bool -> m String
  myMethod = remote "myMethod"
Synopsis

The JSON-RPC remote call monad

class JsonRpcM m => JsonRpc m where Source #

JSON-RPC call monad.

Minimal complete definition

Nothing

Methods

remote :: Remote m a => MethodName -> a Source #

Remote call of JSON-RPC method.

Instances
JsonRpc Web3 Source # 
Instance details

Defined in Network.Web3.Provider

Methods

remote :: Remote Web3 a => MethodName -> a Source #

type MethodName = Text Source #

Name of called method.

JSON-RPC client settings

data JsonRpcClient Source #

JSON-RPC client state vars.

Constructors

JsonRpcHttpClient 

Fields

JsonRpcWsClient 

Fields

defaultSettings Source #

Arguments

:: MonadIO m 
=> String

JSON-RPC server URI

-> m JsonRpcClient 

Create default JsonRpcClient settings.

Error handling

data RpcError Source #

JSON-RPC error message

Constructors

RpcError 

Fields

Instances
Eq RpcError Source # 
Instance details

Defined in Network.JsonRpc.TinyClient

Show RpcError Source # 
Instance details

Defined in Network.JsonRpc.TinyClient

FromJSON RpcError Source # 
Instance details

Defined in Network.JsonRpc.TinyClient