Copyright | Alexander Krupenkin 2018 |
---|---|
License | BSD3 |
Maintainer | mail@akru.me |
Stability | experimental |
Portability | unportable |
Safe Haskell | None |
Language | Haskell2010 |
Internal types and functions of Account
module.
Synopsis
- data CallParam p = CallParam {}
- to :: Lens' (CallParam p) Address
- value :: Unit value => Lens' (CallParam p) value
- gasLimit :: Lens' (CallParam p) Integer
- gasPrice :: Unit gasprice => Lens' (CallParam p) gasprice
- block :: Lens' (CallParam p) DefaultBlock
- account :: Lens' (CallParam p) p
- newtype AccountT p m a = AccountT {
- runAccountT :: StateT (CallParam p) m a
- withParam :: Account p (AccountT p) => (CallParam p -> CallParam p) -> AccountT p m a -> AccountT p m a
- defaultCallParam :: a -> CallParam a
- getCall :: MonadState (CallParam p) m => m Call
- getReceipt :: JsonRpc m => HexString -> m TxReceipt
- updateReceipt :: JsonRpc m => TxReceipt -> m TxReceipt
Documentation
Account is needed to send transactions to blockchain
Transaction parametrization data type
newtype AccountT p m a Source #
Monad transformer for sending parametrized transactions from account
AccountT | |
|
Instances
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
defaultCallParam :: a -> CallParam a Source #