common: json_to_msat and json_to_sat helpers.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-02-21 11:16:57 +10:30
parent a25e22737c
commit 177cfd9edc
3 changed files with 30 additions and 0 deletions

View File

@@ -4,6 +4,8 @@
#include "config.h"
#include <common/json.h>
struct amount_msat;
struct amount_sat;
struct pubkey;
struct short_channel_id;
@@ -20,4 +22,12 @@ bool json_to_short_channel_id(const char *buffer, const jsmntok_t *tok,
struct short_channel_id *scid,
bool may_be_deprecated_form);
/* Extract a satoshis amount from this */
bool json_to_sat(const char *buffer, const jsmntok_t *tok,
struct amount_sat *sat);
/* Extract a millisatoshis amount from this */
bool json_to_msat(const char *buffer, const jsmntok_t *tok,
struct amount_msat *msat);
#endif /* LIGHTNING_COMMON_JSON_HELPERS_H */