11 #include "tl/expected.hpp"
12 #include "big_int.hpp"
18 crow::json::wvalue to_json()
const;
25 crow::json::wvalue to_json()
const;
36 std::string additional_info;
37 time_t cdd_expiry_date;
52 std::string issuer_cipher_suite;
57 std::string protocol_version;
58 std::vector<WeightedUrl> redeem_service;
59 std::vector<WeightedUrl> renew_service;
61 crow::json::wvalue to_json()
const;
66 std::string signature;
68 crow::json::wvalue to_json()
const;
72 unsigned int cdd_serial;
73 std::string coins_expiry_date;
74 unsigned int denomination;
79 std::string sign_coins_not_after;
80 std::string sign_coins_not_before;
82 crow::json::wvalue to_json()
const;
87 std::string signature;
89 crow::json::wvalue to_json()
const;
95 JSON_WRONG_REQUEST_TYPE,
96 JSON_WRONG_VALUE_TYPE,
102 unsigned int message_reference;
103 unsigned int status_code;
104 std::string status_description;
106 virtual crow::json::wvalue to_json()
const;
110 unsigned int message_reference;
112 static tl::expected<RequestCDDCSerial, eError>
117 unsigned int cdd_serial;
119 crow::json::wvalue to_json()
const override;
123 unsigned int cdd_serial;
126 static tl::expected<RequestCDDC, eError>
from_string(
const std::string &str);
132 crow::json::wvalue to_json()
const override;
136 std::vector<unsigned int> denominations;
137 unsigned int message_reference;
141 static tl::expected<RequestMKCs, eError> from_string(
const std::string &str);
145 std::vector<MintKeyCert> keys;
147 crow::json::wvalue to_json()
const override;
151 BigInt blinded_payload_hash;
153 std::string reference;
154 crow::json::wvalue to_json()
const;
155 static tl::expected<Blind, eError> from_json(
const crow::json::rvalue &json);
160 std::string reference;
161 crow::json::wvalue to_json()
const;
165 unsigned int message_reference;
168 std::vector<Blind> blinds;
170 static tl::expected<RequestMint, eError> from_string(
const std::string &str);
174 std::vector<BlindSignature> blind_signatures;
176 crow::json::wvalue to_json()
const override;
181 std::string cdd_location;
182 unsigned int denomination;
185 std::string protocol_version;
188 crow::json::wvalue to_json()
const;
189 static tl::expected<Payload,eError> from_json(
const crow::json::rvalue& json);
193 std::string signature;
195 crow::json::wvalue to_json()
const;
196 static tl::expected<Coin, eError> from_json(
const crow::json::rvalue &json);
200 std::vector<Coin> coins;
203 crow::json::wvalue to_json()
const;
207 std::vector<Blind> blinds;
208 std::vector<Coin> coins;
209 unsigned int message_reference;
213 static tl::expected<RequestRenew, eError> from_string(
const std::string &str);
217 crow::json::wvalue to_json()
const override;
221 unsigned int message_reference;
225 static tl::expected<RequestResume, eError>
226 from_string(
const std::string &str);
230 std::vector<Coin> coins;
231 unsigned int message_reference;
234 static tl::expected<RequestRedeem, eError>
239 crow::json::wvalue to_json()
const override;
252 virtual tl::expected<CDDC *, bool>
getCDDC(
unsigned int cdd_serial) = 0;
269 virtual const std::vector<MintKeyCert>
270 getMKCs(
const std::vector<unsigned int> &denominations,
271 const std::vector<BigInt> &mint_key_ids) = 0;
282 virtual std::vector<BlindSignature>
283 mint(std::string
const& transaction_reference,
284 const std::vector<Blind> &blinds) = 0;
293 virtual bool redeem(
const std::vector<Coin> &coins) = 0;
303 static std::unique_ptr<Model>
getModel(
const std::string &backend_name);
Definition: model.hpp:242
virtual std::vector< BlindSignature > mint(std::string const &transaction_reference, const std::vector< Blind > &blinds)=0
virtual bool redeem(const std::vector< Coin > &coins)=0
virtual tl::expected< CDDC *, bool > getCurrentCDDC()=0
static std::unique_ptr< Model > getModel(const std::string &backend_name)
Definition: model.cpp:51
virtual tl::expected< CDDC *, bool > getCDDC(unsigned int cdd_serial)=0
virtual const std::vector< MintKeyCert > getMKCs(const std::vector< unsigned int > &denominations, const std::vector< BigInt > &mint_key_ids)=0
Definition: big_int.hpp:9
Definition: model.hpp:158
Definition: model.hpp:150
currency description document
Definition: model.hpp:34
PublicKey issuer_public_master_key
Definition: model.hpp:55
std::vector< WeightedUrl > info_service
an identity for this currency
Definition: model.hpp:50
time_t cdd_signing_date
serial number of currency description document
Definition: model.hpp:42
size_t currency_divisor
Definition: model.hpp:44
std::string currency_name
divisor used for coins of this currency
Definition: model.hpp:45
BigInt id
the available denominations of this currency
Definition: model.hpp:48
std::vector< unsigned > denominations
name of the currency (e.g. OpenCent)
Definition: model.hpp:47
size_t cdd_serial
Definition: model.hpp:41
std::string cdd_location
Definition: model.hpp:39
std::vector< WeightedUrl > mint_service
the public key of this currency
Definition: model.hpp:56
Definition: model.hpp:199
Definition: model.hpp:180
Definition: model.hpp:179
Definition: model.hpp:109
static tl::expected< RequestCDDCSerial, eError > from_string(const std::string &str)
Definition: json_serialisation.cpp:116
Definition: model.hpp:122
static tl::expected< RequestCDDC, eError > from_string(const std::string &str)
Definition: json_serialisation.cpp:139
unsigned int message_reference
The version of the CDD. (Int)
Definition: model.hpp:124
Definition: model.hpp:135
std::vector< BigInt > mint_key_ids
Definition: model.hpp:139
Definition: model.hpp:164
BigInt transaction_reference
Definition: model.hpp:167
Definition: model.hpp:229
static tl::expected< RequestRedeem, eError > from_string(const std::string &str)
Definition: json_serialisation.cpp:439
Definition: model.hpp:206
std::string transaction_reference
Definition: model.hpp:211
Definition: model.hpp:220
BigInt transaction_reference
Definition: model.hpp:223
Definition: model.hpp:116
Definition: model.hpp:129
Definition: model.hpp:216
Definition: model.hpp:144
Definition: model.hpp:173
Definition: model.hpp:238
Definition: model.hpp:101