Electroneum
wallet_light_rpc.h
Go to the documentation of this file.
1 // Copyright (c) 2014-2018, The Monero Project
2 //
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without modification, are
6 // permitted provided that the following conditions are met:
7 //
8 // 1. Redistributions of source code must retain the above copyright notice, this list of
9 // conditions and the following disclaimer.
10 //
11 // 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 // of conditions and the following disclaimer in the documentation and/or other
13 // materials provided with the distribution.
14 //
15 // 3. Neither the name of the copyright holder nor the names of its contributors may be
16 // used to endorse or promote products derived from this software without specific
17 // prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
20 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22 // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
27 // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 //
29 // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
30 
31 #pragma once
33 #include "crypto/hash.h"
34 
35 namespace tools
36 {
37  //-----------------------------------------------
39  {
40  struct request_t
41  {
44 
49  };
50  typedef epee::misc_utils::struct_init<request_t> request;
51 
52  struct spent_output {
58 
59 
61  KV_SERIALIZE(amount)
63  KV_SERIALIZE(tx_pub_key)
64  KV_SERIALIZE(out_index)
65  KV_SERIALIZE(mixin)
67  };
68 
69  struct transaction
70  {
78  std::list<spent_output> spent_outputs;
80  bool coinbase;
81  bool mempool;
83 
85  KV_SERIALIZE(id)
87  KV_SERIALIZE(timestamp)
88  KV_SERIALIZE(total_received)
89  KV_SERIALIZE(total_sent)
90  KV_SERIALIZE(unlock_time)
92  KV_SERIALIZE(spent_outputs)
93  KV_SERIALIZE(payment_id)
94  KV_SERIALIZE(coinbase)
95  KV_SERIALIZE(mempool)
96  KV_SERIALIZE(mixin)
98  };
99 
100 
101  struct response_t
102  {
103  //std::list<std::string> txs_as_json;
105  uint64_t total_received_unlocked = 0; // OpenMonero only
107  std::vector<transaction> transactions;
112  KV_SERIALIZE(total_received)
113  KV_SERIALIZE(total_received_unlocked)
114  KV_SERIALIZE(scanned_height)
115  KV_SERIALIZE(transactions)
116  KV_SERIALIZE(blockchain_height)
117  KV_SERIALIZE(scanned_block_height)
118  KV_SERIALIZE(status)
120  };
121  typedef epee::misc_utils::struct_init<response_t> response;
122  };
123 
124  //-----------------------------------------------
126  {
127  struct request_t
128  {
131 
136  };
137  typedef epee::misc_utils::struct_init<request_t> request;
138 
139  struct spent_output
140  {
146 
148  KV_SERIALIZE(amount)
150  KV_SERIALIZE(tx_pub_key)
151  KV_SERIALIZE(out_index)
152  KV_SERIALIZE(mixin)
154  };
155 
156  struct response_t
157  {
166  std::list<spent_output> spent_outputs;
168  KV_SERIALIZE(locked_funds)
169  KV_SERIALIZE(total_received)
170  KV_SERIALIZE(total_sent)
171  KV_SERIALIZE(scanned_height)
172  KV_SERIALIZE(scanned_block_height)
173  KV_SERIALIZE(start_height)
174  KV_SERIALIZE(transaction_height)
175  KV_SERIALIZE(blockchain_height)
176  KV_SERIALIZE(spent_outputs)
178  };
179  typedef epee::misc_utils::struct_init<response_t> response;
180  };
181 
182  //-----------------------------------------------
184  {
185  struct request_t
186  {
190  // OpenMonero specific
192  bool use_dust;
194 
196  KV_SERIALIZE(amount)
199  KV_SERIALIZE(mixin)
200  KV_SERIALIZE(use_dust)
201  KV_SERIALIZE(dust_threshold)
203  };
204  typedef epee::misc_utils::struct_init<request_t> request;
205 
206 
207  struct output {
216  std::vector<std::string> spend_key_images;
219 
220 
222  KV_SERIALIZE(amount)
224  KV_SERIALIZE(index)
225  KV_SERIALIZE(global_index)
227  KV_SERIALIZE(tx_hash)
228  KV_SERIALIZE(tx_pub_key)
229  KV_SERIALIZE(tx_prefix_hash)
230  KV_SERIALIZE(spend_key_images)
231  KV_SERIALIZE(timestamp)
234  };
235 
236  struct response_t
237  {
239  std::list<output> outputs;
244  KV_SERIALIZE(amount)
245  KV_SERIALIZE(outputs)
246  KV_SERIALIZE(per_kb_fee)
247  KV_SERIALIZE(status)
248  KV_SERIALIZE(reason)
250  };
251  typedef epee::misc_utils::struct_init<response_t> response;
252  };
253  //-----------------------------------------------
255  {
256  struct request_t
257  {
261 
265  KV_SERIALIZE(create_account)
267  };
268  typedef epee::misc_utils::struct_init<request_t> request;
269 
270  struct response_t
271  {
275 
277  KV_SERIALIZE(status)
278  KV_SERIALIZE(reason)
279  KV_SERIALIZE(new_address)
281  };
282  typedef epee::misc_utils::struct_init<response_t> response;
283  };
284  //-----------------------------------------------
286  {
287  struct request_t
288  {
291 
296  };
297  typedef epee::misc_utils::struct_init<request_t> request;
298 
299  struct response_t
300  {
307 
309  KV_SERIALIZE(payment_id)
310  KV_SERIALIZE(import_fee)
311  KV_SERIALIZE(new_request)
312  KV_SERIALIZE(request_fulfilled)
313  KV_SERIALIZE(payment_address)
314  KV_SERIALIZE(status)
316  };
317  typedef epee::misc_utils::struct_init<response_t> response;
318  };
319  //-----------------------------------------------
320 }
::std::string string
Definition: gtest-port.h:1097
uint64_t height
Definition: blockchain.cpp:91
#define KV_SERIALIZE(varialble)
unsigned int uint32_t
Definition: stdint.h:126
Various Tools.
Definition: tools.cpp:31
unsigned __int64 uint64_t
Definition: stdint.h:136
POD_CLASS public_key
Definition: crypto.h:76
POD_CLASS key_image
Definition: crypto.h:102
POD_CLASS hash
Definition: hash.h:50
#define END_KV_SERIALIZE_MAP()
#define BEGIN_KV_SERIALIZE_MAP()