cmditch/elm-ethereum/4.0.1

NOTE: the latest version is 5.0.0

Eth.Types

Types

Simple

type alias Address =
Address
type alias TxHash =
TxHash
type alias BlockHash =
BlockHash
type alias Hex =
Hex

Complex

type alias Call a =
{ to : Maybe Address
, from : Maybe Address
, gas : Maybe Int
, gasPrice : Maybe BigInt
, value : Maybe BigInt
, data : Maybe Hex
, nonce : Maybe Int
, decoder : Decoder a
}
type alias Tx =
{ hash : TxHash
, nonce : Int
, blockHash : Maybe BlockHash
, blockNumber : Maybe Int
, transactionIndex : Int
, from : Address
, to : Maybe Address
, value : BigInt
, gasPrice : BigInt
, gas : Int
, input : String
}
type alias TxReceipt =
{ hash : TxHash
, index : Int
, blockHash : BlockHash
, blockNumber : Int
, gasUsed : BigInt
, cumulativeGasUsed : BigInt
, contractAddress : Maybe Address
, logs : List Log
, logsBloom : String
, root : Maybe String
, status : Maybe Bool
}
type BlockId
= BlockNum Int
| EarliestBlock
| LatestBlock
| PendingBlock
type alias Block a =
{ number : 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 : Int
, gasLimit : Int
, gasUsed : Int
, timestamp : Posix
, transactions : List a
, uncles : List String
}
type alias Uncle =
Block ()
type alias BlockHead =
{ number : Int
, hash : BlockHash
, parentHash : BlockHash
, nonce : String
, sha3Uncles : String
, logsBloom : String
, transactionsRoot : String
, stateRoot : String
, receiptsRoot : String
, miner : Address
, difficulty : BigInt
, extraData : String
, gasLimit : Int
, gasUsed : Int
, mixHash : String
, timestamp : Posix
}
type alias Log =
{ address : Address
, data : String
, topics : List Hex
, removed : Bool
, logIndex : Int
, transactionIndex : Int
, transactionHash : TxHash
, blockHash : BlockHash
, blockNumber : Int
}
type alias Event a =
{ address : Address
, data : String
, topics : List Hex
, removed : Bool
, logIndex : Int
, transactionIndex : Int
, transactionHash : TxHash
, blockHash : BlockHash
, blockNumber : 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 : Int
, currentBlock : Int
, highestBlock : Int
, knownStates : Int
, pulledStates : Int
}

Misc

type alias HttpProvider =
String
type alias WebsocketProvider =
String
type alias FilterId =
String