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

Function list_methods

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

Source from the content-addressed store, hash-verified

155 )
156)]
157pub async fn list_methods(
158 Extension(plugin): Extension<Plugin<PluginState>>,
159) -> Result<Html<String>, AppError> {
160 match call_rpc(&plugin, "help", json!(HelpRequest { command: None })).await {
161 Ok(help_response) => {
162 let html_content = process_help_response(help_response);
163 Ok(Html(html_content))
164 }
165 Err(err) => Err(AppError::InternalServerError(RpcError {
166 code: None,
167 data: None,
168 message: format!("Error calling help rpc: {}", err),
169 })),
170 }
171}
172
173fn process_help_response(help_response: serde_json::Value) -> String {
174 /* 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