#ifndef LIGHTNING_PLUGINS_BKPR_INCOMESTMT_H
#define LIGHTNING_PLUGINS_BKPR_INCOMESTMT_H
#include "config.h"
#include <ccan/tal/tal.h>
#include <common/amount.h>
#include <common/json_parse_simple.h>
#include <stdio.h>
struct bkpr;
struct command;
struct json_stream;
struct income_event {
const char *acct_name;
const char *tag;
const char *desc;
struct amount_msat credit;
struct amount_msat debit;
struct amount_msat fees;
u64 timestamp;
struct bitcoin_outpoint *outpoint;
struct bitcoin_txid *txid;
struct sha256 *payment_id;
};
struct csv_fmt {
const char *fmt_name;
void (*emit_header)(FILE *);
void (*emit_entry)(const tal_t *, FILE *, struct income_event *);
};
struct income_event **list_income_events_all(const tal_t *ctx,
const struct bkpr *bkpr,
struct command *cmd,
bool consolidate_fees);
struct income_event **list_income_events(const tal_t *ctx,
const struct bkpr *bkpr,
struct command *cmd,
u64 start_time,
u64 end_time,
bool consolidate_fees);
void json_add_income_event(struct json_stream *str, struct income_event *ev);
char *csv_print_income_events(const tal_t *ctx,
const struct csv_fmt *csvfmt,
const char *filename,
struct income_event **evs);
const struct csv_fmt *csv_match_token(const char *buffer, const jsmntok_t *tok);
const char *csv_list_fmts(const tal_t *ctx);
const char *csv_filename(const tal_t *ctx, const struct csv_fmt *fmt);
#endif