exchange_api_handle.h (2524B)
1 /* 2 This file is part of TALER 3 Copyright (C) 2014, 2015, 2023 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 15 <http://www.gnu.org/licenses/> 16 */ 17 /** 18 * @file lib/exchange_api_handle.h 19 * @brief Internal interface to the handle part of the exchange's HTTP API 20 * @author Christian Grothoff 21 */ 22 #ifndef EXCHANGE_API_HANDLE_H 23 #define EXCHANGE_API_HANDLE_H 24 25 #include <gnunet/gnunet_curl_lib.h> 26 #include "taler/taler_auditor_service.h" 27 #include "taler/taler_exchange_service.h" 28 #include "taler/taler_util.h" 29 #include "taler/taler_curl_lib.h" 30 31 32 /** 33 * Function called for each auditor to give us a chance to possibly 34 * launch a deposit confirmation interaction. 35 * 36 * @param cls closure 37 * @param auditor_url base URL of the auditor 38 * @param auditor_pub public key of the auditor 39 */ 40 typedef void 41 (*TEAH_AuditorCallback)( 42 void *cls, 43 const char *auditor_url, 44 const struct TALER_AuditorPublicKeyP *auditor_pub); 45 46 47 /** 48 * Iterate over all available auditors for @a h, calling 49 * @a ac and giving it a chance to start a deposit 50 * confirmation interaction. 51 * 52 * @param keys the keys to go over auditors for 53 * @param ac function to call per auditor 54 * @param ac_cls closure for @a ac 55 */ 56 void 57 TALER_EXCHANGE_get_auditors_for_dc_ ( 58 struct TALER_EXCHANGE_Keys *keys, 59 TEAH_AuditorCallback ac, 60 void *ac_cls); 61 62 63 /** 64 * Decode the JSON in @a resp_obj from the /keys response 65 * and store the data in the @a key_data. 66 * 67 * @param[in] resp_obj JSON object to parse 68 * @param check_sig true if we should check the signature 69 * @param[out] key_data where to store the results we decoded 70 * @param[out] vc where to store version compatibility data 71 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error 72 * (malformed JSON) 73 */ 74 enum GNUNET_GenericReturnValue 75 TALER_EXCHANGE_decode_keys_json_ ( 76 const json_t *resp_obj, 77 bool check_sig, 78 struct TALER_EXCHANGE_Keys *key_data, 79 enum TALER_EXCHANGE_VersionCompatibility *vc); 80 81 82 /* end of exchange_api_handle.h */ 83 #endif