Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- plugin :: Value -> InitMonad s -> PluginApp s -> IO ()
- release :: Monad m => Id -> ConduitT i (Res Value) m ()
- reject :: Monad m => Id -> ConduitT i (Res Value) m ()
- respond :: Value -> Id -> PluginMonad a ()
- type PluginApp a = PluginReq -> PluginMonad a ()
- type PluginMonad a b = ConduitT (Either (Res Value) PluginReq) (Res Value) (ReaderT PlugInfo (StateT a IO)) b
- type InitMonad a = ReaderT PlugInfo IO a
- type PluginReq = (Maybe Id, Method, Params)
- type PlugInfo = (Handle, Init)
Documentation
plugin :: Value -> InitMonad s -> PluginApp s -> IO () Source #
Create main executable that can be installed as core lightning plugin.
release :: Monad m => Id -> ConduitT i (Res Value) m () Source #
Helper function to allow node to continue default behaviour.
reject :: Monad m => Id -> ConduitT i (Res Value) m () Source #
Helper function to prevent node default behaviour.
respond :: Value -> Id -> PluginMonad a () Source #
Respond with arbitrary Value, custom rpc hooks will pass back through to terminal.
type PluginApp a = PluginReq -> PluginMonad a () Source #
Function called on every event subscribed to in the manifest.
type PluginMonad a b = ConduitT (Either (Res Value) PluginReq) (Res Value) (ReaderT PlugInfo (StateT a IO)) b Source #
Plugin stack contains ReaderT (ask - rpc handle & config), stateT (get/put - polymorphic state) and conduitT (yield - data exchange to core lightning.)