Copyright | Alexander Krupenkin 2016 |
---|---|
License | BSD3 |
Maintainer | mail@akru.me |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Web3 service provider.
Synopsis
- newtype Web3 a = Web3 {
- unWeb3 :: StateT JsonRpcClient IO a
- data Web3Error
- = JsonRpcFail !String
- | ParserFail !String
- | UserFail !String
- data Provider
- runWeb3With :: MonadIO m => Manager -> Provider -> Web3 a -> m (Either Web3Error a)
- runWeb3' :: MonadIO m => Provider -> Web3 a -> m (Either Web3Error a)
- runWeb3 :: MonadIO m => Web3 a -> m (Either Web3Error a)
- forkWeb3 :: Web3 a -> Web3 (Async a)
- getConnection :: String -> Int -> String -> IO Connection
Documentation
Any communication with node wrapped with Web3
monad
Web3 | |
|
Instances
Monad Web3 Source # | |
Functor Web3 Source # | |
Applicative Web3 Source # | |
MonadIO Web3 Source # | |
Defined in Network.Web3.Provider | |
MonadThrow Web3 Source # | |
Defined in Network.Web3.Provider | |
JsonRpc Web3 Source # | |
Defined in Network.Web3.Provider remote :: Remote Web3 a => MethodName -> a Source # | |
MonadState JsonRpcClient Web3 Source # | |
Defined in Network.Web3.Provider get :: Web3 JsonRpcClient # put :: JsonRpcClient -> Web3 () # state :: (JsonRpcClient -> (a, JsonRpcClient)) -> Web3 a # |
Some peace of error response
Instances
Eq Web3Error Source # | |
Show Web3Error Source # | |
Generic Web3Error Source # | |
Exception Web3Error Source # | |
Defined in Network.Web3.Provider toException :: Web3Error -> SomeException # fromException :: SomeException -> Maybe Web3Error # displayException :: Web3Error -> String # | |
type Rep Web3Error Source # | |
Defined in Network.Web3.Provider type Rep Web3Error = D1 (MetaData "Web3Error" "Network.Web3.Provider" "web3-0.9.1.0-3q6w2KRBOG16VQPAACkK14" False) (C1 (MetaCons "JsonRpcFail" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 String)) :+: (C1 (MetaCons "ParserFail" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 String)) :+: C1 (MetaCons "UserFail" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 String)))) |
Web3 Provider
Instances
Eq Provider Source # | |
Show Provider Source # | |
Generic Provider Source # | |
Default Provider Source # | Default Provider URI |
Defined in Network.Web3.Provider | |
type Rep Provider Source # | |
Defined in Network.Web3.Provider type Rep Provider = D1 (MetaData "Provider" "Network.Web3.Provider" "web3-0.9.1.0-3q6w2KRBOG16VQPAACkK14" False) (C1 (MetaCons "HttpProvider" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)) :+: C1 (MetaCons "WsProvider" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int))) |
runWeb3With :: MonadIO m => Manager -> Provider -> Web3 a -> m (Either Web3Error a) Source #
Web3
monad runner, using the supplied Manager
runWeb3 :: MonadIO m => Web3 a -> m (Either Web3Error a) Source #
Web3
runner for default Http provider
:: String | Host |
-> Int | Port |
-> String | Path |
-> IO Connection |
Returns a WebSocket Connection Instance