| Copyright | Alexander Krupenkin 2016-2018 |
|---|---|
| License | BSD3 |
| Maintainer | mail@akru.me |
| Stability | experimental |
| Portability | noportable |
| Safe Haskell | None |
| Language | Haskell2010 |
Network.Ethereum.ABI.Json
Description
JSON encoded contract ABI parsers.
Synopsis
- newtype ContractABI = ContractABI {
- unABI :: [Declaration]
- data Declaration
- = DConstructor {
- conInputs :: [FunctionArg]
- | DFunction {
- funName :: Text
- funConstant :: Bool
- funInputs :: [FunctionArg]
- funOutputs :: Maybe [FunctionArg]
- | DEvent { }
- | DFallback {
- falPayable :: Bool
- = DConstructor {
- data FunctionArg = FunctionArg {
- funArgName :: Text
- funArgType :: Text
- data EventArg = EventArg {
- eveArgName :: Text
- eveArgType :: Text
- eveArgIndexed :: Bool
- signature :: Declaration -> Text
- methodId :: Declaration -> Text
- eventId :: Declaration -> Text
- data SolidityType
- parseSolidityType :: Text -> Either ParseError SolidityType
Documentation
newtype ContractABI #
Contract ABI is a list of method / event declarations
Constructors
| ContractABI | |
Fields
| |
Instances
| Eq ContractABI # | |
Defined in Network.Ethereum.ABI.Json | |
| Ord ContractABI # | |
Defined in Network.Ethereum.ABI.Json Methods compare :: ContractABI -> ContractABI -> Ordering # (<) :: ContractABI -> ContractABI -> Bool # (<=) :: ContractABI -> ContractABI -> Bool # (>) :: ContractABI -> ContractABI -> Bool # (>=) :: ContractABI -> ContractABI -> Bool # max :: ContractABI -> ContractABI -> ContractABI # min :: ContractABI -> ContractABI -> ContractABI # | |
| Show ContractABI # | |
Defined in Network.Ethereum.ABI.Json Methods showsPrec :: Int -> ContractABI -> ShowS # show :: ContractABI -> String # showList :: [ContractABI] -> ShowS # | |
| ToJSON ContractABI # | |
Defined in Network.Ethereum.ABI.Json Methods toJSON :: ContractABI -> Value # toEncoding :: ContractABI -> Encoding # toJSONList :: [ContractABI] -> Value # toEncodingList :: [ContractABI] -> Encoding # | |
| FromJSON ContractABI # | |
Defined in Network.Ethereum.ABI.Json | |
data Declaration #
Elementrary contract interface item
Constructors
| DConstructor | Contract constructor |
Fields
| |
| DFunction | Method |
Fields
| |
| DEvent | Event |
| DFallback | Fallback function |
Fields
| |
Instances
| Eq Declaration # | |
Defined in Network.Ethereum.ABI.Json | |
| Ord Declaration # | |
Defined in Network.Ethereum.ABI.Json Methods compare :: Declaration -> Declaration -> Ordering # (<) :: Declaration -> Declaration -> Bool # (<=) :: Declaration -> Declaration -> Bool # (>) :: Declaration -> Declaration -> Bool # (>=) :: Declaration -> Declaration -> Bool # max :: Declaration -> Declaration -> Declaration # min :: Declaration -> Declaration -> Declaration # | |
| Show Declaration # | |
Defined in Network.Ethereum.ABI.Json Methods showsPrec :: Int -> Declaration -> ShowS # show :: Declaration -> String # showList :: [Declaration] -> ShowS # | |
| ToJSON Declaration # | |
Defined in Network.Ethereum.ABI.Json Methods toJSON :: Declaration -> Value # toEncoding :: Declaration -> Encoding # toJSONList :: [Declaration] -> Value # toEncodingList :: [Declaration] -> Encoding # | |
| FromJSON Declaration # | |
Defined in Network.Ethereum.ABI.Json | |
data FunctionArg #
Method argument
Constructors
| FunctionArg | |
Fields
| |
Instances
| Eq FunctionArg # | |
Defined in Network.Ethereum.ABI.Json | |
| Ord FunctionArg # | |
Defined in Network.Ethereum.ABI.Json Methods compare :: FunctionArg -> FunctionArg -> Ordering # (<) :: FunctionArg -> FunctionArg -> Bool # (<=) :: FunctionArg -> FunctionArg -> Bool # (>) :: FunctionArg -> FunctionArg -> Bool # (>=) :: FunctionArg -> FunctionArg -> Bool # max :: FunctionArg -> FunctionArg -> FunctionArg # min :: FunctionArg -> FunctionArg -> FunctionArg # | |
| Show FunctionArg # | |
Defined in Network.Ethereum.ABI.Json Methods showsPrec :: Int -> FunctionArg -> ShowS # show :: FunctionArg -> String # showList :: [FunctionArg] -> ShowS # | |
| ToJSON FunctionArg # | |
Defined in Network.Ethereum.ABI.Json Methods toJSON :: FunctionArg -> Value # toEncoding :: FunctionArg -> Encoding # toJSONList :: [FunctionArg] -> Value # toEncodingList :: [FunctionArg] -> Encoding # | |
| FromJSON FunctionArg # | |
Defined in Network.Ethereum.ABI.Json | |
Event argument
Constructors
| EventArg | |
Fields
| |
signature :: Declaration -> Text #
Take a signature by given decl, e.g. foo(uint,string)
methodId :: Declaration -> Text #
Generate method selector by given method Delcaration
eventId :: Declaration -> Text #
Generate event topic0 hash by givent event Delcaration
data SolidityType #
Solidity types and parsers
Constructors
| SolidityBool | |
| SolidityAddress | |
| SolidityUint Int | |
| SolidityInt Int | |
| SolidityString | |
| SolidityBytesN Int | |
| SolidityBytes | |
| SolidityVector [Int] SolidityType | |
| SolidityArray SolidityType |
Instances
| Eq SolidityType # | |
Defined in Network.Ethereum.ABI.Json | |
| Show SolidityType # | |
Defined in Network.Ethereum.ABI.Json Methods showsPrec :: Int -> SolidityType -> ShowS # show :: SolidityType -> String # showList :: [SolidityType] -> ShowS # | |