-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Ethereum API for Haskell -- -- Web3 is a Haskell client library for Ethereum @package web3 @version 0.5.2.0 -- | Ethereum smart contract JSON ABI types. module Network.Ethereum.Web3.JsonAbi -- | Contract ABI is a list of method / event declarations newtype ContractABI ContractABI :: [Declaration] -> ContractABI [unABI] :: ContractABI -> [Declaration] -- | Elementrary contract interface item data Declaration -- | Contract constructor DConstructor :: [FunctionArg] -> Declaration [conInputs] :: Declaration -> [FunctionArg] -- | Method DFunction :: Text -> Bool -> [FunctionArg] -> Maybe [FunctionArg] -> Declaration [funName] :: Declaration -> Text [funConstant] :: Declaration -> Bool [funInputs] :: Declaration -> [FunctionArg] [funOutputs] :: Declaration -> Maybe [FunctionArg] -- | Event DEvent :: Text -> [EventArg] -> Bool -> Declaration [eveName] :: Declaration -> Text [eveInputs] :: Declaration -> [EventArg] [eveAnonymous] :: Declaration -> Bool -- | Fallback function DFallback :: Bool -> Declaration [falPayable] :: Declaration -> Bool -- | Method argument data FunctionArg FunctionArg :: Text -> Text -> FunctionArg -- | Argument name [funArgName] :: FunctionArg -> Text -- | Argument type [funArgType] :: FunctionArg -> Text -- | Event argument data EventArg EventArg :: Text -> Text -> Bool -> EventArg -- | Argument name [eveArgName] :: EventArg -> Text -- | Argument type [eveArgType] :: EventArg -> Text -- | Argument is indexed (e.g. placed on topics of event) [eveArgIndexed] :: EventArg -> Bool -- | Take a signature by given decl, e.g. foo(uint,string) signature :: Declaration -> Text -- | Generate method selector by given method Delcaration methodId :: Declaration -> Text -- | Generate event topic0 hash by givent event -- Delcaration eventId :: Declaration -> Text instance GHC.Classes.Ord Network.Ethereum.Web3.JsonAbi.ContractABI instance GHC.Classes.Eq Network.Ethereum.Web3.JsonAbi.ContractABI instance Data.Aeson.Types.Class.ToJSON Network.Ethereum.Web3.JsonAbi.Declaration instance Data.Aeson.Types.Class.FromJSON Network.Ethereum.Web3.JsonAbi.Declaration instance GHC.Show.Show Network.Ethereum.Web3.JsonAbi.ContractABI instance Data.Aeson.Types.Class.FromJSON Network.Ethereum.Web3.JsonAbi.ContractABI instance Data.Aeson.Types.Class.ToJSON Network.Ethereum.Web3.JsonAbi.ContractABI instance GHC.Classes.Ord Network.Ethereum.Web3.JsonAbi.Declaration instance GHC.Classes.Eq Network.Ethereum.Web3.JsonAbi.Declaration instance GHC.Show.Show Network.Ethereum.Web3.JsonAbi.Declaration instance Data.Aeson.Types.Class.ToJSON Network.Ethereum.Web3.JsonAbi.EventArg instance Data.Aeson.Types.Class.FromJSON Network.Ethereum.Web3.JsonAbi.EventArg instance GHC.Classes.Ord Network.Ethereum.Web3.JsonAbi.EventArg instance GHC.Classes.Eq Network.Ethereum.Web3.JsonAbi.EventArg instance GHC.Show.Show Network.Ethereum.Web3.JsonAbi.EventArg instance Data.Aeson.Types.Class.ToJSON Network.Ethereum.Web3.JsonAbi.FunctionArg instance Data.Aeson.Types.Class.FromJSON Network.Ethereum.Web3.JsonAbi.FunctionArg instance GHC.Classes.Ord Network.Ethereum.Web3.JsonAbi.FunctionArg instance GHC.Classes.Eq Network.Ethereum.Web3.JsonAbi.FunctionArg instance GHC.Show.Show Network.Ethereum.Web3.JsonAbi.FunctionArg -- | Ethereum address type, render and parser. module Network.Ethereum.Web3.Address -- | Ethereum account address data Address -- | Parse Address from text string fromText :: Text -> Either String Address -- | Render Address to text string toText :: Address -> Text -- | Null address zero :: Address instance GHC.Classes.Ord Network.Ethereum.Web3.Address.Address instance GHC.Classes.Eq Network.Ethereum.Web3.Address.Address instance GHC.Show.Show Network.Ethereum.Web3.Address.Address instance Data.String.IsString Network.Ethereum.Web3.Address.Address instance Data.Aeson.Types.Class.FromJSON Network.Ethereum.Web3.Address.Address instance Data.Aeson.Types.Class.ToJSON Network.Ethereum.Web3.Address.Address -- | Web3 ABI encoding data support. module Network.Ethereum.Web3.Encoding -- | Contract ABI data codec class ABIEncoding a where toData = toStrict . toLazyText . toDataBuilder fromData = maybeResult . parse fromDataParser . fromStrict toDataBuilder :: ABIEncoding a => a -> Builder fromDataParser :: ABIEncoding a => Parser a -- | Encode value into abi-encoding represenation toData :: ABIEncoding a => a -> Text -- | Parse encoded value fromData :: ABIEncoding a => Text -> Maybe a instance Network.Ethereum.Web3.Encoding.ABIEncoding GHC.Types.Bool instance Network.Ethereum.Web3.Encoding.ABIEncoding GHC.Integer.Type.Integer instance Network.Ethereum.Web3.Encoding.ABIEncoding GHC.Types.Int instance Network.Ethereum.Web3.Encoding.ABIEncoding GHC.Types.Word instance Network.Ethereum.Web3.Encoding.ABIEncoding Data.Text.Internal.Text instance Network.Ethereum.Web3.Encoding.ABIEncoding Network.Ethereum.Web3.Address.Address instance Network.Ethereum.Web3.Encoding.ABIEncoding a => Network.Ethereum.Web3.Encoding.ABIEncoding [a] -- | The type bytesM support. module Network.Ethereum.Web3.Encoding.Bytes -- | Fixed length byte array newtype BytesN (n :: Nat) BytesN :: Bytes -> BytesN [unBytesN] :: BytesN -> Bytes -- | Dynamic length byte array newtype BytesD BytesD :: Bytes -> BytesD [unBytesD] :: BytesD -> Bytes instance GHC.Classes.Ord Network.Ethereum.Web3.Encoding.Bytes.BytesD instance GHC.Classes.Eq Network.Ethereum.Web3.Encoding.Bytes.BytesD instance GHC.Classes.Ord (Network.Ethereum.Web3.Encoding.Bytes.BytesN n) instance GHC.Classes.Eq (Network.Ethereum.Web3.Encoding.Bytes.BytesN n) instance GHC.TypeLits.KnownNat n => Network.Ethereum.Web3.Encoding.Internal.EncodingType (Network.Ethereum.Web3.Encoding.Bytes.BytesN n) instance GHC.TypeLits.KnownNat n => Network.Ethereum.Web3.Encoding.ABIEncoding (Network.Ethereum.Web3.Encoding.Bytes.BytesN n) instance GHC.TypeLits.KnownNat n => GHC.Show.Show (Network.Ethereum.Web3.Encoding.Bytes.BytesN n) instance GHC.Base.Monoid Network.Ethereum.Web3.Encoding.Bytes.BytesD instance Network.Ethereum.Web3.Encoding.Internal.EncodingType Network.Ethereum.Web3.Encoding.Bytes.BytesD instance Network.Ethereum.Web3.Encoding.ABIEncoding Network.Ethereum.Web3.Encoding.Bytes.BytesD instance GHC.Show.Show Network.Ethereum.Web3.Encoding.Bytes.BytesD -- | ABIEncoding tuple instances. module Network.Ethereum.Web3.Encoding.Tuple -- | Singleton parameter instance newtype Singleton a Singleton :: a -> Singleton a [unSingleton] :: Singleton a -> a instance (Network.Ethereum.Web3.Encoding.ABIEncoding t0, Network.Ethereum.Web3.Encoding.ABIEncoding t1, Network.Ethereum.Web3.Encoding.ABIEncoding t2, Network.Ethereum.Web3.Encoding.ABIEncoding t3, Network.Ethereum.Web3.Encoding.ABIEncoding t4, Network.Ethereum.Web3.Encoding.ABIEncoding t5, Network.Ethereum.Web3.Encoding.ABIEncoding t6, Network.Ethereum.Web3.Encoding.ABIEncoding t7, Network.Ethereum.Web3.Encoding.ABIEncoding t8, Network.Ethereum.Web3.Encoding.ABIEncoding t9, Network.Ethereum.Web3.Encoding.ABIEncoding t10, Network.Ethereum.Web3.Encoding.ABIEncoding t11, Network.Ethereum.Web3.Encoding.ABIEncoding t12, Network.Ethereum.Web3.Encoding.ABIEncoding t13, Network.Ethereum.Web3.Encoding.ABIEncoding t14, Network.Ethereum.Web3.Encoding.Internal.EncodingType t0, Network.Ethereum.Web3.Encoding.Internal.EncodingType t1, Network.Ethereum.Web3.Encoding.Internal.EncodingType t2, Network.Ethereum.Web3.Encoding.Internal.EncodingType t3, Network.Ethereum.Web3.Encoding.Internal.EncodingType t4, Network.Ethereum.Web3.Encoding.Internal.EncodingType t5, Network.Ethereum.Web3.Encoding.Internal.EncodingType t6, Network.Ethereum.Web3.Encoding.Internal.EncodingType t7, Network.Ethereum.Web3.Encoding.Internal.EncodingType t8, Network.Ethereum.Web3.Encoding.Internal.EncodingType t9, Network.Ethereum.Web3.Encoding.Internal.EncodingType t10, Network.Ethereum.Web3.Encoding.Internal.EncodingType t11, Network.Ethereum.Web3.Encoding.Internal.EncodingType t12, Network.Ethereum.Web3.Encoding.Internal.EncodingType t13, Network.Ethereum.Web3.Encoding.Internal.EncodingType t14) => Network.Ethereum.Web3.Encoding.ABIEncoding (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14) instance (Network.Ethereum.Web3.Encoding.ABIEncoding t0, Network.Ethereum.Web3.Encoding.ABIEncoding t1, Network.Ethereum.Web3.Encoding.ABIEncoding t2, Network.Ethereum.Web3.Encoding.ABIEncoding t3, Network.Ethereum.Web3.Encoding.ABIEncoding t4, Network.Ethereum.Web3.Encoding.ABIEncoding t5, Network.Ethereum.Web3.Encoding.ABIEncoding t6, Network.Ethereum.Web3.Encoding.ABIEncoding t7, Network.Ethereum.Web3.Encoding.ABIEncoding t8, Network.Ethereum.Web3.Encoding.ABIEncoding t9, Network.Ethereum.Web3.Encoding.ABIEncoding t10, Network.Ethereum.Web3.Encoding.ABIEncoding t11, Network.Ethereum.Web3.Encoding.ABIEncoding t12, Network.Ethereum.Web3.Encoding.ABIEncoding t13, Network.Ethereum.Web3.Encoding.Internal.EncodingType t0, Network.Ethereum.Web3.Encoding.Internal.EncodingType t1, Network.Ethereum.Web3.Encoding.Internal.EncodingType t2, Network.Ethereum.Web3.Encoding.Internal.EncodingType t3, Network.Ethereum.Web3.Encoding.Internal.EncodingType t4, Network.Ethereum.Web3.Encoding.Internal.EncodingType t5, Network.Ethereum.Web3.Encoding.Internal.EncodingType t6, Network.Ethereum.Web3.Encoding.Internal.EncodingType t7, Network.Ethereum.Web3.Encoding.Internal.EncodingType t8, Network.Ethereum.Web3.Encoding.Internal.EncodingType t9, Network.Ethereum.Web3.Encoding.Internal.EncodingType t10, Network.Ethereum.Web3.Encoding.Internal.EncodingType t11, Network.Ethereum.Web3.Encoding.Internal.EncodingType t12, Network.Ethereum.Web3.Encoding.Internal.EncodingType t13) => Network.Ethereum.Web3.Encoding.ABIEncoding (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13) instance (Network.Ethereum.Web3.Encoding.ABIEncoding t0, Network.Ethereum.Web3.Encoding.ABIEncoding t1, Network.Ethereum.Web3.Encoding.ABIEncoding t2, Network.Ethereum.Web3.Encoding.ABIEncoding t3, Network.Ethereum.Web3.Encoding.ABIEncoding t4, Network.Ethereum.Web3.Encoding.ABIEncoding t5, Network.Ethereum.Web3.Encoding.ABIEncoding t6, Network.Ethereum.Web3.Encoding.ABIEncoding t7, Network.Ethereum.Web3.Encoding.ABIEncoding t8, Network.Ethereum.Web3.Encoding.ABIEncoding t9, Network.Ethereum.Web3.Encoding.ABIEncoding t10, Network.Ethereum.Web3.Encoding.ABIEncoding t11, Network.Ethereum.Web3.Encoding.ABIEncoding t12, Network.Ethereum.Web3.Encoding.Internal.EncodingType t0, Network.Ethereum.Web3.Encoding.Internal.EncodingType t1, Network.Ethereum.Web3.Encoding.Internal.EncodingType t2, Network.Ethereum.Web3.Encoding.Internal.EncodingType t3, Network.Ethereum.Web3.Encoding.Internal.EncodingType t4, Network.Ethereum.Web3.Encoding.Internal.EncodingType t5, Network.Ethereum.Web3.Encoding.Internal.EncodingType t6, Network.Ethereum.Web3.Encoding.Internal.EncodingType t7, Network.Ethereum.Web3.Encoding.Internal.EncodingType t8, Network.Ethereum.Web3.Encoding.Internal.EncodingType t9, Network.Ethereum.Web3.Encoding.Internal.EncodingType t10, Network.Ethereum.Web3.Encoding.Internal.EncodingType t11, Network.Ethereum.Web3.Encoding.Internal.EncodingType t12) => Network.Ethereum.Web3.Encoding.ABIEncoding (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12) instance (Network.Ethereum.Web3.Encoding.ABIEncoding t0, Network.Ethereum.Web3.Encoding.ABIEncoding t1, Network.Ethereum.Web3.Encoding.ABIEncoding t2, Network.Ethereum.Web3.Encoding.ABIEncoding t3, Network.Ethereum.Web3.Encoding.ABIEncoding t4, Network.Ethereum.Web3.Encoding.ABIEncoding t5, Network.Ethereum.Web3.Encoding.ABIEncoding t6, Network.Ethereum.Web3.Encoding.ABIEncoding t7, Network.Ethereum.Web3.Encoding.ABIEncoding t8, Network.Ethereum.Web3.Encoding.ABIEncoding t9, Network.Ethereum.Web3.Encoding.ABIEncoding t10, Network.Ethereum.Web3.Encoding.ABIEncoding t11, Network.Ethereum.Web3.Encoding.Internal.EncodingType t0, Network.Ethereum.Web3.Encoding.Internal.EncodingType t1, Network.Ethereum.Web3.Encoding.Internal.EncodingType t2, Network.Ethereum.Web3.Encoding.Internal.EncodingType t3, Network.Ethereum.Web3.Encoding.Internal.EncodingType t4, Network.Ethereum.Web3.Encoding.Internal.EncodingType t5, Network.Ethereum.Web3.Encoding.Internal.EncodingType t6, Network.Ethereum.Web3.Encoding.Internal.EncodingType t7, Network.Ethereum.Web3.Encoding.Internal.EncodingType t8, Network.Ethereum.Web3.Encoding.Internal.EncodingType t9, Network.Ethereum.Web3.Encoding.Internal.EncodingType t10, Network.Ethereum.Web3.Encoding.Internal.EncodingType t11) => Network.Ethereum.Web3.Encoding.ABIEncoding (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11) instance (Network.Ethereum.Web3.Encoding.ABIEncoding t0, Network.Ethereum.Web3.Encoding.ABIEncoding t1, Network.Ethereum.Web3.Encoding.ABIEncoding t2, Network.Ethereum.Web3.Encoding.ABIEncoding t3, Network.Ethereum.Web3.Encoding.ABIEncoding t4, Network.Ethereum.Web3.Encoding.ABIEncoding t5, Network.Ethereum.Web3.Encoding.ABIEncoding t6, Network.Ethereum.Web3.Encoding.ABIEncoding t7, Network.Ethereum.Web3.Encoding.ABIEncoding t8, Network.Ethereum.Web3.Encoding.ABIEncoding t9, Network.Ethereum.Web3.Encoding.ABIEncoding t10, Network.Ethereum.Web3.Encoding.Internal.EncodingType t0, Network.Ethereum.Web3.Encoding.Internal.EncodingType t1, Network.Ethereum.Web3.Encoding.Internal.EncodingType t2, Network.Ethereum.Web3.Encoding.Internal.EncodingType t3, Network.Ethereum.Web3.Encoding.Internal.EncodingType t4, Network.Ethereum.Web3.Encoding.Internal.EncodingType t5, Network.Ethereum.Web3.Encoding.Internal.EncodingType t6, Network.Ethereum.Web3.Encoding.Internal.EncodingType t7, Network.Ethereum.Web3.Encoding.Internal.EncodingType t8, Network.Ethereum.Web3.Encoding.Internal.EncodingType t9, Network.Ethereum.Web3.Encoding.Internal.EncodingType t10) => Network.Ethereum.Web3.Encoding.ABIEncoding (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10) instance (Network.Ethereum.Web3.Encoding.ABIEncoding t0, Network.Ethereum.Web3.Encoding.ABIEncoding t1, Network.Ethereum.Web3.Encoding.ABIEncoding t2, Network.Ethereum.Web3.Encoding.ABIEncoding t3, Network.Ethereum.Web3.Encoding.ABIEncoding t4, Network.Ethereum.Web3.Encoding.ABIEncoding t5, Network.Ethereum.Web3.Encoding.ABIEncoding t6, Network.Ethereum.Web3.Encoding.ABIEncoding t7, Network.Ethereum.Web3.Encoding.ABIEncoding t8, Network.Ethereum.Web3.Encoding.ABIEncoding t9, Network.Ethereum.Web3.Encoding.Internal.EncodingType t0, Network.Ethereum.Web3.Encoding.Internal.EncodingType t1, Network.Ethereum.Web3.Encoding.Internal.EncodingType t2, Network.Ethereum.Web3.Encoding.Internal.EncodingType t3, Network.Ethereum.Web3.Encoding.Internal.EncodingType t4, Network.Ethereum.Web3.Encoding.Internal.EncodingType t5, Network.Ethereum.Web3.Encoding.Internal.EncodingType t6, Network.Ethereum.Web3.Encoding.Internal.EncodingType t7, Network.Ethereum.Web3.Encoding.Internal.EncodingType t8, Network.Ethereum.Web3.Encoding.Internal.EncodingType t9) => Network.Ethereum.Web3.Encoding.ABIEncoding (t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) instance (Network.Ethereum.Web3.Encoding.ABIEncoding t0, Network.Ethereum.Web3.Encoding.ABIEncoding t1, Network.Ethereum.Web3.Encoding.ABIEncoding t2, Network.Ethereum.Web3.Encoding.ABIEncoding t3, Network.Ethereum.Web3.Encoding.ABIEncoding t4, Network.Ethereum.Web3.Encoding.ABIEncoding t5, Network.Ethereum.Web3.Encoding.ABIEncoding t6, Network.Ethereum.Web3.Encoding.ABIEncoding t7, Network.Ethereum.Web3.Encoding.ABIEncoding t8, Network.Ethereum.Web3.Encoding.Internal.EncodingType t0, Network.Ethereum.Web3.Encoding.Internal.EncodingType t1, Network.Ethereum.Web3.Encoding.Internal.EncodingType t2, Network.Ethereum.Web3.Encoding.Internal.EncodingType t3, Network.Ethereum.Web3.Encoding.Internal.EncodingType t4, Network.Ethereum.Web3.Encoding.Internal.EncodingType t5, Network.Ethereum.Web3.Encoding.Internal.EncodingType t6, Network.Ethereum.Web3.Encoding.Internal.EncodingType t7, Network.Ethereum.Web3.Encoding.Internal.EncodingType t8) => Network.Ethereum.Web3.Encoding.ABIEncoding (t0, t1, t2, t3, t4, t5, t6, t7, t8) instance (Network.Ethereum.Web3.Encoding.ABIEncoding t0, Network.Ethereum.Web3.Encoding.ABIEncoding t1, Network.Ethereum.Web3.Encoding.ABIEncoding t2, Network.Ethereum.Web3.Encoding.ABIEncoding t3, Network.Ethereum.Web3.Encoding.ABIEncoding t4, Network.Ethereum.Web3.Encoding.ABIEncoding t5, Network.Ethereum.Web3.Encoding.ABIEncoding t6, Network.Ethereum.Web3.Encoding.ABIEncoding t7, Network.Ethereum.Web3.Encoding.Internal.EncodingType t0, Network.Ethereum.Web3.Encoding.Internal.EncodingType t1, Network.Ethereum.Web3.Encoding.Internal.EncodingType t2, Network.Ethereum.Web3.Encoding.Internal.EncodingType t3, Network.Ethereum.Web3.Encoding.Internal.EncodingType t4, Network.Ethereum.Web3.Encoding.Internal.EncodingType t5, Network.Ethereum.Web3.Encoding.Internal.EncodingType t6, Network.Ethereum.Web3.Encoding.Internal.EncodingType t7) => Network.Ethereum.Web3.Encoding.ABIEncoding (t0, t1, t2, t3, t4, t5, t6, t7) instance (Network.Ethereum.Web3.Encoding.ABIEncoding t0, Network.Ethereum.Web3.Encoding.ABIEncoding t1, Network.Ethereum.Web3.Encoding.ABIEncoding t2, Network.Ethereum.Web3.Encoding.ABIEncoding t3, Network.Ethereum.Web3.Encoding.ABIEncoding t4, Network.Ethereum.Web3.Encoding.ABIEncoding t5, Network.Ethereum.Web3.Encoding.ABIEncoding t6, Network.Ethereum.Web3.Encoding.Internal.EncodingType t0, Network.Ethereum.Web3.Encoding.Internal.EncodingType t1, Network.Ethereum.Web3.Encoding.Internal.EncodingType t2, Network.Ethereum.Web3.Encoding.Internal.EncodingType t3, Network.Ethereum.Web3.Encoding.Internal.EncodingType t4, Network.Ethereum.Web3.Encoding.Internal.EncodingType t5, Network.Ethereum.Web3.Encoding.Internal.EncodingType t6) => Network.Ethereum.Web3.Encoding.ABIEncoding (t0, t1, t2, t3, t4, t5, t6) instance (Network.Ethereum.Web3.Encoding.ABIEncoding t0, Network.Ethereum.Web3.Encoding.ABIEncoding t1, Network.Ethereum.Web3.Encoding.ABIEncoding t2, Network.Ethereum.Web3.Encoding.ABIEncoding t3, Network.Ethereum.Web3.Encoding.ABIEncoding t4, Network.Ethereum.Web3.Encoding.ABIEncoding t5, Network.Ethereum.Web3.Encoding.Internal.EncodingType t0, Network.Ethereum.Web3.Encoding.Internal.EncodingType t1, Network.Ethereum.Web3.Encoding.Internal.EncodingType t2, Network.Ethereum.Web3.Encoding.Internal.EncodingType t3, Network.Ethereum.Web3.Encoding.Internal.EncodingType t4, Network.Ethereum.Web3.Encoding.Internal.EncodingType t5) => Network.Ethereum.Web3.Encoding.ABIEncoding (t0, t1, t2, t3, t4, t5) instance (Network.Ethereum.Web3.Encoding.ABIEncoding t0, Network.Ethereum.Web3.Encoding.ABIEncoding t1, Network.Ethereum.Web3.Encoding.ABIEncoding t2, Network.Ethereum.Web3.Encoding.ABIEncoding t3, Network.Ethereum.Web3.Encoding.ABIEncoding t4, Network.Ethereum.Web3.Encoding.Internal.EncodingType t0, Network.Ethereum.Web3.Encoding.Internal.EncodingType t1, Network.Ethereum.Web3.Encoding.Internal.EncodingType t2, Network.Ethereum.Web3.Encoding.Internal.EncodingType t3, Network.Ethereum.Web3.Encoding.Internal.EncodingType t4) => Network.Ethereum.Web3.Encoding.ABIEncoding (t0, t1, t2, t3, t4) instance (Network.Ethereum.Web3.Encoding.ABIEncoding t0, Network.Ethereum.Web3.Encoding.ABIEncoding t1, Network.Ethereum.Web3.Encoding.ABIEncoding t2, Network.Ethereum.Web3.Encoding.ABIEncoding t3, Network.Ethereum.Web3.Encoding.Internal.EncodingType t0, Network.Ethereum.Web3.Encoding.Internal.EncodingType t1, Network.Ethereum.Web3.Encoding.Internal.EncodingType t2, Network.Ethereum.Web3.Encoding.Internal.EncodingType t3) => Network.Ethereum.Web3.Encoding.ABIEncoding (t0, t1, t2, t3) instance (Network.Ethereum.Web3.Encoding.ABIEncoding t0, Network.Ethereum.Web3.Encoding.ABIEncoding t1, Network.Ethereum.Web3.Encoding.ABIEncoding t2, Network.Ethereum.Web3.Encoding.Internal.EncodingType t0, Network.Ethereum.Web3.Encoding.Internal.EncodingType t1, Network.Ethereum.Web3.Encoding.Internal.EncodingType t2) => Network.Ethereum.Web3.Encoding.ABIEncoding (t0, t1, t2) instance (Network.Ethereum.Web3.Encoding.ABIEncoding t0, Network.Ethereum.Web3.Encoding.ABIEncoding t1, Network.Ethereum.Web3.Encoding.Internal.EncodingType t0, Network.Ethereum.Web3.Encoding.Internal.EncodingType t1) => Network.Ethereum.Web3.Encoding.ABIEncoding (t0, t1) instance (Network.Ethereum.Web3.Encoding.Internal.EncodingType a, Network.Ethereum.Web3.Encoding.ABIEncoding a) => Network.Ethereum.Web3.Encoding.ABIEncoding (Network.Ethereum.Web3.Encoding.Tuple.Singleton a) -- | Common used types and instances. module Network.Ethereum.Web3.Types -- | Any communication with Ethereum node wrapped with Web3 monad newtype Web3 a b Web3 :: IO b -> Web3 a b [unWeb3] :: Web3 a b -> IO b -- | Some peace of error response data Web3Error -- | JSON-RPC communication error JsonRpcFail :: RpcError -> Web3Error -- | Error in parser state ParserFail :: String -> Web3Error -- | Common head for user errors UserFail :: String -> Web3Error -- | JSON-RPC error message data RpcError RpcError :: Int -> Text -> Maybe Value -> RpcError [errCode] :: RpcError -> Int [errMessage] :: RpcError -> Text [errData] :: RpcError -> Maybe Value -- | Low-level event filter data structure data Filter Filter :: Maybe Address -> Maybe [Maybe Text] -> Maybe Text -> Maybe Text -> Filter [filterAddress] :: Filter -> Maybe Address [filterTopics] :: Filter -> Maybe [Maybe Text] [filterFromBlock] :: Filter -> Maybe Text [filterToBlock] :: Filter -> Maybe Text -- | Event filder ident newtype FilterId FilterId :: Int -> FilterId -- | Changes pulled by low-level call eth_getFilterChanges data Change Change :: Text -> Text -> Text -> Text -> Text -> Address -> Text -> [Text] -> Change [changeLogIndex] :: Change -> Text [changeTransactionIndex] :: Change -> Text [changeTransactionHash] :: Change -> Text [changeBlockHash] :: Change -> Text [changeBlockNumber] :: Change -> Text [changeAddress] :: Change -> Address [changeData] :: Change -> Text [changeTopics] :: Change -> [Text] -- | The contract call params data Call Call :: Maybe Address -> Address -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Call [callFrom] :: Call -> Maybe Address [callTo] :: Call -> Address [callGas] :: Call -> Maybe Text [callPrice] :: Call -> Maybe Text [callValue] :: Call -> Maybe Text [callData] :: Call -> Maybe Text -- | The contract call mode describe used state: latest or pending data CallMode Latest :: CallMode Pending :: CallMode -- | Transaction hash text string type TxHash = Text -- | Transaction information data Transaction Transaction :: TxHash -> Text -> Text -> Text -> Text -> Address -> Maybe Address -> Text -> Text -> Text -> Text -> Transaction -- | DATA, 32 Bytes - hash of the transaction. [txHash] :: Transaction -> TxHash -- | QUANTITY - the number of transactions made by the sender prior to this -- one. [txNonce] :: Transaction -> Text -- | DATA, 32 Bytes - hash of the block where this transaction was in. null -- when its pending. [txBlockHash] :: Transaction -> Text -- | QUANTITY - block number where this transaction was in. null when its -- pending. [txBlockNumber] :: Transaction -> Text -- | QUANTITY - integer of the transactions index position in the block. -- null when its pending. [txTransactionIndex] :: Transaction -> Text -- | DATA, 20 Bytes - address of the sender. [txFrom] :: Transaction -> Address -- | DATA, 20 Bytes - address of the receiver. null when its a contract -- creation transaction. [txTo] :: Transaction -> Maybe Address -- | QUANTITY - value transferred in Wei. [txValue] :: Transaction -> Text -- | QUANTITY - gas price provided by the sender in Wei. [txGasPrice] :: Transaction -> Text -- | QUANTITY - gas provided by the sender. [txGas] :: Transaction -> Text -- | DATA - the data send along with the transaction. [txInput] :: Transaction -> Text -- | Block information data Block Block :: Text -> Text -> Text -> Maybe Text -> Text -> Text -> Text -> Text -> Maybe Text -> Address -> Text -> Text -> Text -> Text -> Text -> Text -> Text -> [Transaction] -> [Text] -> Block -- | QUANTITY - the block number. null when its pending block. [blockNumber] :: Block -> Text -- | DATA, 32 Bytes - hash of the block. null when its pending block. [blockHash] :: Block -> Text -- | DATA, 32 Bytes - hash of the parent block. [blockParentHash] :: Block -> Text -- | DATA, 8 Bytes - hash of the generated proof-of-work. null when its -- pending block. [blockNonce] :: Block -> Maybe Text -- | DATA, 32 Bytes - SHA3 of the uncles data in the block. [blockSha3Uncles] :: Block -> Text -- | DATA, 256 Bytes - the bloom filter for the logs of the block. null -- when its pending block. [blockLogsBloom] :: Block -> Text -- | DATA, 32 Bytes - the root of the transaction trie of the block. [blockTransactionsRoot] :: Block -> Text -- | DATA, 32 Bytes - the root of the final state trie of the block. [blockStateRoot] :: Block -> Text -- | DATA, 32 Bytes - the root of the receipts trie of the block. [blockReceiptRoot] :: Block -> Maybe Text -- | DATA, 20 Bytes - the address of the beneficiary to whom the mining -- rewards were given. [blockMiner] :: Block -> Address -- | QUANTITY - integer of the difficulty for this block. [blockDifficulty] :: Block -> Text -- | QUANTITY - integer of the total difficulty of the chain until this -- block. [blockTotalDifficulty] :: Block -> Text -- | DATA - the "extra data" field of this block. [blockExtraData] :: Block -> Text -- | QUANTITY - integer the size of this block in bytes. [blockSize] :: Block -> Text -- | QUANTITY - the maximum gas allowed in this block. [blockGasLimit] :: Block -> Text -- | QUANTITY - the total used gas by all transactions in this block. [blockGasUsed] :: Block -> Text -- | QUANTITY - the unix timestamp for when the block was collated. [blockTimestamp] :: Block -> Text -- | Array of transaction objects. [blockTransactions] :: Block -> [Transaction] -- | Array - Array of uncle hashes. [blockUncles] :: Block -> [Text] instance Data.Aeson.Types.Class.ToJSON Network.Ethereum.Web3.Types.Block instance Data.Aeson.Types.Class.FromJSON Network.Ethereum.Web3.Types.Block instance GHC.Show.Show Network.Ethereum.Web3.Types.Block instance Data.Aeson.Types.Class.ToJSON Network.Ethereum.Web3.Types.Transaction instance Data.Aeson.Types.Class.FromJSON Network.Ethereum.Web3.Types.Transaction instance GHC.Show.Show Network.Ethereum.Web3.Types.Transaction instance GHC.Classes.Eq Network.Ethereum.Web3.Types.CallMode instance GHC.Show.Show Network.Ethereum.Web3.Types.CallMode instance Data.Aeson.Types.Class.ToJSON Network.Ethereum.Web3.Types.Call instance Data.Aeson.Types.Class.FromJSON Network.Ethereum.Web3.Types.Call instance Data.Aeson.Types.Class.ToJSON Network.Ethereum.Web3.Types.CallMode instance GHC.Show.Show Network.Ethereum.Web3.Types.Call instance Data.Aeson.Types.Class.ToJSON Network.Ethereum.Web3.Types.Change instance Data.Aeson.Types.Class.FromJSON Network.Ethereum.Web3.Types.Change instance GHC.Show.Show Network.Ethereum.Web3.Types.Change instance GHC.Classes.Ord Network.Ethereum.Web3.Types.FilterId instance GHC.Classes.Eq Network.Ethereum.Web3.Types.FilterId instance GHC.Show.Show Network.Ethereum.Web3.Types.FilterId instance Data.Aeson.Types.Class.ToJSON Network.Ethereum.Web3.Types.Filter instance Data.Aeson.Types.Class.FromJSON Network.Ethereum.Web3.Types.Filter instance Data.Aeson.Types.Class.FromJSON Network.Ethereum.Web3.Types.FilterId instance Data.Aeson.Types.Class.ToJSON Network.Ethereum.Web3.Types.FilterId instance GHC.Show.Show Network.Ethereum.Web3.Types.Filter instance Data.Aeson.Types.Class.ToJSON Network.Ethereum.Web3.Types.RpcError instance Data.Aeson.Types.Class.FromJSON Network.Ethereum.Web3.Types.RpcError instance GHC.Classes.Eq Network.Ethereum.Web3.Types.Web3Error instance GHC.Show.Show Network.Ethereum.Web3.Types.Web3Error instance GHC.Classes.Eq Network.Ethereum.Web3.Types.RpcError instance GHC.Show.Show Network.Ethereum.Web3.Types.RpcError instance Control.Monad.IO.Class.MonadIO (Network.Ethereum.Web3.Types.Web3 a) instance GHC.Base.Monad (Network.Ethereum.Web3.Types.Web3 a) instance GHC.Base.Applicative (Network.Ethereum.Web3.Types.Web3 a) instance GHC.Base.Functor (Network.Ethereum.Web3.Types.Web3 a) instance GHC.Exception.Exception Network.Ethereum.Web3.Types.Web3Error -- | Web3 service provider. module Network.Ethereum.Web3.Provider -- | Ethereum node service provider class Provider a -- | JSON-RPC provider URI, default: localhost:8545 rpcUri :: Provider a => Web3 a String -- | Default Web3 service provider data DefaultProvider -- | Web3 monad runner runWeb3' :: MonadIO m => Web3 a b -> m (Either Web3Error b) -- | Web3 runner for default provider runWeb3 :: MonadIO m => Web3 DefaultProvider b -> m (Either Web3Error b) -- | Fork Web3 with the same Provider forkWeb3 :: Web3 a () -> Web3 a ThreadId instance Network.Ethereum.Web3.Provider.Provider Network.Ethereum.Web3.Provider.DefaultProvider -- | Ethereum node JSON-RPC API methods. module Network.Ethereum.Web3.Api -- | Returns current node version string. web3_clientVersion :: Provider a => Web3 a Text -- | Returns Keccak-256 (not the standardized SHA3-256) of the given data. web3_sha3 :: Provider a => Text -> Web3 a Text -- | Returns the balance of the account of given address. eth_getBalance :: Provider a => Address -> CallMode -> Web3 a Text -- | Creates a filter object, based on filter options, to notify when the -- state changes (logs). To check if the state has changed, call -- getFilterChanges. eth_newFilter :: Provider a => Filter -> Web3 a FilterId -- | Polling method for a filter, which returns an array of logs which -- occurred since last poll. eth_getFilterChanges :: Provider a => FilterId -> Web3 a [Change] -- | Uninstalls a filter with given id. Should always be called when watch -- is no longer needed. eth_uninstallFilter :: Provider a => FilterId -> Web3 a Bool -- | Executes a new message call immediately without creating a transaction -- on the block chain. eth_call :: Provider a => Call -> CallMode -> Web3 a Text -- | Creates new message call transaction or a contract creation, if the -- data field contains code. eth_sendTransaction :: Provider a => Call -> Web3 a Text -- | Returns a list of addresses owned by client. eth_accounts :: Provider a => Web3 a [Address] eth_newBlockFilter :: Provider a => Web3 a Text -- | Polling method for a block filter, which returns an array of block -- hashes occurred since last poll. eth_getBlockFilterChanges :: Provider a => Text -> Web3 a [Text] -- | Returns information about a block by hash. eth_getBlockByHash :: Provider a => Text -> Web3 a Block -- | Ethereum has a metric system of denominations used as units of ether. -- Each denomination has its own unique name (some bear the family name -- of seminal figures playing a role in evolution of computer science and -- cryptoeconomics). The smallest denomination aka base unit of ether is -- called Wei. Below is a list of the named denominations and -- their value in Wei. Following a common (although somewhat -- ambiguous) pattern, ether also designates a unit (of 1e18 or one -- quintillion Wei) of the currency. Note that the currency is not -- called Ethereum as many mistakenly think, nor is Ethereum a unit. -- -- In Haskell the Ethereum unit system presented as set of types: -- Wei, Szabo, Finney, etc. They are members of -- Unit typeclass. Also available standart Show, -- Read, Num operations over Ethereum units. -- --
-- > let x = 1.2 :: Ether -- > toWei x -- 1200000000000000000 -- -- > let y = x + 2 -- > y -- 3.20 ether -- -- > let z = 15 :: Szabo -- > y + z -- -- interactive:6:5: error: -- • Couldn't match type ‘Network.Ethereum.Unit.U4’ -- with ‘Network.Ethereum.Unit.U6’ -- Expected type: Ether -- Actual type: Szabo --module Network.Ethereum.Unit -- | Ethereum value unit class (Read a, Show a, UnitSpec a, Fractional a) => Unit a where convert = fromWei . toWei -- | Make a value from integer wei fromWei :: Unit a => Integer -> a -- | Convert a value to integer wei toWei :: Unit a => a -> Integer -- | Conversion beween two values convert :: (Unit a, Unit b) => a -> b -- | Wei unit type type Wei = Value U0 -- | KWei unit type type KWei = Value U1 -- | MWei unit type type MWei = Value U2 -- | GWei unit type type GWei = Value U3 -- | Szabo unit type type Szabo = Value U4 -- | Finney unit type type Finney = Value U5 -- | Ether unit type type Ether = Value U6 -- | KEther unit type type KEther = Value U7 instance GHC.Classes.Ord (Network.Ethereum.Unit.Value a) instance GHC.Classes.Eq (Network.Ethereum.Unit.Value a) instance Network.Ethereum.Unit.UnitSpec a => Network.Ethereum.Unit.Unit (Network.Ethereum.Unit.Value a) instance Network.Ethereum.Unit.UnitSpec a => Network.Ethereum.Unit.UnitSpec (Network.Ethereum.Unit.Value a) instance Network.Ethereum.Unit.UnitSpec a => GHC.Num.Num (Network.Ethereum.Unit.Value a) instance Network.Ethereum.Unit.UnitSpec a => GHC.Real.Fractional (Network.Ethereum.Unit.Value a) instance Network.Ethereum.Unit.UnitSpec a => GHC.Show.Show (Network.Ethereum.Unit.Value a) instance Network.Ethereum.Unit.UnitSpec a => GHC.Read.Read (Network.Ethereum.Unit.Value a) instance Network.Ethereum.Unit.UnitSpec Network.Ethereum.Unit.U0 instance Network.Ethereum.Unit.UnitSpec Network.Ethereum.Unit.U1 instance Network.Ethereum.Unit.UnitSpec Network.Ethereum.Unit.U2 instance Network.Ethereum.Unit.UnitSpec Network.Ethereum.Unit.U3 instance Network.Ethereum.Unit.UnitSpec Network.Ethereum.Unit.U4 instance Network.Ethereum.Unit.UnitSpec Network.Ethereum.Unit.U5 instance Network.Ethereum.Unit.UnitSpec Network.Ethereum.Unit.U6 instance Network.Ethereum.Unit.UnitSpec Network.Ethereum.Unit.U7 -- | Ethereum contract generalized interface, e.g. event function -- catch all event depend by given callback function type. -- --
-- runWeb3 $ event "0x..." ((MyEvent a b c) -> 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) --module Network.Ethereum.Web3.Contract -- | Event callback control response data EventAction -- | Continue to listen events ContinueEvent :: EventAction -- | Terminate event listener TerminateEvent :: EventAction -- | Contract method caller class ABIEncoding a => Method a where sendTx = _sendTransaction call = _call -- | Send a transaction for given contract Address, value and input -- data sendTx :: (Method a, Provider p, Unit b) => Address -> b -> a -> Web3 p TxHash -- | Constant call given contract Address in mode and given input -- data call :: (Method a, Provider p, ABIEncoding b) => Address -> CallMode -> a -> Web3 p b -- | Contract event listener class ABIEncoding a => Event a where event = _event -- | Event filter structure used by low-level subscription methods eventFilter :: Event a => a -> Address -> Filter -- | Start an event listener for given contract Address and callback event :: (Event a, Provider p) => Address -> (a -> IO EventAction) -> Web3 p ThreadId -- | Dummy method for sending transaction without method call data NoMethod NoMethod :: NoMethod -- | Zero value is used to send transaction without money nopay :: Wei instance GHC.Classes.Eq Network.Ethereum.Web3.Contract.EventAction instance GHC.Show.Show Network.Ethereum.Web3.Contract.EventAction instance Network.Ethereum.Web3.Encoding.ABIEncoding Network.Ethereum.Web3.Contract.NoMethod instance Network.Ethereum.Web3.Contract.Method Network.Ethereum.Web3.Contract.NoMethod -- | 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. module Network.Ethereum.Web3 -- | Any communication with Ethereum node wrapped with Web3 monad data Web3 a b -- | Ethereum node service provider class Provider a -- | JSON-RPC provider URI, default: localhost:8545 rpcUri :: Provider a => Web3 a String -- | Default Web3 service provider data DefaultProvider -- | Some peace of error response data Web3Error -- | JSON-RPC communication error JsonRpcFail :: RpcError -> Web3Error -- | Error in parser state ParserFail :: String -> Web3Error -- | Common head for user errors UserFail :: String -> Web3Error -- | Fork Web3 with the same Provider forkWeb3 :: Web3 a () -> Web3 a ThreadId -- | Web3 monad runner runWeb3' :: MonadIO m => Web3 a b -> m (Either Web3Error b) -- | Web3 runner for default provider runWeb3 :: MonadIO m => Web3 DefaultProvider b -> m (Either Web3Error b) -- | Event callback control response data EventAction -- | Continue to listen events ContinueEvent :: EventAction -- | Terminate event listener TerminateEvent :: EventAction -- | Contract event listener class ABIEncoding a => Event a where event = _event -- | Event filter structure used by low-level subscription methods eventFilter :: Event a => a -> Address -> Filter -- | Start an event listener for given contract Address and callback event :: (Event a, Provider p) => Address -> (a -> IO EventAction) -> Web3 p ThreadId -- | Contract method caller class ABIEncoding a => Method a where sendTx = _sendTransaction call = _call -- | Send a transaction for given contract Address, value and input -- data sendTx :: (Method a, Provider p, Unit b) => Address -> b -> a -> Web3 p TxHash -- | Constant call given contract Address in mode and given input -- data call :: (Method a, Provider p, ABIEncoding b) => Address -> CallMode -> a -> Web3 p b -- | Dummy method for sending transaction without method call data NoMethod NoMethod :: NoMethod -- | Zero value is used to send transaction without money nopay :: Wei -- | Fixed length byte array newtype BytesN (n :: Nat) BytesN :: Bytes -> BytesN [unBytesN] :: BytesN -> Bytes -- | Dynamic length byte array newtype BytesD BytesD :: Bytes -> BytesD [unBytesD] :: BytesD -> Bytes -- | Ethereum account address data Address -- | TemplateHaskell based Ethereum contract ABI methods & event -- generator for Haskell native API. -- --
-- [abiFrom|data/sample.json|] -- -- main = do -- runWeb3 $ event "0x..." $ -- (Action2 n x) -> do print n -- print x -- wait -- where wait = threadDelay 1000000 >> wait --module Network.Ethereum.Web3.TH -- | QQ reader for contract ABI abi :: QuasiQuoter -- | Read contract ABI from file abiFrom :: QuasiQuoter -- | Simplest Byte Array data Bytes :: * -- | A space efficient, packed, unboxed Unicode text type. data Text :: * -- | Singleton parameter instance newtype Singleton a Singleton :: a -> Singleton a [unSingleton] :: Singleton a -> a -- | Contract ABI data codec class ABIEncoding a where toData = toStrict . toLazyText . toDataBuilder fromData = maybeResult . parse fromDataParser . fromStrict toDataBuilder :: ABIEncoding a => a -> Builder fromDataParser :: ABIEncoding a => Parser a -- | Encode value into abi-encoding represenation toData :: ABIEncoding a => a -> Text -- | Parse encoded value fromData :: ABIEncoding a => Text -> Maybe a