| 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.
- 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 Source #
Contract ABI is a list of method / event declarations
Constructors
| ContractABI | |
Fields
| |
Instances
data Declaration Source #
Elementrary contract interface item
Constructors
| DConstructor | Contract constructor |
Fields
| |
| DFunction | Method |
Fields
| |
| DEvent | Event |
| DFallback | Fallback function |
Fields
| |
Instances
data FunctionArg Source #
Method argument
Constructors
| FunctionArg | |
Fields
| |
Instances
Event argument
Constructors
| EventArg | |
Fields
| |
signature :: Declaration -> Text Source #
Take a signature by given decl, e.g. foo(uint,string)
methodId :: Declaration -> Text Source #
Generate method selector by given method Delcaration
eventId :: Declaration -> Text Source #
Generate event topic0 hash by givent event Delcaration
data SolidityType Source #
Solidity types and parsers
Constructors
| SolidityBool | |
| SolidityAddress | |
| SolidityUint Int | |
| SolidityInt Int | |
| SolidityString | |
| SolidityBytesN Int | |
| SolidityBytes | |
| SolidityVector [Int] SolidityType | |
| SolidityArray SolidityType |
Instances