BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
wallet.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 Cryptonomex, Inc., and contributors.
3  *
4  * The MIT License
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  */
24 #include <algorithm>
25 #include <cctype>
26 #include <iomanip>
27 #include <iostream>
28 #include <iterator>
29 #include <sstream>
30 #include <string>
31 #include <list>
32 
33 #include <boost/version.hpp>
34 #include <boost/lexical_cast.hpp>
35 #include <boost/algorithm/string/replace.hpp>
36 
37 #include <boost/range/adaptor/map.hpp>
38 #include <boost/range/algorithm_ext/erase.hpp>
39 #include <boost/range/algorithm/unique.hpp>
40 #include <boost/range/algorithm/sort.hpp>
41 
42 #include <boost/multi_index_container.hpp>
43 #include <boost/multi_index/ordered_index.hpp>
44 #include <boost/multi_index/mem_fun.hpp>
45 #include <boost/multi_index/member.hpp>
46 #include <boost/multi_index/random_access_index.hpp>
47 #include <boost/multi_index/tag.hpp>
48 #include <boost/multi_index/sequenced_index.hpp>
49 #include <boost/multi_index/hashed_index.hpp>
50 
51 #include <fc/git_revision.hpp>
52 #include <fc/io/fstream.hpp>
53 #include <fc/io/json.hpp>
54 #include <fc/io/stdio.hpp>
56 #include <fc/rpc/cli.hpp>
57 #include <fc/rpc/websocket_api.hpp>
58 #include <fc/crypto/hex.hpp>
59 #include <fc/thread/mutex.hpp>
61 #include <fc/crypto/base58.hpp>
62 #include <fc/crypto/aes.hpp>
63 
64 #include <graphene/app/api.hpp>
65 #include <graphene/app/util.hpp>
69 #include <graphene/chain/hardfork.hpp>
75 #include "wallet_api_impl.hpp"
77 
78 #include "operation_printer.hpp"
80 
81 #define BRAIN_KEY_WORD_COUNT 16
82 #define RANGE_PROOF_MANTISSA 49 // Minimum mantissa bits to "hide" in the range proof.
83  // If this number is set too low, then for large value
84  // commitments the length of the range proof will hint
85  // strongly at the value amount that is being hidden.
86 
87 namespace graphene { namespace wallet {
89  {
90  fc::stringstream to_sign;
91  to_sign << message << '\n';
92  to_sign << "account=" << meta.account << '\n';
93  to_sign << "memokey=" << string( meta.memo_key ) << '\n';
94  to_sign << "block=" << meta.block << '\n';
95  to_sign << "timestamp=" << meta.time;
96 
97  return fc::sha256::hash( to_sign.str() );
98  }
99  vector<brain_key_info> utility::derive_owner_keys_from_brain_key( const string& brain_key,
100  uint32_t number_of_desired_keys )
101  {
102  // Safety-check
103  FC_ASSERT( number_of_desired_keys >= 1, "number_of_desired_keys should be at least 1" );
104 
105  // Create as many derived owner keys as requested
106  vector<brain_key_info> results;
107  for( uint32_t i = 0; i < number_of_desired_keys; ++i )
108  {
110 
111  brain_key_info result;
112  result.brain_priv_key = brain_key;
113  result.wif_priv_key = key_to_wif( priv_key );
114  result.pub_key = priv_key.get_public_key();
115 
116  results.push_back(result);
117  }
118 
119  return results;
120  }
121 
123  {
124  brain_key_info result;
125  // create a private key for secure entropy
128  fc::bigint entropy1(sha_entropy1.data(), sha_entropy1.data_size());
129  fc::bigint entropy2(sha_entropy2.data(), sha_entropy2.data_size());
130  fc::bigint entropy(entropy1);
131  entropy <<= 8 * sha_entropy1.data_size();
132  entropy += entropy2;
133  string brain_key = "";
134 
135  for( uint32_t i = 0; i < BRAIN_KEY_WORD_COUNT; ++i )
136  {
137  fc::bigint choice = entropy % graphene::words::word_list_size;
139  if (i > 0)
140  brain_key += " ";
141  brain_key += graphene::words::word_list[choice.to_int64()];
142  }
143 
144  brain_key = detail::normalize_brain_key(brain_key);
145  fc::ecc::private_key priv_key = detail::derive_private_key(brain_key, 0);
146  result.brain_priv_key = brain_key;
147  result.wif_priv_key = key_to_wif(priv_key);
148  result.pub_key = priv_key.get_public_key();
149  return result;
150  }
151 }}
152 
153 namespace graphene { namespace wallet {
154 
155 wallet_api::wallet_api( const wallet_data& initial_data, const fc::api<login_api>& rapi )
156  : my( std::make_unique<detail::wallet_api_impl>(*this, initial_data, rapi) )
157 {
158 }
159 
160 wallet_api::~wallet_api() = default;
161 
162 bool wallet_api::copy_wallet_file( const string& destination_filename )const
163 {
164  return my->copy_wallet_file(destination_filename);
165 }
166 
167 optional<signed_block_with_info> wallet_api::get_block(uint32_t num)const
168 {
169  return my->_remote_db->get_block(num);
170 }
171 
173 {
174  return my->_remote_db->get_account_count();
175 }
176 
177 vector<account_object> wallet_api::list_my_accounts()const
178 {
179  return vector<account_object>(my->_wallet.my_accounts.begin(), my->_wallet.my_accounts.end());
180 }
181 
182 map<string, account_id_type, std::less<>> wallet_api::list_accounts( const string& lowerbound, uint32_t limit )const
183 {
184  return my->_remote_db->lookup_accounts(lowerbound, limit, {});
185 }
186 
187 vector<asset> wallet_api::list_account_balances( const string& id )const
188 {
189  return my->_remote_db->get_account_balances(id, flat_set<asset_id_type>());
190 }
191 
192 vector<extended_asset_object> wallet_api::list_assets( const string& lowerbound, uint32_t limit )const
193 {
194  return my->_remote_db->list_assets( lowerbound, limit );
195 }
196 
198 {
199  return my->_remote_db->get_asset_count();
200 }
201 
202 signed_transaction wallet_api::htlc_create( const string& source, const string& destination,
203  const string& amount, const string& asset_symbol, const string& hash_algorithm,
204  const string& preimage_hash, uint32_t preimage_size,
205  uint32_t claim_period_seconds, const string& memo, bool broadcast ) const
206 {
207  return my->htlc_create(source, destination, amount, asset_symbol, hash_algorithm, preimage_hash, preimage_size,
208  claim_period_seconds, memo, broadcast);
209 }
210 
211 fc::optional<fc::variant> wallet_api::get_htlc(const htlc_id_type& htlc_id) const
212 {
213  fc::optional<htlc_object> optional_obj = my->get_htlc(htlc_id);
214  if ( optional_obj.valid() )
215  {
216  const htlc_object& obj = *optional_obj;
217  // convert to formatted variant
219  const auto& from = my->get_account( obj.transfer.from );
220  transfer["from"] = from.name;
221  const auto& to = my->get_account( obj.transfer.to );
222  transfer["to"] = to.name;
223  const auto& asset = my->get_asset( obj.transfer.asset_id );
224  transfer["asset"] = asset.symbol;
226  if (obj.memo.valid())
227  transfer["memo"] = my->read_memo( *obj.memo );
228  class htlc_hash_to_variant_visitor
229  {
230  public:
232 
233  result_type operator()(const fc::ripemd160& obj)const
234  { return convert("RIPEMD160", obj.str()); }
235  result_type operator()(const fc::sha1& obj)const
236  { return convert("SHA1", obj.str()); }
237  result_type operator()(const fc::sha256& obj)const
238  { return convert("SHA256", obj.str()); }
239  result_type operator()(const fc::hash160& obj)const
240  { return convert("HASH160", obj.str()); }
241  private:
242  result_type convert(const string& type, const string& hash)const
243  {
245  ret_val["hash_algo"] = type;
246  ret_val["preimage_hash"] = hash;
247  return ret_val;
248  }
249  };
250  static htlc_hash_to_variant_visitor hash_visitor;
251  fc::mutable_variant_object htlc_lock = obj.conditions.hash_lock.preimage_hash.visit(hash_visitor);
252  htlc_lock["preimage_size"] = obj.conditions.hash_lock.preimage_size;
253  fc::mutable_variant_object time_lock;
254  time_lock["expiration"] = obj.conditions.time_lock.expiration;
256  fc::mutable_variant_object conditions;
257  conditions["htlc_lock"] = htlc_lock;
258  conditions["time_lock"] = time_lock;
260  result["transfer"] = transfer;
261  result["conditions"] = conditions;
262  return fc::optional<fc::variant>(result);
263  }
264  return fc::optional<fc::variant>();
265 }
266 
267 signed_transaction wallet_api::htlc_redeem( const htlc_id_type& htlc_id, const string& issuer,
268  const string& preimage, bool broadcast ) const
269 {
270 
271  return my->htlc_redeem(htlc_id, issuer, std::vector<char>(preimage.begin(), preimage.end()), broadcast);
272 }
273 
274 signed_transaction wallet_api::htlc_extend( const htlc_id_type& htlc_id, const string& issuer,
275  uint32_t seconds_to_add, bool broadcast ) const
276 {
277  return my->htlc_extend(htlc_id, issuer, seconds_to_add, broadcast);
278 }
279 
280 vector<operation_detail> wallet_api::get_account_history( const string& name, uint32_t limit )const
281 {
282  vector<operation_detail> result;
283 
284  while( limit > 0 )
285  {
286  bool skip_first_row = false;
287  operation_history_id_type start;
288  if( result.size() )
289  {
290  start = result.back().op.id;
291  if( start == operation_history_id_type() ) // no more data
292  break;
293  start = start + (-1);
294  if( start == operation_history_id_type() ) // will return most recent history if
295  // directly call remote API with this
296  {
297  start = start + 1;
298  skip_first_row = true;
299  }
300  }
301 
302  uint32_t default_page_size = 100;
303  uint32_t page_limit = skip_first_row ? std::min<uint32_t>( default_page_size, limit + 1 )
304  : std::min<uint32_t>( default_page_size, limit );
305 
306  vector<operation_history_object> current = my->_remote_hist->get_account_history(
307  name,
308  operation_history_id_type(),
309  page_limit,
310  start );
311  bool first_row = true;
312  for( auto& o : current )
313  {
314  if( first_row )
315  {
316  first_row = false;
317  if( skip_first_row )
318  {
319  continue;
320  }
321  }
322  std::stringstream ss;
323  auto memo = o.op.visit(detail::operation_printer(ss, *my, o));
324  result.push_back( operation_detail{ memo, ss.str(), o } );
325  }
326 
327  if( current.size() < page_limit )
328  break;
329 
330  limit -= current.size();
331  if( skip_first_row )
332  ++limit;
333  }
334 
335  return result;
336 }
337 
339  const string& name,
340  uint32_t stop,
341  uint32_t limit,
342  uint32_t start )const
343 {
344  vector<operation_detail> result;
345  auto account_id = get_account(name).get_id();
346 
347  const account_object& account = my->get_account(account_id);
348  const account_statistics_object& stats = my->get_object(account.statistics);
349 
350  if(start == 0)
351  start = stats.total_ops;
352  else
353  start = std::min<uint32_t>(start, stats.total_ops);
354 
355  uint32_t default_page_size = 100;
356  while( limit > 0 )
357  {
358  uint32_t page_size = std::min<uint32_t>(default_page_size, limit);
359  vector <operation_history_object> current = my->_remote_hist->get_relative_account_history(
360  name,
361  stop,
362  page_size,
363  start);
364  for (auto &o : current) {
365  std::stringstream ss;
366  auto memo = o.op.visit(detail::operation_printer(ss, *my, o));
367  result.push_back(operation_detail{memo, ss.str(), o});
368  }
369  if (current.size() < page_size)
370  break;
371  limit -= page_size;
372  start -= page_size;
373  if( start == 0 ) break;
374  }
375  return result;
376 }
377 
379  const string& name,
380  const flat_set<uint16_t>& operation_types,
381  uint32_t start,
382  uint32_t limit )const
383 {
385 
386  const auto& account = my->get_account(name);
387  const auto& stats = my->get_object(account.statistics);
388 
389  // sequence of account_history_object start with 1
390  start = start == 0 ? 1 : start;
391 
392  if (start <= stats.removed_ops) {
393  start = stats.removed_ops;
394  result.total_count =stats.removed_ops;
395  }
396 
397  uint32_t default_page_size = 100;
398  while (limit > 0 && start <= stats.total_ops) {
399  uint32_t min_limit = std::min(default_page_size, limit);
400  auto current = my->_remote_hist->get_account_history_by_operations(name, operation_types, start, min_limit);
401  auto his_rend = current.operation_history_objs.rend();
402  for( auto it = current.operation_history_objs.rbegin(); it != his_rend; ++it )
403  {
404  auto& obj = *it;
405  std::stringstream ss;
406  auto memo = obj.op.visit(detail::operation_printer(ss, *my, obj));
407 
408  transaction_id_type transaction_id;
409  auto block = get_block(obj.block_num);
410  if (block.valid() && obj.trx_in_block < block->transaction_ids.size()) {
411  transaction_id = block->transaction_ids[obj.trx_in_block];
412  }
413  result.details.push_back(operation_detail_ex{memo, ss.str(), obj, transaction_id});
414  }
415  result.result_count += current.operation_history_objs.size();
416  result.total_count += current.total_count;
417 
418  start += current.total_count > 0 ? current.total_count : min_limit;
419  limit -= current.operation_history_objs.size();
420  }
421 
422  return result;
423 }
424 
425 full_account wallet_api::get_full_account( const string& name_or_id )const
426 {
427  return my->_remote_db->get_full_accounts({name_or_id}, false)[name_or_id];
428 }
429 
430 vector<bucket_object> wallet_api::get_market_history(
431  const string& symbol1,
432  const string& symbol2,
433  uint32_t bucket,
434  const fc::time_point_sec& start,
435  const fc::time_point_sec& end )const
436 {
437  return my->_remote_hist->get_market_history( symbol1, symbol2, bucket, start, end );
438 }
439 
440 vector<limit_order_object> wallet_api::get_account_limit_orders(
441  const string& name_or_id,
442  const string& base,
443  const string& quote,
444  uint32_t limit,
445  const optional<limit_order_id_type>& ostart_id,
446  const optional<price>& ostart_price )const
447 {
448  return my->_remote_db->get_account_limit_orders(name_or_id, base, quote, limit, ostart_id, ostart_price);
449 }
450 
451 vector<limit_order_object> wallet_api::get_limit_orders( const string& a, const string& b, uint32_t limit )const
452 {
453  return my->_remote_db->get_limit_orders(a, b, limit);
454 }
455 
456 vector<call_order_object> wallet_api::get_call_orders( const string& a, uint32_t limit )const
457 {
458  return my->_remote_db->get_call_orders(a, limit);
459 }
460 
461 vector<force_settlement_object> wallet_api::get_settle_orders( const string& a, uint32_t limit )const
462 {
463  return my->_remote_db->get_settle_orders(a, limit);
464 }
465 
466 vector<collateral_bid_object> wallet_api::get_collateral_bids( const string& a, uint32_t limit, uint32_t start )const
467 {
468  return my->_remote_db->get_collateral_bids(a, limit, start);
469 }
470 
472 {
474 }
475 
477  const string& brain_key,
478  uint32_t number_of_desired_keys ) const
479 {
480  return graphene::wallet::utility::derive_owner_keys_from_brain_key(brain_key, number_of_desired_keys);
481 }
482 
483 bool wallet_api::is_public_key_registered( const string& public_key ) const
484 {
485  bool is_known = my->_remote_db->is_public_key_registered(public_key);
486  return is_known;
487 }
488 
489 
490 string wallet_api::serialize_transaction( const signed_transaction& tx )const
491 {
492  return fc::to_hex(fc::raw::pack(tx));
493 }
494 
495 variant wallet_api::get_object( const object_id_type& id ) const
496 {
497  return my->_remote_db->get_objects({id}, {});
498 }
499 
501 {
502  return my->get_wallet_filename();
503 }
504 
506 {
507  return my->begin_builder_transaction();
508 }
509 
511  transaction_handle_type transaction_handle,
512  const operation& op )const
513 {
514  my->add_operation_to_builder_transaction(transaction_handle, op);
515 }
516 
519  uint32_t operation_index,
520  const operation& new_op )const
521 {
522  my->replace_operation_in_builder_transaction(handle, operation_index, new_op);
523 }
524 
526 {
527  return my->set_fees_on_builder_transaction(handle, fee_asset);
528 }
529 
531 {
532  return my->preview_builder_transaction(handle);
533 }
534 
535 signed_transaction wallet_api::sign_builder_transaction(transaction_handle_type transaction_handle,
536  bool broadcast)const
537 {
538  return my->sign_builder_transaction(transaction_handle, broadcast);
539 }
540 
542  const vector<public_key_type>& explicit_keys,
543  bool broadcast)const
544 {
545  return my->sign_builder_transaction2(transaction_handle, explicit_keys, broadcast);
546 }
547 
548 pair<transaction_id_type,signed_transaction> wallet_api::broadcast_transaction( const signed_transaction& tx )const
549 {
550  return my->broadcast_transaction(tx);
551 }
552 
555  const time_point_sec& expiration,
556  uint32_t review_period_seconds,
557  bool broadcast )const
558 {
559  return my->propose_builder_transaction(handle, expiration, review_period_seconds, broadcast);
560 }
561 
564  const string& account_name_or_id,
565  const time_point_sec& expiration,
566  uint32_t review_period_seconds,
567  bool broadcast )const
568 {
569  return my->propose_builder_transaction2(handle, account_name_or_id, expiration, review_period_seconds, broadcast);
570 }
571 
573 {
574  return my->remove_builder_transaction(handle);
575 }
576 
577 account_object wallet_api::get_account( const string& account_name_or_id ) const
578 {
579  return my->get_account(account_name_or_id);
580 }
581 
582 extended_asset_object wallet_api::get_asset( const string& asset_name_or_id ) const
583 {
584  auto found_asset = my->find_asset(asset_name_or_id);
585  FC_ASSERT( found_asset, "Unable to find asset '${a}'", ("a",asset_name_or_id) );
586  return *found_asset;
587 }
588 
589 asset_bitasset_data_object wallet_api::get_bitasset_data( const string& asset_name_or_id ) const
590 {
591  auto asset = get_asset(asset_name_or_id);
592  FC_ASSERT(asset.is_market_issued() && asset.bitasset_data_id);
593  return my->get_object(*asset.bitasset_data_id);
594 }
595 
596 account_id_type wallet_api::get_account_id( const string& account_name_or_id ) const
597 {
598  return my->get_account_id(account_name_or_id);
599 }
600 
601 asset_id_type wallet_api::get_asset_id( const string& asset_symbol_or_id ) const
602 {
603  return my->get_asset_id(asset_symbol_or_id);
604 }
605 
606 bool wallet_api::import_key( const string& account_name_or_id, const string& wif_key )const
607 {
608  FC_ASSERT(!is_locked());
609  // backup wallet
610  fc::optional<fc::ecc::private_key> optional_private_key = wif_to_key(wif_key);
611  if (!optional_private_key)
612  FC_THROW("Invalid private key");
613  string shorthash = detail::address_to_shorthash(address(optional_private_key->get_public_key()));
614  copy_wallet_file( "before-import-key-" + shorthash );
615 
616  if( my->import_key(account_name_or_id, wif_key) )
617  {
619  copy_wallet_file( "after-import-key-" + shorthash );
620  return true;
621  }
622  return false;
623 }
624 
625 map<string, bool, std::less<>> wallet_api::import_accounts( const string& filename, const string& password )const
626 {
627  FC_ASSERT( !is_locked() );
628  FC_ASSERT( fc::exists( filename ) );
629 
630  const auto imported_keys = fc::json::from_file<exported_keys>( filename );
631 
632  const auto password_hash = fc::sha512::hash( password );
633  FC_ASSERT( fc::sha512::hash( password_hash ) == imported_keys.password_checksum );
634 
635  map<string, bool, std::less<>> result;
636  for( const auto& item : imported_keys.account_keys )
637  {
638  const auto import_this_account = [ & ]() -> bool
639  {
640  try
641  {
642  const account_object account = get_account( item.account_name );
643  const auto& owner_keys = account.owner.get_keys();
644  const auto& active_keys = account.active.get_keys();
645 
646  for( const auto& public_key : item.public_keys )
647  {
648  if( std::find( owner_keys.begin(), owner_keys.end(), public_key ) != owner_keys.end() )
649  return true;
650 
651  if( std::find( active_keys.begin(), active_keys.end(), public_key ) != active_keys.end() )
652  return true;
653  }
654  }
655  catch( ... )
656  {
657  }
658 
659  return false;
660  };
661 
662  const auto should_proceed = import_this_account();
663  result[ item.account_name ] = should_proceed;
664 
665  if( should_proceed )
666  {
667  uint32_t import_successes = 0;
668  uint32_t import_failures = 0;
669  // TODO: First check that all private keys match public keys
670  for( const auto& encrypted_key : item.encrypted_private_keys )
671  {
672  try
673  {
674  const auto plain_text = fc::aes_decrypt( password_hash, encrypted_key );
675  const auto private_key = fc::raw::unpack<private_key_type>( plain_text );
676 
677  import_key( item.account_name, string( graphene::utilities::key_to_wif( private_key ) ) );
678  ++import_successes;
679  }
680  catch( const fc::exception& e )
681  {
682  elog( "Couldn't import key due to exception ${e}", ("e", e.to_detail_string()) );
683  ++import_failures;
684  }
685  }
686  ilog( "successfully imported ${n} keys for account ${name}",
687  ("n", import_successes)("name", item.account_name) );
688  if( import_failures > 0 )
689  elog( "failed to import ${n} keys for account ${name}",
690  ("n", import_failures)("name", item.account_name) );
691  }
692  }
693 
694  return result;
695 }
696 
698  const string& filename,
699  const string& password,
700  const string& src_account_name,
701  const string& dest_account_name )const
702 {
703  FC_ASSERT( !is_locked() );
704  FC_ASSERT( fc::exists( filename ) );
705 
706  bool is_my_account = false;
707  const auto accounts = list_my_accounts();
708  for( const auto& account : accounts )
709  {
710  if( account.name == dest_account_name )
711  {
712  is_my_account = true;
713  break;
714  }
715  }
716  FC_ASSERT( is_my_account );
717 
718  const auto imported_keys = fc::json::from_file<exported_keys>( filename );
719 
720  const auto password_hash = fc::sha512::hash( password );
721  FC_ASSERT( fc::sha512::hash( password_hash ) == imported_keys.password_checksum );
722 
723  bool found_account = false;
724  for( const auto& item : imported_keys.account_keys )
725  {
726  if( item.account_name != src_account_name )
727  continue;
728 
729  found_account = true;
730 
731  for( const auto& encrypted_key : item.encrypted_private_keys )
732  {
733  const auto plain_text = fc::aes_decrypt( password_hash, encrypted_key );
734  const auto private_key = fc::raw::unpack<private_key_type>( plain_text );
735 
736  my->import_key( dest_account_name, string( graphene::utilities::key_to_wif( private_key ) ) );
737  }
738 
739  return true;
740  }
742 
743  FC_ASSERT( found_account );
744 
745  return false;
746 }
747 
748 string wallet_api::normalize_brain_key( const string& s ) const
749 {
750  return detail::normalize_brain_key( s );
751 }
752 
754 {
755  return my->info();
756 }
757 
759 {
760  return my->about();
761 }
762 
763 fc::ecc::private_key wallet_api::derive_private_key( const string& prefix_string, uint32_t sequence_number ) const
764 {
765  return detail::derive_private_key( prefix_string, sequence_number );
766 }
767 
768 signed_transaction wallet_api::register_account( const string& name,
769  const public_key_type& owner_pubkey,
770  const public_key_type& active_pubkey,
771  const string& registrar_account,
772  const string& referrer_account,
773  uint32_t referrer_percent,
774  bool broadcast )const
775 {
776  return my->register_account( name, owner_pubkey, active_pubkey,
777  registrar_account, referrer_account, referrer_percent, broadcast );
778 }
779 signed_transaction wallet_api::create_account_with_brain_key( const string& brain_key, const string& account_name,
780  const string& registrar_account, const string& referrer_account,
781  bool broadcast /* = false */ )const
782 {
783  return my->create_account_with_brain_key(
784  brain_key, account_name, registrar_account,
785  referrer_account, broadcast
786  );
787 }
788 signed_transaction wallet_api::issue_asset( const string& to_account, const string& amount, const string& symbol,
789  const string& memo, bool broadcast )const
790 {
791  return my->issue_asset(to_account, amount, symbol, memo, broadcast);
792 }
793 
794 signed_transaction wallet_api::transfer( const string& from, const string& to, const string& amount,
795  const string& asset_symbol, const string& memo,
796  bool broadcast /* = false */ )const
797 {
798  return my->transfer(from, to, amount, asset_symbol, memo, broadcast);
799 }
800 signed_transaction wallet_api::create_asset( const string& issuer,
801  const string& symbol,
802  uint8_t precision,
803  const asset_options& common,
804  const optional<bitasset_options>& bitasset_opts,
805  bool broadcast )const
806 {
807  return my->create_asset(issuer, symbol, precision, common, bitasset_opts, broadcast);
808 }
809 
810 signed_transaction wallet_api::update_asset( const string& symbol,
811  const optional<string>& new_issuer,
812  const asset_options& new_options,
813  bool broadcast /* = false */ )const
814 {
815  return my->update_asset(symbol, new_issuer, new_options, broadcast);
816 }
817 
818 signed_transaction wallet_api::update_asset_issuer( const string& symbol,
819  const string& new_issuer,
820  bool broadcast /* = false */ )const
821 {
822  return my->update_asset_issuer(symbol, new_issuer, broadcast);
823 }
824 
825 signed_transaction wallet_api::update_bitasset( const string& symbol,
826  const bitasset_options& new_options,
827  bool broadcast /* = false */ )const
828 {
829  return my->update_bitasset(symbol, new_options, broadcast);
830 }
831 
832 signed_transaction wallet_api::update_asset_feed_producers( const string& symbol,
833  const flat_set<string>& new_feed_producers,
834  bool broadcast /* = false */ )const
835 {
836  return my->update_asset_feed_producers(symbol, new_feed_producers, broadcast);
837 }
838 
839 signed_transaction wallet_api::publish_asset_feed( const string& publishing_account,
840  const string& symbol,
841  const price_feed& feed,
842  bool broadcast /* = false */ )const
843 {
844  return my->publish_asset_feed(publishing_account, symbol, feed, broadcast);
845 }
846 
847 signed_transaction wallet_api::fund_asset_fee_pool( const string& from,
848  const string& symbol,
849  const string& amount,
850  bool broadcast /* = false */ )const
851 {
852  return my->fund_asset_fee_pool(from, symbol, amount, broadcast);
853 }
854 
855 signed_transaction wallet_api::claim_asset_fee_pool( const string& symbol,
856  const string& amount,
857  bool broadcast /* = false */ )const
858 {
859  return my->claim_asset_fee_pool(symbol, amount, broadcast);
860 }
861 
862 signed_transaction wallet_api::reserve_asset( const string& from,
863  const string& amount,
864  const string& symbol,
865  bool broadcast /* = false */ )const
866 {
867  return my->reserve_asset(from, amount, symbol, broadcast);
868 }
869 
870 signed_transaction wallet_api::global_settle_asset( const string& symbol,
871  const price& settle_price,
872  bool broadcast /* = false */ )const
873 {
874  return my->global_settle_asset(symbol, settle_price, broadcast);
875 }
876 
877 signed_transaction wallet_api::settle_asset( const string& account_to_settle,
878  const string& amount_to_settle,
879  const string& symbol,
880  bool broadcast /* = false */ )const
881 {
882  return my->settle_asset(account_to_settle, amount_to_settle, symbol, broadcast);
883 }
884 
885 signed_transaction wallet_api::bid_collateral( const string& bidder_name,
886  const string& debt_amount, const string& debt_symbol,
887  const string& additional_collateral,
888  bool broadcast )const
889 {
890  return my->bid_collateral(bidder_name, debt_amount, debt_symbol, additional_collateral, broadcast);
891 }
892 
893 signed_transaction wallet_api::whitelist_account( const string& authorizing_account,
894  const string& account_to_list,
895  account_whitelist_operation::account_listing new_listing_status,
896  bool broadcast /* = false */ )const
897 {
898  return my->whitelist_account(authorizing_account, account_to_list, new_listing_status, broadcast);
899 }
900 
901 signed_transaction wallet_api::create_committee_member( const string& owner_account, const string& url,
902  bool broadcast /* = false */ )const
903 {
904  return my->create_committee_member(owner_account, url, broadcast);
905 }
906 
907 map<string, witness_id_type, std::less<>> wallet_api::list_witnesses( const string& lowerbound, uint32_t limit )const
908 {
909  return my->_remote_db->lookup_witness_accounts(lowerbound, limit);
910 }
911 
912 map<string,committee_member_id_type, std::less<>> wallet_api::list_committee_members(
913  const string& lowerbound, uint32_t limit )const
914 {
915  return my->_remote_db->lookup_committee_member_accounts(lowerbound, limit);
916 }
917 
918 witness_object wallet_api::get_witness( const string& owner_account )const
919 {
920  return my->get_witness(owner_account);
921 }
922 
924 {
925  return my->get_committee_member(owner_account);
926 }
927 
928 signed_transaction wallet_api::create_witness( const string& owner_account,
929  const string& url,
930  bool broadcast /* = false */ )const
931 {
932  return my->create_witness(owner_account, url, broadcast);
933 }
934 
935 signed_transaction wallet_api::create_worker(
936  const string& owner_account,
937  const time_point_sec& work_begin_date,
938  const time_point_sec& work_end_date,
939  const share_type& daily_pay,
940  const string& name,
941  const string& url,
942  const variant& worker_settings,
943  bool broadcast /* = false */ )const
944 {
945  return my->create_worker( owner_account, work_begin_date, work_end_date,
946  daily_pay, name, url, worker_settings, broadcast );
947 }
948 
950  const string& owner_account,
951  const worker_vote_delta& delta,
952  bool broadcast /* = false */ )const
953 {
954  return my->update_worker_votes( owner_account, delta, broadcast );
955 }
956 
957 signed_transaction wallet_api::update_witness(
958  const string& witness_name,
959  const string& url,
960  const string& block_signing_key,
961  bool broadcast /* = false */ )const
962 {
963  return my->update_witness(witness_name, url, block_signing_key, broadcast);
964 }
965 
966 vector< vesting_balance_object_with_info > wallet_api::get_vesting_balances( const string& account_name )const
967 {
968  return my->get_vesting_balances( account_name );
969 }
970 
971 signed_transaction wallet_api::withdraw_vesting(
972  const string& witness_name,
973  const string& amount,
974  const string& asset_symbol,
975  bool broadcast /* = false */ )const
976 {
977  return my->withdraw_vesting( witness_name, amount, asset_symbol, broadcast );
978 }
979 
980 signed_transaction wallet_api::vote_for_committee_member( const string& voting_account,
981  const string& witness,
982  bool approve,
983  bool broadcast /* = false */ )const
984 {
985  return my->vote_for_committee_member(voting_account, witness, approve, broadcast);
986 }
987 
988 signed_transaction wallet_api::vote_for_witness( const string& voting_account,
989  const string& witness,
990  bool approve,
991  bool broadcast /* = false */ )const
992 {
993  return my->vote_for_witness(voting_account, witness, approve, broadcast);
994 }
995 
996 signed_transaction wallet_api::set_voting_proxy( const string& account_to_modify,
997  const optional<string>& voting_account,
998  bool broadcast /* = false */ )const
999 {
1000  return my->set_voting_proxy(account_to_modify, voting_account, broadcast);
1001 }
1002 
1003 signed_transaction wallet_api::set_desired_witness_and_committee_member_count( const string& account_to_modify,
1004  uint16_t desired_number_of_witnesses,
1005  uint16_t desired_number_of_committee_members,
1006  bool broadcast /* = false */ )const
1007 {
1008  return my->set_desired_witness_and_committee_member_count(account_to_modify, desired_number_of_witnesses,
1009  desired_number_of_committee_members, broadcast);
1010 }
1011 
1012 void wallet_api::set_wallet_filename( const string& wallet_filename )const
1013 {
1014  my->_wallet_filename = wallet_filename;
1015 }
1016 
1017 signed_transaction wallet_api::sign_transaction( const signed_transaction& tx, bool broadcast /* = false */ )const
1018 { try {
1019  return my->sign_transaction( tx, broadcast);
1020 } FC_CAPTURE_AND_RETHROW( (tx) ) }
1021 
1022 signed_transaction wallet_api::sign_transaction2( const signed_transaction& tx,
1023  const vector<public_key_type>& signing_keys,
1024  bool broadcast /* = false */ )const
1025 { try {
1026  return my->sign_transaction2( tx, signing_keys, broadcast);
1027 } FC_CAPTURE_AND_RETHROW( (tx) ) }
1028 
1029 flat_set<public_key_type> wallet_api::get_transaction_signers( const signed_transaction& tx ) const
1030 { try {
1031  return my->get_transaction_signers(tx);
1032 } FC_CAPTURE_AND_RETHROW( (tx) ) }
1033 
1034 vector<flat_set<account_id_type>> wallet_api::get_key_references( const vector<public_key_type>& keys ) const
1035 { try {
1036  return my->get_key_references(keys);
1037 } FC_CAPTURE_AND_RETHROW( (keys) ) }
1038 
1039 operation wallet_api::get_prototype_operation( const string& operation_name )const
1040 {
1041  return my->get_prototype_operation( operation_name );
1042 }
1043 
1044 void wallet_api::dbg_make_uia( const string& creator, const string& symbol )const
1045 {
1046  FC_ASSERT(!is_locked());
1047  my->dbg_make_uia(creator, symbol);
1048 }
1049 
1050 void wallet_api::dbg_make_mia( const string& creator, const string& symbol )const
1051 {
1052  FC_ASSERT(!is_locked());
1053  my->dbg_make_mia(creator, symbol);
1054 }
1055 
1056 void wallet_api::dbg_push_blocks( const string& src_filename, uint32_t count )const
1057 {
1058  my->dbg_push_blocks( src_filename, count );
1059 }
1060 
1061 void wallet_api::dbg_generate_blocks( const string& debug_wif_key, uint32_t count )const
1062 {
1063  my->dbg_generate_blocks( debug_wif_key, count );
1064 }
1065 
1066 void wallet_api::dbg_stream_json_objects( const string& filename )const
1067 {
1068  my->dbg_stream_json_objects( filename );
1069 }
1070 
1072 {
1073  my->dbg_update_object( update );
1074 }
1075 
1076 void wallet_api::network_add_nodes( const vector<string>& nodes )const
1077 {
1078  my->network_add_nodes( nodes );
1079 }
1080 
1082 {
1083  return my->network_get_connected_peers();
1084 }
1085 
1086 void wallet_api::flood_network( const string& prefix, uint32_t number_of_transactions )const
1087 {
1088  FC_ASSERT(!is_locked());
1089  my->flood_network(prefix, number_of_transactions);
1090 }
1091 
1093  const string& proposing_account,
1094  const fc::time_point_sec& expiration_time,
1095  const variant_object& changed_values,
1096  bool broadcast /* = false */
1097  )const
1098 {
1099  return my->propose_parameter_change( proposing_account, expiration_time, changed_values, broadcast );
1100 }
1101 
1103  const string& proposing_account,
1104  const fc::time_point_sec& expiration_time,
1105  const variant_object& changed_fees,
1106  bool broadcast /* = false */
1107  )const
1108 {
1109  return my->propose_fee_change( proposing_account, expiration_time, changed_fees, broadcast );
1110 }
1111 
1112 signed_transaction wallet_api::approve_proposal(
1113  const string& fee_paying_account,
1114  const string& proposal_id,
1115  const approval_delta& delta,
1116  bool broadcast /* = false */
1117  )const
1118 {
1119  return my->approve_proposal( fee_paying_account, proposal_id, delta, broadcast );
1120 }
1121 
1123 {
1124  return my->get_global_properties();
1125 }
1126 
1128 {
1129  return my->get_dynamic_global_properties();
1130 }
1131 
1132 signed_transaction wallet_api::add_transaction_signature( const signed_transaction& tx,
1133  bool broadcast )const
1134 {
1135  return my->add_transaction_signature( tx, broadcast );
1136 }
1137 
1138 string wallet_api::help()const
1139 {
1140  std::vector<string> method_names = my->method_documentation.get_method_names();
1141  std::stringstream ss;
1142  for (const string& method_name : method_names)
1143  {
1144  try
1145  {
1146  ss << my->method_documentation.get_brief_description(method_name);
1147  }
1148  catch (const fc::key_not_found_exception&)
1149  {
1150  ss << method_name << " (no help available)\n";
1151  }
1152  }
1153  return ss.str();
1154 }
1155 
1156 string wallet_api::gethelp( const string& method )const
1157 {
1158  fc::api<wallet_api> tmp;
1159  std::stringstream ss;
1160  ss << "\n";
1161 
1162  string doxygenHelpString = my->method_documentation.get_detailed_description(method);
1163  if (!doxygenHelpString.empty())
1164  ss << doxygenHelpString << "\n";
1165 
1166  if( method == "import_key" )
1167  {
1168  ss << "usage: import_key ACCOUNT_NAME_OR_ID WIF_PRIVATE_KEY\n\n";
1169  ss << "example: import_key \"1.3.11\" 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3\n";
1170  ss << "example: import_key \"usera\" 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3\n";
1171  }
1172  else if( method == "transfer" )
1173  {
1174  ss << "usage: transfer FROM TO AMOUNT SYMBOL \"memo\" BROADCAST\n\n";
1175  ss << "example: transfer \"1.3.11\" \"1.3.4\" 1000.03 CORE \"memo\" true\n";
1176  ss << "example: transfer \"usera\" \"userb\" 1000.123 CORE \"memo\" true\n";
1177  }
1178  else if( method == "create_account_with_brain_key" )
1179  {
1180  ss << "usage: create_account_with_brain_key BRAIN_KEY ACCOUNT_NAME REGISTRAR REFERRER BROADCAST\n\n";
1181  ss << "example: create_account_with_brain_key "
1182  << "\"my really long brain key\" \"newaccount\" \"1.3.11\" \"1.3.11\" true\n";
1183  ss << "example: create_account_with_brain_key "
1184  << "\"my really long brain key\" \"newaccount\" \"someaccount\" \"otheraccount\" true\n";
1185  ss << "\n";
1186  ss << "This method should be used if you would like the wallet to generate new keys derived from the "
1187  << "brain key.\n";
1188  ss << "The BRAIN_KEY will be used as the owner key, and the active key will be derived from the BRAIN_KEY. "
1189  << "Use\n";
1190  ss << "register_account if you already know the keys you know the public keys that you would like to "
1191  << "register.\n";
1192 
1193  }
1194  else if( method == "register_account" )
1195  {
1196  ss << "usage: register_account ACCOUNT_NAME OWNER_PUBLIC_KEY ACTIVE_PUBLIC_KEY REGISTRAR "
1197  << "REFERRER REFERRER_PERCENT BROADCAST\n\n";
1198  ss << "example: register_account \"newaccount\" \"CORE6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV\" "
1199  << "\"CORE6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV\" \"1.3.11\" \"1.3.11\" 50 true\n";
1200  ss << "\n";
1201  ss << "Use this method to register an account for which you do not know the private keys.";
1202  }
1203  else if( method == "create_asset" )
1204  {
1205  ss << "usage: ISSUER SYMBOL PRECISION_DIGITS OPTIONS BITASSET_OPTIONS BROADCAST\n\n";
1206  ss << "PRECISION_DIGITS: the number of digits after the decimal point\n\n";
1207  ss << "Example value of OPTIONS: \n";
1209  ss << "\nExample value of BITASSET_OPTIONS: \n";
1211  ss << "\nBITASSET_OPTIONS may be null\n";
1212  }
1213  else if (doxygenHelpString.empty())
1214  ss << "No help defined for method " << method << "\n";
1215 
1216  return ss.str();
1217 }
1218 
1219 bool wallet_api::load_wallet_file( const string& wallet_filename )const
1220 {
1221  return my->load_wallet_file( wallet_filename );
1222 }
1223 
1224 void wallet_api::quit()const
1225 {
1226  my->quit();
1227 }
1228 
1229 void wallet_api::save_wallet_file( const string& wallet_filename )const
1230 {
1231  my->save_wallet_file( wallet_filename );
1232 }
1233 
1234 std::map< string, std::function< string( const fc::variant&, const fc::variants& ) >, std::less<> >
1236 {
1237  return my->get_result_formatters();
1238 }
1239 
1241 {
1242  return my->is_locked();
1243 }
1245 {
1246  return my->_wallet.cipher_keys.size() == 0;
1247 }
1248 
1250 {
1251  my->encrypt_keys();
1252 }
1253 
1254 void wallet_api::lock()const
1255 { try {
1256  FC_ASSERT( !is_locked() );
1257  encrypt_keys();
1258  for( auto key : my->_keys )
1259  key.second = key_to_wif(fc::ecc::private_key());
1260  my->_keys.clear();
1261  my->_checksum = fc::sha512();
1262  my->self.lock_changed(true);
1264 
1265 void wallet_api::unlock( const string& password )const
1266 { try {
1267  FC_ASSERT(password.size() > 0);
1268  auto pw = fc::sha512::hash(password.c_str(), password.size());
1269  vector<char> decrypted = fc::aes_decrypt(pw, my->_wallet.cipher_keys);
1270  auto pk = fc::raw::unpack<plain_keys>(decrypted);
1271  FC_ASSERT(pk.checksum == pw);
1272  my->_keys = std::move(pk.keys);
1273  my->_checksum = pk.checksum;
1274  my->self.lock_changed(false);
1276 
1277 void wallet_api::set_password( const string& password )const
1278 {
1279  if( !is_new() )
1280  FC_ASSERT( !is_locked(), "The wallet must be unlocked before the password can be set" );
1281  my->_checksum = fc::sha512::hash( password.c_str(), password.size() );
1282  lock();
1283 }
1284 
1285 vector< signed_transaction > wallet_api::import_balance(
1286  const string& name_or_id,
1287  const vector<string>& wif_keys,
1288  bool broadcast )const
1289 {
1290  return my->import_balance( name_or_id, wif_keys, broadcast );
1291 }
1292 
1293 map<public_key_type, string> wallet_api::dump_private_keys()const
1294 {
1295  FC_ASSERT(!is_locked());
1296  return my->_keys;
1297 }
1298 
1299 signed_transaction wallet_api::upgrade_account( const string& name, bool broadcast )const
1300 {
1301  return my->upgrade_account(name,broadcast);
1302 }
1303 
1304 signed_transaction wallet_api::sell_asset( const string& seller_account,
1305  const string& amount_to_sell,
1306  const string& symbol_to_sell,
1307  const string& min_to_receive,
1308  const string& symbol_to_receive,
1309  uint32_t expiration,
1310  bool fill_or_kill,
1311  bool broadcast )const
1312 {
1313  return my->sell_asset(seller_account, amount_to_sell, symbol_to_sell, min_to_receive,
1314  symbol_to_receive, expiration, fill_or_kill, broadcast);
1315 }
1316 
1317 signed_transaction wallet_api::borrow_asset( const string& seller_name, const string& amount_to_sell,
1318  const string& asset_symbol, const string& amount_of_collateral,
1319  bool broadcast )const
1320 {
1321  FC_ASSERT(!is_locked());
1322  return my->borrow_asset_ext( seller_name, amount_to_sell, asset_symbol, amount_of_collateral, {}, broadcast );
1323 }
1324 
1325 signed_transaction wallet_api::borrow_asset_ext( const string& seller_name, const string& amount_to_sell,
1326  const string& asset_symbol, const string& amount_of_collateral,
1328  bool broadcast )const
1329 {
1330  FC_ASSERT(!is_locked());
1331  return my->borrow_asset_ext(seller_name, amount_to_sell, asset_symbol,
1332  amount_of_collateral, extensions, broadcast);
1333 }
1334 
1335 signed_transaction wallet_api::cancel_order( const limit_order_id_type& order_id, bool broadcast ) const
1336 {
1337  FC_ASSERT(!is_locked());
1338  return my->cancel_order(order_id, broadcast);
1339 }
1340 
1341 memo_data wallet_api::sign_memo( const string& from, const string& to, const string& memo )const
1342 {
1343  FC_ASSERT(!is_locked());
1344  return my->sign_memo(from, to, memo);
1345 }
1346 
1347 string wallet_api::read_memo( const memo_data& memo )const
1348 {
1349  FC_ASSERT(!is_locked());
1350  return my->read_memo(memo);
1351 }
1352 
1353 signed_message wallet_api::sign_message( const string& signer, const string& message )const
1354 {
1355  FC_ASSERT(!is_locked());
1356  return my->sign_message(signer, message);
1357 }
1358 
1359 bool wallet_api::verify_message( const string& message, const string& account, int32_t block, const string& msg_time,
1360  const fc::ecc::compact_signature& sig )const
1361 {
1362  return my->verify_message( message, account, block, msg_time, sig );
1363 }
1364 
1371 {
1372  return my->verify_signed_message( message );
1373 }
1374 
1381 {
1382  return my->verify_encapsulated_message( message );
1383 }
1384 
1385 
1386 string wallet_api::get_key_label( const public_key_type& key )const
1387 {
1388  auto key_itr = my->_wallet.labeled_keys.get<by_key>().find(key);
1389  if( key_itr != my->_wallet.labeled_keys.get<by_key>().end() )
1390  return key_itr->label;
1391  return string();
1392 }
1393 
1394 string wallet_api::get_private_key( const public_key_type& pubkey )const
1395 {
1396  return key_to_wif( my->get_private_key( pubkey ) );
1397 }
1398 
1399 public_key_type wallet_api::get_public_key( const string& label )const
1400 {
1401  try { return fc::variant(label, 1).as<public_key_type>( 1 ); } catch ( ... ){}
1402 
1403  auto key_itr = my->_wallet.labeled_keys.get<by_label>().find(label);
1404  if( key_itr != my->_wallet.labeled_keys.get<by_label>().end() )
1405  return key_itr->key;
1406  return public_key_type();
1407 }
1408 
1409 bool wallet_api::set_key_label( const public_key_type& key, const string& label )const
1410 {
1411  auto result = my->_wallet.labeled_keys.insert( key_label{label,key} );
1412  if( result.second ) return true;
1413 
1414  auto key_itr = my->_wallet.labeled_keys.get<by_key>().find(key);
1415  auto label_itr = my->_wallet.labeled_keys.get<by_label>().find(label);
1416  if( label_itr == my->_wallet.labeled_keys.get<by_label>().end() )
1417  {
1418  if( key_itr != my->_wallet.labeled_keys.get<by_key>().end() )
1419  return my->_wallet.labeled_keys.get<by_key>().modify( key_itr, [&]( key_label& obj ){ obj.label = label; } );
1420  }
1421  return false;
1422 }
1423 map<string, public_key_type, std::less<>> wallet_api::get_blind_accounts()const
1424 {
1425  map<string, public_key_type, std::less<>> result;
1426  for( const auto& item : my->_wallet.labeled_keys )
1427  result[item.label] = item.key;
1428  return result;
1429 }
1430 map<string, public_key_type, std::less<>> wallet_api::get_my_blind_accounts()const
1431 {
1432  FC_ASSERT( !is_locked() );
1433  map<string, public_key_type, std::less<>> result;
1434  for( const auto& item : my->_wallet.labeled_keys )
1435  {
1436  if( my->_keys.find(item.key) != my->_keys.end() )
1437  result[item.label] = item.key;
1438  }
1439  return result;
1440 }
1441 
1442 public_key_type wallet_api::create_blind_account( const string& label, const string& p_brain_key )const
1443 {
1444  FC_ASSERT( !is_locked() );
1445 
1446  auto label_itr = my->_wallet.labeled_keys.get<by_label>().find(label);
1447  if( label_itr != my->_wallet.labeled_keys.get<by_label>().end() )
1448  FC_ASSERT( !"Key with label already exists" );
1449  auto brain_key = fc::trim_and_normalize_spaces( p_brain_key );
1450  auto secret = fc::sha256::hash( brain_key.c_str(), brain_key.size() );
1451  auto priv_key = fc::ecc::private_key::regenerate( secret );
1452  public_key_type pub_key = priv_key.get_public_key();
1453 
1454  FC_ASSERT( set_key_label( pub_key, label ) );
1455 
1456  my->_keys[pub_key] = graphene::utilities::key_to_wif( priv_key );
1457 
1458  save_wallet_file();
1459  return pub_key;
1460 }
1461 
1462 vector<asset> wallet_api::get_blind_balances( const string& key_or_label )const
1463 {
1464  vector<asset> result;
1465  map<asset_id_type, share_type> balances;
1466 
1467  vector<commitment_type> used;
1468 
1469  auto pub_key = get_public_key( key_or_label );
1470  auto& to_asset_used_idx = my->_wallet.blind_receipts.get<by_to_asset_used>();
1471  auto start = to_asset_used_idx.lower_bound( std::make_tuple(pub_key,asset_id_type(0),false) );
1472  auto end = to_asset_used_idx.lower_bound( std::make_tuple(pub_key,asset_id_type(uint32_t(0xffffffff)),true) );
1473  while( start != end )
1474  {
1475  if( !start->used )
1476  {
1477  auto answer = my->_remote_db->get_blinded_balances( {start->commitment()} );
1478  if( answer.size() )
1479  balances[start->amount.asset_id] += start->amount.amount;
1480  else
1481  used.push_back( start->commitment() );
1482  }
1483  ++start;
1484  }
1485  for( const auto& u : used )
1486  {
1487  auto itr = my->_wallet.blind_receipts.get<by_commitment>().find( u );
1488  my->_wallet.blind_receipts.modify( itr, []( blind_receipt& r ){ r.used = true; } );
1489  }
1490  for( auto item : balances )
1491  result.push_back( asset( item.second, item.first ) );
1492  return result;
1493 }
1494 
1495 blind_confirmation wallet_api::transfer_from_blind( const string& from_blind_account_key_or_label,
1496  const string& to_account_id_or_name,
1497  const string& amount_in,
1498  const string& symbol,
1499  bool broadcast )const
1500 { try {
1501  transfer_from_blind_operation from_blind;
1502 
1503 
1504  auto fees = my->_remote_db->get_global_properties().parameters.get_current_fees();
1505  fc::optional<asset_object> asset_obj = get_asset(symbol);
1506  FC_ASSERT(asset_obj.valid(), "Could not find asset matching ${asset}", ("asset", symbol));
1507  auto amount = asset_obj->amount_from_string(amount_in);
1508 
1509  from_blind.fee = fees.calculate_fee( from_blind, asset_obj->options.core_exchange_rate );
1510 
1511  auto blind_in = asset_obj->amount_to_string( from_blind.fee + amount );
1512 
1513 
1514  auto conf = blind_transfer_help( from_blind_account_key_or_label,
1515  from_blind_account_key_or_label,
1516  blind_in, symbol, false, true/*to_temp*/ );
1517  FC_ASSERT( conf.outputs.size() > 0 );
1518 
1519  auto to_account = my->get_account( to_account_id_or_name );
1520  from_blind.to = to_account.id;
1521  from_blind.amount = amount;
1522  from_blind.blinding_factor = conf.outputs.back().decrypted_memo.blinding_factor;
1523  from_blind.inputs.push_back( {conf.outputs.back().decrypted_memo.commitment, authority() } );
1524  from_blind.fee = fees.calculate_fee( from_blind, asset_obj->options.core_exchange_rate );
1525 
1526  idump( (from_blind) );
1527  conf.trx.operations.push_back(from_blind);
1528  ilog( "about to validate" );
1529  conf.trx.validate();
1530 
1531  ilog( "about to broadcast" );
1532  conf.trx = sign_transaction( conf.trx, broadcast );
1533 
1534  if( broadcast && conf.outputs.size() == 2 ) {
1535 
1536  // Save the change
1537  blind_confirmation::output conf_output;
1538  blind_confirmation::output change_output = conf.outputs[0];
1539 
1540  // The wallet must have a private key for confirmation.to, this is used to decrypt the memo
1541  public_key_type from_key = get_public_key(from_blind_account_key_or_label);
1542  conf_output.confirmation.to = from_key;
1543  conf_output.confirmation.one_time_key = change_output.confirmation.one_time_key;
1544  conf_output.confirmation.encrypted_memo = change_output.confirmation.encrypted_memo;
1545  conf_output.confirmation_receipt = conf_output.confirmation;
1546  //try {
1548  from_blind_account_key_or_label,
1549  "@"+to_account.name );
1550  //} catch ( ... ){}
1551  }
1552 
1553  return conf;
1554 } FC_CAPTURE_AND_RETHROW( (from_blind_account_key_or_label)(to_account_id_or_name)(amount_in)(symbol) ) }
1555 
1556 blind_confirmation wallet_api::blind_transfer( const string& from_key_or_label,
1557  const string& to_key_or_label,
1558  const string& amount_in,
1559  const string& symbol,
1560  bool broadcast )const
1561 {
1562  return blind_transfer_help( from_key_or_label, to_key_or_label, amount_in, symbol, broadcast, false );
1563 }
1564 blind_confirmation wallet_api::blind_transfer_help( const string& from_key_or_label,
1565  const string& to_key_or_label,
1566  const string& amount_in,
1567  const string& symbol,
1568  bool broadcast,
1569  bool to_temp )const
1570 {
1571  blind_confirmation confirm;
1572  try {
1573 
1574  FC_ASSERT( !is_locked() );
1575  public_key_type from_key = get_public_key(from_key_or_label);
1576  public_key_type to_key = get_public_key(to_key_or_label);
1577 
1578  fc::optional<asset_object> asset_obj = get_asset(symbol);
1579  FC_ASSERT(asset_obj.valid(), "Could not find asset matching ${asset}", ("asset", symbol));
1580 
1581  blind_transfer_operation blind_tr;
1582  blind_tr.outputs.resize(2);
1583 
1584  auto fees = my->_remote_db->get_global_properties().parameters.get_current_fees();
1585 
1586  auto amount = asset_obj->amount_from_string(amount_in);
1587 
1588  asset total_amount = asset_obj->amount(0);
1589 
1590  vector<fc::sha256> blinding_factors;
1591 
1592  //auto from_priv_key = my->get_private_key( from_key );
1593 
1594  blind_tr.fee = fees.calculate_fee( blind_tr, asset_obj->options.core_exchange_rate );
1595 
1596  vector<commitment_type> used;
1597 
1598  auto& to_asset_used_idx = my->_wallet.blind_receipts.get<by_to_asset_used>();
1599  auto start = to_asset_used_idx.lower_bound( std::make_tuple(from_key,amount.asset_id,false) );
1600  auto end = to_asset_used_idx.lower_bound( std::make_tuple(from_key,amount.asset_id,true) );
1601  while( start != end )
1602  {
1603  auto result = my->_remote_db->get_blinded_balances( {start->commitment() } );
1604  if( result.size() == 0 )
1605  {
1606  used.push_back( start->commitment() );
1607  }
1608  else
1609  {
1610  blind_tr.inputs.push_back({start->commitment(), start->control_authority});
1611  blinding_factors.push_back( start->data.blinding_factor );
1612  total_amount += start->amount;
1613 
1614  if( total_amount >= amount + blind_tr.fee )
1615  break;
1616  }
1617  ++start;
1618  }
1619  for( const auto& u : used )
1620  {
1621  auto itr = my->_wallet.blind_receipts.get<by_commitment>().find( u );
1622  my->_wallet.blind_receipts.modify( itr, []( blind_receipt& r ){ r.used = true; } );
1623  }
1624 
1625  FC_ASSERT( total_amount >= amount+blind_tr.fee,
1626  "Insufficient Balance",
1627  ("available",total_amount)("amount",amount)("fee",blind_tr.fee) );
1628 
1629  auto one_time_key = fc::ecc::private_key::generate();
1630  auto secret = one_time_key.get_shared_secret( to_key );
1631  auto child = fc::sha256::hash( secret );
1632  auto nonce = fc::sha256::hash( one_time_key.get_secret() );
1633  auto blind_factor = fc::sha256::hash( child );
1634 
1635  auto from_secret = one_time_key.get_shared_secret( from_key );
1636  auto from_child = fc::sha256::hash( from_secret );
1637  auto from_nonce = fc::sha256::hash( nonce );
1638 
1639  auto change = total_amount - amount - blind_tr.fee;
1640  fc::sha256 change_blind_factor;
1641  fc::sha256 to_blind_factor;
1642  if( change.amount > 0 )
1643  {
1644  idump(("to_blind_factor")(blind_factor) );
1645  blinding_factors.push_back( blind_factor );
1646  change_blind_factor = fc::ecc::blind_sum( blinding_factors, blinding_factors.size() - 1 );
1647  wdump(("change_blind_factor")(change_blind_factor) );
1648  }
1649  else // change == 0
1650  {
1651  blind_tr.outputs.resize(1);
1652  blind_factor = fc::ecc::blind_sum( blinding_factors, blinding_factors.size() );
1653  idump(("to_sum_blind_factor")(blind_factor) );
1654  blinding_factors.push_back( blind_factor );
1655  idump(("nochange to_blind_factor")(blind_factor) );
1656  }
1657  fc::ecc::public_key from_pub_key = from_key;
1658  fc::ecc::public_key to_pub_key = to_key;
1659 
1660  blind_output to_out;
1661  to_out.owner = to_temp ? authority() : authority( 1, public_key_type( to_pub_key.child( child ) ), 1 );
1662  to_out.commitment = fc::ecc::blind( blind_factor, amount.amount.value );
1663  idump(("to_out.blind")(blind_factor)(to_out.commitment) );
1664 
1665 
1666  if( blind_tr.outputs.size() > 1 )
1667  {
1668  to_out.range_proof = fc::ecc::range_proof_sign( 0, to_out.commitment, blind_factor, nonce,
1669  0, RANGE_PROOF_MANTISSA, amount.amount.value );
1670 
1671  blind_output change_out;
1672  change_out.owner = authority( 1, public_key_type( from_pub_key.child( from_child ) ), 1 );
1673  change_out.commitment = fc::ecc::blind( change_blind_factor, change.amount.value );
1674  change_out.range_proof = fc::ecc::range_proof_sign( 0, change_out.commitment, change_blind_factor, from_nonce,
1675  0, RANGE_PROOF_MANTISSA, change.amount.value );
1676  blind_tr.outputs[1] = change_out;
1677 
1678 
1679  blind_confirmation::output conf_output;
1680  conf_output.label = from_key_or_label;
1681  conf_output.pub_key = from_key;
1682  conf_output.decrypted_memo.from = from_key;
1683  conf_output.decrypted_memo.amount = change;
1684  conf_output.decrypted_memo.blinding_factor = change_blind_factor;
1685  conf_output.decrypted_memo.commitment = change_out.commitment;
1686  conf_output.decrypted_memo.check = from_secret._hash[0].value();
1687  conf_output.confirmation.one_time_key = one_time_key.get_public_key();
1688  conf_output.confirmation.to = from_key;
1689  conf_output.confirmation.encrypted_memo =
1690  fc::aes_encrypt( from_secret, fc::raw::pack( conf_output.decrypted_memo ) );
1691  conf_output.auth = change_out.owner;
1692  conf_output.confirmation_receipt = conf_output.confirmation;
1693 
1694  confirm.outputs.push_back( conf_output );
1695  }
1696  blind_tr.outputs[0] = to_out;
1697 
1698  blind_confirmation::output conf_output;
1699  conf_output.label = to_key_or_label;
1700  conf_output.pub_key = to_key;
1701  conf_output.decrypted_memo.from = from_key;
1702  conf_output.decrypted_memo.amount = amount;
1703  conf_output.decrypted_memo.blinding_factor = blind_factor;
1704  conf_output.decrypted_memo.commitment = to_out.commitment;
1705  conf_output.decrypted_memo.check = secret._hash[0].value();
1706  conf_output.confirmation.one_time_key = one_time_key.get_public_key();
1707  conf_output.confirmation.to = to_key;
1708  conf_output.confirmation.encrypted_memo = fc::aes_encrypt( secret, fc::raw::pack( conf_output.decrypted_memo ) );
1709  conf_output.auth = to_out.owner;
1710  conf_output.confirmation_receipt = conf_output.confirmation;
1711 
1712  confirm.outputs.push_back( conf_output );
1713 
1715  std::sort( blind_tr.outputs.begin(), blind_tr.outputs.end(),
1716  [&]( const blind_output& a, const blind_output& b ){ return a.commitment < b.commitment; } );
1717  std::sort( blind_tr.inputs.begin(), blind_tr.inputs.end(),
1718  [&]( const blind_input& a, const blind_input& b ){ return a.commitment < b.commitment; } );
1719 
1720  confirm.trx.operations.emplace_back( std::move(blind_tr) );
1721  ilog( "validate before" );
1722  confirm.trx.validate();
1723  confirm.trx = sign_transaction(confirm.trx, broadcast);
1724 
1725  if( broadcast )
1726  {
1727  for( const auto& out : confirm.outputs )
1728  {
1729  try { receive_blind_transfer( out.confirmation_receipt, from_key_or_label, "" ); } catch ( ... ){}
1730  }
1731  }
1732 
1733  return confirm;
1734 } FC_CAPTURE_AND_RETHROW( (from_key_or_label)(to_key_or_label)(amount_in)(symbol)(broadcast)(confirm) ) }
1735 
1736 
1737 
1738 /*
1739  * Transfers a public balance from @from to one or more blinded balances using a
1740  * stealth transfer.
1741  */
1742 blind_confirmation wallet_api::transfer_to_blind( const string& from_account_id_or_name,
1743  const string& asset_symbol,
1744  /* map from key or label to amount */
1745  const vector<pair<string, string>>& to_amounts,
1746  bool broadcast )const
1747 { try {
1748  FC_ASSERT( !is_locked() );
1749  idump((to_amounts));
1750 
1751  blind_confirmation confirm;
1752  account_object from_account = my->get_account(from_account_id_or_name);
1753 
1754  fc::optional<asset_object> asset_obj = get_asset(asset_symbol);
1755  FC_ASSERT(asset_obj, "Could not find asset matching ${asset}", ("asset", asset_symbol));
1756 
1758  bop.from = from_account.id;
1759 
1760  vector<fc::sha256> blinding_factors;
1761 
1762  asset total_amount = asset_obj->amount(0);
1763 
1764  for( auto item : to_amounts )
1765  {
1766  auto one_time_key = fc::ecc::private_key::generate();
1767  auto to_key = get_public_key( item.first );
1768  auto secret = one_time_key.get_shared_secret( to_key );
1769  auto child = fc::sha256::hash( secret );
1770  auto nonce = fc::sha256::hash( one_time_key.get_secret() );
1771  auto blind_factor = fc::sha256::hash( child );
1772 
1773  blinding_factors.push_back( blind_factor );
1774 
1775  auto amount = asset_obj->amount_from_string(item.second);
1776  total_amount += amount;
1777 
1778 
1779  fc::ecc::public_key to_pub_key = to_key;
1780  blind_output out;
1781  out.owner = authority( 1, public_key_type( to_pub_key.child( child ) ), 1 );
1782  out.commitment = fc::ecc::blind( blind_factor, amount.amount.value );
1783  if( to_amounts.size() > 1 )
1784  out.range_proof = fc::ecc::range_proof_sign( 0, out.commitment, blind_factor, nonce,
1785  0, RANGE_PROOF_MANTISSA, amount.amount.value );
1786 
1787  blind_confirmation::output conf_output;
1788  conf_output.label = item.first;
1789  conf_output.pub_key = to_key;
1790  conf_output.decrypted_memo.amount = amount;
1791  conf_output.decrypted_memo.blinding_factor = blind_factor;
1792  conf_output.decrypted_memo.commitment = out.commitment;
1793  conf_output.decrypted_memo.check = secret._hash[0].value();
1794  conf_output.confirmation.one_time_key = one_time_key.get_public_key();
1795  conf_output.confirmation.to = to_key;
1796  conf_output.confirmation.encrypted_memo =
1797  fc::aes_encrypt( secret, fc::raw::pack( conf_output.decrypted_memo ) );
1798  conf_output.confirmation_receipt = conf_output.confirmation;
1799 
1800  confirm.outputs.push_back( conf_output );
1801 
1802  bop.outputs.push_back(out);
1803  }
1804  bop.amount = total_amount;
1805  bop.blinding_factor = fc::ecc::blind_sum( blinding_factors, blinding_factors.size() );
1806 
1808  std::sort( bop.outputs.begin(), bop.outputs.end(),
1809  [&]( const blind_output& a, const blind_output& b ){ return a.commitment < b.commitment; } );
1810 
1811  confirm.trx.operations.push_back( bop );
1812  my->set_operation_fees( confirm.trx, my->_remote_db->get_global_properties().parameters.get_current_fees());
1813  confirm.trx.validate();
1814  confirm.trx = sign_transaction(confirm.trx, broadcast);
1815 
1816  if( broadcast )
1817  {
1818  for( const auto& out : confirm.outputs )
1819  {
1820  try {
1821  receive_blind_transfer( out.confirmation_receipt, "@"+from_account.name, "from @"+from_account.name );
1822  } catch ( ... ){}
1823  }
1824  }
1825 
1826  return confirm;
1827 } FC_CAPTURE_AND_RETHROW( (from_account_id_or_name)(asset_symbol)(to_amounts) ) }
1828 
1829 blind_receipt wallet_api::receive_blind_transfer( const string& confirmation_receipt,
1830  const string& opt_from, const string& opt_memo )const
1831 {
1832  FC_ASSERT( !is_locked() );
1833  stealth_confirmation conf(confirmation_receipt);
1834  FC_ASSERT( conf.to );
1835 
1836  blind_receipt result;
1837  result.conf = conf;
1838 
1839  auto to_priv_key_itr = my->_keys.find( *conf.to );
1840  FC_ASSERT( to_priv_key_itr != my->_keys.end(), "No private key for receiver", ("conf",conf) );
1841 
1842 
1843  auto to_priv_key = wif_to_key( to_priv_key_itr->second );
1844  FC_ASSERT( to_priv_key );
1845 
1846  auto secret = to_priv_key->get_shared_secret( conf.one_time_key );
1847  auto child = fc::sha256::hash( secret );
1848 
1849  auto child_priv_key = to_priv_key->child( child );
1850  //auto blind_factor = fc::sha256::hash( child );
1851 
1852  auto plain_memo = fc::aes_decrypt( secret, conf.encrypted_memo );
1853  auto memo = fc::raw::unpack<stealth_confirmation::memo_data>( plain_memo );
1854 
1855  result.to_key = *conf.to;
1856  result.to_label = get_key_label( result.to_key );
1857  if( memo.from )
1858  {
1859  result.from_key = *memo.from;
1860  result.from_label = get_key_label( result.from_key );
1861  if( result.from_label == string() )
1862  {
1863  result.from_label = opt_from;
1864  set_key_label( result.from_key, result.from_label );
1865  }
1866  }
1867  else
1868  {
1869  result.from_label = opt_from;
1870  }
1871  result.amount = memo.amount;
1872  result.memo = opt_memo;
1873 
1874  // confirm the amount matches the commitment (verify the blinding factor)
1875  auto commtiment_test = fc::ecc::blind( memo.blinding_factor, memo.amount.amount.value );
1876  FC_ASSERT( fc::ecc::verify_sum( {commtiment_test}, {memo.commitment}, 0 ) );
1877 
1878  blind_balance bal;
1879  bal.amount = memo.amount;
1880  bal.to = *conf.to;
1881  if( memo.from ) bal.from = *memo.from;
1882  bal.one_time_key = conf.one_time_key;
1883  bal.blinding_factor = memo.blinding_factor;
1884  bal.commitment = memo.commitment;
1885  bal.used = false;
1886 
1887  auto child_pubkey = child_priv_key.get_public_key();
1888  auto owner = authority(1, public_key_type(child_pubkey), 1);
1889  result.control_authority = owner;
1890  result.data = memo;
1891 
1892  auto child_key_itr = owner.key_auths.find( child_pubkey );
1893  if( child_key_itr != owner.key_auths.end() )
1894  my->_keys[child_key_itr->first] = key_to_wif( child_priv_key );
1895 
1896  // my->_wallet.blinded_balances[memo.amount.asset_id][bal.to].push_back( bal );
1897 
1898  result.date = fc::time_point::now();
1899  my->_wallet.blind_receipts.insert( result );
1900  my->_keys[child_pubkey] = key_to_wif( child_priv_key );
1901 
1902  save_wallet_file();
1903 
1904  return result;
1905 }
1906 
1907 vector<blind_receipt> wallet_api::blind_history( const string& key_or_account )const
1908 {
1909  vector<blind_receipt> result;
1910  auto pub_key = get_public_key( key_or_account );
1911 
1912  if( pub_key == public_key_type() )
1913  return vector<blind_receipt>();
1914 
1915  for( auto& r : my->_wallet.blind_receipts )
1916  {
1917  if( r.from_key == pub_key || r.to_key == pub_key )
1918  result.push_back( r );
1919  }
1920  std::sort( result.begin(), result.end(),
1921  [&]( const blind_receipt& a, const blind_receipt& b ){ return a.date > b.date; } );
1922  return result;
1923 }
1924 
1925 order_book wallet_api::get_order_book( const string& base, const string& quote, uint32_t limit )const
1926 {
1927  return( my->_remote_db->get_order_book( base, quote, limit ) );
1928 }
1929 
1930 // custom operations
1931 signed_transaction wallet_api::account_store_map( const string& account, const string& catalog, bool is_to_remove,
1932  const flat_map<string, optional<string>>& key_values, bool broadcast )const
1933 {
1934  return my->account_store_map(account, catalog, is_to_remove, key_values, broadcast);
1935 }
1936 
1937 vector<account_storage_object> wallet_api::get_account_storage( const string& account, const string& catalog )const
1938 { try {
1939  return my->_custom_operations->get_storage_info(account, catalog);
1940 } FC_CAPTURE_AND_RETHROW( (account)(catalog) ) }
1941 
1943  : signed_block( block ),
1944  block_id { id() },
1945  signing_key { signee() }
1946 {
1947  transaction_ids.reserve( transactions.size() );
1948  for( const processed_transaction& tx : transactions )
1949  transaction_ids.push_back( tx.id() );
1950 }
1951 
1953  const vesting_balance_object& vbo,
1954  const fc::time_point_sec& now )
1955  : vesting_balance_object( vbo ),
1956  allowed_withdraw { get_allowed_withdraw( now ) },
1957  allowed_withdraw_time { now }
1958 {
1959 }
1960 
1961 } } // graphene::wallet
1962 
1963 namespace fc {
1964  void to_variant( const account_multi_index_type& accts, variant& vo, uint32_t max_depth )
1965  {
1966  to_variant( std::vector<account_object>(accts.begin(), accts.end()), vo, max_depth );
1967  }
1968 
1969  void from_variant( const variant& var, account_multi_index_type& vo, uint32_t max_depth )
1970  {
1971  const std::vector<account_object>& v = var.as<std::vector<account_object>>( max_depth );
1972  vo = account_multi_index_type(v.begin(), v.end());
1973  }
1974 }
graphene::wallet::wallet_api::set_key_label
bool set_key_label(const public_key_type &key, const string &label) const
Definition: wallet.cpp:1409
graphene::wallet::wallet_api::is_public_key_registered
bool is_public_key_registered(const string &public_key) const
Definition: wallet.cpp:483
graphene::wallet::wallet_api::get_vesting_balances
vector< vesting_balance_object_with_info > get_vesting_balances(const string &account_name) const
Definition: wallet.cpp:966
graphene::wallet::detail::normalize_brain_key
string normalize_brain_key(string s)
Definition: wallet_sign.cpp:68
graphene::wallet::signed_message_meta::time
string time
Definition: wallet_structs.hpp:257
graphene::wallet::wallet_api::begin_builder_transaction
transaction_handle_type begin_builder_transaction() const
Definition: wallet.cpp:505
graphene::chain::htlc_object::transfer_info::asset_id
asset_id_type asset_id
Definition: htlc_object.hpp:48
graphene::protocol::transaction::operations
vector< operation > operations
Definition: transaction.hpp:89
stdio.hpp
git_revision.hpp
FC_CAPTURE_AND_RETHROW
#define FC_CAPTURE_AND_RETHROW(...)
Definition: exception.hpp:479
graphene::wallet::wallet_api::receive_blind_transfer
blind_receipt receive_blind_transfer(const string &confirmation_receipt, const string &opt_from, const string &opt_memo) const
Definition: wallet.cpp:1829
graphene::wallet::wallet_api::sign_builder_transaction
signed_transaction sign_builder_transaction(transaction_handle_type transaction_handle, bool broadcast=true) const
Definition: wallet.cpp:535
graphene::wallet::account_history_operation_detail
Definition: wallet_structs.hpp:316
graphene::wallet::blind_confirmation::output::pub_key
public_key_type pub_key
Definition: wallet_structs.hpp:63
graphene::wallet::wallet_api::network_add_nodes
void network_add_nodes(const vector< string > &nodes) const
Definition: wallet.cpp:1076
graphene::wallet::wallet_api::create_account_with_brain_key
signed_transaction create_account_with_brain_key(const string &brain_key, const string &account_name, const string &registrar_account, const string &referrer_account, bool broadcast=false) const
Definition: wallet.cpp:779
fc::variant_object
An order-perserving dictionary of variant's.
Definition: variant_object.hpp:20
graphene::wallet::wallet_api::serialize_transaction
string serialize_transaction(const signed_transaction &tx) const
Definition: wallet.cpp:490
graphene::protocol::transfer_to_blind_operation
Converts public account balance to a blinded or stealth balance.
Definition: confidential.hpp:150
graphene::wallet::wallet_api::list_assets
vector< extended_asset_object > list_assets(const string &lowerbound, uint32_t limit) const
Definition: wallet.cpp:192
graphene::db::object::id
object_id_type id
Definition: object.hpp:69
graphene::wallet::wallet_api::create_asset
signed_transaction create_asset(const string &issuer, const string &symbol, uint8_t precision, const asset_options &common, const optional< bitasset_options > &bitasset_opts, bool broadcast=false) const
Definition: wallet.cpp:800
graphene::wallet::wallet_api::sign_transaction
signed_transaction sign_transaction(const signed_transaction &tx, bool broadcast=false) const
Definition: wallet.cpp:1017
graphene::wallet::wallet_api::unlock
void unlock(const string &password) const
Definition: wallet.cpp:1265
graphene::wallet::wallet_api::get_bitasset_data
asset_bitasset_data_object get_bitasset_data(const string &asset_symbol_or_id) const
Definition: wallet.cpp:589
graphene::wallet::wallet_api::get_transaction_signers
flat_set< public_key_type > get_transaction_signers(const signed_transaction &tx) const
Definition: wallet.cpp:1029
graphene::wallet::wallet_api::get_asset
extended_asset_object get_asset(const string &asset_symbol_or_id) const
Definition: wallet.cpp:582
graphene::chain::dynamic_global_property_object
Maintains global state information (committee_member list, current fees)
Definition: global_property_object.hpp:62
graphene::wallet::wallet_api::transfer_from_blind
blind_confirmation transfer_from_blind(const string &from_blind_account_key_or_label, const string &to_account_name_or_id, const string &amount, const string &asset_symbol_or_id, bool broadcast=false) const
Definition: wallet.cpp:1495
graphene::wallet::wallet_api::about
variant_object about() const
Definition: wallet.cpp:758
graphene::wallet::wallet_api::~wallet_api
virtual ~wallet_api()
graphene::wallet::wallet_api::is_locked
bool is_locked() const
Definition: wallet.cpp:1240
graphene::protocol::blind_transfer_operation
Transfers from blind to blind.
Definition: confidential.hpp:238
graphene::wallet::wallet_api::dbg_stream_json_objects
void dbg_stream_json_objects(const string &filename) const
Definition: wallet.cpp:1066
fc::hash160::str
string str() const
Definition: hash160.cpp:46
graphene::wallet::wallet_api::list_committee_members
map< string, committee_member_id_type, std::less<> > list_committee_members(const string &lowerbound, uint32_t limit) const
Definition: wallet.cpp:912
graphene::wallet::wallet_api::get_limit_orders
vector< limit_order_object > get_limit_orders(const string &a, const string &b, uint32_t limit) const
Get limit orders in a given market.
Definition: wallet.cpp:451
graphene::protocol::blind_output
Defines data required to create a new blind commitment.
Definition: confidential.hpp:135
graphene::wallet::wallet_api::import_account_keys
bool import_account_keys(const string &filename, const string &password, const string &src_account_name, const string &dest_account_name) const
Definition: wallet.cpp:697
fc::exception
Used to generate a useful error report when an exception is thrown.
Definition: exception.hpp:56
fc::mutable_variant_object
An order-perserving dictionary of variant's.
Definition: variant_object.hpp:108
graphene::wallet::wallet_api::get_wallet_filename
string get_wallet_filename() const
Definition: wallet.cpp:500
graphene::protocol::stealth_confirmation::memo_data::check
uint32_t check
Definition: confidential.hpp:110
graphene::protocol::stealth_confirmation::one_time_key
public_key_type one_time_key
Definition: confidential.hpp:123
graphene::wallet::wallet_api::gethelp
string gethelp(const string &method) const
Definition: wallet.cpp:1156
graphene::wallet::wallet_api::suggest_brain_key
brain_key_info suggest_brain_key() const
Definition: wallet.cpp:471
graphene::chain::htlc_object::condition_info::hash_lock
hash_lock_info hash_lock
Definition: htlc_object.hpp:61
graphene::wallet::wallet_api::get_order_book
order_book get_order_book(const string &base, const string &quote, uint32_t limit=50) const
Definition: wallet.cpp:1925
graphene::wallet::wallet_api::get_prototype_operation
operation get_prototype_operation(const string &operation_type) const
Definition: wallet.cpp:1039
graphene::protocol::transfer_from_blind_operation::inputs
vector< blind_input > inputs
Definition: confidential.hpp:183
asset_object.hpp
graphene::protocol::stealth_confirmation::memo_data::commitment
fc::ecc::commitment_type commitment
Definition: confidential.hpp:109
graphene::wallet::blind_receipt::amount
asset amount
Definition: wallet_structs.hpp:99
graphene::wallet::wallet_api::update_asset_issuer
signed_transaction update_asset_issuer(const string &symbol_or_id, const string &new_issuer, bool broadcast=false) const
Definition: wallet.cpp:818
graphene::wallet::blind_receipt::from_label
string from_label
Definition: wallet_structs.hpp:96
graphene::wallet::wallet_api::propose_fee_change
signed_transaction propose_fee_change(const string &proposing_account, const time_point_sec &expiration_time, const variant_object &changed_values, bool broadcast=false) const
Definition: wallet.cpp:1102
graphene::wallet::wallet_api::get_htlc
optional< variant > get_htlc(const htlc_id_type &htlc_id) const
Definition: wallet.cpp:211
graphene::wallet::wallet_api::verify_message
bool verify_message(const string &message, const string &account, int32_t block, const string &msg_time, const fc::ecc::compact_signature &sig) const
Definition: wallet.cpp:1359
graphene::wallet::wallet_api::settle_asset
signed_transaction settle_asset(const string &account_to_settle, const string &amount_to_settle, const string &symbol_or_id, bool broadcast=false) const
Definition: wallet.cpp:877
websocket_api.hpp
graphene::wallet::wallet_api::publish_asset_feed
signed_transaction publish_asset_feed(const string &publishing_account, const string &symbol_or_id, const price_feed &feed, bool broadcast=false) const
Definition: wallet.cpp:839
fc::ecc::range_proof_sign
range_proof_type range_proof_sign(uint64_t min_value, const commitment_type &commit, const blind_factor_type &commit_blind, const blind_factor_type &nonce, int8_t base10_exp, uint8_t min_bits, uint64_t actual_value)
Definition: elliptic_secp256k1.cpp:240
graphene::wallet::wallet_api::get_asset_id
asset_id_type get_asset_id(const string &asset_symbol_or_id) const
Definition: wallet.cpp:601
pts_address.hpp
fc::ecc::blind_sum
blind_factor_type blind_sum(const std::vector< blind_factor_type > &blinds, uint32_t non_neg)
Definition: elliptic_secp256k1.cpp:215
graphene::wallet::wallet_api::transfer
signed_transaction transfer(const string &from, const string &to, const string &amount, const string &asset_symbol_or_id, const string &memo, bool broadcast=false) const
Definition: wallet.cpp:794
graphene::utilities::key_to_wif
std::string key_to_wif(const fc::sha256 &private_secret)
Definition: key_conversion.cpp:30
graphene::wallet::wallet_api::get_account_history_by_operations
account_history_operation_detail get_account_history_by_operations(const string &account_name_or_id, const flat_set< uint16_t > &operation_types, uint32_t start, uint32_t limit) const
Definition: wallet.cpp:378
graphene::wallet::account_history_operation_detail::details
vector< operation_detail_ex > details
Definition: wallet_structs.hpp:319
graphene::utilities::wif_to_key
fc::optional< fc::ecc::private_key > wif_to_key(const std::string &wif_key)
Definition: key_conversion.cpp:47
graphene::protocol::transfer_from_blind_operation::to
account_id_type to
Definition: confidential.hpp:181
graphene::wallet::detail::derive_private_key
fc::ecc::private_key derive_private_key(const std::string &prefix_string, int sequence_number)
Definition: wallet_sign.cpp:60
graphene::wallet::wallet_api::borrow_asset_ext
signed_transaction borrow_asset_ext(const string &borrower, const string &amount_to_borrow, const string &asset_symbol_or_id, const string &amount_of_collateral, const call_order_update_operation::extensions_type &extensions, bool broadcast=false) const
Definition: wallet.cpp:1325
graphene::wallet::wallet_api::sign_memo
memo_data sign_memo(const string &from, const string &to, const string &memo) const
Definition: wallet.cpp:1341
graphene::wallet::wallet_api::get_settle_orders
vector< force_settlement_object > get_settle_orders(const string &a, uint32_t limit) const
Get forced settlement orders in a given asset.
Definition: wallet.cpp:461
RANGE_PROOF_MANTISSA
#define RANGE_PROOF_MANTISSA
Definition: wallet.cpp:82
graphene::chain::account_object::active
authority active
Definition: account_object.hpp:220
graphene::wallet::wallet_api::global_settle_asset
signed_transaction global_settle_asset(const string &symbol_or_id, const price &settle_price, bool broadcast=false) const
Definition: wallet.cpp:870
graphene::wallet::wallet_api::approve_proposal
signed_transaction approve_proposal(const string &fee_paying_account, const string &proposal_id, const approval_delta &delta, bool broadcast) const
Definition: wallet.cpp:1112
graphene::protocol::blind_input
Definition: confidential.hpp:85
graphene::app::extended_asset_object
Definition: api_objects.hpp:161
graphene::wallet::wallet_api::sign_transaction2
signed_transaction sign_transaction2(const signed_transaction &tx, const vector< public_key_type > &signing_keys=vector< public_key_type >(), bool broadcast=true) const
Definition: wallet.cpp:1022
fc
Definition: api.hpp:15
FC_THROW
#define FC_THROW( ...)
Definition: exception.hpp:366
graphene::wallet::wallet_api::list_accounts
map< string, account_id_type, std::less<> > list_accounts(const string &lowerbound, uint32_t limit) const
Definition: wallet.cpp:182
graphene::wallet::wallet_api::flood_network
void flood_network(const string &prefix, uint32_t number_of_transactions) const
Definition: wallet.cpp:1086
fc::ecc::blind
commitment_type blind(const blind_factor_type &blind, uint64_t value)
Definition: elliptic_secp256k1.cpp:208
fc::ecc::private_key::get_secret
private_key_secret get_secret() const
Definition: elliptic_impl_priv.cpp:59
graphene::wallet::wallet_api::whitelist_account
signed_transaction whitelist_account(const string &authorizing_account, const string &account_to_list, account_whitelist_operation::account_listing new_listing_status, bool broadcast=false) const
Definition: wallet.cpp:893
graphene::chain::htlc_object::condition_info::time_lock
time_lock_info time_lock
Definition: htlc_object.hpp:62
graphene::wallet::wallet_api::propose_builder_transaction2
signed_transaction propose_builder_transaction2(transaction_handle_type handle, const string &account_name_or_id, const time_point_sec &expiration=time_point::now()+fc::minutes(1), uint32_t review_period_seconds=0, bool broadcast=true) const
Definition: wallet.cpp:562
graphene::wallet::wallet_api::issue_asset
signed_transaction issue_asset(const string &to_account, const string &amount, const string &symbol_or_id, const string &memo, bool broadcast=false) const
Definition: wallet.cpp:788
graphene::wallet::wallet_api::get_witness
witness_object get_witness(const string &owner_account) const
Definition: wallet.cpp:918
graphene::net::message
Definition: message.hpp:58
graphene::protocol::blind_output::range_proof
range_proof_type range_proof
Definition: confidential.hpp:139
graphene::wallet::wallet_api::cancel_order
signed_transaction cancel_order(const limit_order_id_type &order_id, bool broadcast=false) const
Definition: wallet.cpp:1335
graphene::protocol::blind_output::owner
authority owner
Definition: confidential.hpp:140
hex.hpp
scoped_lock.hpp
graphene::protocol::result_type
object_restriction_predicate< operation > result_type
Definition: list_1.cpp:29
graphene::protocol::asset_options::core_exchange_rate
price core_exchange_rate
Definition: asset_ops.hpp:72
fee_schedule.hpp
graphene::chain::asset_object::amount_to_string
string amount_to_string(share_type amount) const
Convert an asset to a textual representation, i.e. "123.45".
Definition: asset_object.cpp:207
graphene::chain::htlc_object::transfer_info::from
account_id_type from
Definition: htlc_object.hpp:45
graphene::wallet::wallet_api::get_account_id
account_id_type get_account_id(const string &account_name_or_id) const
Definition: wallet.cpp:596
graphene::wallet::wallet_api::get_asset_count
uint64_t get_asset_count() const
Definition: wallet.cpp:197
graphene::protocol::blind_transfer_operation::outputs
vector< blind_output > outputs
Definition: confidential.hpp:247
graphene::wallet::wallet_api::my
std::shared_ptr< detail::wallet_api_impl > my
Definition: wallet.hpp:55
fc::sha256
Definition: sha256.hpp:10
graphene::protocol::transfer_from_blind_operation::blinding_factor
blind_factor_type blinding_factor
Definition: confidential.hpp:182
fc::json::to_pretty_string
static string to_pretty_string(const variant &v, output_formatting format=stringify_large_ints_and_doubles, uint32_t max_depth=DEFAULT_MAX_RECURSION_DEPTH)
Definition: json.cpp:748
graphene::protocol::transaction
groups operations that should be applied atomically
Definition: transaction.hpp:69
graphene::wallet::wallet_api::get_market_history
vector< bucket_object > get_market_history(const string &symbol, const string &symbol2, uint32_t bucket, const time_point_sec &start, const time_point_sec &end) const
Get OHLCV data of a trading pair in a time range.
Definition: wallet.cpp:430
graphene::wallet::wallet_api::encrypt_keys
void encrypt_keys() const
Definition: wallet.cpp:1249
graphene::wallet::wallet_api::create_witness
signed_transaction create_witness(const string &owner_account, const string &url, bool broadcast=false) const
Definition: wallet.cpp:928
graphene::wallet::wallet_api::verify_signed_message
bool verify_signed_message(const signed_message &message) const
Definition: wallet.cpp:1370
fc::sha256::data_size
static constexpr size_t data_size()
Definition: sha256.hpp:21
graphene::wallet::wallet_api::reserve_asset
signed_transaction reserve_asset(const string &from, const string &amount, const string &symbol_or_id, bool broadcast=false) const
Definition: wallet.cpp:862
graphene::protocol::stealth_confirmation::memo_data::blinding_factor
fc::sha256 blinding_factor
Definition: confidential.hpp:108
fc::zero_initialized_array
Definition: zeroed_array.hpp:30
fc::ecc::public_key
contains only the public point of an elliptic curve key.
Definition: elliptic.hpp:35
graphene::wallet::blind_receipt::control_authority
authority control_authority
Definition: wallet_structs.hpp:101
graphene::wallet::wallet_api::dbg_update_object
void dbg_update_object(const variant_object &update) const
Definition: wallet.cpp:1071
graphene::chain::htlc_object::condition_info::time_lock_info::expiration
fc::time_point_sec expiration
Definition: htlc_object.hpp:59
graphene::wallet::account_history_operation_detail::result_count
uint32_t result_count
Definition: wallet_structs.hpp:318
wallet_api_impl.hpp
cli.hpp
graphene::wallet::wallet_api::create_blind_account
public_key_type create_blind_account(const string &label, const string &brain_key) const
Definition: wallet.cpp:1442
fc::from_variant
void from_variant(const variant &var, flat_set< T, A... > &vo, uint32_t _max_depth)
Definition: flat.hpp:116
graphene::protocol::asset_options
The asset_options struct contains options available on all assets in the network.
Definition: asset_ops.hpp:47
graphene::wallet::wallet_api::sign_message
signed_message sign_message(const string &signer, const string &message) const
Definition: wallet.cpp:1353
graphene::wallet::blind_receipt::data
stealth_confirmation::memo_data data
Definition: wallet_structs.hpp:102
graphene::wallet::wallet_api::blind_transfer_help
blind_confirmation blind_transfer_help(const string &from_key_or_label, const string &to_key_or_label, const string &amount, const string &symbol, bool broadcast=false, bool to_temp=false) const
Definition: wallet.cpp:1564
graphene::wallet::wallet_api::get_full_account
full_account get_full_account(const string &name_or_id) const
Fetch all objects relevant to the specified account.
Definition: wallet.cpp:425
fc::stringstream::str
std::string str()
Definition: sstream.cpp:33
graphene::chain::asset_object::amount_from_string
asset amount_from_string(string amount_string) const
Definition: asset_object.cpp:152
graphene::wallet::wallet_api::get_collateral_bids
vector< collateral_bid_object > get_collateral_bids(const string &asset_symbol_or_id, uint32_t limit=100, uint32_t start=0) const
Definition: wallet.cpp:466
graphene::protocol::bitasset_options
The bitasset_options struct contains configurable options available only to BitAssets.
Definition: asset_ops.hpp:109
graphene::wallet::wallet_api::set_desired_witness_and_committee_member_count
signed_transaction set_desired_witness_and_committee_member_count(const string &account_to_modify, uint16_t desired_number_of_witnesses, uint16_t desired_number_of_committee_members, bool broadcast=false) const
Definition: wallet.cpp:1003
graphene::wallet::brain_key_info::brain_priv_key
string brain_priv_key
Definition: wallet_structs.hpp:47
graphene::wallet::wallet_api::borrow_asset
signed_transaction borrow_asset(const string &borrower, const string &amount_to_borrow, const string &asset_symbol_or_id, const string &amount_of_collateral, bool broadcast=false) const
Definition: wallet.cpp:1317
graphene::wallet::wallet_api::normalize_brain_key
string normalize_brain_key(const string &s) const
Definition: wallet.cpp:748
graphene::wallet::blind_confirmation::output
Definition: wallet_structs.hpp:60
graphene::wallet::blind_balance
Definition: wallet_structs.hpp:74
fc::ecc::private_key
an elliptic curve private key.
Definition: elliptic.hpp:89
fc::to_hex
std::string to_hex(const char *d, uint32_t s)
Definition: hex.cpp:17
graphene::wallet::wallet_api::fund_asset_fee_pool
signed_transaction fund_asset_fee_pool(const string &from, const string &symbol_or_id, const string &amount, bool broadcast=false) const
Definition: wallet.cpp:847
graphene::wallet::wallet_api::get_private_key
string get_private_key(const public_key_type &pubkey) const
Definition: wallet.cpp:1394
graphene::protocol::stealth_confirmation::to
optional< public_key_type > to
Definition: confidential.hpp:124
graphene::wallet::blind_balance::commitment
fc::ecc::commitment_type commitment
Definition: wallet_structs.hpp:81
graphene::wallet::wallet_api::htlc_redeem
signed_transaction htlc_redeem(const htlc_id_type &htlc_id, const string &issuer, const string &preimage, bool broadcast=false) const
Definition: wallet.cpp:267
graphene::protocol::stealth_confirmation::memo_data::from
optional< public_key_type > from
Definition: confidential.hpp:106
graphene::wallet::wallet_api::import_key
bool import_key(const string &account_name_or_id, const string &wif_key) const
Definition: wallet.cpp:606
graphene::chain::vesting_balance_object
Definition: vesting_balance_object.hpp:151
fc::ecc::private_key::generate
static private_key generate()
Definition: elliptic_common.cpp:217
graphene::chain::htlc_object::transfer
transfer_info transfer
Definition: htlc_object.hpp:65
fc::sha512
Definition: sha512.hpp:9
graphene::wallet::wallet_api::get_blind_accounts
map< string, public_key_type, std::less<> > get_blind_accounts() const
Definition: wallet.cpp:1423
graphene::words::word_list_size
const uint32_t word_list_size
Definition: words.cpp:49776
graphene::wallet::blind_balance::blinding_factor
fc::sha256 blinding_factor
Definition: wallet_structs.hpp:80
graphene::wallet::utility::derive_owner_keys_from_brain_key
static vector< brain_key_info > derive_owner_keys_from_brain_key(const string &brain_key, uint32_t number_of_desired_keys=1)
Definition: wallet.cpp:99
fc::bigint
Definition: bigint.hpp:10
graphene::wallet::wallet_api::set_wallet_filename
void set_wallet_filename(const string &wallet_filename) const
Definition: wallet.cpp:1012
graphene::wallet::wallet_api::dbg_make_mia
void dbg_make_mia(const string &creator, const string &symbol) const
Definition: wallet.cpp:1050
operation_printer.hpp
graphene::wallet::wallet_api::get_key_label
string get_key_label(const public_key_type &key) const
Definition: wallet.cpp:1386
graphene::wallet::wallet_api::claim_asset_fee_pool
signed_transaction claim_asset_fee_pool(const string &symbol_or_id, const string &amount, bool broadcast=false) const
Definition: wallet.cpp:855
graphene::chain::account_statistics_object
Definition: account_object.hpp:46
reflect_util.hpp
wdump
#define wdump(SEQ)
Definition: logger.hpp:174
graphene::wallet::approval_delta
Definition: wallet_structs.hpp:212
graphene::protocol::transfer_from_blind_operation
Converts blinded/stealth balance to a public account balance.
Definition: confidential.hpp:173
graphene::wallet::blind_balance::one_time_key
public_key_type one_time_key
used to derive the authority key and blinding factor
Definition: wallet_structs.hpp:79
graphene::wallet::signed_message_meta::block
uint32_t block
Definition: wallet_structs.hpp:256
graphene::wallet::signed_message::digest
fc::sha256 digest() const
Definition: wallet.cpp:88
graphene::wallet::wallet_api::dump_private_keys
map< public_key_type, string > dump_private_keys() const
Definition: wallet.cpp:1293
graphene::chain::account_statistics_object::total_ops
uint64_t total_ops
Definition: account_object.hpp:59
graphene::chain::htlc_object::transfer_info::to
account_id_type to
Definition: htlc_object.hpp:46
graphene::wallet::blind_balance::amount
asset amount
Definition: wallet_structs.hpp:76
ilog
#define ilog(FORMAT,...)
Definition: logger.hpp:117
graphene::wallet::blind_balance::to
public_key_type to
the account this balance is logically associated with
Definition: wallet_structs.hpp:78
graphene::wallet::wallet_api::dbg_push_blocks
void dbg_push_blocks(const string &src_filename, uint32_t count) const
Definition: wallet.cpp:1056
graphene::wallet::blind_receipt::conf
stealth_confirmation conf
Definition: wallet_structs.hpp:104
git_revision.hpp
graphene::wallet::wallet_api::get_account_limit_orders
vector< limit_order_object > get_account_limit_orders(const string &name_or_id, const string &base, const string &quote, uint32_t limit=101, const optional< limit_order_id_type > &ostart_id={}, const optional< price > &ostart_price=optional< price >()) const
Fetch all orders relevant to the specified account sorted descendingly by price.
Definition: wallet.cpp:440
fc::optional::valid
bool valid() const
Definition: optional.hpp:186
fc::variants
std::vector< variant > variants
Definition: variant.hpp:170
wallet.hpp
fc::sha512::hash
static sha512 hash(const char *d, uint32_t dlen)
Definition: sha512.cpp:34
graphene::chain::htlc_object::condition_info::hash_lock_info::preimage_hash
htlc_hash preimage_hash
Definition: htlc_object.hpp:54
graphene::chain::account_object
This class represents an account on the object graph.
Definition: account_object.hpp:180
graphene::wallet::wallet_api::dbg_make_uia
void dbg_make_uia(const string &creator, const string &symbol) const
Definition: wallet.cpp:1044
graphene::wallet::wallet_api::get_account
account_object get_account(const string &account_name_or_id) const
Definition: wallet.cpp:577
graphene::wallet::wallet_api::verify_encapsulated_message
bool verify_encapsulated_message(const string &message) const
Definition: wallet.cpp:1380
graphene::wallet::blind_receipt::from_key
public_key_type from_key
Definition: wallet_structs.hpp:95
graphene::wallet::wallet_api::get_committee_member
committee_member_object get_committee_member(const string &owner_account) const
Definition: wallet.cpp:923
graphene::wallet::signed_message::meta
signed_message_meta meta
Definition: wallet_structs.hpp:263
graphene::wallet::wallet_api::list_witnesses
map< string, witness_id_type, std::less<> > list_witnesses(const string &lowerbound, uint32_t limit) const
Definition: wallet.cpp:907
fc::time_point_sec
Definition: time.hpp:74
fc::ecc::public_key::child
public_key child(const fc::sha256 &offset) const
Definition: elliptic_common.cpp:121
graphene::wallet::wallet_api::account_store_map
signed_transaction account_store_map(const string &account, const string &catalog, bool is_to_remove, const flat_map< string, optional< string >> &key_values, bool broadcast) const
Definition: wallet.cpp:1931
fc::sha256::data
char * data() const
Definition: sha256.cpp:29
graphene::words::word_list
const const_char_ptr word_list[]
Definition: words.cpp:29
fc::variant::as
T as(uint32_t max_depth) const
Definition: variant.hpp:337
graphene::wallet::wallet_api::get_dynamic_global_properties
dynamic_global_property_object get_dynamic_global_properties() const
Definition: wallet.cpp:1127
fc::ripemd160
Definition: ripemd160.hpp:11
graphene::wallet::blind_balance::used
bool used
Definition: wallet_structs.hpp:82
graphene::wallet::blind_receipt::date
fc::time_point date
Definition: wallet_structs.hpp:94
graphene::protocol::authority::get_keys
vector< public_key_type > get_keys() const
Definition: authority.hpp:85
graphene::chain::vesting_balance_object::get_allowed_withdraw
asset get_allowed_withdraw(const time_point_sec &now) const
Definition: vesting_balance_object.cpp:267
graphene::wallet::wallet_api::bid_collateral
signed_transaction bid_collateral(const string &bidder, const string &debt_amount, const string &debt_symbol_or_id, const string &additional_collateral, bool broadcast=false) const
Definition: wallet.cpp:885
graphene::chain::account_object::owner
authority owner
Definition: account_object.hpp:217
graphene::wallet::wallet_api::get_account_history
vector< operation_detail > get_account_history(const string &account_name_or_id, uint32_t limit) const
Definition: wallet.cpp:280
graphene::wallet::wallet_api::get_result_formatters
std::map< string, std::function< string(const variant &, const fc::variants &) >, std::less<> > get_result_formatters() const
Definition: wallet.cpp:1235
graphene::wallet::wallet_api::set_password
void set_password(const string &password) const
Definition: wallet.cpp:1277
graphene::chain::asset_bitasset_data_object
contains properties that only apply to bitassets (market issued assets)
Definition: asset_object.hpp:255
fc::ripemd160::str
string str() const
Definition: ripemd160.cpp:21
fc::to_variant
void to_variant(const flat_set< T, A... > &var, variant &vo, uint32_t _max_depth)
Definition: flat.hpp:105
graphene::wallet::operation_detail
Definition: wallet_structs.hpp:303
graphene::wallet::wallet_api::remove_builder_transaction
void remove_builder_transaction(transaction_handle_type handle) const
Definition: wallet.cpp:572
graphene::wallet::wallet_api::upgrade_account
signed_transaction upgrade_account(const string &account_name_or_id, bool broadcast) const
Definition: wallet.cpp:1299
fc::sha256::str
string str() const
Definition: sha256.cpp:24
graphene::wallet::key_label
Definition: wallet_structs.hpp:132
fc::exception::to_detail_string
std::string to_detail_string(log_level ll=log_level::all) const
Definition: exception.cpp:183
graphene::wallet::wallet_api::add_transaction_signature
signed_transaction add_transaction_signature(const signed_transaction &tx, bool broadcast=false) const
Definition: wallet.cpp:1132
graphene::wallet::wallet_api::derive_private_key
fc::ecc::private_key derive_private_key(const string &prefix_string, uint32_t sequence_number) const
Definition: wallet.cpp:763
graphene::wallet::wallet_api::get_account_storage
vector< account_storage_object > get_account_storage(const string &account, const string &catalog) const
Definition: wallet.cpp:1937
graphene::protocol::blind_transfer_operation::inputs
vector< blind_input > inputs
Definition: confidential.hpp:246
graphene::chain::htlc_object::condition_info::hash_lock_info::preimage_size
uint16_t preimage_size
Definition: htlc_object.hpp:55
graphene::wallet::signed_block_with_info::signed_block_with_info
signed_block_with_info(const signed_block &block)
Definition: wallet.cpp:1942
graphene::wallet::wallet_api::update_worker_votes
signed_transaction update_worker_votes(const string &account, const worker_vote_delta &delta, bool broadcast=false) const
Definition: wallet.cpp:949
graphene::chain::htlc_object::transfer_info::amount
share_type amount
Definition: htlc_object.hpp:47
graphene::wallet::transaction_handle_type
uint32_t transaction_handle_type
Definition: wallet_structs.hpp:37
graphene::wallet::blind_receipt::memo
string memo
Definition: wallet_structs.hpp:100
fc::sha1::str
std::string str() const
Definition: sha1.cpp:18
graphene::wallet::wallet_api::copy_wallet_file
bool copy_wallet_file(const string &destination_filename) const
Definition: wallet.cpp:162
fc::ecc::private_key::get_public_key
public_key get_public_key() const
Definition: elliptic_impl_priv.cpp:70
graphene::protocol::transfer_to_blind_operation::from
account_id_type from
Definition: confidential.hpp:160
graphene::wallet::wallet_api::is_new
bool is_new() const
Definition: wallet.cpp:1244
graphene::protocol::share_type
safe< int64_t > share_type
Definition: types.hpp:309
graphene::wallet::wallet_api::get_global_properties
global_property_object get_global_properties() const
Definition: wallet.cpp:1122
graphene::wallet::brain_key_info::wif_priv_key
string wif_priv_key
Definition: wallet_structs.hpp:48
graphene::app::order_book
Definition: api_objects.hpp:102
graphene::wallet::wallet_api::help
string help() const
Definition: wallet.cpp:1138
graphene::protocol::stealth_confirmation::memo_data::amount
asset amount
Definition: confidential.hpp:107
graphene::wallet::blind_confirmation::output::confirmation_receipt
string confirmation_receipt
Definition: wallet_structs.hpp:67
graphene::wallet::wallet_api::info
variant info() const
Definition: wallet.cpp:753
graphene::wallet::blind_receipt::used
bool used
Definition: wallet_structs.hpp:103
graphene::wallet::wallet_api::dbg_generate_blocks
void dbg_generate_blocks(const string &debug_wif_key, uint32_t count) const
Definition: wallet.cpp:1061
graphene::wallet::blind_confirmation::output::confirmation
stealth_confirmation confirmation
Definition: wallet_structs.hpp:65
graphene::wallet::wallet_api::get_public_key
public_key_type get_public_key(const string &label) const
Definition: wallet.cpp:1399
json.hpp
websocket.hpp
fc::bigint::to_int64
int64_t to_int64() const
Definition: bigint.cpp:54
graphene::wallet::wallet_api::create_committee_member
signed_transaction create_committee_member(const string &owner_account, const string &url, bool broadcast=false) const
Definition: wallet.cpp:901
fc::get_approximate_relative_time_string
std::string get_approximate_relative_time_string(const time_point_sec &event_time, const time_point_sec &relative_to_time=fc::time_point::now(), const std::string &ago=" ago")
Definition: time.cpp:70
graphene::wallet::wallet_api::wallet_api
wallet_api(const wallet_data &initial_data, const fc::api< login_api > &rapi)
Definition: wallet.cpp:155
graphene::wallet::wallet_api::load_wallet_file
bool load_wallet_file(const string &wallet_filename="") const
Definition: wallet.cpp:1219
graphene::wallet::wallet_api::create_worker
signed_transaction create_worker(const string &owner_account, const time_point_sec &work_begin_date, const time_point_sec &work_end_date, const share_type &daily_pay, const string &name, const string &url, const variant &worker_settings, bool broadcast=false) const
Definition: wallet.cpp:935
graphene::wallet::signed_message_meta::memo_key
public_key_type memo_key
Definition: wallet_structs.hpp:255
graphene::wallet::brain_key_info
Definition: wallet_structs.hpp:45
fc::time_point::now
static time_point now()
Definition: time.cpp:13
graphene::wallet::wallet_api::read_memo
string read_memo(const memo_data &memo) const
Definition: wallet.cpp:1347
graphene::wallet::wallet_api::list_my_accounts
vector< account_object > list_my_accounts() const
Definition: wallet.cpp:177
FC_ASSERT
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
Definition: exception.hpp:345
fc::sha1
Definition: sha1.hpp:10
graphene::wallet::blind_confirmation::output::label
string label
Definition: wallet_structs.hpp:62
base58.hpp
graphene::chain::account_object::name
string name
The account's name. This name must be unique among all account names on the graph....
Definition: account_object.hpp:209
graphene::protocol::processed_transaction
captures the result of evaluating the operations contained in the transaction
Definition: transaction.hpp:292
graphene::wallet::wallet_api::set_fees_on_builder_transaction
asset set_fees_on_builder_transaction(transaction_handle_type handle, const string &fee_asset=GRAPHENE_SYMBOL) const
Definition: wallet.cpp:525
graphene::protocol::transaction::validate
virtual void validate() const
Definition: transaction.cpp:58
fc::variant
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Definition: variant.hpp:198
graphene::wallet::blind_receipt
Definition: wallet_structs.hpp:85
graphene::chain::account_multi_index_type
multi_index_container< account_object, indexed_by< ordered_unique< tag< by_id >, member< object, object_id_type, &object::id > >, ordered_unique< tag< by_name >, member< account_object, string, &account_object::name > > > > account_multi_index_type
Definition: account_object.hpp:415
graphene::wallet::wallet_api::vote_for_witness
signed_transaction vote_for_witness(const string &voting_account, const string &witness, bool approve, bool broadcast=false) const
Definition: wallet.cpp:988
graphene::protocol::asset::amount
share_type amount
Definition: asset.hpp:36
graphene::wallet::wallet_api::withdraw_vesting
signed_transaction withdraw_vesting(const string &witness_name, const string &amount, const string &asset_symbol_or_id, bool broadcast=false) const
Definition: wallet.cpp:971
graphene::wallet::wallet_api::register_account
signed_transaction register_account(const string &name, const public_key_type &owner, const public_key_type &active, const string &registrar_account, const string &referrer_account, uint32_t referrer_percent, bool broadcast=false) const
Definition: wallet.cpp:768
graphene::wallet::blind_receipt::to_key
public_key_type to_key
Definition: wallet_structs.hpp:97
graphene::wallet::vesting_balance_object_with_info::vesting_balance_object_with_info
vesting_balance_object_with_info(const vesting_balance_object &vbo, const fc::time_point_sec &now)
Definition: wallet.cpp:1952
graphene::wallet::wallet_api::update_asset
signed_transaction update_asset(const string &symbol_or_id, const optional< string > &new_issuer, const asset_options &new_options, bool broadcast=false) const
Definition: wallet.cpp:810
graphene::wallet::wallet_api::broadcast_transaction
pair< transaction_id_type, signed_transaction > broadcast_transaction(const signed_transaction &tx) const
Definition: wallet.cpp:548
std
Definition: zeroed_array.hpp:76
graphene::wallet::wallet_api::set_voting_proxy
signed_transaction set_voting_proxy(const string &account_to_modify, const optional< string > &voting_account, bool broadcast=false) const
Definition: wallet.cpp:996
idump
#define idump(SEQ)
Definition: logger.hpp:166
graphene::chain::htlc_object::conditions
condition_info conditions
Definition: htlc_object.hpp:66
graphene::wallet::wallet_api::get_blind_balances
vector< asset > get_blind_balances(const string &key_or_label) const
Definition: wallet.cpp:1462
graphene::chain::asset_object::amount
asset amount(share_type a) const
Helper function to get an asset object with the given amount in this asset's type.
Definition: asset_object.hpp:114
graphene::wallet::detail::address_to_shorthash
string address_to_shorthash(const graphene::protocol::address &addr)
Definition: wallet_sign.cpp:42
graphene::protocol::blind_output::commitment
fc::ecc::commitment_type commitment
Definition: confidential.hpp:137
graphene::wallet::wallet_api::sign_builder_transaction2
signed_transaction sign_builder_transaction2(transaction_handle_type transaction_handle, const vector< public_key_type > &signing_keys=vector< public_key_type >(), bool broadcast=true) const
Definition: wallet.cpp:541
graphene::wallet::wallet_api::save_wallet_file
void save_wallet_file(const string &wallet_filename="") const
Definition: wallet.cpp:1229
graphene::chain::global_property_object
Maintains global state information (committee_member list, current fees)
Definition: global_property_object.hpp:40
graphene::wallet::wallet_api::propose_builder_transaction
signed_transaction propose_builder_transaction(transaction_handle_type handle, const time_point_sec &expiration=time_point::now()+fc::minutes(1), uint32_t review_period_seconds=0, bool broadcast=true) const
Definition: wallet.cpp:553
fstream.hpp
graphene::wallet::utility::suggest_brain_key
static brain_key_info suggest_brain_key()
Definition: wallet.cpp:122
graphene::wallet::brain_key_info::pub_key
public_key_type pub_key
Definition: wallet_structs.hpp:49
graphene::wallet::wallet_api::derive_owner_keys_from_brain_key
vector< brain_key_info > derive_owner_keys_from_brain_key(const string &brain_key, uint32_t number_of_desired_keys=1) const
Definition: wallet.cpp:476
BRAIN_KEY_WORD_COUNT
#define BRAIN_KEY_WORD_COUNT
Definition: wallet.cpp:81
graphene::wallet::wallet_api::preview_builder_transaction
transaction preview_builder_transaction(transaction_handle_type handle) const
Definition: wallet.cpp:530
graphene::wallet::wallet_api::get_block
optional< signed_block_with_info > get_block(uint32_t num) const
Definition: wallet.cpp:167
graphene::wallet::wallet_api::update_bitasset
signed_transaction update_bitasset(const string &symbol_or_id, const bitasset_options &new_options, bool broadcast=false) const
Definition: wallet.cpp:825
graphene::wallet::wallet_api::blind_transfer
blind_confirmation blind_transfer(const string &from_key_or_label, const string &to_key_or_label, const string &amount, const string &symbol_or_id, bool broadcast=false) const
Definition: wallet.cpp:1556
graphene::wallet::wallet_api::list_account_balances
vector< asset > list_account_balances(const string &account_name_or_id) const
Definition: wallet.cpp:187
graphene::chain::witness_object
Definition: witness_object.hpp:32
graphene::wallet::wallet_data
Definition: wallet_structs.hpp:150
graphene::chain::account_object::statistics
account_statistics_id_type statistics
Definition: account_object.hpp:229
graphene::wallet::wallet_api::transfer_to_blind
blind_confirmation transfer_to_blind(const string &from_account_name_or_id, const string &asset_symbol_or_id, const vector< pair< string, string >> &to_amounts, bool broadcast=false) const
Definition: wallet.cpp:1742
words.hpp
graphene::wallet::wallet_api::import_balance
vector< signed_transaction > import_balance(const string &account_name_or_id, const vector< string > &wif_keys, bool broadcast) const
Definition: wallet.cpp:1285
graphene::wallet::wallet_api::sell_asset
signed_transaction sell_asset(const string &seller_account, const string &amount_to_sell, const string &symbol_or_id_to_sell, const string &min_to_receive, const string &symbol_or_id_to_receive, uint32_t timeout_sec=0, bool fill_or_kill=false, bool broadcast=false) const
Definition: wallet.cpp:1304
graphene::wallet::wallet_api::blind_history
vector< blind_receipt > blind_history(const string &key_or_account) const
Definition: wallet.cpp:1907
graphene::db::abstract_object::get_id
object_id< SpaceID, TypeID > get_id() const
Definition: object.hpp:113
graphene::protocol::blind_transfer_operation::fee
asset fee
Definition: confidential.hpp:245
graphene::wallet::wallet_api::get_object
variant get_object(const object_id_type &id) const
Definition: wallet.cpp:495
graphene::wallet::wallet_api::get_call_orders
vector< call_order_object > get_call_orders(const string &asset_symbol_or_id, uint32_t limit) const
Get call orders (aka margin positions) for a given asset.
Definition: wallet.cpp:456
fc::static_variant::visit
visitor::result_type visit(visitor &v)
Definition: static_variant.hpp:256
graphene::wallet::signed_message_meta::account
string account
Definition: wallet_structs.hpp:254
aes.hpp
graphene::protocol::authority
Identifies a weighted set of keys and accounts that must approve operations.
Definition: authority.hpp:34
fc::optional< fc::variant >
graphene::wallet::wallet_api::get_relative_account_history
vector< operation_detail > get_relative_account_history(const string &account_name_or_id, uint32_t stop, uint32_t limit, uint32_t start) const
Definition: wallet.cpp:338
graphene::wallet::wallet_api::htlc_extend
signed_transaction htlc_extend(const htlc_id_type &htlc_id, const string &issuer, uint32_t seconds_to_add, bool broadcast=false) const
Definition: wallet.cpp:274
key_conversion.hpp
graphene::wallet::wallet_api::replace_operation_in_builder_transaction
void replace_operation_in_builder_transaction(transaction_handle_type handle, uint32_t operation_index, const operation &new_op) const
Definition: wallet.cpp:517
graphene::wallet::wallet_api::add_operation_to_builder_transaction
void add_operation_to_builder_transaction(transaction_handle_type transaction_handle, const operation &op) const
Definition: wallet.cpp:510
graphene::wallet::wallet_api::propose_parameter_change
signed_transaction propose_parameter_change(const string &proposing_account, const time_point_sec &expiration_time, const variant_object &changed_values, bool broadcast=false) const
Definition: wallet.cpp:1092
fc::stringstream
Definition: sstream.hpp:7
fc::hash160
Definition: hash160.hpp:32
graphene::protocol::asset
Definition: asset.hpp:31
graphene::chain::asset_object::options
asset_options options
Definition: asset_object.hpp:137
graphene::wallet::wallet_api::update_asset_feed_producers
signed_transaction update_asset_feed_producers(const string &symbol_or_id, const flat_set< string > &new_feed_producers, bool broadcast=false) const
Definition: wallet.cpp:832
graphene::app::uint128_amount_to_string
std::string uint128_amount_to_string(const fc::uint128_t &amount, const uint8_t precision)
Definition: util.cpp:42
api_documentation.hpp
graphene::wallet::signed_message
Definition: wallet_structs.hpp:260
graphene::wallet::account_history_operation_detail::total_count
uint32_t total_count
Definition: wallet_structs.hpp:317
graphene::wallet::blind_balance::from
public_key_type from
the account this balance came from
Definition: wallet_structs.hpp:77
graphene::wallet::blind_receipt::to_label
string to_label
Definition: wallet_structs.hpp:98
graphene::wallet::wallet_api::lock
void lock() const
Definition: wallet.cpp:1254
api.hpp
graphene::wallet::wallet_api::htlc_create
signed_transaction htlc_create(const string &source, const string &destination, const string &amount, const string &asset_symbol_or_id, const string &hash_algorithm, const string &preimage_hash, uint32_t preimage_size, uint32_t claim_period_seconds, const string &memo, bool broadcast=false) const
Definition: wallet.cpp:202
fc::safe::value
T value
Definition: safe.hpp:28
graphene::protocol::transfer_to_blind_operation::blinding_factor
blind_factor_type blinding_factor
Definition: confidential.hpp:161
graphene::protocol::transfer_to_blind_operation::outputs
vector< blind_output > outputs
Definition: confidential.hpp:162
graphene::chain::htlc_object::memo
fc::optional< memo_data > memo
Definition: htlc_object.hpp:67
graphene::wallet::wallet_api::get_account_count
uint64_t get_account_count() const
Definition: wallet.cpp:172
graphene::protocol::transfer_from_blind_operation::fee
asset fee
Definition: confidential.hpp:179
graphene::wallet::detail::operation_printer
Definition: operation_printer.hpp:56
graphene::wallet::worker_vote_delta
Definition: wallet_structs.hpp:222
graphene::wallet::operation_detail_ex
Definition: wallet_structs.hpp:309
graphene::wallet::wallet_api::update_witness
signed_transaction update_witness(const string &witness_name, const string &url, const string &block_signing_key, bool broadcast=false) const
Definition: wallet.cpp:957
fc::ecc::private_key::regenerate
static private_key regenerate(const fc::sha256 &secret)
Definition: elliptic_impl_priv.cpp:52
fc::trim_and_normalize_spaces
string trim_and_normalize_spaces(const string &s)
Definition: string.cpp:104
graphene::wallet::wallet_api::get_my_blind_accounts
map< string, public_key_type, std::less<> > get_my_blind_accounts() const
Definition: wallet.cpp:1430
fc::ecc::verify_sum
bool verify_sum(const std::vector< commitment_type > &commits, const std::vector< commitment_type > &neg_commits, int64_t excess)
Definition: elliptic_secp256k1.cpp:225
graphene::protocol::transfer_from_blind_operation::amount
asset amount
Definition: confidential.hpp:180
fc::api
Definition: api.hpp:120
graphene::wallet::blind_confirmation::output::decrypted_memo
stealth_confirmation::memo_data decrypted_memo
Definition: wallet_structs.hpp:64
graphene::wallet::wallet_api::import_accounts
map< string, bool, std::less<> > import_accounts(const string &filename, const string &password) const
Definition: wallet.cpp:625
graphene::chain::vesting_balance_type::witness
@ witness
fc::aes_decrypt
unsigned aes_decrypt(unsigned char *ciphertext, int ciphertext_len, unsigned char *key, unsigned char *iv, unsigned char *plaintext)
Definition: aes.cpp:230
graphene::wallet::key_label::label
string label
Definition: wallet_structs.hpp:134
graphene::app::full_account
Definition: api_objects.hpp:59
debug_api.hpp
graphene::wallet::blind_confirmation::output::auth
authority auth
Definition: wallet_structs.hpp:66
fc::sha256::hash
static sha256 hash(const char *d, uint32_t dlen)
Definition: sha256.cpp:41
graphene
Definition: api.cpp:48
util.hpp
fc::exists
bool exists(const path &p)
Definition: filesystem.cpp:209
fc::aes_encrypt
unsigned aes_encrypt(unsigned char *plaintext, int plaintext_len, unsigned char *key, unsigned char *iv, unsigned char *ciphertext)
Definition: aes.cpp:181
graphene::protocol::address
a 160 bit hash of a public key
Definition: address.hpp:44
graphene::wallet::wallet_api::get_key_references
vector< flat_set< account_id_type > > get_key_references(const vector< public_key_type > &keys) const
Definition: wallet.cpp:1034
graphene::protocol::stealth_confirmation::encrypted_memo
vector< char > encrypted_memo
Definition: confidential.hpp:125
graphene::wallet::wallet_api::quit
void quit() const
Definition: wallet.cpp:1224
graphene::chain::htlc_object
database object to store HTLCs
Definition: htlc_object.hpp:40
fc::raw::pack
void pack(Stream &s, const flat_set< T, A... > &value, uint32_t _max_depth)
Definition: flat.hpp:11
graphene::wallet::blind_confirmation
Definition: wallet_structs.hpp:58
graphene::wallet::blind_confirmation::trx
signed_transaction trx
Definition: wallet_structs.hpp:70
mutex.hpp
graphene::protocol::extensions_type
future_extensions::flat_set_type extensions_type
Definition: base.hpp:156
graphene::protocol::transfer_to_blind_operation::amount
asset amount
Definition: confidential.hpp:159
graphene::wallet::blind_confirmation::outputs
vector< output > outputs
Definition: wallet_structs.hpp:71
graphene::protocol::stealth_confirmation
Definition: confidential.hpp:102
graphene::protocol::operation
fc::static_variant< transfer_operation, limit_order_create_operation, limit_order_cancel_operation, call_order_update_operation, fill_order_operation, account_create_operation, account_update_operation, account_whitelist_operation, account_upgrade_operation, account_transfer_operation, asset_create_operation, asset_update_operation, asset_update_bitasset_operation, asset_update_feed_producers_operation, asset_issue_operation, asset_reserve_operation, asset_fund_fee_pool_operation, asset_settle_operation, asset_global_settle_operation, asset_publish_feed_operation, witness_create_operation, witness_update_operation, proposal_create_operation, proposal_update_operation, proposal_delete_operation, withdraw_permission_create_operation, withdraw_permission_update_operation, withdraw_permission_claim_operation, withdraw_permission_delete_operation, committee_member_create_operation, committee_member_update_operation, committee_member_update_global_parameters_operation, vesting_balance_create_operation, vesting_balance_withdraw_operation, worker_create_operation, custom_operation, assert_operation, balance_claim_operation, override_transfer_operation, transfer_to_blind_operation, blind_transfer_operation, transfer_from_blind_operation, asset_settle_cancel_operation, asset_claim_fees_operation, fba_distribute_operation, bid_collateral_operation, execute_bid_operation, asset_claim_pool_operation, asset_update_issuer_operation, htlc_create_operation, htlc_redeem_operation, htlc_redeemed_operation, htlc_extend_operation, htlc_refund_operation, custom_authority_create_operation, custom_authority_update_operation, custom_authority_delete_operation, ticket_create_operation, ticket_update_operation, liquidity_pool_create_operation, liquidity_pool_delete_operation, liquidity_pool_deposit_operation, liquidity_pool_withdraw_operation, liquidity_pool_exchange_operation, samet_fund_create_operation, samet_fund_delete_operation, samet_fund_update_operation, samet_fund_borrow_operation, samet_fund_repay_operation, credit_offer_create_operation, credit_offer_delete_operation, credit_offer_update_operation, credit_offer_accept_operation, credit_deal_repay_operation, credit_deal_expired_operation, liquidity_pool_update_operation, credit_deal_update_operation, limit_order_update_operation > operation
Definition: operations.hpp:134
elog
#define elog(FORMAT,...)
Definition: logger.hpp:129
graphene::wallet::wallet_api::vote_for_committee_member
signed_transaction vote_for_committee_member(const string &voting_account, const string &committee_member, bool approve, bool broadcast=false) const
Definition: wallet.cpp:980
graphene::wallet::wallet_api::network_get_connected_peers
vector< variant > network_get_connected_peers() const
Definition: wallet.cpp:1081
graphene::chain::committee_member_object
tracks information about a committee_member account.
Definition: committee_member_object.hpp:43