web3-0.7.3.0: Ethereum API for Haskell

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

Network.Ethereum.Web3

Contents

Description

An Ethereum node offers a RPC interface. This interface gives Ðapp’s access to the Ethereum blockchain and functionality that the node provides, such as compiling smart contract code. It uses a subset of the JSON-RPC 2.0 specification (no support for notifications or named parameters) as serialisation protocol and is available over HTTP and IPC (unix domain sockets on linux/OSX and named pipe’s on Windows).

Web3 Haskell library currently use JSON-RPC over HTTP to access node functionality.

Synopsis

Monad as base of any Ethereum node communication

data Web3 a Source #

Any communication with Ethereum node wrapped with Web3 monad

Instances

Monad Web3 Source # 

Methods

(>>=) :: Web3 a -> (a -> Web3 b) -> Web3 b #

(>>) :: Web3 a -> Web3 b -> Web3 b #

return :: a -> Web3 a #

fail :: String -> Web3 a #

Functor Web3 Source # 

Methods

fmap :: (a -> b) -> Web3 a -> Web3 b #

(<$) :: a -> Web3 b -> Web3 a #

Applicative Web3 Source # 

Methods

pure :: a -> Web3 a #

(<*>) :: Web3 (a -> b) -> Web3 a -> Web3 b #

liftA2 :: (a -> b -> c) -> Web3 a -> Web3 b -> Web3 c #

(*>) :: Web3 a -> Web3 b -> Web3 b #

(<*) :: Web3 a -> Web3 b -> Web3 a #

MonadIO Web3 Source # 

Methods

liftIO :: IO a -> Web3 a #

MonadThrow Web3 Source # 

Methods

throwM :: Exception e => e -> Web3 a #

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

Methods

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

MonadReader (ServerUri, Manager) Web3 Source # 

Methods

ask :: Web3 (ServerUri, Manager) #

local :: ((ServerUri, Manager) -> (ServerUri, Manager)) -> Web3 a -> Web3 a #

reader :: ((ServerUri, Manager) -> a) -> Web3 a #

runWeb3 :: MonadIO m => Web3 a -> m (Either Web3Error a) Source #

Web3 runner for default provider

Basic transaction sending

sendTx Source #

Arguments

:: Method a 
=> Call

Call configuration

-> a

method data

-> Web3 Hash 

sendTx is used to submit a state changing transaction.

data Call Source #

The contract call params.

Constructors

Call 

Fields

  • callFrom :: !(Maybe Address)

    DATA, 20 Bytes - The address the transaction is send from.

  • callTo :: !(Maybe Address)

    DATA, 20 Bytes - (optional when creating new contract) The address the transaction is directed to.

  • callGas :: !(Maybe Quantity)

    QUANTITY - (optional, default: 3000000) Integer of the gas provided for the transaction execution. It will return unused gas.

  • callGasPrice :: !(Maybe Quantity)

    QUANTITY - (optional, default: To-Be-Determined) Integer of the gasPrice used for each paid gas.

  • callValue :: !(Maybe Quantity)

    QUANTITY - (optional) Integer of the value sent with this transaction.

  • callData :: !(Maybe Bytes)

    DATA - The compiled code of a contract OR the hash of the invoked method signature and encoded parameters.

  • callNonce :: !(Maybe Quantity)

    QUANTITY - (optional) Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce.

Instances

Eq Call Source # 

Methods

(==) :: Call -> Call -> Bool #

(/=) :: Call -> Call -> Bool #

Show Call Source # 

Methods

showsPrec :: Int -> Call -> ShowS #

show :: Call -> String #

showList :: [Call] -> ShowS #

Generic Call Source # 

Associated Types

type Rep Call :: * -> * #

Methods

from :: Call -> Rep Call x #

to :: Rep Call x -> Call #

ToJSON Call Source # 
FromJSON Call Source # 
Default Call Source # 

Methods

def :: Call #

type Rep Call Source # 

Basic event listening

data EventAction Source #

Event callback control response

Constructors

ContinueEvent

Continue to listen events

TerminateEvent

Terminate event listener

event :: DecodeEvent i ni e => Filter e -> (e -> ReaderT Change Web3 EventAction) -> Web3 (Async ()) Source #

Run 'event\'' one block at a time.

event' :: DecodeEvent i ni e => Filter e -> (e -> ReaderT Change Web3 EventAction) -> Web3 () Source #

Same as event, but does not immediately spawn a new thread.

Primitive data types

Metric unit system