| 17 | #include <wire/wire_sync.h> |
| 18 | |
| 19 | static 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 | |
| 37 | static struct command_result *param_b12_offer(struct command *cmd, |
| 38 | const char *name, |
no test coverage detected