| Copyright | Alexander Krupenkin 2016 |
|---|---|
| License | BSD3 |
| Maintainer | mail@akru.me |
| Stability | experimental |
| Portability | unknown |
| Safe Haskell | None |
| Language | Haskell2010 |
Network.Ethereum.Web3
Contents
Description
An Ethereum node offers a RPC interface. This interface gives Ðapp’s access to the Ethereum blockchain and functionality that the node provides, such as compiling smart contract code. It uses a subset of the JSON-RPC 2.0 specification (no support for notifications or named parameters) as serialisation protocol and is available over HTTP and IPC (unix domain sockets on linux/OSX and named pipe’s on Windows).
Web3 Haskell library currently use JSON-RPC over HTTP to access node functionality.
- data Web3 a b
- class Provider a where
- data DefaultProvider
- data Web3Error
- runWeb3 :: MonadIO m => Web3 DefaultProvider b -> m (Either Web3Error b)
- data EventAction
- class ABIEncoding a => Event a where
- class ABIEncoding a => Method a where
- nopay :: Wei
- newtype BytesN n = BytesN {}
- newtype BytesD = BytesD {}
- data Address
- module Network.Ethereum.Unit
Web3 monad and service provider
Any communication with Ethereum node wrapped with Web3 monad
class Provider a where Source #
Ethereum node service provider
Minimal complete definition
Methods
rpcUri :: Web3 a String Source #
JSON-RPC provider URI, default: localhost:8545
runWeb3' :: MonadIO m => Web3 a b -> m (Either Web3Error b) Source #
Web3 monad runner
Instances
Some peace of error response
Constructors
| JsonRpcFail RpcError | JSON-RPC communication error |
| ParserFail String | Error in parser state |
| UserFail String | Common head for user errors |
runWeb3 :: MonadIO m => Web3 DefaultProvider b -> m (Either Web3Error b) Source #
Web3 runner for default provider
Contract actions
data EventAction Source #
Event callback control response
Constructors
| ContinueEvent | Continue to listen events |
| TerminateEvent | Terminate event listener |
Instances
class ABIEncoding a => Method a where Source #
Contract method caller
Methods
sendTx :: (Provider p, Unit b) => Address -> b -> a -> Web3 p TxHash Source #
Send a transaction for given contract Address, value and input data
call :: (Provider p, ABIEncoding b) => Address -> CallMode -> a -> Web3 p b Source #
Constant call given contract Address in mode and given input data
Ethereum data types
Fixed length byte array
Dynamic length byte array
Ethereum account address
Ethereum unit conversion utils
module Network.Ethereum.Unit