exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 8f8221da0590780a9f28cdbe950edb247019914f
parent 5dbf9d7cf1b79cdbcb09b96d5745437b9ef4aea9
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sat,  4 Apr 2026 13:34:33 +0200

fix GET /reserves/ header disorganization

Diffstat:
Msrc/include/taler/taler-exchange/get-reserves-RESERVE_PUB-history.h | 337++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
Msrc/include/taler/taler-exchange/get-reserves-RESERVE_PUB.h | 335-------------------------------------------------------------------------------
2 files changed, 336 insertions(+), 336 deletions(-)

diff --git a/src/include/taler/taler-exchange/get-reserves-RESERVE_PUB-history.h b/src/include/taler/taler-exchange/get-reserves-RESERVE_PUB-history.h @@ -22,7 +22,342 @@ #define _TALER_EXCHANGE__GET_RESERVES_RESERVE_PUB_HISTORY_H #include <taler/taler-exchange/common.h> -#include <taler/taler-exchange/get-reserves-RESERVE_PUB.h> + + +/** + * Ways how a reserve's balance may change. + */ +enum TALER_EXCHANGE_ReserveTransactionType +{ + + /** + * Deposit into the reserve. + */ + TALER_EXCHANGE_RTT_CREDIT, + + /** + * Withdrawal from the reserve. + */ + TALER_EXCHANGE_RTT_WITHDRAWAL, + + /** + * /recoup operation. + */ + TALER_EXCHANGE_RTT_RECOUP, + + /** + * Reserve closed operation. + */ + TALER_EXCHANGE_RTT_CLOSING, + + /** + * Reserve purse merge operation. + */ + TALER_EXCHANGE_RTT_MERGE, + + /** + * Reserve open request operation. + */ + TALER_EXCHANGE_RTT_OPEN, + + /** + * Reserve close request operation. + */ + TALER_EXCHANGE_RTT_CLOSE + +}; + + +/** + * @brief Entry in the reserve's transaction history. + */ +struct TALER_EXCHANGE_ReserveHistoryEntry +{ + + /** + * Type of the transaction. + */ + enum TALER_EXCHANGE_ReserveTransactionType type; + + /** + * Amount transferred (in or out). + */ + struct TALER_Amount amount; + + /** + * Details depending on @e type. + */ + union + { + + /** + * Information about a deposit that filled this reserve. + * @e type is #TALER_EXCHANGE_RTT_CREDIT. + */ + struct + { + /** + * Sender account payto://-URL of the incoming transfer. + */ + struct TALER_FullPayto sender_url; + + /** + * Information that uniquely identifies the wire transfer. + */ + uint64_t wire_reference; + + /** + * When did the wire transfer happen? + */ + struct GNUNET_TIME_Timestamp timestamp; + + } in_details; + + /** + * Information about a withdrawal operation. + * @e type is #TALER_EXCHANGE_RTT_WITHDRAWAL. + */ + struct + { + /** + * Signature authorizing the withdrawal. + */ + json_t *out_authorization_sig; + + /** + * Running hash over all hashes of blinded planchets of the withdrawal. + */ + struct TALER_HashBlindedPlanchetsP planchets_h; + + /** + * True if age restriction was required during the protocol. + */ + bool age_restricted; + + /** + * Maximum age committed, if @e age_restricted is true. + */ + uint8_t max_age; + + /** + * If @e age_restricted is true, the index not to be revealed + * after the initial commitment in /withdraw. + */ + uint8_t noreveal_index; + + /** + * If @e age_restricted is true, hash of the selected blinded planchets. + */ + struct TALER_HashBlindedPlanchetsP selected_h; + + /** + * True if no blinding_seed was provided. + */ + bool no_blinding_seed; + + /** + * For CS denominations, the seed for the prior /blinding-prepare call. + */ + struct TALER_BlindingMasterSeedP blinding_seed; + + /** + * Fee charged for the withdrawal. + */ + struct TALER_Amount fee; + + /** + * Number of coins withdrawn. + */ + uint16_t num_coins; + + } withdraw; + + /** + * Information provided if the reserve was filled via /recoup. + * @e type is #TALER_EXCHANGE_RTT_RECOUP. + */ + struct + { + /** + * Public key of the coin that was paid back. + */ + struct TALER_CoinSpendPublicKeyP coin_pub; + + /** + * Signature of type TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP. + */ + struct TALER_ExchangeSignatureP exchange_sig; + + /** + * Public key used for @e exchange_sig. + */ + struct TALER_ExchangePublicKeyP exchange_pub; + + /** + * When did the /recoup operation happen? + */ + struct GNUNET_TIME_Timestamp timestamp; + + } recoup_details; + + /** + * Information about a close operation of the reserve. + * @e type is #TALER_EXCHANGE_RTT_CLOSING. + */ + struct + { + /** + * Receiver account for the outgoing wire transfer. + */ + struct TALER_FullPayto receiver_account_details; + + /** + * Wire transfer details for the outgoing wire transfer. + */ + struct TALER_WireTransferIdentifierRawP wtid; + + /** + * Signature of type TALER_SIGNATURE_EXCHANGE_RESERVE_CLOSED. + */ + struct TALER_ExchangeSignatureP exchange_sig; + + /** + * Public key used for @e exchange_sig. + */ + struct TALER_ExchangePublicKeyP exchange_pub; + + /** + * When did the wire transfer happen? + */ + struct GNUNET_TIME_Timestamp timestamp; + + /** + * Fee charged for the closing. + */ + struct TALER_Amount fee; + + } close_details; + + /** + * Information about a merge operation on the reserve. + * @e type is #TALER_EXCHANGE_RTT_MERGE. + */ + struct + { + /** + * Fee paid for the purse. + */ + struct TALER_Amount purse_fee; + + /** + * Hash over the contract. + */ + struct TALER_PrivateContractHashP h_contract_terms; + + /** + * Merge capability key. + */ + struct TALER_PurseMergePublicKeyP merge_pub; + + /** + * Purse public key. + */ + struct TALER_PurseContractPublicKeyP purse_pub; + + /** + * Signature by the reserve approving the merge. + */ + struct TALER_ReserveSignatureP reserve_sig; + + /** + * When was the merge made? + */ + struct GNUNET_TIME_Timestamp merge_timestamp; + + /** + * When was the purse set to expire? + */ + struct GNUNET_TIME_Timestamp purse_expiration; + + /** + * Minimum age required for depositing into the purse. + */ + uint32_t min_age; + + /** + * Flags of the purse. + */ + enum TALER_WalletAccountMergeFlags flags; + + /** + * True if the purse was actually merged, false if only the + * @e purse_fee was charged. + */ + bool merged; + + } merge_details; + + /** + * Information about an open request operation on the reserve. + * @e type is #TALER_EXCHANGE_RTT_OPEN. + */ + struct + { + /** + * Signature by the reserve approving the open. + */ + struct TALER_ReserveSignatureP reserve_sig; + + /** + * Amount to be paid from the reserve balance to open the reserve. + */ + struct TALER_Amount reserve_payment; + + /** + * When was the request created? + */ + struct GNUNET_TIME_Timestamp request_timestamp; + + /** + * For how long should the reserve be kept open? + */ + struct GNUNET_TIME_Timestamp reserve_expiration; + + /** + * How many open purses should be included with the open reserve? + */ + uint32_t purse_limit; + + } open_request; + + /** + * Information about a close request operation on the reserve. + * @e type is #TALER_EXCHANGE_RTT_CLOSE. + */ + struct + { + /** + * Signature by the reserve approving the close. + */ + struct TALER_ReserveSignatureP reserve_sig; + + /** + * When was the request created? + */ + struct GNUNET_TIME_Timestamp request_timestamp; + + /** + * Hash of the payto://-URI of the target account for the closure, + * or all zeros for the reserve origin account. + */ + struct TALER_FullPaytoHashP target_account_h_payto; + + } close_request; + + } details; + +}; + /** * Possible options we can set for the GET reserves history request. diff --git a/src/include/taler/taler-exchange/get-reserves-RESERVE_PUB.h b/src/include/taler/taler-exchange/get-reserves-RESERVE_PUB.h @@ -25,341 +25,6 @@ /** - * Ways how a reserve's balance may change. - */ -enum TALER_EXCHANGE_ReserveTransactionType -{ - - /** - * Deposit into the reserve. - */ - TALER_EXCHANGE_RTT_CREDIT, - - /** - * Withdrawal from the reserve. - */ - TALER_EXCHANGE_RTT_WITHDRAWAL, - - /** - * /recoup operation. - */ - TALER_EXCHANGE_RTT_RECOUP, - - /** - * Reserve closed operation. - */ - TALER_EXCHANGE_RTT_CLOSING, - - /** - * Reserve purse merge operation. - */ - TALER_EXCHANGE_RTT_MERGE, - - /** - * Reserve open request operation. - */ - TALER_EXCHANGE_RTT_OPEN, - - /** - * Reserve close request operation. - */ - TALER_EXCHANGE_RTT_CLOSE - -}; - - -/** - * @brief Entry in the reserve's transaction history. - */ -struct TALER_EXCHANGE_ReserveHistoryEntry -{ - - /** - * Type of the transaction. - */ - enum TALER_EXCHANGE_ReserveTransactionType type; - - /** - * Amount transferred (in or out). - */ - struct TALER_Amount amount; - - /** - * Details depending on @e type. - */ - union - { - - /** - * Information about a deposit that filled this reserve. - * @e type is #TALER_EXCHANGE_RTT_CREDIT. - */ - struct - { - /** - * Sender account payto://-URL of the incoming transfer. - */ - struct TALER_FullPayto sender_url; - - /** - * Information that uniquely identifies the wire transfer. - */ - uint64_t wire_reference; - - /** - * When did the wire transfer happen? - */ - struct GNUNET_TIME_Timestamp timestamp; - - } in_details; - - /** - * Information about a withdrawal operation. - * @e type is #TALER_EXCHANGE_RTT_WITHDRAWAL. - */ - struct - { - /** - * Signature authorizing the withdrawal. - */ - json_t *out_authorization_sig; - - /** - * Running hash over all hashes of blinded planchets of the withdrawal. - */ - struct TALER_HashBlindedPlanchetsP planchets_h; - - /** - * True if age restriction was required during the protocol. - */ - bool age_restricted; - - /** - * Maximum age committed, if @e age_restricted is true. - */ - uint8_t max_age; - - /** - * If @e age_restricted is true, the index not to be revealed - * after the initial commitment in /withdraw. - */ - uint8_t noreveal_index; - - /** - * If @e age_restricted is true, hash of the selected blinded planchets. - */ - struct TALER_HashBlindedPlanchetsP selected_h; - - /** - * True if no blinding_seed was provided. - */ - bool no_blinding_seed; - - /** - * For CS denominations, the seed for the prior /blinding-prepare call. - */ - struct TALER_BlindingMasterSeedP blinding_seed; - - /** - * Fee charged for the withdrawal. - */ - struct TALER_Amount fee; - - /** - * Number of coins withdrawn. - */ - uint16_t num_coins; - - } withdraw; - - /** - * Information provided if the reserve was filled via /recoup. - * @e type is #TALER_EXCHANGE_RTT_RECOUP. - */ - struct - { - /** - * Public key of the coin that was paid back. - */ - struct TALER_CoinSpendPublicKeyP coin_pub; - - /** - * Signature of type TALER_SIGNATURE_EXCHANGE_CONFIRM_RECOUP. - */ - struct TALER_ExchangeSignatureP exchange_sig; - - /** - * Public key used for @e exchange_sig. - */ - struct TALER_ExchangePublicKeyP exchange_pub; - - /** - * When did the /recoup operation happen? - */ - struct GNUNET_TIME_Timestamp timestamp; - - } recoup_details; - - /** - * Information about a close operation of the reserve. - * @e type is #TALER_EXCHANGE_RTT_CLOSING. - */ - struct - { - /** - * Receiver account for the outgoing wire transfer. - */ - struct TALER_FullPayto receiver_account_details; - - /** - * Wire transfer details for the outgoing wire transfer. - */ - struct TALER_WireTransferIdentifierRawP wtid; - - /** - * Signature of type TALER_SIGNATURE_EXCHANGE_RESERVE_CLOSED. - */ - struct TALER_ExchangeSignatureP exchange_sig; - - /** - * Public key used for @e exchange_sig. - */ - struct TALER_ExchangePublicKeyP exchange_pub; - - /** - * When did the wire transfer happen? - */ - struct GNUNET_TIME_Timestamp timestamp; - - /** - * Fee charged for the closing. - */ - struct TALER_Amount fee; - - } close_details; - - /** - * Information about a merge operation on the reserve. - * @e type is #TALER_EXCHANGE_RTT_MERGE. - */ - struct - { - /** - * Fee paid for the purse. - */ - struct TALER_Amount purse_fee; - - /** - * Hash over the contract. - */ - struct TALER_PrivateContractHashP h_contract_terms; - - /** - * Merge capability key. - */ - struct TALER_PurseMergePublicKeyP merge_pub; - - /** - * Purse public key. - */ - struct TALER_PurseContractPublicKeyP purse_pub; - - /** - * Signature by the reserve approving the merge. - */ - struct TALER_ReserveSignatureP reserve_sig; - - /** - * When was the merge made? - */ - struct GNUNET_TIME_Timestamp merge_timestamp; - - /** - * When was the purse set to expire? - */ - struct GNUNET_TIME_Timestamp purse_expiration; - - /** - * Minimum age required for depositing into the purse. - */ - uint32_t min_age; - - /** - * Flags of the purse. - */ - enum TALER_WalletAccountMergeFlags flags; - - /** - * True if the purse was actually merged, false if only the - * @e purse_fee was charged. - */ - bool merged; - - } merge_details; - - /** - * Information about an open request operation on the reserve. - * @e type is #TALER_EXCHANGE_RTT_OPEN. - */ - struct - { - /** - * Signature by the reserve approving the open. - */ - struct TALER_ReserveSignatureP reserve_sig; - - /** - * Amount to be paid from the reserve balance to open the reserve. - */ - struct TALER_Amount reserve_payment; - - /** - * When was the request created? - */ - struct GNUNET_TIME_Timestamp request_timestamp; - - /** - * For how long should the reserve be kept open? - */ - struct GNUNET_TIME_Timestamp reserve_expiration; - - /** - * How many open purses should be included with the open reserve? - */ - uint32_t purse_limit; - - } open_request; - - /** - * Information about a close request operation on the reserve. - * @e type is #TALER_EXCHANGE_RTT_CLOSE. - */ - struct - { - /** - * Signature by the reserve approving the close. - */ - struct TALER_ReserveSignatureP reserve_sig; - - /** - * When was the request created? - */ - struct GNUNET_TIME_Timestamp request_timestamp; - - /** - * Hash of the payto://-URI of the target account for the closure, - * or all zeros for the reserve origin account. - */ - struct TALER_FullPaytoHashP target_account_h_payto; - - } close_request; - - } details; - -}; - - -/** * Possible options we can set for the GET reserves request. */ enum TALER_EXCHANGE_GetReservesOption