commit 46da92d5035214b0090de643db33479cf8454b98
parent 312c76fbeca4812e92fee845a0a089e65d577776
Author: Özgür Kesim <oec-taler@kesim.org>
Date: Wed, 19 Mar 2025 13:45:28 +0100
[exchange] Added new reserve history entry for withdraw
Starting with protocol version v26, the history
for the reserve will contain a new entry for WITHDRAW.
(The former entry is now BATCH_WITHDRAW and will be phased out)
Diffstat:
1 file changed, 55 insertions(+), 12 deletions(-)
diff --git a/core/api-exchange.rst b/core/api-exchange.rst
@@ -1537,7 +1537,7 @@ exchange.
Blinding Prepare
~~~~~~~~~~~~~~~~
-.. note:: This endpoint is available since v24 of the API and is a substitute
+.. note:: This endpoint is available since v26 of the API and is a substitute
for ``/csr-withdraw``.
@@ -1621,7 +1621,7 @@ Blinding Prepare
CSR-Withdraw
~~~~~~~~~~~~
-.. note:: This endpoint is deprecated starting with API version v24.
+.. note:: This endpoint is deprecated starting with API version v26.
Use ``/blinding-prepare`` instead.
.. http:post:: /csr-withdraw
@@ -1707,7 +1707,7 @@ Withdraw
.. http:post:: /withdraw
.. note::
- This endpoint is available starting with API version v24.
+ This endpoint is available starting with API version v26.
It combines and replaces the endpoints ``/reserves/$RESERVE_PUB/batch-withdraw``
and ``/reserves/$RESERVE_PUB/age-withdraw``.
@@ -1963,7 +1963,7 @@ Batch Withdraw
.. http:post:: /reserves/$RESERVE_PUB/batch-withdraw
.. note::
- This endpoint becomes deprecated starting with API version v24.
+ This endpoint becomes deprecated starting with API version v26.
Use the ``/withdraw`` endpoint instead, see `Withdraw`_.
Withdraw multiple coins from the same reserve. Note that the client should
@@ -2065,7 +2065,7 @@ Reveal
------
.. note::
- These endpoints are available starting with API version v24.
+ These endpoints are available starting with API version v26.
These endpoints are called by the client
@@ -2338,6 +2338,7 @@ Reserve History
// Union discriminated by the "type" field.
type TransactionHistoryItem =
| AccountSetupTransaction
+ | ReserveBatchWithdrawTransaction
| ReserveWithdrawTransaction
| ReserveCreditTransaction
| ReserveClosingTransaction
@@ -2375,10 +2376,12 @@ Reserve History
}
- .. ts:def:: ReserveWithdrawTransaction
+ .. ts:def:: ReserveBatchWithdrawTransaction
- interface ReserveWithdrawTransaction {
- type: "WITHDRAW";
+ // NOTE: This interface is will be phased out after v26
+ // of the protocol
+ interface ReserveBatchWithdrawTransaction {
+ type: "BATCH_WITHDRAW";
// Offset of this entry in the reserve history.
// Useful to request incremental histories via
@@ -2406,6 +2409,46 @@ Reserve History
withdraw_fee: Amount;
}
+ .. ts:def:: ReserveWithdrawTransaction
+
+ interface ReserveWithdrawTransaction {
+ type: "WITHDRAW";
+
+ // Offset of this entry in the reserve history.
+ // Useful to request incremental histories via
+ // the "start" query parameter.
+ history_offset: Integer;
+
+ // Amount withdrawn.
+ amount: Amount;
+
+ // Total fee that is charged for withdraw.
+ withdraw_fee: Amount;
+
+ // Signature over a `TALER_WithdrawRequestPS`
+ // with purpose ``TALER_SIGNATURE_WALLET_RESERVE_WITHDRAW``
+ // created with the reserve's private key.
+ reserve_sig: EddsaSignature;
+
+ // The hash of the withdraw commitment (TALER_WithdrawCommitmentHashP)
+ // from the previous call to /withdraw.
+ withdraw_commitment_h: HashCode;
+
+ // The array of blinded coins to be signed.
+ h_coin_evs: HashCode[];
+
+ // The array of hashes of public key of denominations for the coins.
+ denom_pub_hashes: HashCode[];
+
+ // The maximum age committed to, if the withdraw request
+ // required age-restriction
+ max_age?: Integer;
+
+ // The noreveal index that was returned as part
+ // of a age-restricted withdraw, if applicable
+ noreveal_index?: Integer;
+ }
+
.. ts:def:: ReserveCreditTransaction
@@ -3449,7 +3492,7 @@ the API during normal operation.
.. http:post:: /melt/$COIN_PUB
.. note::
- This endpoint will become available starting with version v24 of the API.
+ This endpoint will become available starting with version v26 of the API.
.. warning:: This endpoint is still work-in-progress!
@@ -3585,11 +3628,11 @@ the API during normal operation.
}
-.. _pre24refresh:
+.. _pre26refresh:
.. http:post:: /coins/$COIN_PUB/melt
.. note::
- This endpoint will become depreciated starting with version v24 of the API.
+ This endpoint will become depreciated starting with version v26 of the API.
Use ``/melt/$COIN_PUB`` instead, see `melt`_.
"Melts" a coin. Invalidates the coins and prepares for exchanging of fresh
@@ -3705,7 +3748,7 @@ the API during normal operation.
.. note::
- This endpoint will become depreciated starting with version v24 of the API.
+ This endpoint will become depreciated starting with version v26 of the API.
Use ``/reveal-melt/$RCH`` then instead, see `Reveal`_.
Reveal previously committed values to the exchange, except for the values