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

Function list_methods

plugins/rest-plugin/src/handlers.rs:35–49  ·  view source on GitHub ↗
(
    Extension(plugin): Extension<Plugin<PluginState>>,
)

Source from the content-addressed store, hash-verified

33 )
34)]
35pub async fn list_methods(
36 Extension(plugin): Extension<Plugin<PluginState>>,
37) -> Result<Html<String>, AppError> {
38 match call_rpc(&plugin, "help", json!(HelpRequest { command: None })).await {
39 Ok(help_response) => {
40 let html_content = process_help_response(help_response);
41 Ok(Html(html_content))
42 }
43 Err(err) => Err(AppError::InternalServerError(RpcError {
44 code: None,
45 data: None,
46 message: format!("Error calling help rpc: {}", err),
47 })),
48 }
49}
50
51fn process_help_response(help_response: serde_json::Value) -> String {
52 /* Parse the "help" field as an array of HelpCommand */

Callers

nothing calls this directly

Calls 2

call_rpcFunction · 0.85
process_help_responseFunction · 0.85

Tested by

no test coverage detected