aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2022-03-20 09:44:42 +0100
committerChristian Grothoff <grothoff@gnunet.org>2022-03-20 09:44:42 +0100
commitdee45bf02284716d5dea18e94193d74e64f7e5bf (patch)
treed650ece27dd5fe51ef55417eba54538618d34021 /src/include
parent1bb5a77c8da3e460b45b3faa49ed10ab6ae9190d (diff)
downloadexchange-dee45bf02284716d5dea18e94193d74e64f7e5bf.tar.xz
return new global fees from /keys
Diffstat (limited to 'src/include')
-rw-r--r--src/include/taler_exchange_service.h59
-rw-r--r--src/include/taler_exchangedb_plugin.h2
-rw-r--r--src/include/taler_json_lib.h24
3 files changed, 84 insertions, 1 deletions
diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h
index 48272a6b8..56940669d 100644
--- a/src/include/taler_exchange_service.h
+++ b/src/include/taler_exchange_service.h
@@ -204,6 +204,55 @@ struct TALER_EXCHANGE_AuditorInformation
/**
+ * Global fees and options of an exchange for a given time period.
+ */
+struct TALER_EXCHANGE_GlobalFee
+{
+
+ /**
+ * Signature affirming all of the data.
+ */
+ struct TALER_MasterSignatureP master_sig;
+
+ /**
+ * Starting time of the validity period (inclusive).
+ */
+ struct GNUNET_TIME_Timestamp start_date;
+
+ /**
+ * End time of the validity period (exclusive).
+ */
+ struct GNUNET_TIME_Timestamp end_date;
+
+ /**
+ * Unmerged purses will be timed out after at most this time.
+ */
+ struct GNUNET_TIME_Relative purse_timeout;
+
+ /**
+ * Accounts without KYC will be closed after this time.
+ */
+ struct GNUNET_TIME_Relative kyc_timeout;
+
+ /**
+ * Account history is limited to this timeframe.
+ */
+ struct GNUNET_TIME_Relative history_expiration;
+
+ /**
+ * Fees that apply globally, independent of denomination
+ * and wire method.
+ */
+ struct TALER_GlobalFeeSet fees;
+
+ /**
+ * Number of free purses per account.
+ */
+ uint32_t purse_account_limit;
+};
+
+
+/**
* @brief Information about keys from the exchange.
*/
struct TALER_EXCHANGE_Keys
@@ -230,6 +279,11 @@ struct TALER_EXCHANGE_Keys
struct TALER_EXCHANGE_AuditorInformation *auditors;
/**
+ * Array with the global fees of the exchange.
+ */
+ struct TALER_EXCHANGE_GlobalFee *global_fees;
+
+ /**
* Supported Taler protocol version by the exchange.
* String in the format current:revision:age using the
* semantics of GNU libtool. See
@@ -273,6 +327,11 @@ struct TALER_EXCHANGE_Keys
struct TALER_AgeMask age_mask;
/**
+ * Length of the @e global_fees array.
+ */
+ unsigned int num_global_fees;
+
+ /**
* Length of the @e sign_keys array (number of valid entries).
*/
unsigned int num_sign_keys;
diff --git a/src/include/taler_exchangedb_plugin.h b/src/include/taler_exchangedb_plugin.h
index 7696b607d..fc909a1ba 100644
--- a/src/include/taler_exchangedb_plugin.h
+++ b/src/include/taler_exchangedb_plugin.h
@@ -3968,7 +3968,7 @@ struct TALER_EXCHANGEDB_Plugin
* Obtain information about the global fee structure of the exchange.
*
* @param cls closure
- * @param cb function to call on each account
+ * @param cb function to call on each fee entry
* @param cb_cls closure for @a cb
* @return transaction status code
*/
diff --git a/src/include/taler_json_lib.h b/src/include/taler_json_lib.h
index 6238c07d3..b4f999001 100644
--- a/src/include/taler_json_lib.h
+++ b/src/include/taler_json_lib.h
@@ -280,6 +280,30 @@ TALER_JSON_spec_amount_any_nbo (const char *name,
/**
+ * Generate specification to parse all global fees.
+ *
+ * @param currency which currency to expect
+ * @param[out] gfs a `struct TALER_GlobalFeeSet` to initialize
+ */
+#define TALER_JSON_SPEC_GLOBAL_FEES(currency,gfs) \
+ TALER_JSON_spec_amount ("kyc_fee", (currency), &(gfs)->kyc), \
+ TALER_JSON_spec_amount ("history_fee", (currency), &(gfs)->history), \
+ TALER_JSON_spec_amount ("account_fee", (currency), &(gfs)->account), \
+ TALER_JSON_spec_amount ("purse_fee", (currency), &(gfs)->purse)
+
+/**
+ * Macro to pack all of the global fees.
+ *
+ * @param gfs a `struct TALER_GlobalFeeSet` to pack
+ */
+#define TALER_JSON_PACK_GLOBAL_FEES(gfs) \
+ TALER_JSON_pack_amount ("kyc_fee", &(gfs)->kyc), \
+ TALER_JSON_pack_amount ("history_fee", &(gfs)->history), \
+ TALER_JSON_pack_amount ("account_fee", &(gfs)->account), \
+ TALER_JSON_pack_amount ("purse_fee", &(gfs)->purse)
+
+
+/**
* Generate line in parser specification for denomination public key.
*
* @param field name of the field