| 410 | } |
| 411 | |
| 412 | void json_add_income_event(struct json_stream *out, struct income_event *ev) |
| 413 | { |
| 414 | json_object_start(out, NULL); |
| 415 | json_add_string(out, "account", ev->acct_name); |
| 416 | json_add_string(out, "tag", ev->tag); |
| 417 | json_add_amount_msat(out, "credit_msat", ev->credit); |
| 418 | json_add_amount_msat(out, "debit_msat", ev->debit); |
| 419 | json_add_string(out, "currency", chainparams->lightning_hrp); |
| 420 | json_add_u64(out, "timestamp", ev->timestamp); |
| 421 | |
| 422 | if (ev->desc) |
| 423 | json_add_string(out, "description", ev->desc); |
| 424 | |
| 425 | if (ev->outpoint) |
| 426 | json_add_outpoint(out, "outpoint", ev->outpoint); |
| 427 | |
| 428 | if (ev->txid) |
| 429 | json_add_txid(out, "txid", ev->txid); |
| 430 | |
| 431 | if (ev->payment_id) |
| 432 | json_add_sha256(out, "payment_id", ev->payment_id); |
| 433 | |
| 434 | json_object_end(out); |
| 435 | } |
| 436 | |
| 437 | const char *csv_filename(const tal_t *ctx, const struct csv_fmt *fmt) |
| 438 | { |
no test coverage detected