web3-0.6.0.0: Ethereum API for Haskell

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

Network.Ethereum.Web3.TH

Contents

Description

TemplateHaskell based Ethereum contract ABI methods & event generator for Haskell native API.

[abiFrom|data/sample.json|]

main = do
    runWeb3 $ event "0x..." $
       (Action2 n x) -> liftIO $ do print n
                                     print x
    wait
  where wait = threadDelay 1000000 >> wait

Synopsis

Quasiquoter's

abi :: QuasiQuoter Source #

QQ reader for contract ABI

abiFrom :: QuasiQuoter Source #

Read contract ABI from file

Used by TH data types

data Bytes :: * #

Simplest Byte Array

Instances

Eq Bytes 

Methods

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

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

Ord Bytes 

Methods

compare :: Bytes -> Bytes -> Ordering #

(<) :: Bytes -> Bytes -> Bool #

(<=) :: Bytes -> Bytes -> Bool #

(>) :: Bytes -> Bytes -> Bool #

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

max :: Bytes -> Bytes -> Bytes #

min :: Bytes -> Bytes -> Bytes #

Show Bytes 

Methods

showsPrec :: Int -> Bytes -> ShowS #

show :: Bytes -> String #

showList :: [Bytes] -> ShowS #

Monoid Bytes 

Methods

mempty :: Bytes #

mappend :: Bytes -> Bytes -> Bytes #

mconcat :: [Bytes] -> Bytes #

ByteArray Bytes 

Methods

allocRet :: Int -> (Ptr p -> IO a) -> IO (a, Bytes) #

ByteArrayAccess Bytes 

Methods

length :: Bytes -> Int #

withByteArray :: Bytes -> (Ptr p -> IO a) -> IO a #

NFData Bytes 

Methods

rnf :: Bytes -> () #

newtype Singleton a Source #

Singleton parameter instance

Constructors

Singleton 

Fields

class ABIEncoding a where Source #

Contract ABI data codec

Minimal complete definition

toDataBuilder, fromDataParser

Methods

toDataBuilder :: a -> Builder Source #

fromDataParser :: Parser a Source #

toData :: a -> Text Source #

Encode value into abi-encoding represenation

fromData :: Text -> Maybe a Source #

Parse encoded value

Instances

ABIEncoding Bool Source # 
ABIEncoding Int Source # 
ABIEncoding Integer Source # 
ABIEncoding Word Source # 
ABIEncoding Text Source # 
ABIEncoding Address Source # 
ABIEncoding BytesD Source # 
ABIEncoding NoMethod Source # 
ABIEncoding a => ABIEncoding [a] Source # 
KnownNat n => ABIEncoding (BytesN n) Source # 
(EncodingType a, ABIEncoding a) => ABIEncoding (Singleton a) Source #