web3-0.5.4.0: Ethereum API for Haskell

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

Network.Ethereum.Web3.Contract

Description

Ethereum contract generalized interface, e.g. event function catch all event depend by given callback function type.

runWeb3 $ do
    event "0x..." $ (MyEvent a b c) ->
        liftIO $ print (a + b * c))

In other case call function used for constant calls (without transaction creation and change state), and sendTx function like a call but return no contract method return but created transaction hash.

runweb3 $ do
  x  <- call "0x.." Latest MySelector
  tx <- sendTx "0x.." nopay $ MySelector2 (x + 2)

Synopsis

Documentation

data EventAction Source #

Event callback control response

Constructors

ContinueEvent

Continue to listen events

TerminateEvent

Terminate event listener

class ABIEncoding a => Method a where Source #

Contract method caller

Methods

sendTx :: (Provider p, Unit b) => Address -> b -> a -> Web3 p TxHash Source #

Send a transaction for given contract Address, value and input data

call :: (Provider p, ABIEncoding b) => Address -> CallMode -> a -> Web3 p b Source #

Constant call given contract Address in mode and given input data

Instances

class ABIEncoding a => Event a where Source #

Contract event listener

Minimal complete definition

eventFilter

Methods

eventFilter :: a -> Address -> Filter Source #

Event filter structure used by low-level subscription methods

event :: Provider p => Address -> (a -> Web3 p EventAction) -> Web3 p ThreadId Source #

Start an event listener for given contract Address and callback

data NoMethod Source #

Dummy method for sending transaction without method call

Constructors

NoMethod 

nopay :: Wei Source #

Zero value is used to send transaction without money