MCPcopy Create free account
hub / github.com/ElementsProject/lightning / call_rpc

Function call_rpc

plugins/rest-plugin/src/shared.rs:74–86  ·  view source on GitHub ↗
(
    plugin: &Plugin<PluginState>,
    method: &str,
    params: serde_json::Value,
)

Source from the content-addressed store, hash-verified

72}
73
74pub async fn call_rpc(
75 plugin: &Plugin<PluginState>,
76 method: &str,
77 params: serde_json::Value,
78) -> Result<serde_json::Value, RpcError> {
79 let rpc_path = plugin.configuration().rpc_file;
80 let mut rpc = ClnRpc::new(rpc_path).await.map_err(|e| RpcError {
81 code: None,
82 data: None,
83 message: e.to_string(),
84 })?;
85 rpc.call_raw(method, &params).await
86}
87
88pub fn path_to_rest_map_and_params(
89 plugin: &Plugin<PluginState>,

Callers 3

list_methodsFunction · 0.85
call_rpc_methodFunction · 0.85
verify_runeFunction · 0.85

Calls 3

configurationMethod · 0.80
call_rawMethod · 0.80
to_stringMethod · 0.45

Tested by

no test coverage detected