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

Function on_rpc_command

tests/plugins/rpc_command_1.py:11–23  ·  view source on GitHub ↗
(plugin, rpc_command, **kwargs)

Source from the content-addressed store, hash-verified

9
10@plugin.hook("rpc_command")
11def on_rpc_command(plugin, rpc_command, **kwargs):
12 request = rpc_command
13 if request["method"] == "invoice":
14 # Replace part of this command
15 request["params"]["description"] = "rpc_command_1 modified this description"
16 return {"replace": request}
17 elif request["method"] == "listfunds":
18 # Return a custom result to the command
19 return {"return": {"result": ["Custom rpc_command_1 result"]}}
20 elif request["method"] == "help":
21 request["method"] = "listconfigs"
22 return {"replace": request}
23 return {"result": "continue"}
24
25
26plugin.run()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected