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

Control.Plugin

Synopsis

Documentation

plugin :: Value -> InitMonad s -> PluginApp s -> IO () Source #

Create main executable that can be installed as core lightning plugin. 1st arg is the manifest that configures the interface, 2nd arg is a function with Plug reader that returns initial state, and 3rd arg is a function that is called each time data is received.

release :: Id -> PluginMonad a () Source #

Helper function to allow node to continue default behaviour.

reject :: Id -> PluginMonad a () 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 = ReaderT Plug (StateT a IO) Source #

Plugin stack contains ReaderT (ask - rpc handle & config), stateT (get/put - polymorphic state)

type InitMonad a = ReaderT Plug IO a Source #

Function called on initialization, returned value is the initial state.

data Plug Source #

Handles to lightning-rpc file and stdout plugin & configuration object.

Constructors

Plug 

Fields