clplug-0.1.0.0: Create Core Lightning Plugins
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Plugin

Synopsis

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.

type PlugInfo = (Handle, Init) Source #

Handle connected to lightning-rpc file (use with Control.Client) & configuration object.