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