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

Function json_populate_offer

lightningd/offer.c:13–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11#include <lightningd/lightningd.h>
12
13static void json_populate_offer(struct json_stream *response,
14 const struct sha256 *offer_id,
15 const char *b12,
16 const struct json_escape *label,
17 enum offer_status status,
18 bool force_paths)
19{
20 json_add_sha256(response, "offer_id", offer_id);
21 json_add_bool(response, "active", offer_status_active(status));
22 json_add_bool(response, "single_use", offer_status_single(status));
23 json_add_string(response, "bolt12", b12);
24 json_add_bool(response, "force_paths", force_paths);
25 json_add_bool(response, "used", offer_status_used(status));
26 if (label)
27 json_add_escaped_string(response, "label", label);
28}
29
30static const char *offer_description_from_b12(const tal_t *ctx,
31 struct lightningd *ld,

Callers 4

json_createofferFunction · 0.85
json_listoffersFunction · 0.85
json_disableofferFunction · 0.85
json_enableofferFunction · 0.85

Calls 7

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

Tested by

no test coverage detected