From dee45bf02284716d5dea18e94193d74e64f7e5bf Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 20 Mar 2022 09:44:42 +0100 Subject: return new global fees from /keys --- src/include/taler_json_lib.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/include/taler_json_lib.h') 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 @@ -279,6 +279,30 @@ TALER_JSON_spec_amount_any_nbo (const char *name, TALER_JSON_pack_amount (pfx "_refund", &(dfs)->refund) +/** + * 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. * -- cgit v1.2.3