summaryrefslogtreecommitdiff
path: root/src/include/taler_json_lib.h
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/taler_json_lib.h
parent1bb5a77c8da3e460b45b3faa49ed10ab6ae9190d (diff)
downloadexchange-dee45bf02284716d5dea18e94193d74e64f7e5bf.tar.gz
exchange-dee45bf02284716d5dea18e94193d74e64f7e5bf.tar.bz2
exchange-dee45bf02284716d5dea18e94193d74e64f7e5bf.zip
return new global fees from /keys
Diffstat (limited to 'src/include/taler_json_lib.h')
-rw-r--r--src/include/taler_json_lib.h24
1 files changed, 24 insertions, 0 deletions
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