web3-0.7.0.0: Ethereum API for Haskell

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

Network.JsonRpc.TinyClient

Description

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

Synopsis

Documentation

data RpcError Source #

JSON-RPC error message

Constructors

RpcError 

Fields

type MethodName = Text Source #

Name of called method.

type ServerUri = String Source #

JSON-RPC server URI

class (MonadIO m, MonadThrow m, MonadReader Config m) => Remote m a | a -> m Source #

Typeclass for JSON-RPC monad base.

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 Remote MyMonad (Mymonad a)

  foo :: Int -> Bool -> Mymonad Text
  foo = remote "foo"

Instances

FromJSON a => Remote Web3 (Web3 a) Source # 

Methods

remote_ :: ([Value] -> Web3 ByteString) -> Web3 a

(ToJSON a, Remote m b) => Remote m (a -> b) Source # 

Methods

remote_ :: ([Value] -> m ByteString) -> a -> b

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

Remote call of JSON-RPC method.

Arguments of function are stored into params request array.

Example:

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