web3-0.8.4.0: Ethereum API for Haskell

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

Network.Ethereum.Contract.TH

Contents

Description

Contract abstraction is a high level interface of web3 library.

The Application Binary Interface is the standard way to interact with contracts in the Ethereum ecosystem. It can be described by specially JSON file, like ERC20.json. This module use TemplateHaskell for generation described in Abi contract methods and events. Helper functions and instances inserted in haskell module and can be used in another modules or in place.

import Network.Ethereum.Contract.TH

[abiFrom|examples/ERC20.json|]

main = do
    runWeb3 $ event' def $
       (Transfer _ to val) -> liftIO $ do print to
                                           print val

Full code example available in examples folder.

Synopsis

The contract quasiquoters

abi :: QuasiQuoter Source #

QQ reader for contract Abi

abiFrom :: QuasiQuoter Source #

Read contract Abi from file