cmditch / elm-ethereum / Eth.Types

Types

Simple


type alias Address =
Internal.Types.Address


type alias TxHash =
Internal.Types.TxHash


type alias BlockHash =
Internal.Types.BlockHash


type alias Hex =
Internal.Types.Hex

Complex


type alias Call a =
{ to : Maybe Address
, from : Maybe Address
, gas : Maybe Basics.Int
, gasPrice : Maybe BigInt
, value : Maybe BigInt
, data : Maybe Hex
, nonce : Maybe Basics.Int
, decoder : Json.Decode.Decoder a 
}


type alias Send =
{ to : Maybe Address
, from : Maybe Address
, gas : Maybe Basics.Int
, gasPrice : Maybe BigInt
, value : Maybe BigInt
, data : Maybe Hex
, nonce : Maybe Basics.Int 
}


type alias Tx =
{ hash : TxHash
, nonce : Basics.Int
, blockHash : Maybe BlockHash
, blockNumber : Maybe Basics.Int
, transactionIndex : Basics.Int
, from : Address
, to : Maybe Address
, value : BigInt
, gasPrice : BigInt
, gas : Basics.Int
, input : String 
}


type alias TxReceipt =
{ hash : TxHash
, index : Basics.Int
, blockHash : BlockHash
, blockNumber : Basics.Int
, gasUsed : BigInt
, cumulativeGasUsed : BigInt
, contractAddress : Maybe Address
, logs : List Log
, logsBloom : String
, root : Maybe String
, status : Maybe Basics.Bool 
}


type BlockId
    = BlockNum Basics.Int
    | EarliestBlock
    | LatestBlock
    | PendingBlock


type alias Block a =
{ number : Basics.Int
, hash : BlockHash
, parentHash : BlockHash
, nonce : String
, sha3Uncles : String
, logsBloom : String
, transactionsRoot : String
, stateRoot : String
, receiptsRoot : String
, miner : Address
, difficulty : BigInt
, totalDifficulty : BigInt
, extraData : String
, size : Basics.Int
, gasLimit : Basics.Int
, gasUsed : Basics.Int
, timestamp : Time.Posix
, transactions : List a
, uncles : List String 
}


type alias Uncle =
Block ()


type alias BlockHead =
{ number : Basics.Int
, hash : BlockHash
, parentHash : BlockHash
, nonce : String
, sha3Uncles : String
, logsBloom : String
, transactionsRoot : String
, stateRoot : String
, receiptsRoot : String
, miner : Address
, difficulty : BigInt
, extraData : String
, gasLimit : Basics.Int
, gasUsed : Basics.Int
, mixHash : String
, timestamp : Time.Posix 
}


type alias Log =
{ address : Address
, data : String
, topics : List Hex
, removed : Basics.Bool
, logIndex : Basics.Int
, transactionIndex : Basics.Int
, transactionHash : TxHash
, blockHash : BlockHash
, blockNumber : Basics.Int 
}


type alias Event a =
{ address : Address
, data : String
, topics : List Hex
, removed : Basics.Bool
, logIndex : Basics.Int
, transactionIndex : Basics.Int
, transactionHash : TxHash
, blockHash : BlockHash
, blockNumber : Basics.Int
, returnData : a 
}


type alias LogFilter =
{ fromBlock : BlockId
, toBlock : BlockId
, address : Address
, topics : List (Maybe Hex) 
}

NOTE: Different from JSON RPC API, removed some optionality to reduce complexity (array with array)


type alias SyncStatus =
{ startingBlock : Basics.Int
, currentBlock : Basics.Int
, highestBlock : Basics.Int
, knownStates : Basics.Int
, pulledStates : Basics.Int 
}

Misc


type alias HttpProvider =
String


type alias WebsocketProvider =
String


type alias FilterId =
String