diff --git a/docs/source/interface.rst b/docs/source/interface.rst index 0ec7d3910c1fe7a70d769f67324dac3bb2eb8b98..d899f5451e189313737baeccaa11ff82fd9049db 100644 --- a/docs/source/interface.rst +++ b/docs/source/interface.rst @@ -32,11 +32,15 @@ If the voucher is not known then the response is **NOT FOUND**. For any voucher which has previously been submitted, the response is **OK** with an ``application/json`` content-type response body like:: - {"value": <string>, "created": <iso8601 timestamp>, "redeemed": bool, "version": 1} + {"value": <string>, "created": <iso8601 timestamp>, "redeemed": <boolean>, "token-count": <number>, "version": 1} The ``value`` property merely indicates the voucher which was requested. The ``created`` property indicates when the voucher was first added to the node. The ``redeemed`` property indicates whether or not the voucher has successfully been redeemed with a payment server yet. +The ``token-count`` property gives the number of blinded token signatures the client received in exchange for redemption of the voucher +(each blinded token signature can be used to construct a one ZKAP), +if it has been redeemed. +If it has not been redeemed then it is ``null``. The ``version`` property indicates the semantic version of the data being returned. When properties are removed or the meaning of a property is changed, diff --git a/src/_zkapauthorizer/model.py b/src/_zkapauthorizer/model.py index 331ec04a990f526cd651abd15e3e3c0cb2a14739..6be37722c61955255d154fe98fe732d9dd7923cb 100644 --- a/src/_zkapauthorizer/model.py +++ b/src/_zkapauthorizer/model.py @@ -464,7 +464,7 @@ class Voucher(object): number=values[u"number"], created=None if values[u"created"] is None else parse_datetime(values[u"created"]), redeemed=values[u"redeemed"], - token_count=values[u"token_count"], + token_count=values[u"token-count"], ) @@ -481,6 +481,6 @@ class Voucher(object): u"number": self.number, u"created": None if self.created is None else self.created.isoformat(), u"redeemed": self.redeemed, - u"token_count": self.token_count, + u"token-count": self.token_count, u"version": 1, }