From cddfaf007f4ac22e224f3df5f0151a0d620fb131 Mon Sep 17 00:00:00 2001 From: Özgür Kesim Date: Mon, 27 Jun 2022 17:38:11 +0200 Subject: age commitment: json parser helper and support for purses added --- src/include/taler_json_lib.h | 23 +++++++++++++++++++++++ 1 file changed, 23 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 1300f875..d8912e52 100644 --- a/src/include/taler_json_lib.h +++ b/src/include/taler_json_lib.h @@ -215,6 +215,18 @@ TALER_JSON_pack_econtract ( const char *name, const struct TALER_EncryptedContract *econtract); +/** + * Generate packer instruction for a JSON field of type age_commitment + * + * @param name name of the field to add to the object + * @param age_commitment age commitment to add + * @return json pack specification + */ +struct GNUNET_JSON_PackSpec +TALER_JSON_pack_age_commitment ( + const char *name, + const struct TALER_AgeCommitment *age_commitment); + /** * Convert a TALER amount to a JSON object. @@ -294,6 +306,17 @@ TALER_JSON_spec_econtract (const char *name, struct TALER_EncryptedContract *econtract); +/** + * Provide specification to parse a given JSON object to an age commitment. + * + * @param name name of the age commitment field in the JSON + * @param[out] age_commitment where to store the age commitment + * @return spec for parsing an age commitment + */ +struct GNUNET_JSON_Specification +TALER_JSON_spec_age_commitment (const char *name, + struct TALER_AgeCommitment *age_commitment); + /** * Provide specification to parse given JSON object to an amount * in any currency in network byte order. -- cgit v1.2.3