| 11 | #include <lightningd/lightningd.h> |
| 12 | |
| 13 | static 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 | |
| 30 | static const char *offer_description_from_b12(const tal_t *ctx, |
| 31 | struct lightningd *ld, |
no test coverage detected