Crate that provides a procedural macros implementation to make easy to develop a plugin developer to build a plugin.
Crate that provides a procedural macros implementation to make easy to develop a plugin developer to build a plugin.
```rust use clightningrpcpluginmacros::{addpluginrpc, rpcmethod}; use serdejson::{json, Value};
use clightningrpcplugin::addrpc; use clightningrpcplugin::commands::RPCCommand; use clightningrpcplugin::plugin::Plugin;
rpcname = "foo", description = "This is a simple and short description" )] pub fn foorpc(plugin: Plugin<()>, _request: Value) -> Value { /// The name of the parameters can be used only if used, otherwise can be omitted /// the only rules that the macros require is to have a propriety with the following rules: /// - Plugin as _plugin /// - CLN JSON request as _request /// The function parameter can be specified in any order. json!({"isdynamic": plugin.dynamic, "rpcrequest": _request}) }
fn main() { // as fist step you need to make a new plugin instance // more docs about Plugin struct is provided under the clightning_plugin crate let mut plugin = Plugin::new((), true);
// The macros helper that help to register a RPC method with the name
// without worry about all the rules of the library
add_plugin_rpc!(plugin, "foo");
plugin.start();
} ```
make fmt
before committingIf you want support this library consider to donate with the following methods