insert_purse_request.h (3269B)
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 * @param pg the database context 33 * @param purse_pub public key of the new purse 34 * @param merge_pub public key providing the merge capability 35 * @param purse_expiration time when the purse will expire 36 * @param h_contract_terms hash of the contract for the purse 37 * @param age_limit age limit to enforce for payments into the purse 38 * @param flags flags for the operation 39 * @param purse_fee fee we are allowed to charge to the reserve (depending on @a flags) 40 * @param amount target amount (with fees) to be put into the purse 41 * @param purse_sig signature with @a purse_pub's private key affirming the above 42 * @param[out] in_conflict set to true if the meta data 43 * conflicts with an existing purse; 44 * in this case, the return value will be 45 * #GNUNET_DB_STATUS_SUCCESS_ONE_RESULT despite the failure 46 * @return transaction status code 47 */ 48 enum GNUNET_DB_QueryStatus 49 TALER_EXCHANGEDB_insert_purse_request (struct TALER_EXCHANGEDB_PostgresContext * 50 pg, 51 const struct 52 TALER_PurseContractPublicKeyP * 53 purse_pub, 54 const struct TALER_PurseMergePublicKeyP * 55 merge_pub, 56 struct GNUNET_TIME_Timestamp 57 purse_expiration, 58 const struct TALER_PrivateContractHashP * 59 h_contract_terms, 60 uint32_t age_limit, 61 enum TALER_WalletAccountMergeFlags flags, 62 const struct TALER_Amount *purse_fee, 63 const struct TALER_Amount *amount, 64 const struct 65 TALER_PurseContractSignatureP * 66 purse_sig, 67 bool *in_conflict); 68 69 #endif