splice: Add plugin for magic “splice all” command

The command called “splice” can take a json payload or a ‘splice script’, process it into a list of ‘actions’ and then execute those actions.

These actions include or will include everything you would want to do with a splice:
* Splice into a channel
* Splice out of a channel
* Fund from wallet
* Deposit to wallet
* Send funds to bitcoin address

Changelog-Added: A new magic “splice” command is added that can take a ‘splice script’ or json payload and perform any complex splice across multiple channels merging the result into a single transaction. Some features are disabled and will be added in time.
This commit is contained in:
Dusty Daemon
2024-11-11 13:19:24 +10:30
committed by Rusty Russell
parent 7ce0dc6e2e
commit 7fd16dc493
9 changed files with 1627 additions and 2 deletions

View File

@@ -198,6 +198,17 @@ struct command_result *param_string(struct command *cmd, const char *name,
const char * buffer, const jsmntok_t *tok,
const char **str);
struct str_or_arr
{
const char *str;
const jsmntok_t *arr;
};
/* Extract a string or a json array */
struct command_result *param_string_or_array(struct command *cmd, const char *name,
const char * buffer, const jsmntok_t *tok,
struct str_or_arr **result);
/* Extract an invoice string from a generic string, strip the `lightning:`
* prefix from it if needed. */
struct command_result *param_invstring(struct command *cmd, const char *name,