taler-exchange-httpd_withdraw.h (2213B)
1 /* 2 This file is part of TALER 3 Copyright (C) 2025 Taler Systems SA 4 5 TALER is free software; you can redistribute it and/or modify it under the 6 terms of the GNU Affero General Public License as published by the Free Software 7 Foundation; either version 3, or (at your option) any later version. 8 9 TALER is distributed in the hope that it will be useful, but WITHOUT ANY 10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. 12 13 You should have received a copy of the GNU Affero General Public License along with 14 TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 15 */ 16 /** 17 * @file taler-exchange-httpd_withdraw.h 18 * @brief Handle /withdraw requests 19 * @note This endpoint was introduced in v26 of the protocol. 20 * @author Özgür Kesim 21 */ 22 #ifndef TALER_EXCHANGE_HTTPD_WITHDRAW_H 23 #define TALER_EXCHANGE_HTTPD_WITHDRAW_H 24 25 #include <microhttpd.h> 26 #include "taler-exchange-httpd.h" 27 28 /** 29 * Resume suspended connections, we are shutting down. 30 */ 31 void 32 TEH_withdraw_cleanup (void); 33 34 /** 35 * @brief Handle a "/withdraw" request. 36 * @note This endpoint was introduced in v24 of the protocol. 37 * 38 * Parses the batch of requested "denom_pub" which specifies 39 * the key/value of the respective coin to be withdrawn, 40 * and checks the signature "reserve_sig" for given "reserve_pub" 41 * makes this a valid withdrawal request from the specific reserve. 42 * If the "max_age" value is set in the request, 43 * it is considered a commitment to withdraw age restricted coins. 44 * If the request is valid, the response contains a noreveal_index 45 * which the client has to use for the subsequent call to /reveal-withdraw. 46 * If "max_age" value is not set, and the request is valid, the envelopes 47 * with the blinded coins "blinded_coin_evs" is processed 48 * and the client receives the blinded signatures as response. 49 * 50 * @param rc request context 51 * @param root uploaded JSON data 52 * @param args array of additional options, not used. 53 * @return MHD result code 54 */ 55 MHD_RESULT 56 TEH_handler_withdraw ( 57 struct TEH_RequestContext *rc, 58 const json_t *root, 59 const char *const args[0]); 60 61 #endif