summaryrefslogtreecommitdiff
path: root/src/include/taler_exchangedb_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-03-03 20:31:29 +0100
committerChristian Grothoff <christian@grothoff.org>2017-03-03 20:31:29 +0100
commitf406f96129766c144c1531dc853969664f410d8c (patch)
tree6fdbae6ed117d3057ae9101ab4f799f5e3354d59 /src/include/taler_exchangedb_lib.h
parent364abbaea1383bd7d8311269d596bdc3c1d4b591 (diff)
downloadexchange-f406f96129766c144c1531dc853969664f410d8c.tar.gz
exchange-f406f96129766c144c1531dc853969664f410d8c.tar.bz2
exchange-f406f96129766c144c1531dc853969664f410d8c.zip
implement #4929: add wire transfer fee to /wire (but not yet charged by aggregator)
Diffstat (limited to 'src/include/taler_exchangedb_lib.h')
-rw-r--r--src/include/taler_exchangedb_lib.h78
1 files changed, 77 insertions, 1 deletions
diff --git a/src/include/taler_exchangedb_lib.h b/src/include/taler_exchangedb_lib.h
index 4ebe4841f..02e8cdfec 100644
--- a/src/include/taler_exchangedb_lib.h
+++ b/src/include/taler_exchangedb_lib.h
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014, 2015, 2016 Inria & GNUnet e.V.
+ Copyright (C) 2014-2017 Inria & GNUnet e.V.
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -25,6 +25,7 @@
#include "taler_signatures.h"
+
/**
* Subdirectroy under the exchange's base directory which contains
* the exchange's signing keys.
@@ -297,4 +298,79 @@ void
TALER_EXCHANGEDB_plugin_unload (struct TALER_EXCHANGEDB_Plugin *plugin);
+/**
+ * Sorted list of fees to be paid for aggregate wire transfers.
+ */
+struct TALER_EXCHANGEDB_AggregateFees
+{
+ /**
+ * This is a linked list.
+ */
+ struct TALER_EXCHANGEDB_AggregateFees *next;
+
+ /**
+ * Fee to be paid.
+ */
+ struct TALER_Amount wire_fee;
+
+ /**
+ * Time when this fee goes into effect (inclusive)
+ */
+ struct GNUNET_TIME_Absolute start_date;
+
+ /**
+ * Time when this fee stops being in effect (exclusive).
+ */
+ struct GNUNET_TIME_Absolute end_date;
+
+ /**
+ * Signature affirming the above fee structure.
+ */
+ struct TALER_MasterSignatureP master_sig;
+};
+
+
+/**
+ * Read the current fee structure from disk.
+ *
+ * @param cfg configuration to use
+ * @param wireplugin name of the wire plugin to read fees for
+ * @return sorted list of aggregation fees, NULL on error
+ */
+struct TALER_EXCHANGEDB_AggregateFees *
+TALER_EXCHANGEDB_fees_read (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *wireplugin);
+
+
+/**
+ * Convert @a af to @a wf.
+ *
+ * @param[in,out] af aggregate fees, host format (updated to round time)
+ * @param[out] wf aggregate fees, disk / signature format
+ */
+void
+TALER_EXCHANGEDB_fees_2_wf (struct TALER_EXCHANGEDB_AggregateFees *af,
+ struct TALER_MasterWireFeePS *wf);
+
+
+/**
+ * Write given fee structure to disk.
+ *
+ * @param filename where to write the fees
+ * @param af fee structure to write
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
+ */
+int
+TALER_EXCHANGEDB_fees_write (const char *filename,
+ struct TALER_EXCHANGEDB_AggregateFees *af);
+
+
+/**
+ * Free @a af data structure
+ *
+ * @param af list to free
+ */
+void
+TALER_EXCHANGEDB_fees_free (struct TALER_EXCHANGEDB_AggregateFees *af);
+
#endif