HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

Moduleweb3-ethereum-1.1.0.1Haskell2010

Network.Ethereum.Account

In Etereun there are two types of accounts: * Externally owned account (EOAs): an account controlled by a private key, and if you own the private key associated with the EOA you have the ability to send ether and messages from it. * Contract: an account that has its own code, and is controlled by code.

This module exports different kinds of EOAs: default, node managed and local. Node managed accounts use Personal JSON-RPC API for signing transactions. Local account sign transaction locally and use sendRawTransaction method to export transaction to Ethereum network.

  • 5 types
  • 1 class
  • 8 values

The Account type

1 declaration
classclass MonadTrans t => Account a (t :: (Type -> Type) -> Type -> Type) | t -> a where
#

Account is needed for sending transactions to blockchain

Typically account is provided by node. In this case node manage accounts: encrypt and decrypt private keys, manipulate files etc. In other case web3 can derive account from private key and send to node already signed transactions.

Methods

Instances3Account

Default node account

1 declaration

Unlockable node account

2 declarations
datadata Personal
#

Unlockable node managed account params

Instances4Eq, Show, Default, Account
  • Eq PersonalDefined in web3-ethereum-1.1.0.1 · Network.Ethereum.Account.Personal
  • Show PersonalDefined in web3-ethereum-1.1.0.1 · Network.Ethereum.Account.Personal
  • Default PersonalDefined in web3-ethereum-1.1.0.1 · Network.Ethereum.Account.Personal
  • Account Personal PersonalAccountDefined in web3-ethereum-1.1.0.1 · Network.Ethereum.Account.Personal

Local key account

2 declarations

Transaction parameterization function and lenses

8 declarations
valuewithParam
  1. :: Account p (AccountT p)
  2. => CallParam p -> CallParam p
  3. -> AccountT p m a
  4. -> AccountT p m a
#

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