mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
json: Add helper to extract a secret from JSON
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#define LIGHTNING_COMMON_JSON_H
|
||||
#include "config.h"
|
||||
#include <bitcoin/preimage.h>
|
||||
#include <bitcoin/privkey.h>
|
||||
#include <ccan/tal/tal.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
@@ -49,6 +50,9 @@ bool json_to_int(const char *buffer, const jsmntok_t *tok, int *num);
|
||||
/* Extract boolean from this */
|
||||
bool json_to_bool(const char *buffer, const jsmntok_t *tok, bool *b);
|
||||
|
||||
/* Extract a secret from this. */
|
||||
bool json_to_secret(const char *buffer, const jsmntok_t *tok, struct secret *dest);
|
||||
|
||||
/* Is this a number? [0..9]+ */
|
||||
bool json_tok_is_num(const char *buffer, const jsmntok_t *tok);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user