11 #include "tl/expected.hpp"
12 #include "big_int.hpp"
18 crow::json::wvalue to_json()
const;
25 crow::json::wvalue to_json()
const;
31 std::string additional_info;
32 time_t cdd_expiry_date;
33 std::string cdd_location;
35 time_t cdd_signing_date;
36 size_t currency_divisor;
37 std::string currency_name;
38 std::vector<unsigned> denominations;
41 std::vector<WeightedUrl> info_service;
42 std::string issuer_cipher_suite;
44 issuer_public_master_key;
50 std::vector<WeightedUrl> mint_service;
51 std::string protocol_version;
52 std::vector<WeightedUrl> redeem_service;
53 std::vector<WeightedUrl> renew_service;
55 crow::json::wvalue to_json()
const;
60 std::string signature;
62 crow::json::wvalue to_json()
const;
66 unsigned int cdd_serial;
67 std::string coins_expiry_date;
68 unsigned int denomination;
73 std::string sign_coins_not_after;
74 std::string sign_coins_not_before;
76 crow::json::wvalue to_json()
const;
81 std::string signature;
83 crow::json::wvalue to_json()
const;
89 JSON_WRONG_REQUEST_TYPE,
90 JSON_WRONG_VALUE_TYPE,
96 unsigned int message_reference;
97 unsigned int status_code;
98 std::string status_description;
100 virtual crow::json::wvalue to_json()
const;
104 unsigned int message_reference;
106 static tl::expected<RequestCDDSerial, eError>
111 unsigned int cdd_serial;
113 crow::json::wvalue to_json()
const override;
117 unsigned int cdd_serial;
120 static tl::expected<RequestCDDC, eError>
from_string(
const std::string &str);
126 crow::json::wvalue to_json()
const override;
130 std::vector<unsigned int> denominations;
131 unsigned int message_reference;
135 static tl::expected<RequestMKCs, eError> from_string(
const std::string &str);
139 std::vector<MintKeyCert> keys;
141 crow::json::wvalue to_json()
const override;
145 BigInt blinded_payload_hash;
147 std::string reference;
148 crow::json::wvalue to_json()
const;
149 static tl::expected<Blind, eError> from_json(
const crow::json::rvalue &json);
154 std::string reference;
155 crow::json::wvalue to_json()
const;
159 unsigned int message_reference;
162 std::vector<Blind> blinds;
164 static tl::expected<RequestMint, eError> from_string(
const std::string &str);
168 std::vector<BlindSignature> blind_signatures;
170 crow::json::wvalue to_json()
const override;
175 std::string cdd_location;
176 unsigned int denomination;
179 std::string protocol_version;
182 crow::json::wvalue to_json()
const;
183 static tl::expected<Payload,eError> from_json(
const crow::json::rvalue& json);
187 std::string signature;
189 crow::json::wvalue to_json()
const;
190 static tl::expected<Coin, eError> from_json(
const crow::json::rvalue &json);
194 std::vector<Coin> coins;
197 crow::json::wvalue to_json()
const;
201 std::vector<Blind> blinds;
202 std::vector<Coin> coins;
203 unsigned int message_reference;
207 static tl::expected<RequestRenew, eError> from_string(
const std::string &str);
211 crow::json::wvalue to_json()
const override;
215 unsigned int message_reference;
219 static tl::expected<RequestResume, eError>
220 from_string(
const std::string &str);
224 std::vector<Coin> coins;
225 unsigned int message_reference;
228 static tl::expected<RequestRedeem, eError>
233 crow::json::wvalue to_json()
const override;
240 virtual tl::expected<CDDC *, bool> getCDDC(
unsigned int cdd_serial) = 0;
241 virtual tl::expected<CDDC *, bool> getCurrentCDDC() = 0;
243 virtual const std::vector<MintKeyCert>
244 getMKCs(
const std::vector<unsigned int> &denominations,
245 const std::vector<BigInt> &mint_key_ids) = 0;
247 virtual std::vector<BlindSignature>
248 mint(std::string
const& transaction_reference,
249 const std::vector<Blind> &blinds) = 0;
250 virtual bool redeem(
const std::vector<Coin> &coins) = 0;
252 static std::unique_ptr<Model> getModel(
const std::string &backend_name);
Definition: model.hpp:236
Definition: big_int.hpp:9
Definition: model.hpp:152
Definition: model.hpp:144
Definition: model.hpp:193
Definition: model.hpp:174
Definition: model.hpp:173
Definition: model.hpp:116
static tl::expected< RequestCDDC, eError > from_string(const std::string &str)
Definition: model.cpp:139
unsigned int message_reference
The version of the CDD. (Int)
Definition: model.hpp:118
Definition: model.hpp:103
static tl::expected< RequestCDDSerial, eError > from_string(const std::string &str)
Definition: model.cpp:116
Definition: model.hpp:129
std::vector< BigInt > mint_key_ids
Definition: model.hpp:133
Definition: model.hpp:158
BigInt transaction_reference
Definition: model.hpp:161
Definition: model.hpp:223
static tl::expected< RequestRedeem, eError > from_string(const std::string &str)
Definition: model.cpp:439
Definition: model.hpp:200
std::string transaction_reference
Definition: model.hpp:205
Definition: model.hpp:214
BigInt transaction_reference
Definition: model.hpp:217
Definition: model.hpp:123
Definition: model.hpp:110
Definition: model.hpp:210
Definition: model.hpp:138
Definition: model.hpp:167
Definition: model.hpp:232