insert_purse_request.h (3341B)
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 src/include/exchange-database/insert_purse_request.h 18 * @brief implementation of the insert_purse_request function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef EXCHANGE_DATABASE_INSERT_PURSE_REQUEST_H 22 #define EXCHANGE_DATABASE_INSERT_PURSE_REQUEST_H 23 24 #include "taler/taler_util.h" 25 #include "taler/taler_json_lib.h" 26 #include "exchangedb_lib.h" 27 28 29 /** 30 * Function called to create a new purse with certain meta data. 31 * 32 * Primary test table: `purse_requests` (see test_purse_requests.c). 33 * 34 * @param pg the database context 35 * @param purse_pub public key of the new purse 36 * @param merge_pub public key providing the merge capability 37 * @param purse_expiration time when the purse will expire 38 * @param h_contract_terms hash of the contract for the purse 39 * @param age_limit age limit to enforce for payments into the purse 40 * @param flags flags for the operation 41 * @param purse_fee fee we are allowed to charge to the reserve (depending on @a flags) 42 * @param amount target amount (with fees) to be put into the purse 43 * @param purse_sig signature with @a purse_pub's private key affirming the above 44 * @param[out] in_conflict set to true if the meta data 45 * conflicts with an existing purse; 46 * in this case, the return value will be 47 * #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT despite the failure 48 * @return transaction status code 49 */ 50 enum GNUNET_DB_QueryStatus 51 TALER_EXCHANGEDB_insert_purse_request (struct TALER_EXCHANGEDB_PostgresContext * 52 pg, 53 const struct 54 TALER_PurseContractPublicKeyP * 55 purse_pub, 56 const struct TALER_PurseMergePublicKeyP * 57 merge_pub, 58 struct GNUNET_TIME_Timestamp 59 purse_expiration, 60 const struct TALER_PrivateContractHashP * 61 h_contract_terms, 62 uint32_t age_limit, 63 enum TALER_WalletAccountMergeFlags flags, 64 const struct TALER_Amount *purse_fee, 65 const struct TALER_Amount *amount, 66 const struct 67 TALER_PurseContractSignatureP * 68 purse_sig, 69 bool *in_conflict); 70 71 #endif