(plugin, rpc_command, **kwargs)
| 9 | |
| 10 | @plugin.hook("rpc_command") |
| 11 | def 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 | |
| 26 | plugin.run() |
nothing calls this directly
no outgoing calls
no test coverage detected