web3-0.8.3.0: Ethereum API for Haskell

CopyrightAlexander Krupenkin 2018
LicenseBSD3
Maintainermail@akru.me
Stabilityexperimental
Portabilityunportable
Safe HaskellNone
LanguageHaskell2010

Network.Ethereum.Account.Internal

Description

Internal types and functions of Account module.

Synopsis

Documentation

data CallParam p Source #

Account is needed to send transactions to blockchain

Transaction parametrization data type

Constructors

CallParam 

Fields

Instances
Eq p => Eq (CallParam p) Source # 
Instance details

Defined in Network.Ethereum.Account.Internal

Methods

(==) :: CallParam p -> CallParam p -> Bool #

(/=) :: CallParam p -> CallParam p -> Bool #

Monad m => MonadState (CallParam p) (AccountT p m) Source # 
Instance details

Defined in Network.Ethereum.Account.Internal

Methods

get :: AccountT p m (CallParam p) #

put :: CallParam p -> AccountT p m () #

state :: (CallParam p -> (a, CallParam p)) -> AccountT p m a #

to :: Lens' (CallParam p) Address Source #

Transaction recipient lens

value :: Unit value => Lens' (CallParam p) value Source #

Transaction value lens

gasLimit :: Lens' (CallParam p) Integer Source #

Transaction gas limit lens

gasPrice :: Unit gasprice => Lens' (CallParam p) gasprice Source #

Transaction gas price lens

block :: Lens' (CallParam p) DefaultBlock Source #

Call execution block lens

account :: Lens' (CallParam p) p Source #

EOA params lens

newtype AccountT p m a Source #

Monad transformer for sending parametrized transactions from account

Constructors

AccountT 

Fields

Instances
Account () DefaultAccount Source # 
Instance details

Defined in Network.Ethereum.Account.Default

Methods

withAccount :: JsonRpc m => () -> DefaultAccount m b -> m b Source #

send :: (JsonRpc m, Method args) => args -> DefaultAccount m TxReceipt Source #

call :: (JsonRpc m, Method args, AbiGet result) => args -> DefaultAccount m result Source #

Account Personal PersonalAccount Source # 
Instance details

Defined in Network.Ethereum.Account.Personal

Methods

withAccount :: JsonRpc m => Personal -> PersonalAccount m b -> m b Source #

send :: (JsonRpc m, Method args) => args -> PersonalAccount m TxReceipt Source #

call :: (JsonRpc m, Method args, AbiGet result) => args -> PersonalAccount m result Source #

Account LocalKey LocalKeyAccount Source # 
Instance details

Defined in Network.Ethereum.Account.LocalKey

Methods

withAccount :: JsonRpc m => LocalKey -> LocalKeyAccount m b -> m b Source #

send :: (JsonRpc m, Method args) => args -> LocalKeyAccount m TxReceipt Source #

call :: (JsonRpc m, Method args, AbiGet result) => args -> LocalKeyAccount m result Source #

MonadTrans (AccountT p) Source # 
Instance details

Defined in Network.Ethereum.Account.Internal

Methods

lift :: Monad m => m a -> AccountT p m a #

Monad m => MonadState (CallParam p) (AccountT p m) Source # 
Instance details

Defined in Network.Ethereum.Account.Internal

Methods

get :: AccountT p m (CallParam p) #

put :: CallParam p -> AccountT p m () #

state :: (CallParam p -> (a, CallParam p)) -> AccountT p m a #

Monad m => Monad (AccountT p m) Source # 
Instance details

Defined in Network.Ethereum.Account.Internal

Methods

(>>=) :: AccountT p m a -> (a -> AccountT p m b) -> AccountT p m b #

(>>) :: AccountT p m a -> AccountT p m b -> AccountT p m b #

return :: a -> AccountT p m a #

fail :: String -> AccountT p m a #

Functor m => Functor (AccountT p m) Source # 
Instance details

Defined in Network.Ethereum.Account.Internal

Methods

fmap :: (a -> b) -> AccountT p m a -> AccountT p m b #

(<$) :: a -> AccountT p m b -> AccountT p m a #

Monad m => Applicative (AccountT p m) Source # 
Instance details

Defined in Network.Ethereum.Account.Internal

Methods

pure :: a -> AccountT p m a #

(<*>) :: AccountT p m (a -> b) -> AccountT p m a -> AccountT p m b #

liftA2 :: (a -> b -> c) -> AccountT p m a -> AccountT p m b -> AccountT p m c #

(*>) :: AccountT p m a -> AccountT p m b -> AccountT p m b #

(<*) :: AccountT p m a -> AccountT p m b -> AccountT p m a #

withParam :: Account p (AccountT p) => (CallParam p -> CallParam p) -> AccountT p m a -> AccountT p m a Source #

withParam is very similar to withStateT function, it's used to set parameters of transaction locally and revert params after out of scope.

 withAccount () $
   withParam (to .~ tokenAddress) $
     transfer alice 42