do_reserve_open.h (3161B)
1 /* 2 This file is part of TALER 3 Copyright (C) 2022 Taler Systems SA 4 5 TALER is free software; you can redistribute it and/or modify it under the 6 terms of the GNU 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 General Public License for more details. 12 13 You should have received a copy of the GNU General Public License along with 14 TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 15 */ 16 /** 17 * @file do_reserve_open.h 18 * @brief implementation of the do_reserve_open function 19 * @author Christian Grothoff 20 */ 21 #ifndef EXCHANGE_DATABASE_DO_RESERVE_OPEN_H 22 #define EXCHANGE_DATABASE_DO_RESERVE_OPEN_H 23 24 #include "taler/taler_util.h" 25 #include "taler/taler_json_lib.h" 26 #include "exchangedb_lib.h" 27 28 29 /** 30 * Perform reserve open operation on database. 31 * 32 * Primary test table: `reserves_open_requests` (see test_reserves_open_requests.c). 33 * 34 * @param pg the database context 35 * @param reserve_pub which reserve is this about? 36 * @param total_paid total amount paid (coins and reserve) 37 * @param reserve_payment amount to be paid from the reserve 38 * @param min_purse_limit minimum number of purses we should be able to open 39 * @param reserve_sig signature by the reserve for the operation 40 * @param desired_expiration when should the reserve expire (earliest time) 41 * @param now when did we the client initiate the action 42 * @param open_fee annual fee to be charged for the open operation by the exchange 43 * @param[out] no_funds set to true if reserve balance is insufficient 44 * @param[out] reserve_balance set to the original reserve balance (at the start of this transaction) 45 * @param[out] open_cost set to the actual cost 46 * @param[out] final_expiration when will the reserve expire now 47 * @return transaction status code 48 */ 49 enum GNUNET_DB_QueryStatus 50 TALER_EXCHANGEDB_do_reserve_open (struct TALER_EXCHANGEDB_PostgresContext *pg, 51 const struct TALER_ReservePublicKeyP * 52 reserve_pub, 53 const struct TALER_Amount *total_paid, 54 const struct TALER_Amount *reserve_payment, 55 uint32_t min_purse_limit, 56 const struct TALER_ReserveSignatureP * 57 reserve_sig, 58 struct GNUNET_TIME_Timestamp 59 desired_expiration, 60 struct GNUNET_TIME_Timestamp now, 61 const struct TALER_Amount *open_fee, 62 bool *no_funds, 63 struct TALER_Amount *reserve_balance, 64 struct TALER_Amount *open_cost, 65 struct GNUNET_TIME_Timestamp *final_expiration 66 ); 67 68 69 #endif