web3-0.7.3.0: Ethereum API for Haskell

CopyrightAlexander Krupenkin 2016
LicenseBSD3
Maintainermail@akru.me
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Network.Ethereum.Web3.Types

Description

Ethereum generic JSON-RPC types.

Synopsis

Documentation

type Hash = BytesN 32 #

32 byte type synonym for transaction and block hashes.

newtype Quantity #

Should be viewed as type to representing QUANTITY in Web3 JSON RPC docs

When encoding QUANTITIES (integers, numbers): encode as hex, prefix with "0x", the most compact representation (slight exception: zero should be represented as "0x0"). Examples:

0x41 (65 in decimal) 0x400 (1024 in decimal) WRONG: 0x (should always have at least one digit - zero is "0x0") WRONG: 0x0400 (no leading zeroes allowed) WRONG: ff (must be prefixed 0x)

Constructors

Quantity 

Fields

Instances

Enum Quantity # 
Eq Quantity # 
Fractional Quantity # 
Num Quantity # 
Ord Quantity # 
Read Quantity # 
Real Quantity # 
Show Quantity # 
IsString Quantity # 
Generic Quantity # 

Associated Types

type Rep Quantity :: * -> * #

Methods

from :: Quantity -> Rep Quantity x #

to :: Rep Quantity x -> Quantity #

ToJSON Quantity # 
FromJSON Quantity # 
UnitSpec Quantity # 

Methods

divider :: RealFrac b => proxy Quantity -> b #

name :: proxy Quantity -> Text #

Unit Quantity # 
type Rep Quantity # 
type Rep Quantity = D1 * (MetaData "Quantity" "Network.Ethereum.Web3.Types" "web3-0.7.3.0-AS6kJCy23KXKTnALpFowhj" True) (C1 * (MetaCons "Quantity" PrefixI True) (S1 * (MetaSel (Just Symbol "unQuantity") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Integer)))

data SyncActive #

An object with sync status data.

Constructors

SyncActive 

Fields

data SyncingState #

Sync state pulled by low-level call eth_syncing.

data Change #

Changes pulled by low-level call eth_getFilterChanges, eth_getLogs, and eth_getFilterLogs

Constructors

Change 

Fields

  • changeLogIndex :: !(Maybe Quantity)

    QUANTITY - integer of the log index position in the block. null when its pending log.

  • changeTransactionIndex :: !(Maybe Quantity)

    QUANTITY - integer of the transactions index position log was created from. null when its pending log.

  • changeTransactionHash :: !(Maybe Hash)

    DATA, 32 Bytes - hash of the transactions this log was created from. null when its pending log.

  • changeBlockHash :: !(Maybe Hash)

    DATA, 32 Bytes - hash of the block where this log was in. null when its pending. null when its pending log.

  • changeBlockNumber :: !(Maybe Quantity)

    QUANTITY - the block number where this log was in. null when its pending. null when its pending log.

  • changeAddress :: !Address

    DATA, 20 Bytes - address from which this log originated.

  • changeData :: !Bytes

    DATA - contains one or more 32 Bytes non-indexed arguments of the log.

  • changeTopics :: ![BytesN 32]

    Array of DATA - Array of 0 to 4 32 Bytes DATA of indexed log arguments. (In solidity: The first topic is the hash of the signature of the event (e.g. Deposit(address, bytes32, uint256)), except you declared the event with the anonymous specifier.)

Instances

Eq Change # 

Methods

(==) :: Change -> Change -> Bool #

(/=) :: Change -> Change -> Bool #

Show Change # 
Generic Change # 

Associated Types

type Rep Change :: * -> * #

Methods

from :: Change -> Rep Change x #

to :: Rep Change x -> Change #

ToJSON Change # 
FromJSON Change # 
type Rep Change # 

data Call #

The contract call params.

Constructors

Call 

Fields

  • callFrom :: !(Maybe Address)

    DATA, 20 Bytes - The address the transaction is send from.

  • callTo :: !(Maybe Address)

    DATA, 20 Bytes - (optional when creating new contract) The address the transaction is directed to.

  • callGas :: !(Maybe Quantity)

    QUANTITY - (optional, default: 3000000) Integer of the gas provided for the transaction execution. It will return unused gas.

  • callGasPrice :: !(Maybe Quantity)

    QUANTITY - (optional, default: To-Be-Determined) Integer of the gasPrice used for each paid gas.

  • callValue :: !(Maybe Quantity)

    QUANTITY - (optional) Integer of the value sent with this transaction.

  • callData :: !(Maybe Bytes)

    DATA - The compiled code of a contract OR the hash of the invoked method signature and encoded parameters.

  • callNonce :: !(Maybe Quantity)

    QUANTITY - (optional) Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce.

Instances

Eq Call # 

Methods

(==) :: Call -> Call -> Bool #

(/=) :: Call -> Call -> Bool #

Show Call # 

Methods

showsPrec :: Int -> Call -> ShowS #

show :: Call -> String #

showList :: [Call] -> ShowS #

Generic Call # 

Associated Types

type Rep Call :: * -> * #

Methods

from :: Call -> Rep Call x #

to :: Rep Call x -> Call #

ToJSON Call # 
FromJSON Call # 
Default Call # 

Methods

def :: Call #

type Rep Call # 

data DefaultBlock #

The state of blockchain for contract call.

data Filter e #

