json: add "json-to-psbt" helper

Pull a PSBT out of a json buffer
This commit is contained in:
niftynei
2020-08-06 13:18:54 -05:00
committed by Rusty Russell
parent 10237ccb8e
commit df7c122cb8
2 changed files with 13 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ struct secret;
struct short_channel_id;
struct wireaddr;
struct wireaddr_internal;
struct wally_psbt;
/* Decode a hex-encoded payment preimage */
bool json_to_preimage(const char *buffer, const jsmntok_t *tok, struct preimage *preimage);
@@ -24,6 +25,10 @@ bool json_to_preimage(const char *buffer, const jsmntok_t *tok, struct preimage
/* Extract a secret from this. */
bool json_to_secret(const char *buffer, const jsmntok_t *tok, struct secret *dest);
/* Extract a psbt from this. */
bool json_to_psbt(const tal_t *ctx, const char *buffer,
const jsmntok_t *tok, struct wally_psbt **dest);
/* Extract a pubkey from this */
bool json_to_pubkey(const char *buffer, const jsmntok_t *tok,
struct pubkey *pubkey);