MCPcopy Create free account
hub / github.com/ElementsProject/lightning / json_populate_offer

Function json_populate_offer

lightningd/offer.c:19–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17#include <wire/wire_sync.h>
18
19static void json_populate_offer(struct json_stream *response,
20 const struct sha256 *offer_id,
21 const char *b12,
22 const char *b12_nosig,
23 const struct json_escape *label,
24 enum offer_status status)
25{
26 json_add_sha256(response, "offer_id", offer_id);
27 json_add_bool(response, "active", offer_status_active(status));
28 json_add_bool(response, "single_use", offer_status_single(status));
29 json_add_string(response, "bolt12", b12);
30 if (b12_nosig)
31 json_add_string(response, "bolt12_unsigned", b12_nosig);
32 json_add_bool(response, "used", offer_status_used(status));
33 if (label)
34 json_add_escaped_string(response, "label", label);
35}
36
37static struct command_result *param_b12_offer(struct command *cmd,
38 const char *name,

Callers 3

json_createofferFunction · 0.85
json_listoffersFunction · 0.85
json_disableofferFunction · 0.85

Calls 7

offer_status_activeFunction · 0.85
offer_status_singleFunction · 0.85
offer_status_usedFunction · 0.85
json_add_sha256Function · 0.50
json_add_boolFunction · 0.50
json_add_stringFunction · 0.50
json_add_escaped_stringFunction · 0.50

Tested by

no test coverage detected