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

Function json_add_income_event

plugins/bkpr/incomestmt.c:412–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410}
411
412void 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
437const char *csv_filename(const tal_t *ctx, const struct csv_fmt *fmt)
438{

Callers 1

do_list_incomeFunction · 0.70

Calls 8

json_object_startFunction · 0.85
json_add_amount_msatFunction · 0.85
json_add_u64Function · 0.85
json_add_outpointFunction · 0.85
json_add_txidFunction · 0.85
json_add_sha256Function · 0.85
json_object_endFunction · 0.85
json_add_stringFunction · 0.50

Tested by

no test coverage detected