-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpy_monero_wallet.h
More file actions
566 lines (430 loc) · 24.3 KB
/
py_monero_wallet.h
File metadata and controls
566 lines (430 loc) · 24.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
#pragma once
#include <pybind11/stl_bind.h>
#include <pybind11/eval.h>
#include "py_monero_wallet_model.h"
#include "wallet/monero_wallet.h"
class PyMoneroWalletConnectionManagerListener : public PyMoneroConnectionManagerListener {
public:
PyMoneroWalletConnectionManagerListener(monero::monero_wallet* wallet);
void on_connection_changed(std::shared_ptr<PyMoneroRpcConnection> &connection);
private:
monero::monero_wallet *m_wallet;
};
class PyMoneroWalletListener : public monero_wallet_listener {
public:
void on_sync_progress(uint64_t height, uint64_t start_height, uint64_t end_height, double percent_done, const std::string& message) override;
void on_new_block(uint64_t height) override;
void on_balances_changed(uint64_t new_balance, uint64_t new_unlocked_balance) override;
void on_output_received(const monero_output_wallet& output) override;
void on_output_spent(const monero_output_wallet& output) override;
};
PYBIND11_MAKE_OPAQUE(std::vector<std::string>);
PYBIND11_MAKE_OPAQUE(std::vector<std::shared_ptr<monero::monero_block>>);
PYBIND11_MAKE_OPAQUE(std::vector<std::shared_ptr<monero::monero_block_header>>);
PYBIND11_MAKE_OPAQUE(std::vector<std::shared_ptr<monero::monero_tx>>);
PYBIND11_MAKE_OPAQUE(std::vector<std::shared_ptr<monero::monero_tx_wallet>>);
PYBIND11_MAKE_OPAQUE(std::vector<std::shared_ptr<monero::monero_output>>);
PYBIND11_MAKE_OPAQUE(std::vector<std::shared_ptr<monero::monero_output_wallet>>);
PYBIND11_MAKE_OPAQUE(std::vector<std::shared_ptr<monero::monero_transfer>>);
PYBIND11_MAKE_OPAQUE(std::vector<std::shared_ptr<monero::monero_incoming_transfer>>);
PYBIND11_MAKE_OPAQUE(std::vector<std::shared_ptr<monero::monero_outgoing_transfer>>);
PYBIND11_MAKE_OPAQUE(std::vector<monero::monero_subaddress>);
PYBIND11_MAKE_OPAQUE(std::vector<std::shared_ptr<monero_destination>>);
PYBIND11_MAKE_OPAQUE(std::vector<std::shared_ptr<PyMoneroAccountTag>>);
class PyMoneroWallet : public monero::monero_wallet {
public:
PyMoneroWallet() { }
virtual ~PyMoneroWallet() = default;
virtual void tag_accounts(const std::string& tag, const std::vector<uint32_t>& account_indices) {
PYBIND11_OVERRIDE_PURE(void, PyMoneroWallet, tag_accounts);
}
virtual void untag_accounts(const std::vector<uint32_t>& account_indices) {
PYBIND11_OVERRIDE_PURE(void, PyMoneroWallet, untag_accounts);
}
virtual std::vector<std::shared_ptr<PyMoneroAccountTag>> get_account_tags() {
PYBIND11_OVERRIDE_PURE(std::vector<std::shared_ptr<PyMoneroAccountTag>>, PyMoneroWallet, get_account_tags);
}
virtual void set_account_tag_label(const std::string& tag, const std::string& label) {
PYBIND11_OVERRIDE_PURE(void, PyMoneroWallet, set_account_tag_label);
}
virtual void set_account_label(uint32_t account_idx, const std::string& label) {
PYBIND11_OVERRIDE_PURE(void, PyMoneroWallet, set_account_label);
}
bool is_view_only() const override {
PYBIND11_OVERRIDE(bool, monero_wallet, is_view_only);
}
void set_daemon_connection(const std::string& uri, const std::string& username = "", const std::string& password = "", const std::string& proxy = "") override {
PYBIND11_OVERRIDE(void, monero_wallet, set_daemon_connection, uri, username, password, proxy);
}
void set_daemon_connection(const boost::optional<monero_rpc_connection>& connection) override {
PYBIND11_OVERRIDE(void, monero_wallet, set_daemon_connection, connection);
}
boost::optional<monero_rpc_connection> get_daemon_connection() const override {
PYBIND11_OVERRIDE(boost::optional<monero_rpc_connection>, monero_wallet, get_daemon_connection);
}
bool is_connected_to_daemon() const override {
PYBIND11_OVERRIDE(bool, monero_wallet, is_connected_to_daemon);
}
bool is_daemon_synced() const override {
PYBIND11_OVERRIDE(bool, monero_wallet, is_daemon_synced);
}
bool is_daemon_trusted() const override {
PYBIND11_OVERRIDE(bool, monero_wallet, is_daemon_trusted);
}
bool is_synced() const override {
PYBIND11_OVERRIDE(bool, monero_wallet, is_synced);
}
monero_version get_version() const override {
PYBIND11_OVERRIDE(monero_version, monero_wallet, get_version);
}
monero_network_type get_network_type() const override {
PYBIND11_OVERRIDE(monero_network_type, monero_wallet, get_network_type);
}
std::string get_seed() const override {
PYBIND11_OVERRIDE(std::string, monero_wallet, get_seed);
}
std::string get_seed_language() const override {
PYBIND11_OVERRIDE(std::string, monero_wallet, get_seed_language);
}
std::string get_public_view_key() const override {
PYBIND11_OVERRIDE(std::string, monero_wallet, get_public_view_key);
}
std::string get_private_view_key() const override {
PYBIND11_OVERRIDE(std::string, monero_wallet, get_private_view_key);
}
std::string get_public_spend_key() const override {
PYBIND11_OVERRIDE(std::string, monero_wallet, get_public_spend_key);
}
std::string get_private_spend_key() const override {
PYBIND11_OVERRIDE(std::string, monero_wallet, get_private_spend_key);
}
std::string get_primary_address() const override {
PYBIND11_OVERRIDE(std::string, monero_wallet, get_primary_address);
}
std::string get_address(const uint32_t account_idx, const uint32_t subaddress_idx) const override {
PYBIND11_OVERRIDE(std::string, monero_wallet, get_address, account_idx, subaddress_idx);
}
monero_subaddress get_address_index(const std::string& address) const override {
PYBIND11_OVERRIDE(monero_subaddress, monero_wallet, get_address_index, address);
}
monero_integrated_address get_integrated_address(const std::string& standard_address = "", const std::string& payment_id = "") const override {
PYBIND11_OVERRIDE(monero_integrated_address, monero_wallet, get_integrated_address, standard_address, payment_id);
}
monero_integrated_address decode_integrated_address(const std::string& integrated_address) const override {
PYBIND11_OVERRIDE(monero_integrated_address, monero_wallet, decode_integrated_address, integrated_address);
}
uint64_t get_height() const override {
PYBIND11_OVERRIDE(uint64_t, monero_wallet, get_height);
}
uint64_t get_restore_height() const override {
PYBIND11_OVERRIDE(uint64_t, monero_wallet, get_restore_height);
}
void set_restore_height(uint64_t restore_height) override {
PYBIND11_OVERRIDE(void, monero_wallet, set_restore_height, restore_height);
}
uint64_t get_daemon_height() const override {
PYBIND11_OVERRIDE(uint64_t, monero_wallet, get_daemon_height);
}
uint64_t get_daemon_max_peer_height() const override {
PYBIND11_OVERRIDE(uint64_t, monero_wallet, get_daemon_max_peer_height);
}
uint64_t get_height_by_date(uint16_t year, uint8_t month, uint8_t day) const override {
PYBIND11_OVERRIDE(uint64_t, monero_wallet, get_height_by_date, year, month, day);
}
void add_listener(monero_wallet_listener& listener) override {
m_listeners.insert(&listener);
}
void remove_listener(monero_wallet_listener& listener) override {
m_listeners.erase(&listener);
}
std::set<monero_wallet_listener*> get_listeners() override {
return m_listeners;
}
monero_sync_result sync() override {
PYBIND11_OVERRIDE(monero_sync_result, monero_wallet, sync);
}
monero_sync_result sync(monero_wallet_listener& listener) override {
PYBIND11_OVERRIDE(monero_sync_result, monero_wallet, sync, listener);
}
monero_sync_result sync(uint64_t start_height) override {
PYBIND11_OVERRIDE(monero_sync_result, monero_wallet, sync, start_height);
}
monero_sync_result sync(uint64_t start_height, monero_wallet_listener& listener) override {
PYBIND11_OVERRIDE(monero_sync_result, monero_wallet, sync, start_height, listener);
}
void start_syncing(uint64_t sync_period_in_ms = 10000) override {
PYBIND11_OVERRIDE(void, monero_wallet, start_syncing, sync_period_in_ms);
}
void scan_txs(const std::vector<std::string>& tx_hashes) override {
PYBIND11_OVERRIDE(void, monero_wallet, scan_txs, tx_hashes);
}
void rescan_spent() override {
PYBIND11_OVERRIDE(void, monero_wallet, rescan_spent);
}
void rescan_blockchain() override {
PYBIND11_OVERRIDE(void, monero_wallet, rescan_blockchain);
}
uint64_t get_balance() const override {
PYBIND11_OVERRIDE(uint64_t, monero_wallet, get_balance);
}
uint64_t get_balance(uint32_t account_idx) const override {
PYBIND11_OVERRIDE(uint64_t, monero_wallet, get_balance, account_idx);
}
uint64_t get_balance(uint32_t account_idx, uint32_t subaddress_idx) const override {
PYBIND11_OVERRIDE(uint64_t, monero_wallet, get_balance, account_idx, subaddress_idx);
}
uint64_t get_unlocked_balance() const override {
PYBIND11_OVERRIDE(uint64_t, monero_wallet, get_unlocked_balance);
}
uint64_t get_unlocked_balance(uint32_t account_idx) const override {
PYBIND11_OVERRIDE(uint64_t, monero_wallet, get_unlocked_balance, account_idx);
}
uint64_t get_unlocked_balance(uint32_t account_idx, uint32_t subaddress_idx) const override {
PYBIND11_OVERRIDE(uint64_t, monero_wallet, get_unlocked_balance, account_idx, subaddress_idx);
}
std::vector<monero_account> get_accounts() const override {
PYBIND11_OVERRIDE(std::vector<monero_account>, monero_wallet, get_accounts);
}
std::vector<monero_account> get_accounts(bool include_subaddresses) const override {
PYBIND11_OVERRIDE(std::vector<monero_account>, monero_wallet, get_accounts, include_subaddresses);
}
std::vector<monero_account> get_accounts(const std::string& tag) const override {
PYBIND11_OVERRIDE(std::vector<monero_account>, monero_wallet, get_accounts, tag);
}
std::vector<monero_account> get_accounts(bool include_subaddresses, const std::string& tag) const override {
PYBIND11_OVERRIDE(std::vector<monero_account>, monero_wallet, get_accounts, include_subaddresses, tag);
}
monero_account get_account(uint32_t account_idx) const override {
PYBIND11_OVERRIDE(monero_account, monero_wallet, get_account, account_idx);
}
monero_account get_account(const uint32_t account_idx, bool include_subaddresses) const {
PYBIND11_OVERRIDE(monero_account, monero_wallet, get_account, account_idx, include_subaddresses);
}
monero_account create_account(const std::string& label = "") override {
PYBIND11_OVERRIDE(monero_account, monero_wallet, create_account, label);
}
std::vector<monero_subaddress> get_subaddresses(uint32_t account_idx) const override {
PYBIND11_OVERRIDE(std::vector<monero_subaddress>, monero_wallet, get_subaddresses, account_idx);
}
std::vector<monero_subaddress> get_subaddresses(uint32_t account_idx, const std::vector<uint32_t>& subaddress_indices) const override {
PYBIND11_OVERRIDE(std::vector<monero_subaddress>, monero_wallet, get_subaddresses, account_idx, subaddress_indices);
}
monero_subaddress get_subaddress(uint32_t account_idx, uint32_t subaddress_idx) const override {
PYBIND11_OVERRIDE(monero_subaddress, monero_wallet, get_subaddress, account_idx, subaddress_idx);
}
monero_subaddress create_subaddress(uint32_t account_idx, const std::string& label = "") override {
PYBIND11_OVERRIDE(monero_subaddress, monero_wallet, create_subaddress, account_idx, label);
}
void set_subaddress_label(uint32_t account_idx, uint32_t subaddress_idx, const std::string& label = "") override {
PYBIND11_OVERRIDE(void, monero_wallet, set_subaddress_label, account_idx, subaddress_idx, label);
}
std::vector<std::shared_ptr<monero_tx_wallet>> get_txs() const override {
PYBIND11_OVERRIDE(std::vector<std::shared_ptr<monero_tx_wallet>>, monero_wallet, get_txs);
}
std::vector<std::shared_ptr<monero_tx_wallet>> get_txs(const monero_tx_query& query) const override {
PYBIND11_OVERRIDE(std::vector<std::shared_ptr<monero_tx_wallet>>, monero_wallet, get_txs, query);
}
std::vector<std::shared_ptr<monero_transfer>> get_transfers(const monero_transfer_query& query) const override {
PYBIND11_OVERRIDE(std::vector<std::shared_ptr<monero_transfer>>, monero_wallet, get_transfers, query);
}
std::vector<std::shared_ptr<monero_output_wallet>> get_outputs(const monero_output_query& query) const override {
PYBIND11_OVERRIDE(std::vector<std::shared_ptr<monero_output_wallet>>, monero_wallet, get_outputs, query);
}
std::string export_outputs(bool all = false) const override {
PYBIND11_OVERRIDE(std::string, monero_wallet, export_outputs, all);
}
int import_outputs(const std::string& outputs_hex) override {
PYBIND11_OVERRIDE(int, monero_wallet, import_outputs, outputs_hex);
}
std::vector<std::shared_ptr<monero_key_image>> export_key_images(bool all = false) const override {
PYBIND11_OVERRIDE(std::vector<std::shared_ptr<monero_key_image>>, monero_wallet, export_key_images, all);
}
std::shared_ptr<monero_key_image_import_result> import_key_images(const std::vector<std::shared_ptr<monero_key_image>>& key_images) override {
PYBIND11_OVERRIDE(std::shared_ptr<monero_key_image_import_result>, monero_wallet, import_key_images, key_images);
}
virtual std::vector<std::shared_ptr<monero_key_image>> get_new_key_images_from_last_import() {
PYBIND11_OVERRIDE_PURE(std::vector<std::shared_ptr<monero_key_image>>, PyMoneroWallet, get_new_key_images_from_last_import);
}
void freeze_output(const std::string& key_image) override {
PYBIND11_OVERRIDE(void, monero_wallet, freeze_output, key_image);
}
void thaw_output(const std::string& key_image) override {
PYBIND11_OVERRIDE(void, monero_wallet, thaw_output, key_image);
}
bool is_output_frozen(const std::string& key_image) override {
PYBIND11_OVERRIDE(bool, monero_wallet, is_output_frozen, key_image);
}
monero_tx_priority get_default_fee_priority() const override {
PYBIND11_OVERRIDE(monero_tx_priority, monero_wallet, get_default_fee_priority);
}
std::shared_ptr<monero_tx_wallet> create_tx(const monero_tx_config& config) override {
PYBIND11_OVERRIDE(std::shared_ptr<monero_tx_wallet>, monero_wallet, create_tx, config);
}
std::vector<std::shared_ptr<monero_tx_wallet>> create_txs(const monero_tx_config& config) override {
PYBIND11_OVERRIDE(std::vector<std::shared_ptr<monero_tx_wallet>>, monero_wallet, create_txs, config);
}
std::vector<std::shared_ptr<monero_tx_wallet>> sweep_unlocked(const monero_tx_config& config) override {
PYBIND11_OVERRIDE(std::vector<std::shared_ptr<monero_tx_wallet>>, monero_wallet, sweep_unlocked, config);
}
std::shared_ptr<monero_tx_wallet> sweep_output(const monero_tx_config& config) override {
PYBIND11_OVERRIDE(std::shared_ptr<monero_tx_wallet>, monero_wallet, sweep_output, config);
}
std::vector<std::shared_ptr<monero_tx_wallet>> sweep_dust(bool relay) override {
PYBIND11_OVERRIDE(std::vector<std::shared_ptr<monero_tx_wallet>>, monero_wallet, sweep_dust, relay);
}
std::string relay_tx(const std::string& tx_metadata) override {
PYBIND11_OVERRIDE(std::string, monero_wallet, relay_tx, tx_metadata);
}
std::string relay_tx(const monero_tx_wallet& tx) override {
PYBIND11_OVERRIDE(std::string, monero_wallet, relay_tx, tx);
}
std::vector<std::string> relay_txs(const std::vector<std::shared_ptr<monero_tx_wallet>>& txs) override {
PYBIND11_OVERRIDE(std::vector<std::string>, monero_wallet, relay_txs, txs);
}
std::vector<std::string> relay_txs(const std::vector<std::string>& tx_metadatas) override {
PYBIND11_OVERRIDE(std::vector<std::string>, monero_wallet, relay_txs, tx_metadatas);
}
monero_tx_set describe_tx_set(const monero_tx_set& tx_set) override {
PYBIND11_OVERRIDE(monero_tx_set, monero_wallet, describe_tx_set, tx_set);
}
monero_tx_set sign_txs(const std::string& unsigned_tx_hex) override {
PYBIND11_OVERRIDE(monero_tx_set, monero_wallet, sign_txs, unsigned_tx_hex);
}
std::vector<std::string> submit_txs(const std::string& signed_tx_hex) override {
PYBIND11_OVERRIDE(std::vector<std::string>, monero_wallet, submit_txs, signed_tx_hex);
}
std::string sign_message(const std::string& msg, monero_message_signature_type signature_type, uint32_t account_idx = 0, uint32_t subaddress_idx = 0) const override {
PYBIND11_OVERRIDE(std::string, monero_wallet, sign_message, msg, signature_type, account_idx, subaddress_idx);
}
monero_message_signature_result verify_message(const std::string& msg, const std::string& address, const std::string& signature) const override {
PYBIND11_OVERRIDE(monero_message_signature_result, monero_wallet, verify_message, msg, address, signature);
}
std::string get_tx_key(const std::string& tx_hash) const override {
PYBIND11_OVERRIDE(std::string, monero_wallet, get_tx_key, tx_hash);
}
std::shared_ptr<monero_check_tx> check_tx_key(const std::string& tx_hash, const std::string& tx_key, const std::string& address) const override {
PYBIND11_OVERRIDE(std::shared_ptr<monero_check_tx>, monero_wallet, check_tx_key, tx_hash, tx_key, address);
}
std::string get_tx_proof(const std::string& tx_hash, const std::string& address, const std::string& message) const override {
PYBIND11_OVERRIDE(std::string, monero_wallet, get_tx_proof, tx_hash, address, message);
}
std::shared_ptr<monero_check_tx> check_tx_proof(const std::string& tx_hash, const std::string& address, const std::string& message, const std::string& signature) const override {
PYBIND11_OVERRIDE(std::shared_ptr<monero_check_tx>, monero_wallet, check_tx_proof, tx_hash, address, message, signature);
}
std::string get_spend_proof(const std::string& tx_hash, const std::string& message) const override {
PYBIND11_OVERRIDE(std::string, monero_wallet, get_spend_proof, tx_hash, message);
}
bool check_spend_proof(const std::string& tx_hash, const std::string& message, const std::string& signature) const override {
PYBIND11_OVERRIDE(bool, monero_wallet, check_spend_proof, tx_hash, message, signature);
}
std::string get_reserve_proof_wallet(const std::string& message) const override {
PYBIND11_OVERRIDE(std::string, monero_wallet, get_reserve_proof_wallet, message);
}
std::string get_reserve_proof_account(uint32_t account_idx, uint64_t amount, const std::string& message) const override {
PYBIND11_OVERRIDE(std::string, monero_wallet, get_reserve_proof_account, account_idx, amount, message);
}
std::shared_ptr<monero_check_reserve> check_reserve_proof(const std::string& address, const std::string& message, const std::string& signature) const override {
PYBIND11_OVERRIDE(std::shared_ptr<monero_check_reserve>, monero_wallet, check_reserve_proof, address, message, signature);
}
std::string get_tx_note(const std::string& tx_hash) const override {
PYBIND11_OVERRIDE(std::string, monero_wallet, get_tx_note, tx_hash);
}
std::vector<std::string> get_tx_notes(const std::vector<std::string>& tx_hashes) const override {
PYBIND11_OVERRIDE(std::vector<std::string>, monero_wallet, get_tx_notes, tx_hashes);
}
void set_tx_note(const std::string& tx_hash, const std::string& note) override {
PYBIND11_OVERRIDE(void, monero_wallet, set_tx_note, tx_hash, note);
}
void set_tx_notes(const std::vector<std::string>& tx_hashes, const std::vector<std::string>& notes) override {
PYBIND11_OVERRIDE(void, monero_wallet, set_tx_notes, tx_hashes, notes);
}
std::vector<monero_address_book_entry> get_address_book_entries(const std::vector<uint64_t>& indices) const override {
PYBIND11_OVERRIDE(std::vector<monero_address_book_entry>, monero_wallet, get_address_book_entries, indices);
}
uint64_t add_address_book_entry(const std::string& address, const std::string& description) override {
PYBIND11_OVERRIDE(uint64_t, monero_wallet, add_address_book_entry, address, description);
}
void edit_address_book_entry(uint64_t index, bool set_address, const std::string& address, bool set_description, const std::string& description) override {
PYBIND11_OVERRIDE(void, monero_wallet, edit_address_book_entry, index, set_address, address, set_description, description);
}
void delete_address_book_entry(uint64_t index) override {
PYBIND11_OVERRIDE(void, monero_wallet, delete_address_book_entry, index);
}
std::string get_payment_uri(const monero_tx_config& config) const override {
PYBIND11_OVERRIDE(std::string, monero_wallet, get_payment_uri, config);
}
std::shared_ptr<monero_tx_config> parse_payment_uri(const std::string& uri) const override {
PYBIND11_OVERRIDE(std::shared_ptr<monero_tx_config>, monero_wallet, parse_payment_uri, uri);
}
bool get_attribute(const std::string& key, std::string& value) const override {
PYBIND11_OVERRIDE(bool, monero_wallet, get_attribute, key, value);
}
void set_attribute(const std::string& key, const std::string& val) override {
PYBIND11_OVERRIDE(void, monero_wallet, set_attribute, key, val);
}
void start_mining(boost::optional<uint64_t> num_threads, boost::optional<bool> background_mining, boost::optional<bool> ignore_battery) {
PYBIND11_OVERRIDE(void, monero_wallet, start_mining, num_threads, background_mining, ignore_battery);
}
void stop_mining() override {
PYBIND11_OVERRIDE(void, monero_wallet, stop_mining);
}
uint64_t wait_for_next_block() override {
PYBIND11_OVERRIDE(uint64_t, monero_wallet, wait_for_next_block);
}
bool is_multisig_import_needed() const override {
PYBIND11_OVERRIDE(bool, monero_wallet, is_multisig_import_needed);
}
bool is_multisig() const override {
PYBIND11_OVERRIDE(bool, monero_wallet, is_multisig);
}
monero_multisig_info get_multisig_info() const override {
PYBIND11_OVERRIDE(monero_multisig_info, monero_wallet, get_multisig_info);
}
std::string prepare_multisig() override {
PYBIND11_OVERRIDE(std::string, monero_wallet, prepare_multisig);
}
std::string make_multisig(const std::vector<std::string>& multisig_hexes, int threshold, const std::string& password) override {
PYBIND11_OVERRIDE(std::string, monero_wallet, make_multisig, multisig_hexes, threshold, password);
}
monero_multisig_init_result exchange_multisig_keys(const std::vector<std::string>& multisig_hexes, const std::string& password) override {
PYBIND11_OVERRIDE(monero_multisig_init_result, monero_wallet, exchange_multisig_keys, multisig_hexes, password);
}
std::string export_multisig_hex() override {
PYBIND11_OVERRIDE(std::string, monero_wallet, export_multisig_hex);
}
int import_multisig_hex(const std::vector<std::string>& multisig_hexes) override {
PYBIND11_OVERRIDE(int, monero_wallet, import_multisig_hex, multisig_hexes);
}
monero_multisig_sign_result sign_multisig_tx_hex(const std::string& multisig_tx_hex) override {
PYBIND11_OVERRIDE(monero_multisig_sign_result, monero_wallet, sign_multisig_tx_hex, multisig_tx_hex);
}
std::vector<std::string> submit_multisig_tx_hex(const std::string& signed_multisig_tx_hex) override {
PYBIND11_OVERRIDE(std::vector<std::string>, monero_wallet, submit_multisig_tx_hex, signed_multisig_tx_hex);
}
void change_password(const std::string& old_password, const std::string& new_password) override {
PYBIND11_OVERRIDE(void, monero_wallet, change_password, old_password, new_password);
}
void move_to(const std::string& path, const std::string& password) override {
PYBIND11_OVERRIDE(void, monero_wallet, move_to, path, password);
}
void save() override {
PYBIND11_OVERRIDE(void, monero_wallet, save);
}
void close(bool save = false) override {
PYBIND11_OVERRIDE(void, monero_wallet, close, save);
}
virtual void set_connection_manager(const std::shared_ptr<PyMoneroConnectionManager> &connection_manager);
virtual std::shared_ptr<PyMoneroConnectionManager> get_connection_manager() const { return m_connection_manager; }
virtual void announce_new_block(uint64_t height);
virtual void announce_sync_progress(uint64_t height, uint64_t start_height, uint64_t end_height, float percent_done, const std::string &message);
virtual void announce_balances_changed(uint64_t balance, uint64_t unlocked_balance);
virtual void announce_output_spent(const std::shared_ptr<monero::monero_output_wallet> &output);
virtual void announce_output_received(const std::shared_ptr<monero::monero_output_wallet> &output);
virtual std::shared_ptr<PyMoneroWalletBalance> get_balances(boost::optional<uint32_t> account_idx, boost::optional<uint32_t> subaddress_idx) const;
virtual bool is_closed() const { return m_is_closed; }
protected:
bool m_is_closed = false;
std::shared_ptr<PyMoneroConnectionManager> m_connection_manager;
std::shared_ptr<PyMoneroWalletConnectionManagerListener> m_connection_manager_listener;
std::set<monero::monero_wallet_listener*> m_listeners;
};