Low-level event filter data structure.

Constructors

Filter 

Fields

  • filterAddress :: !(Maybe [Address])

    DATA|Array, 20 Bytes - (optional) Contract address or a list of addresses from which logs should originate.

  • filterFromBlock :: !DefaultBlock

    QUANTITY|TAG - (optional, default: "latest") Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions.

  • filterToBlock :: !DefaultBlock

    QUANTITY|TAG - (optional, default: "latest") Integer block number, or "latest" for the last mined block or "pending", "earliest" for not yet mined transactions.

  • filterTopics :: !(Maybe [Maybe (BytesN 32)])

    Array of DATA, - (optional) Array of 32 Bytes DATA topics. Topics are order-dependent. Each topic can also be an array of DATA with "or" options. Topics are order-dependent. A transaction with a log with topics [A, B] will be matched by the following topic filters: * [] "anything" * [A] "A in first position (and anything after)" * [null, B] "anything in first position AND B in second position (and anything after)" * [A, B] "A in first position AND B in second position (and anything after)" * [[A, B], [A, B]] "(A OR B) in first position AND (A OR B) in second position (and anything after)"

Instances

Eq (Filter e) # 

Methods

(==) :: Filter e -> Filter e -> Bool #

(/=) :: Filter e -> Filter e -> Bool #

Show (Filter e) # 

Methods

showsPrec :: Int -> Filter e -> ShowS #

show :: Filter e -> String #

showList :: [Filter e] -> ShowS #

Generic (Filter e) # 

Associated Types

type Rep (Filter e) :: * -> * #

Methods

from :: Filter e -> Rep (Filter e) x #

to :: Rep (Filter e) x -> Filter e #

ToJSON (Filter e) # 
type Rep (Filter e) # 
type Rep (Filter e) = D1 * (MetaData "Filter" "Network.Ethereum.Web3.Types" "web3-0.7.3.0-AS6kJCy23KXKTnALpFowhj" False) (C1 * (MetaCons "Filter" PrefixI True) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "filterAddress") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe [Address]))) (S1 * (MetaSel (Just Symbol "filterFromBlock") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * DefaultBlock))) ((:*:) * (S1 * (MetaSel (Just Symbol "filterToBlock") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * DefaultBlock)) (S1 * (MetaSel (Just Symbol "filterTopics") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe [Maybe (BytesN 32)]))))))

data TxReceipt #

The Receipt of a Transaction

Constructors

TxReceipt 

Fields

Instances

Show TxReceipt # 
Generic TxReceipt # 

Associated Types

type Rep TxReceipt :: * -> * #

ToJSON TxReceipt # 
FromJSON TxReceipt # 
type Rep TxReceipt # 

data Transaction #

Transaction information.

Constructors

Transaction 

Fields

Instances

Eq Transaction # 
Show Transaction # 
Generic Transaction # 

Associated Types

type Rep Transaction :: * -> * #

ToJSON Transaction # 
FromJSON Transaction # 
type Rep Transaction # 

data Block #

Block information.

Constructors

Block 

Fields

Instances

Show Block # 

Methods

showsPrec :: Int -> Block -> ShowS #

show :: Block -> String #

showList :: [Block] -> ShowS #

Generic Block # 

Associated Types

type Rep Block :: * -> * #

Methods

from :: Block -> Rep Block x #

to :: Rep Block x -> Block #

ToJSON Block # 
FromJSON Block # 
type Rep Block # 
type Rep Block = D1 * (MetaData "Block" "Network.Ethereum.Web3.Types" "web3-0.7.3.0-AS6kJCy23KXKTnALpFowhj" False) (C1 * (MetaCons "Block" PrefixI True) ((:*:) * ((:*:) * ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "blockNumber") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Quantity))) (S1 * (MetaSel (Just Symbol "blockHash") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Hash)))) ((:*:) * (S1 * (MetaSel (Just Symbol "blockParentHash") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Hash)) (S1 * (MetaSel (Just Symbol "blockNonce") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Bytes))))) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "blockSha3Uncles") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (BytesN 32))) (S1 * (MetaSel (Just Symbol "blockLogsBloom") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe Bytes)))) ((:*:) * (S1 * (MetaSel (Just Symbol "blockTransactionsRoot") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (BytesN 32))) ((:*:) * (S1 * (MetaSel (Just Symbol "blockStateRoot") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (BytesN 32))) (S1 * (MetaSel (Just Symbol "blockReceiptRoot") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * (Maybe (BytesN 32)))))))) ((:*:) * ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "blockMiner") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Address)) (S1 * (MetaSel (Just Symbol "blockDifficulty") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Quantity))) ((:*:) * (S1 * (MetaSel (Just Symbol "blockTotalDifficulty") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Quantity)) ((:*:) * (S1 * (MetaSel (Just Symbol "blockExtraData") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Bytes)) (S1 * (MetaSel (Just Symbol "blockSize") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Quantity))))) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "blockGasLimit") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Quantity)) (S1 * (MetaSel (Just Symbol "blockGasUsed") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Quantity))) ((:*:) * (S1 * (MetaSel (Just Symbol "blockTimestamp") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * Quantity)) ((:*:) * (S1 * (MetaSel (Just Symbol "blockTransactions") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * [Transaction])) (S1 * (MetaSel (Just Symbol "blockUncles") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 * [Hash]))))))))