Scorum
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
wallet.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <fc/crypto/base58.hpp>
4 #include <fc/real128.hpp>
5 #include <functional>
6 #include <scorum/app/api.hpp>
12 #include <scorum/wallet/utils.hpp>
13 
14 namespace scorum {
15 namespace wallet {
16 
17 using namespace scorum::app;
18 using namespace scorum::chain;
19 
26 
27 using transaction_handle_type = uint16_t;
28 
29 struct memo_data
30 {
31  static optional<memo_data> from_string(const std::string& str)
32  {
33  try
34  {
35  if (str.size() > sizeof(memo_data) && str[0] == '#')
36  {
37  auto data = fc::from_base58(str.substr(1));
38  auto m = fc::raw::unpack<memo_data>(data);
39  FC_ASSERT(std::string(m) == str);
40  return m;
41  }
42  }
43  catch (...)
44  {
45  }
46  return optional<memo_data>();
47  }
48 
51  uint64_t nonce = 0;
52  uint32_t check = 0;
53  std::vector<char> encrypted;
54 
55  operator std::string() const
56  {
57  auto data = fc::raw::pack(*this);
58  auto base58 = fc::to_base58(data);
59  return '#' + base58;
60  }
61 };
62 
64 {
65  std::vector<char> cipher_keys;
67  std::string ws_server = "ws://localhost:8090";
68  std::string ws_user;
69  std::string ws_password;
70 
72 };
73 
75 {
78  posting
79 };
80 
81 namespace detail {
82 class wallet_api_impl;
83 }
84 
107 {
108 public:
109  wallet_api(const wallet_data& initial_data, fc::api<login_api> rapi);
110  virtual ~wallet_api();
111 
112  using exit_func_type = std::function<void()>;
113 
114  void set_exit_func(exit_func_type);
115 
116  bool copy_wallet_file(const std::string& destination_filename);
117 
118  std::map<std::string, std::function<std::string(fc::variant, const fc::variants&)>> get_result_formatters() const;
119 
123  void encrypt_keys();
124 
128  void check_memo(const std::string& memo, const account_api_obj& account) const;
129 
135  std::string get_encrypted_memo(const std::string& from, const std::string& to, const std::string& memo);
136 
142  std::string decrypt_memo(const std::string& memo);
143 
149  void exit();
150 
159  variant_object about() const;
160 
171  std::string help() const;
172 
181  std::string gethelp(const std::string& method) const;
182 
195  std::string get_wallet_filename() const;
196 
207  bool is_new() const;
208 
218  bool is_locked() const;
219 
225  void lock();
226 
237  void unlock(const std::string& password);
238 
247  void set_password(const std::string& password);
248 
264  bool load_wallet_file(const std::string& wallet_filename = "");
265 
280  void save_wallet_file(const std::string& wallet_filename = "");
281 
292  void set_wallet_filename(const std::string& wallet_filename);
293 
298 
317  operation get_prototype_operation(const std::string& operation_type);
318 
327  std::string serialize_transaction(const signed_transaction& tx) const;
328 
340  annotated_signed_transaction sign_transaction(const signed_transaction& tx, bool broadcast = false);
341 
345  void set_transaction_expiration(uint32_t seconds);
346 
352  void network_add_nodes(const std::vector<std::string>& nodes);
353 
359  std::vector<variant> network_get_connected_peers();
360 
362 
367 
376  bool import_key(const std::string& wif_key);
377 
389 
398  std::map<public_key_type, std::string> list_keys();
399 
404  std::string get_private_key(const public_key_type& pubkey) const;
405 
413  std::pair<public_key_type, std::string> get_private_key_from_password(const std::string& account,
414  const std::string& role,
415  const std::string& password) const;
416 
428  std::string normalize_brain_key(const std::string& s) const;
429 
431 
436 
443  optional<block_header> get_block_header(uint32_t num) const;
444 
451  optional<signed_block_api_obj> get_block(uint32_t num) const;
452 
462  std::map<uint32_t, block_header> get_block_headers_history(uint32_t num, uint32_t limit) const;
463 
473  std::map<uint32_t, signed_block_api_obj> get_blocks_history(uint32_t num, uint32_t limit) const;
474 
483  std::map<uint32_t, applied_operation> get_ops_in_block(uint32_t block_num,
484  applied_operation_type type_of_operation) const;
485 
497  std::map<uint32_t, applied_operation>
498  get_ops_history(uint32_t from_op, uint32_t limit, applied_operation_type type_of_operation) const;
499 
512  std::map<uint32_t, applied_operation> get_ops_history_by_time(const fc::time_point_sec& from,
513  const fc::time_point_sec& to,
514  uint32_t from_op,
515  uint32_t limit) const;
516 
525  std::vector<block_api_object> get_blocks(uint32_t from, uint32_t limit) const;
526 
528 
533 
537  variant info();
538 
542  chain_capital_api_obj get_chain_capital() const;
543 
548  std::vector<account_name_type> get_active_witnesses() const;
549 
554  std::vector<account_api_obj> list_my_accounts();
555 
573  std::set<std::string> list_accounts(const std::string& lowerbound, uint32_t limit);
574 
581  account_api_obj get_account(const std::string& account_name) const;
582 
589  account_balance_info_api_obj get_account_balance(const std::string& account_name) const;
590 
604  annotated_signed_transaction create_account(const std::string& creator,
605  const std::string& newname,
606  const std::string& json_meta,
607  bool broadcast);
608 
627  annotated_signed_transaction create_account_with_keys(const std::string& creator,
628  const std::string& newname,
629  const std::string& json_meta,
630  const public_key_type& owner,
631  const public_key_type& active,
632  const public_key_type& posting,
633  const public_key_type& memo,
634  bool broadcast) const;
635 
654  annotated_signed_transaction create_account_delegated(const std::string& creator,
655  const asset& scorum_fee,
656  const asset& delegated_scorumpower,
657  const std::string& new_account_name,
658  const std::string& json_meta,
659  bool broadcast);
660 
684  annotated_signed_transaction create_account_with_keys_delegated(const std::string& creator,
685  const asset& scorum_fee,
686  const asset& delegated_scorumpower,
687  const std::string& newname,
688  const std::string& json_meta,
689  const public_key_type& owner,
690  const public_key_type& active,
691  const public_key_type& posting,
692  const public_key_type& memo,
693  bool broadcast) const;
705  annotated_signed_transaction create_account_by_committee(const std::string& creator,
706  const std::string& newname,
707  const std::string& json_meta,
708  bool broadcast);
709 
724  annotated_signed_transaction create_account_by_committee_with_keys(const std::string& creator,
725  const std::string& newname,
726  const std::string& json_meta,
727  const public_key_type& owner,
728  const public_key_type& active,
729  const public_key_type& posting,
730  const public_key_type& memo,
731  bool broadcast) const;
743  annotated_signed_transaction update_account(const std::string& accountname,
744  const std::string& json_meta,
745  const public_key_type& owner,
746  const public_key_type& active,
747  const public_key_type& posting,
748  const public_key_type& memo,
749  bool broadcast) const;
750 
766  annotated_signed_transaction update_account_auth_key(const std::string& account_name,
767  const authority_type& type,
768  const public_key_type& key,
769  authority_weight_type weight,
770  bool broadcast);
771 
787  annotated_signed_transaction update_account_auth_account(const std::string& account_name,
788  authority_type type,
789  const std::string& auth_account,
790  authority_weight_type weight,
791  bool broadcast);
792 
808  annotated_signed_transaction update_account_auth_threshold(const std::string& account_name,
809  authority_type type,
810  uint32_t threshold,
811  bool broadcast);
812 
822  update_account_meta(const std::string& account_name, const std::string& json_meta, bool broadcast);
823 
832  update_account_memo_key(const std::string& account_name, const public_key_type& key, bool broadcast);
833 
842  annotated_signed_transaction delegate_scorumpower(const std::string& delegator,
843  const std::string& delegatee,
844  const asset& scorumpower,
845  bool broadcast);
846 
855  annotated_signed_transaction delegate_scorumpower_from_reg_pool(const std::string& reg_committee_member,
856  const std::string& delegatee,
857  const asset& scorumpower,
858  bool broadcast);
859 
878  std::set<account_name_type> list_witnesses(const std::string& lowerbound, uint32_t limit);
879 
887  optional<witness_api_obj> get_witness(const std::string& owner_account);
888 
900  annotated_signed_transaction update_witness(const std::string& witness_name,
901  const std::string& url,
902  const public_key_type& block_signing_key,
903  const chain_properties& props,
904  bool broadcast = false);
905 
924  set_voting_proxy(const std::string& account_to_modify, const std::string& proxy, bool broadcast = false);
925 
940  annotated_signed_transaction vote_for_witness(const std::string& account_to_vote_with,
941  const std::string& witness_to_vote_for,
942  bool approve = true,
943  bool broadcast = false);
944 
955  annotated_signed_transaction transfer(const std::string& from,
956  const std::string& to,
957  const asset& amount,
958  const std::string& memo,
959  bool broadcast = false);
960 
978  annotated_signed_transaction escrow_transfer(const std::string& from,
979  const std::string& to,
980  const std::string& agent,
981  uint32_t escrow_id,
982  const asset& scorum_amount,
983  const asset& fee,
984  time_point_sec ratification_deadline,
985  time_point_sec escrow_expiration,
986  const std::string& json_meta,
987  bool broadcast = false);
988 
1003  annotated_signed_transaction escrow_approve(const std::string& from,
1004  const std::string& to,
1005  const std::string& agent,
1006  const std::string& who,
1007  uint32_t escrow_id,
1008  bool approve,
1009  bool broadcast = false);
1010 
1021  annotated_signed_transaction escrow_dispute(const std::string& from,
1022  const std::string& to,
1023  const std::string& agent,
1024  const std::string& who,
1025  uint32_t escrow_id,
1026  bool broadcast = false);
1027 
1040  annotated_signed_transaction escrow_release(const std::string& from,
1041  const std::string& to,
1042  const std::string& agent,
1043  const std::string& who,
1044  const std::string& receiver,
1045  uint32_t escrow_id,
1046  const asset& scorum_amount,
1047  bool broadcast = false);
1048 
1061  annotated_signed_transaction transfer_to_scorumpower(const std::string& from,
1062  const std::string& to,
1063  const asset& amount,
1064  bool broadcast = false);
1065 
1078  withdraw_scorumpower(const std::string& from, const asset& scorumpower, bool broadcast = false);
1079 
1096  annotated_signed_transaction set_withdraw_scorumpower_route(
1097  const std::string& from, const std::string& to, uint16_t percent, bool auto_vest, bool broadcast = false);
1098 
1105  std::vector<withdraw_route> get_withdraw_routes(const std::string& account, withdraw_route_type type = all) const;
1106 
1113  annotated_signed_transaction get_transaction(transaction_id_type trx_id) const;
1114 
1115 
1128  annotated_signed_transaction post_comment(const std::string& author,
1129  const std::string& permlink,
1130  const std::string& parent_author,
1131  const std::string& parent_permlink,
1132  const std::string& title,
1133  const std::string& body,
1134  const std::string& json,
1135  bool broadcast);
1136 
1147  annotated_signed_transaction vote(const std::string& voter,
1148  const std::string& author,
1149  const std::string& permlink,
1150  int16_t weight,
1151  bool broadcast);
1152 
1163  challenge(const std::string& challenger, const std::string& challenged, bool broadcast);
1164 
1182  annotated_signed_transaction request_account_recovery(const std::string& recovery_account,
1183  const std::string& account_to_recover,
1184  const authority& new_authority,
1185  bool broadcast);
1186 
1205  annotated_signed_transaction recover_account(const std::string& account_to_recover,
1206  const authority& recent_authority,
1207  const authority& new_authority,
1208  bool broadcast);
1209 
1219  change_recovery_account(const std::string& owner, const std::string& new_recovery_account, bool broadcast);
1220 
1229  annotated_signed_transaction prove(const std::string& challenged, bool broadcast);
1230 
1237  std::vector<owner_authority_history_api_obj> get_owner_history(const std::string& account) const;
1238 
1251  std::map<uint32_t, applied_operation>
1252  get_account_history(const std::string& account, uint64_t from, uint32_t limit);
1253 
1266  std::map<uint32_t, applied_operation>
1267  get_account_scr_to_scr_transfers(const std::string& account, uint64_t from, uint32_t limit);
1268 
1281  std::map<uint32_t, applied_operation>
1282  get_account_scr_to_sp_transfers(const std::string& account, uint64_t from, uint32_t limit);
1283 
1296  std::map<uint32_t, applied_withdraw_operation>
1297  get_account_sp_to_scr_transfers(const std::string& account, uint64_t from, uint32_t limit);
1298 
1306  annotated_signed_transaction decline_voting_rights(const std::string& account, bool decline, bool broadcast);
1307 
1309 
1314 
1320  std::vector<budget_api_obj> list_my_budgets();
1321 
1330  std::set<std::string> list_post_budget_owners(const std::string& lowerbound, uint32_t limit);
1331 
1340  std::set<std::string> list_banner_budget_owners(const std::string& lowerbound, uint32_t limit);
1341 
1348  std::vector<budget_api_obj> get_post_budgets(const std::string& account_name);
1349 
1356  std::vector<budget_api_obj> get_banner_budgets(const std::string& account_name);
1357 
1373  annotated_signed_transaction create_budget_for_post(const std::string& owner,
1374  const uuid_type& uuid,
1375  const std::string& json_metadata,
1376  const asset& balance,
1377  const time_point_sec& start,
1378  const time_point_sec& deadline,
1379  bool broadcast);
1380 
1396  annotated_signed_transaction create_budget_for_banner(const std::string& owner,
1397  const uuid_type& uuid,
1398  const std::string& json_metadata,
1399  const asset& balance,
1400  const time_point_sec& start,
1401  const time_point_sec& deadline,
1402  bool broadcast);
1403 
1413  annotated_signed_transaction update_budget_for_banner(const std::string& owner,
1414  const uuid_type& uuid,
1415  const std::string& json_metadata,
1416  bool broadcast);
1417 
1427  annotated_signed_transaction update_budget_for_post(const std::string& owner,
1428  const uuid_type& uuid,
1429  const std::string& json_metadata,
1430  bool broadcast);
1431 
1440  annotated_signed_transaction close_budget_for_post(const uuid_type& uuid, const std::string& owner, bool broadcast);
1441 
1451  close_budget_for_banner(const uuid_type& uuid, const std::string& owner, bool broadcast);
1452 
1462  close_budget_for_post_by_moderator(const uuid_type& uuid, const std::string& moderator, bool broadcast);
1463 
1473  close_budget_for_banner_by_moderator(const uuid_type& uuid, const std::string& moderator, bool broadcast);
1474 
1476 
1481 
1490  vote_for_committee_proposal(const std::string& account_to_vote_with, int64_t proposal_id, bool broadcast);
1491 
1500  annotated_signed_transaction registration_committee_add_member(const std::string& inviter,
1501  const std::string& invitee,
1502  uint32_t lifetime_sec,
1503  bool broadcast);
1504 
1513  annotated_signed_transaction registration_committee_exclude_member(const std::string& initiator,
1514  const std::string& dropout,
1515  uint32_t lifetime_sec,
1516  bool broadcast);
1517 
1525  std::set<account_name_type> list_registration_committee(const std::string& lowerbound, uint32_t limit);
1526 
1532  registration_committee_api_obj get_registration_committee();
1533 
1539  std::vector<proposal_api_obj> list_proposals();
1540 
1550  annotated_signed_transaction registration_committee_change_add_member_quorum(const std::string& creator,
1551  uint64_t quorum_percent,
1552  uint32_t lifetime_sec,
1553  bool broadcast);
1554 
1564  annotated_signed_transaction registration_committee_change_exclude_member_quorum(const std::string& creator,
1565  uint64_t quorum_percent,
1566  uint32_t lifetime_sec,
1567  bool broadcast);
1568 
1577  annotated_signed_transaction registration_committee_change_base_quorum(const std::string& creator,
1578  uint64_t quorum_percent,
1579  uint32_t lifetime_sec,
1580  bool broadcast);
1581 
1590  annotated_signed_transaction development_committee_add_member(const std::string& initiator,
1591  const std::string& invitee,
1592  uint32_t lifetime_sec,
1593  bool broadcast);
1594 
1603  annotated_signed_transaction development_committee_exclude_member(const std::string& initiator,
1604  const std::string& dropout,
1605  uint32_t lifetime_sec,
1606  bool broadcast);
1607 
1615  std::set<account_name_type> list_development_committee(const std::string& lowerbound, uint32_t limit);
1616 
1625  annotated_signed_transaction development_committee_change_add_member_quorum(const std::string& creator,
1626  uint64_t quorum_percent,
1627  uint32_t lifetime_sec,
1628  bool broadcast);
1629 
1638  annotated_signed_transaction development_committee_change_exclude_member_quorum(const std::string& creator,
1639  uint64_t quorum_percent,
1640  uint32_t lifetime_sec,
1641  bool broadcast);
1642 
1651  annotated_signed_transaction development_committee_change_base_quorum(const std::string& creator,
1652  uint64_t quorum_percent,
1653  uint32_t lifetime_sec,
1654  bool broadcast);
1655 
1664  annotated_signed_transaction development_committee_change_transfer_quorum(const std::string& creator,
1665  uint64_t quorum_percent,
1666  uint32_t lifetime_sec,
1667  bool broadcast);
1668 
1677  annotated_signed_transaction development_committee_change_budget_auction_properties_quorum(
1678  const std::string& creator, uint64_t quorum_percent, uint32_t lifetime_sec, bool broadcast);
1679 
1688  annotated_signed_transaction development_committee_change_advertising_moderator_quorum(const std::string& creator,
1689  uint64_t quorum_percent,
1690  uint32_t lifetime_sec,
1691  bool broadcast);
1700  annotated_signed_transaction development_committee_change_betting_moderator_quorum(const std::string& creator,
1701  uint64_t quorum_percent,
1702  uint32_t lifetime_sec,
1703  bool broadcast);
1704 
1713  annotated_signed_transaction development_committee_empower_advertising_moderator(const std::string& initiator,
1714  const std::string& moderator,
1715  uint32_t lifetime_sec,
1716  bool broadcast);
1717 
1726  annotated_signed_transaction development_committee_empower_betting_moderator(const std::string& initiator,
1727  const std::string& moderator,
1728  uint32_t lifetime_sec,
1729  bool broadcast);
1730 
1740  annotated_signed_transaction development_committee_change_betting_resolve_delay(const std::string& initiator,
1741  uint32_t delay_sec,
1742  uint32_t lifetime_sec,
1743  bool broadcast);
1744 
1754  annotated_signed_transaction development_pool_transfer(const std::string& initiator,
1755  const std::string& to_account,
1756  asset amount,
1757  uint32_t lifetime_sec,
1758  bool broadcast);
1759 
1768  annotated_signed_transaction development_pool_withdraw_vesting(const std::string& initiator,
1769  asset amount,
1770  uint32_t lifetime_sec,
1771  bool broadcast);
1772 
1780  annotated_signed_transaction development_pool_post_budgets_auction_properties(const std::string& initiator,
1781  const std::vector<percent_type>&,
1782  uint32_t lifetime_sec,
1783  bool broadcast);
1784 
1792  annotated_signed_transaction development_pool_banner_budgets_auction_properties(const std::string& initiator,
1793  const std::vector<percent_type>&,
1794  uint32_t lifetime_sec,
1795  bool broadcast);
1796 
1800  development_committee_api_obj get_development_committee();
1801 
1813  std::vector<applied_operation> get_devcommittee_history(uint64_t from, uint32_t limit);
1814 
1826  std::vector<applied_operation> get_devcommittee_scr_to_scr_transfers(uint64_t from, uint32_t limit);
1827 
1839  std::vector<applied_withdraw_operation> get_devcommittee_sp_to_scr_transfers(uint64_t from, uint32_t limit);
1840 
1842 
1847 
1865  atomicswap_contract_result_api_obj atomicswap_initiate(const std::string& initiator,
1866  const std::string& participant,
1867  const asset& amount,
1868  const std::string& metadata,
1869  const uint8_t secret_length,
1870  bool broadcast);
1871 
1887  atomicswap_contract_result_api_obj atomicswap_participate(const std::string& secret_hash,
1888  const std::string& participant,
1889  const std::string& initiator,
1890  const asset& amount,
1891  const std::string& metadata,
1892  bool broadcast);
1893 
1902  atomicswap_auditcontract(const std::string& from, const std::string& to, const std::string& secret_hash);
1903 
1917  atomicswap_redeem(const std::string& from, const std::string& to, const std::string& secret, bool broadcast);
1918 
1927  std::string
1928  atomicswap_extractsecret(const std::string& from, const std::string& to, const std::string& secret_hash);
1929 
1942  annotated_signed_transaction atomicswap_refund(const std::string& participant,
1943  const std::string& initiator,
1944  const std::string& secret_hash,
1945  bool broadcast);
1946 
1952  std::vector<atomicswap_contract_api_obj> get_atomicswap_contracts(const std::string& owner);
1953 
1955 
1960 
1975  annotated_signed_transaction create_game(uuid_type uuid,
1976  account_name_type moderator,
1977  const std::string& json_metadata,
1978  fc::time_point_sec start_time,
1979  uint32_t auto_resolve_delay_sec,
1980  game_type game,
1981  const std::vector<market_type>& markets,
1982  bool broadcast);
1983 
1991  annotated_signed_transaction cancel_game(uuid_type uuid, account_name_type moderator, bool broadcast);
1992 
2001  annotated_signed_transaction update_game_markets(uuid_type uuid,
2002  account_name_type moderator,
2003  const std::vector<market_type>& markets,
2004  bool broadcast);
2005 
2015  update_game_start_time(uuid_type uuid, account_name_type moderator, fc::time_point_sec start_time, bool broadcast);
2016 
2025  annotated_signed_transaction post_game_results(uuid_type uuid,
2026  account_name_type moderator,
2027  const std::vector<wincase_type>& wincases,
2028  bool broadcast);
2029 
2044  account_name_type better,
2045  uuid_type game_uuid,
2046  wincase_type wincase,
2047  odds_input odds,
2048  asset stake,
2049  bool is_live,
2050  bool broadcast);
2051 
2060  cancel_pending_bets(account_name_type better, const std::vector<uuid_type>& bet_uuids, bool broadcast);
2061 
2068  std::vector<game_api_object> get_games_by_status(const fc::flat_set<game_status>& filter) const;
2069 
2076  std::vector<game_api_object> get_games_by_uuids(const std::vector<uuid_type>& uuids) const;
2077 
2085  std::vector<game_api_object> lookup_games_by_id(game_id_type from, uint32_t limit) const;
2086 
2094  std::vector<matched_bet_api_object> lookup_matched_bets(matched_bet_id_type from, int64_t limit) const;
2095 
2103  std::vector<pending_bet_api_object> lookup_pending_bets(pending_bet_id_type from, int64_t limit) const;
2104 
2111  std::vector<matched_bet_api_object> get_matched_bets(const std::vector<uuid_type>& uuids) const;
2112 
2119  std::vector<pending_bet_api_object> get_pending_bets(const std::vector<uuid_type>& uuids) const;
2120 
2126  betting_property_api_object get_betting_properties() const;
2127 
2134  std::vector<matched_bet_api_object> get_game_returns(const uuid_type& game_uuid) const;
2135 
2142  std::vector<winner_api_object> get_game_winners(const uuid_type& game_uuid) const;
2143 
2150  std::vector<matched_bet_api_object> get_game_matched_bets(const uuid_type& uuid) const;
2151 
2158  std::vector<pending_bet_api_object> get_game_pending_bets(const uuid_type& uuid) const;
2159 
2161 
2166 
2177  annotated_signed_transaction create_nft(const std::string& owner,
2178  const uuid_type& uuid,
2179  const std::string& name,
2180  int32_t initial_power,
2181  const std::string& json_meta,
2182  bool broadcast) const;
2183 
2192  annotated_signed_transaction update_nft_meta(const std::string& moderator,
2193  const uuid_type& uuid,
2194  const std::string& json_meta,
2195  bool broadcast) const;
2196 
2205  annotated_signed_transaction adjust_nft_experience(const std::string& moderator,
2206  const uuid_type& uuid,
2207  int32_t experience,
2208  bool broadcast) const;
2209 
2218  annotated_signed_transaction update_nft_name(const std::string& moderator,
2219  const uuid_type& uuid,
2220  const std::string& name,
2221  bool broadcast) const;
2228  nft_api_obj get_nft_by_id(int64_t id) const;
2229 
2236  nft_api_obj get_nft_by_name(const account_name_type& name) const;
2237 
2244  nft_api_obj get_nft_by_uuid(const uuid_type& uuid) const;
2245 
2253  std::vector<nft_api_obj> lookup_nft(int64_t from, uint32_t limit) const;
2254 
2264  annotated_signed_transaction create_game_round(const std::string& owner,
2265  const uuid_type& uuid,
2266  const std::string& verification_key,
2267  const std::string& seed,
2268  bool broadcast) const;
2269 
2280  annotated_signed_transaction update_game_round_result(const std::string& owner,
2281  const uuid_type& uuid,
2282  const std::string& proof,
2283  const std::string& vrf,
2284  int32_t result,
2285  bool broadcast) const;
2286 
2293  game_round_api_obj get_game_round_by_uuid(const uuid_type& uuid) const;
2294 
2302  std::vector<game_round_api_obj> lookup_game_round(int64_t from, uint32_t limit) const;
2303 
2305 
2306 public:
2307  fc::signal<void(bool)> lock_changed;
2308 
2309 private:
2310  std::shared_ptr<detail::wallet_api_impl> my;
2311  exit_func_type exit_func;
2312 };
2313 
2315 {
2316  fc::sha512 checksum;
2317  std::map<public_key_type, std::string> keys;
2318 };
2319 } // namespace wallet
2320 } // namespace scorum
2321 
2322 // clang-format off
2323 
2325  (cipher_keys)
2326  (ws_server)
2327  (ws_user)
2328  (ws_password)
2329  (chain_id))
2330 
2331 FC_REFLECT( scorum::wallet::brain_key_info, (brain_priv_key)(wif_priv_key) (pub_key))
2332 
2333 FC_REFLECT( scorum::wallet::plain_keys, (checksum)(keys) )
2334 
2336 
2339  (help)(gethelp)
2340  (about)(is_new)(is_locked)(lock)(unlock)(set_password)
2341  (load_wallet_file)(save_wallet_file)(exit)
2342 
2344  (import_key)
2346  (list_keys)
2347  (get_private_key)
2348  (get_private_key_from_password)
2350 
2352  (get_block_header)
2353  (get_block)
2354  (get_block_headers_history)
2355  (get_blocks_history)
2356  (get_ops_in_block)
2357  (get_ops_history)
2358  (get_ops_history_by_time)
2359  (get_transaction)
2360 
2362  (info)
2363  (get_chain_capital)
2364  (get_active_witnesses)
2365  (list_my_accounts)
2366  (list_accounts)
2367  (list_witnesses)
2368  (get_witness)
2369  (get_account)
2370  (get_account_balance)
2371  (get_account_history)
2372  (get_account_scr_to_scr_transfers)
2373  (get_account_scr_to_sp_transfers)
2374  (get_account_sp_to_scr_transfers)
2375  (get_withdraw_routes)
2376  (get_owner_history)
2377  (get_encrypted_memo)
2378 
2379  (create_account)
2380  (create_account_with_keys)
2381  (create_account_delegated)
2382  (create_account_with_keys_delegated)
2383  (create_account_by_committee)
2384  (create_account_by_committee_with_keys)
2385  (update_account)
2386  (update_account_auth_key)
2387  (update_account_auth_account)
2388  (update_account_auth_threshold)
2389  (update_account_meta)
2390  (update_account_memo_key)
2391  (delegate_scorumpower)
2392  (delegate_scorumpower_from_reg_pool)
2393  (update_witness)
2394  (set_voting_proxy)
2395  (vote_for_witness)
2396  (transfer)
2397  (escrow_transfer)
2398  (escrow_approve)
2399  (escrow_dispute)
2400  (escrow_release)
2401  (transfer_to_scorumpower)
2402  (withdraw_scorumpower)
2403  (set_withdraw_scorumpower_route)
2404  (post_comment)
2405  (vote)
2406  (set_transaction_expiration)
2407  (challenge)
2408  (prove)
2409  (request_account_recovery)
2410  (recover_account)
2411  (change_recovery_account)
2412  (decrypt_memo)
2413  (decline_voting_rights)
2414 
2416  (create_budget_for_post)
2417  (create_budget_for_banner)
2418  (update_budget_for_banner)
2419  (update_budget_for_post)
2420  (close_budget_for_post)
2421  (close_budget_for_banner)
2422  (close_budget_for_post_by_moderator)
2423  (close_budget_for_banner_by_moderator)
2424  (list_my_budgets)
2425  (list_post_budget_owners)
2426  (list_banner_budget_owners)
2427  (get_post_budgets)
2428  (get_banner_budgets)
2429 
2431  (vote_for_committee_proposal)
2432  (registration_committee_add_member)
2433  (registration_committee_exclude_member)
2434  (list_registration_committee)
2435  (registration_committee_change_add_member_quorum)
2436  (registration_committee_change_exclude_member_quorum)
2437  (registration_committee_change_base_quorum)
2438  (get_registration_committee)
2439  (list_proposals)
2440  (get_devcommittee_history)
2441  (get_devcommittee_scr_to_scr_transfers)
2442  (get_devcommittee_sp_to_scr_transfers)
2443 
2445  (development_committee_add_member)
2446  (development_committee_exclude_member)
2447  (list_development_committee)
2448  (development_committee_change_add_member_quorum)
2449  (development_committee_change_exclude_member_quorum)
2450  (development_committee_change_base_quorum)
2451  (development_committee_change_transfer_quorum)
2452  (development_committee_change_budget_auction_properties_quorum)
2453  (development_committee_change_advertising_moderator_quorum)
2454  (development_committee_change_betting_moderator_quorum)
2455  (development_committee_empower_advertising_moderator)
2456  (development_committee_empower_betting_moderator)
2457  (development_committee_change_betting_resolve_delay)
2458  (get_development_committee)
2459  (development_pool_transfer)
2460  (development_pool_withdraw_vesting)
2461  (development_pool_post_budgets_auction_properties)
2462  (development_pool_banner_budgets_auction_properties)
2463 
2465  (atomicswap_initiate)
2466  (atomicswap_participate)
2467  (atomicswap_redeem)
2468  (atomicswap_auditcontract)
2469  (atomicswap_extractsecret)
2470  (atomicswap_refund)
2471  (get_atomicswap_contracts)
2472 
2474  (create_game)
2475  (cancel_game)
2476  (update_game_markets)
2477  (update_game_start_time)
2478  (post_game_results)
2479  (post_bet)
2480  (cancel_pending_bets)
2481 
2482  (get_games_by_status)
2483  (get_games_by_uuids)
2484  (lookup_games_by_id)
2485  (lookup_matched_bets)
2486  (lookup_pending_bets)
2487  (get_matched_bets)
2488  (get_pending_bets)
2489  (get_betting_properties)
2490  (get_game_returns)
2491  (get_game_winners)
2492  (get_game_matched_bets)
2493  (get_game_pending_bets)
2494 
2496  (create_nft)
2497  (update_nft_meta)
2498  (adjust_nft_experience)
2499  (update_nft_name)
2500  (get_nft_by_id)
2501  (get_nft_by_name)
2502  (get_nft_by_uuid)
2503  (lookup_nft)
2504 
2505  (create_game_round)
2506  (update_game_round_result)
2507  (get_game_round_by_uuid)
2508  (lookup_game_round)
2509 
2511  (get_prototype_operation)
2512  (serialize_transaction)
2513  (sign_transaction)
2514 
2515  (network_add_nodes)
2516  (network_get_connected_peers)
2517  )
2518 
2519 FC_REFLECT( scorum::wallet::memo_data, (from)(to)(nonce)(check)(encrypted) )
2520 
2521 // clang-format on
std::function< void()> exit_func_type
Definition: wallet.hpp:112
fc::signal< void(bool)> lock_changed
Definition: wallet.hpp:2307
FC_REFLECT_ENUM(scorum::protocol::game_status,(created)(started)(finished)(resolved)(expired)(cancelled)) namespace fc
Definition: game_status.hpp:18
FC_REFLECT(appender_args,(appender)(stream)) FC_REFLECT_DERIVED(file_appender_args
fc::ripemd160 transaction_id_type
Definition: types.hpp:65
fc::static_variant< vote_operation, comment_operation, transfer_operation, transfer_to_scorumpower_operation, withdraw_scorumpower_operation, account_create_by_committee_operation, account_create_operation, account_create_with_delegation_operation, account_update_operation, witness_update_operation, account_witness_vote_operation, account_witness_proxy_operation, delete_comment_operation, comment_options_operation, set_withdraw_scorumpower_route_to_account_operation, set_withdraw_scorumpower_route_to_dev_pool_operation, prove_authority_operation, request_account_recovery_operation, recover_account_operation, change_recovery_account_operation, escrow_approve_operation, escrow_dispute_operation, escrow_release_operation, escrow_transfer_operation, decline_voting_rights_operation, delegate_scorumpower_operation, create_budget_operation, close_budget_operation, proposal_vote_operation, proposal_create_operation, atomicswap_initiate_operation, atomicswap_redeem_operation, atomicswap_refund_operation, close_budget_by_advertising_moderator_operation, update_budget_operation, create_game_operation, cancel_game_operation, update_game_markets_operation, update_game_start_time_operation, post_game_results_operation, post_bet_operation, cancel_pending_bets_operation, delegate_sp_from_reg_pool_operation, create_nft_operation, update_nft_meta_operation, create_game_round_operation, update_game_round_result_operation, adjust_nft_experience_operation, update_nft_name_operation, author_reward_operation, comment_benefficiary_reward_operation, comment_payout_update_operation, comment_reward_operation, curation_reward_operation, hardfork_operation, producer_reward_operation, active_sp_holders_reward_operation, return_scorumpower_delegation_operation, shutdown_witness_operation, witness_miss_block_operation, expired_contract_refund_operation, acc_finished_vesting_withdraw_operation, devpool_finished_vesting_withdraw_operation, acc_to_acc_vesting_withdraw_operation, devpool_to_acc_vesting_withdraw_operation, acc_to_devpool_vesting_withdraw_operation, devpool_to_devpool_vesting_withdraw_operation, proposal_virtual_operation, budget_outgo_operation, budget_owner_income_operation, active_sp_holders_reward_legacy_operation, budget_closing_operation, bets_matched_operation, game_status_changed_operation, bet_resolved_operation, bet_cancelled_operation, bet_restored_operation, bet_updated_operation > operation
Definition: operations.hpp:112
fc::fixed_string_16 account_name_type
Definition: types.hpp:62
fc::sha256 chain_id_type
Definition: types.hpp:61
uint16_t authority_weight_type
Definition: types.hpp:68
fc::static_variant< result_home::yes, result_home::no, result_draw::yes, result_draw::no, result_away::yes, result_away::no, round_home::yes, round_home::no, handicap::over, handicap::under, correct_score_home::yes, correct_score_home::no, correct_score_draw::yes, correct_score_draw::no, correct_score_away::yes, correct_score_away::no, correct_score::yes, correct_score::no, goal_home::yes, goal_home::no, goal_both::yes, goal_both::no, goal_away::yes, goal_away::no, total::over, total::under, total_goals_home::over, total_goals_home::under, total_goals_away::over, total_goals_away::under > wincase_type
Definition: market.hpp:128
fc::static_variant< soccer_game, hockey_game > game_type
Definition: game.hpp:14
brain_key_info suggest_brain_key()
Definition: utils.cpp:151
std::string normalize_brain_key(const std::string &s)
Definition: utils.cpp:29
uint16_t transaction_handle_type
Definition: wallet.hpp:27
void check_memo(const std::string &memo, const account_object &account, const account_authority_object &auth)
Definition: asset.cpp:15
boost::uuids::uuid uuid_type
Definition: types.hpp:53
static optional< memo_data > from_string(const std::string &str)
Definition: wallet.hpp:31
public_key_type from
Definition: wallet.hpp:49
std::vector< char > encrypted
Definition: wallet.hpp:53
public_key_type to
Definition: wallet.hpp:50
std::map< public_key_type, std::string > keys
Definition: wallet.hpp:2317
chain_id_type chain_id
Definition: wallet.hpp:71
std::vector< char > cipher_keys
Definition: wallet.hpp:65