| 178 | AUTODATA(json_command, &newaddr_command); |
| 179 | |
| 180 | static void json_add_address_details(struct json_stream *response, |
| 181 | const u64 keyidx, |
| 182 | const char *out_p2wpkh, |
| 183 | const char *out_p2tr, |
| 184 | enum addrtype addrtype) |
| 185 | { |
| 186 | json_object_start(response, NULL); |
| 187 | json_add_u64(response, "keyidx", keyidx); |
| 188 | if (!streq(out_p2wpkh, "")) { |
| 189 | json_add_string(response, "bech32", out_p2wpkh); |
| 190 | } |
| 191 | if (!streq(out_p2tr,"")) { |
| 192 | json_add_string(response, "p2tr", out_p2tr); |
| 193 | } |
| 194 | json_object_end(response); |
| 195 | } |
| 196 | |
| 197 | static struct command_result *json_listaddresses(struct command *cmd, |
| 198 | const char *buffer, |
no test coverage detected