Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- plugin :: Value -> PluginInit s -> PluginApp s -> IO ()
- release :: Id -> PluginMonad a
- respond :: Value -> Id -> PluginMonad a
- type PluginApp a = PluginReq -> PluginMonad a
- type PluginMonad a = ConduitT (Either (Res Value) PluginReq) (Res Value) (ReaderT PlugInfo (StateT a IO)) ()
- type PluginInit a = PlugInfo -> IO a
- type PluginReq = (Maybe Id, Method, Params)
- type PlugInfo = (Handle, Init)
Documentation
plugin :: Value -> PluginInit s -> PluginApp s -> IO () Source #
Create main executable that can be installed as core lightning plugin.
release :: Id -> PluginMonad a Source #
Helper function to allow node to continue. Hooks delay default node 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 = ConduitT (Either (Res Value) PluginReq) (Res Value) (ReaderT PlugInfo (StateT a IO)) () Source #
Plugin stack contains ReaderT (ask - rpc handle & config), stateT (get/put - polymorphic state) and conduitT (yield - data exchange to core lightning.)
type PluginInit a = PlugInfo -> IO a Source #
Function called on initialization, returned value is the initial state.