decode: new generic API to decode bolt11 and bolt12.

This is experimental for now, but can eventually deprecated
'decodepay' and even decode other kinds of messages.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2021-01-08 05:18:47 +10:30
parent 84dc943cf5
commit c08ff167b2
10 changed files with 926 additions and 9 deletions

View File

@@ -9,10 +9,12 @@
struct amount_msat;
struct amount_sat;
struct bip340sig;
struct channel_id;
struct node_id;
struct preimage;
struct pubkey;
struct pubkey32;
struct secret;
struct short_channel_id;
struct wireaddr;
@@ -83,6 +85,16 @@ void json_add_pubkey(struct json_stream *response,
const char *fieldname,
const struct pubkey *key);
/* '"fieldname" : "89abcdef..."' or "89abcdef..." if fieldname is NULL */
void json_add_pubkey32(struct json_stream *response,
const char *fieldname,
const struct pubkey32 *key);
/* '"fieldname" : "89abcdef..."' or "89abcdef..." if fieldname is NULL */
void json_add_bip340sig(struct json_stream *response,
const char *fieldname,
const struct bip340sig *sig);
/* '"fieldname" : "89abcdef..."' or "89abcdef..." if fieldname is NULL */
void json_add_secret(struct json_stream *response,
const char *fieldname,