BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
wallet_account.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 <boost/range/algorithm_ext/erase.hpp>
25 #include <boost/range/algorithm/unique.hpp>
26 #include <boost/range/algorithm/sort.hpp>
27 
28 #include "wallet_api_impl.hpp"
31 
32 /****
33  * Wallet API methods to handle accounts
34  */
35 
36 namespace graphene { namespace wallet { namespace detail {
37 
39  public_key_type active, string registrar_account, string referrer_account,
40  uint32_t referrer_percent, bool broadcast )
41  { try {
42  FC_ASSERT( !self.is_locked() );
43  FC_ASSERT( is_valid_name(name) );
44  account_create_operation account_create_op;
45 
46  // #449 referrer_percent is on 0-100 scale, if user has larger
47  // number it means their script is using GRAPHENE_100_PERCENT scale
48  // instead of 0-100 scale.
49  FC_ASSERT( referrer_percent <= 100 );
50  // TODO: process when pay_from_account is ID
51 
52  account_object registrar_account_object =
53  this->get_account( registrar_account );
54  FC_ASSERT( registrar_account_object.is_lifetime_member() );
55 
56  account_id_type registrar_account_id = registrar_account_object.get_id();
57 
58  account_object referrer_account_object =
59  this->get_account( referrer_account );
60  account_create_op.referrer = referrer_account_object.id;
61  account_create_op.referrer_percent = uint16_t( referrer_percent * GRAPHENE_1_PERCENT );
62 
63  account_create_op.registrar = registrar_account_id;
64  account_create_op.name = name;
65  account_create_op.owner = authority(1, owner, 1);
66  account_create_op.active = authority(1, active, 1);
67  account_create_op.options.memo_key = active;
68 
70  tx.operations.push_back( account_create_op );
71  set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees() );
72  tx.validate();
73 
74  return sign_transaction(tx, broadcast);
75  } FC_CAPTURE_AND_RETHROW( (name)(owner)(active)(registrar_account)
76  (referrer_account)(referrer_percent)(broadcast) ) }
77 
78  signed_transaction wallet_api_impl::upgrade_account(string name, bool broadcast)
79  { try {
80  FC_ASSERT( !self.is_locked() );
81  account_object account_obj = get_account(name);
82  FC_ASSERT( !account_obj.is_lifetime_member() );
83 
86  op.account_to_upgrade = account_obj.get_id();
88  tx.operations = {op};
89  set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees() );
90  tx.validate();
91 
92  return sign_transaction( tx, broadcast );
93  } FC_CAPTURE_AND_RETHROW( (name) ) }
94 
96  string account_name,
97  string registrar_account,
98  string referrer_account,
99  bool broadcast,
100  bool save_wallet )
101  { try {
102  FC_ASSERT( !self.is_locked() );
103  string normalized_brain_key = normalize_brain_key( brain_key );
104  // TODO: scan blockchain for accounts that exist with same brain key
105  fc::ecc::private_key owner_privkey = derive_private_key( normalized_brain_key, 0 );
106  return create_account_with_private_key(owner_privkey, account_name, registrar_account,
107  referrer_account, broadcast, save_wallet);
108  } FC_CAPTURE_AND_RETHROW( (account_name)(registrar_account)(referrer_account) ) }
109 
110  signed_transaction wallet_api_impl::account_store_map(string account, string catalog, bool remove,
111  flat_map<string, optional<string>> key_values, bool broadcast)
112  {
113  try
114  {
115  FC_ASSERT( !self.is_locked() );
116 
117  account_id_type account_id = get_account(account).get_id();
118 
119  custom_operation op;
120  account_storage_map store;
121  store.catalog = catalog;
122  store.remove = remove;
123  store.key_values = key_values;
124 
125  custom_plugin_operation custom_plugin_op(store);
126  auto packed = fc::raw::pack(custom_plugin_op);
127 
128  op.payer = account_id;
129  op.data = packed;
130 
132  tx.operations.push_back(op);
133  set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees());
134  tx.validate();
135 
136  return sign_transaction(tx, broadcast);
137 
138  } FC_CAPTURE_AND_RETHROW( (account)(remove)(catalog)(key_values)(broadcast) )
139  }
140 
141  void wallet_api_impl::claim_registered_account(const graphene::chain::account_object& account)
142  {
143  bool import_keys = false;
144  auto it = _wallet.pending_account_registrations.find( account.name );
146  for (const std::string& wif_key : it->second) {
147  if( !import_key( account.name, wif_key ) )
148  {
149  // somebody else beat our pending registration, there is
150  // nothing we can do except log it and move on
151  elog( "account ${name} registered by someone else first!",
152  ("name", account.name) );
153  // might as well remove it from pending regs,
154  // because there is now no way this registration
155  // can become valid (even in the extremely rare
156  // possibility of migrating to a fork where the
157  // name is available, the user can always
158  // manually re-register)
159  } else {
160  import_keys = true;
161  }
162  }
164 
165  if( import_keys ) {
167  }
168  }
169 
170  // after a witness registration succeeds, this saves the private key in the wallet permanently
171  //
172  void wallet_api_impl::claim_registered_witness(const std::string& witness_name)
173  {
174  auto iter = _wallet.pending_witness_registrations.find(witness_name);
176  std::string wif_key = iter->second;
177 
178  // get the list key id this key is registered with in the chain
179  fc::optional<fc::ecc::private_key> witness_private_key = wif_to_key(wif_key);
180  FC_ASSERT(witness_private_key);
181 
182  auto pub_key = witness_private_key->get_public_key();
183  _keys[pub_key] = wif_key;
185  }
186 
187  account_object wallet_api_impl::get_account(account_id_type id) const
188  {
189  auto account_id = std::string(id);
190 
191  auto rec = _remote_db->get_accounts({account_id}, {}).front();
192  FC_ASSERT(rec);
193  return *rec;
194  }
195 
196  account_object wallet_api_impl::get_account(string account_name_or_id) const
197  {
198  FC_ASSERT( account_name_or_id.size() > 0 );
199 
200  if( auto id = maybe_id<account_id_type>(account_name_or_id) )
201  {
202  // It's an ID
203  return get_account(*id);
204  } else {
205  auto rec = _remote_db->lookup_account_names({account_name_or_id}).front();
206  FC_ASSERT( rec && rec->name == account_name_or_id );
207  return *rec;
208  }
209  }
210 
211  account_id_type wallet_api_impl::get_account_id(string account_name_or_id) const
212  {
213  return get_account(account_name_or_id).get_id();
214  }
215 
217  string account_name, string registrar_account, string referrer_account, bool broadcast,
218  bool save_wallet )
219  { try {
220  int active_key_index = find_first_unused_derived_key_index(owner_privkey);
221  fc::ecc::private_key active_privkey = derive_private_key( key_to_wif(owner_privkey), active_key_index);
222 
223  int memo_key_index = find_first_unused_derived_key_index(active_privkey);
224  fc::ecc::private_key memo_privkey = derive_private_key( key_to_wif(active_privkey), memo_key_index);
225 
226  graphene::chain::public_key_type owner_pubkey = owner_privkey.get_public_key();
227  graphene::chain::public_key_type active_pubkey = active_privkey.get_public_key();
228  graphene::chain::public_key_type memo_pubkey = memo_privkey.get_public_key();
229 
230  account_create_operation account_create_op;
231 
232  // TODO: process when pay_from_account is ID
233 
234  account_object registrar_account_object = get_account( registrar_account );
235 
236  account_id_type registrar_account_id = registrar_account_object.get_id();
237 
238  account_object referrer_account_object = get_account( referrer_account );
239  account_create_op.referrer = referrer_account_object.id;
240  account_create_op.referrer_percent = referrer_account_object.referrer_rewards_percentage;
241 
242  account_create_op.registrar = registrar_account_id;
243  account_create_op.name = account_name;
244  account_create_op.owner = authority(1, owner_pubkey, 1);
245  account_create_op.active = authority(1, active_pubkey, 1);
246  account_create_op.options.memo_key = memo_pubkey;
247 
248  // current_fee_schedule()
249  // find_account(pay_from_account)
250 
251  // account_create_op.fee = account_create_op.calculate_fee(db.current_fee_schedule());
252 
254  tx.operations.push_back( account_create_op );
255  set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees());
256  tx.validate();
257 
258  // we do not insert owner_privkey here because
259  // it is intended to only be used for key recovery
260  _wallet.pending_account_registrations[account_name].push_back(key_to_wif( active_privkey ));
261  _wallet.pending_account_registrations[account_name].push_back(key_to_wif( memo_privkey ));
262  if( save_wallet )
264  return sign_transaction(tx, broadcast);
265  } FC_CAPTURE_AND_RETHROW( (account_name)(registrar_account)(referrer_account)(broadcast) ) }
266 
267  signed_transaction wallet_api_impl::whitelist_account(string authorizing_account, string account_to_list,
268  account_whitelist_operation::account_listing new_listing_status, bool broadcast )
269  { try {
270  account_whitelist_operation whitelist_op;
271  whitelist_op.authorizing_account = get_account_id(authorizing_account);
272  whitelist_op.account_to_list = get_account_id(account_to_list);
273  whitelist_op.new_listing = new_listing_status;
274 
276  tx.operations.push_back( whitelist_op );
277  set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees());
278  tx.validate();
279 
280  return sign_transaction( tx, broadcast );
281  } FC_CAPTURE_AND_RETHROW( (authorizing_account)(account_to_list)(new_listing_status)(broadcast) ) }
282 
283  vector< vesting_balance_object_with_info > wallet_api_impl::get_vesting_balances( string account_name )
284  { try {
285  fc::optional<vesting_balance_id_type> vbid = maybe_id<vesting_balance_id_type>( account_name );
286  std::vector<vesting_balance_object_with_info> result;
287  fc::time_point_sec now = _remote_db->get_dynamic_global_properties().time;
288 
289  if( vbid )
290  {
291  result.emplace_back( get_object(*vbid), now );
292  return result;
293  }
294 
295  vector< vesting_balance_object > vbos = _remote_db->get_vesting_balances( account_name );
296  if( vbos.size() == 0 )
297  return result;
298 
299  for( const vesting_balance_object& vbo : vbos )
300  result.emplace_back( vbo, now );
301 
302  return result;
303  } FC_CAPTURE_AND_RETHROW( (account_name) )
304  }
305 
306  vector< signed_transaction > wallet_api_impl::import_balance( string name_or_id,
307  const vector<string>& wif_keys, bool broadcast )
308  { try {
309  FC_ASSERT(!is_locked());
310  const dynamic_global_property_object& dpo = _remote_db->get_dynamic_global_properties();
311  account_object claimer = get_account( name_or_id );
312  uint32_t max_ops_per_tx = 30;
313 
314  map< address, private_key_type > keys; // local index of address -> private key
315  vector< address > addrs;
316  bool has_wildcard = false;
317  addrs.reserve( wif_keys.size() );
318  for( const string& wif_key : wif_keys )
319  {
320  if( wif_key == "*" )
321  {
322  if( has_wildcard )
323  continue;
324  for( const public_key_type& pub : _wallet.extra_keys[ claimer.get_id() ] )
325  {
326  addrs.push_back( address(pub) );
327  auto it = _keys.find( pub );
328  if( it != _keys.end() )
329  {
330  fc::optional< fc::ecc::private_key > privkey = wif_to_key( it->second );
331  FC_ASSERT( privkey );
332  keys[ addrs.back() ] = *privkey;
333  }
334  else
335  {
336  wlog( "Somehow _keys has no private key for extra_keys public key ${k}", ("k", pub) );
337  }
338  }
339  has_wildcard = true;
340  }
341  else
342  {
343  optional< private_key_type > key = wif_to_key( wif_key );
344  FC_ASSERT( key.valid(), "Invalid private key" );
345  fc::ecc::public_key pk = key->get_public_key();
346  addrs.push_back( address(pk) );
347  keys[addrs.back()] = *key;
348  // see chain/balance_evaluator.cpp
349  addrs.push_back( address( pts_address( pk, false ) ) ); // version = 56 (default)
350  keys[addrs.back()] = *key;
351  addrs.push_back( address( pts_address( pk, true ) ) ); // version = 56 (default)
352  keys[addrs.back()] = *key;
353  addrs.push_back( address( pts_address( pk, false, 0 ) ) );
354  keys[addrs.back()] = *key;
355  addrs.push_back( address( pts_address( pk, true, 0 ) ) );
356  keys[addrs.back()] = *key;
357  }
358  }
359 
360  vector< balance_object > balances = _remote_db->get_balance_objects( addrs );
361  addrs.clear();
362 
363  set<asset_id_type> bal_types;
364  for( auto b : balances ) bal_types.insert( b.balance.asset_id );
365 
366  struct claim_tx
367  {
368  vector< balance_claim_operation > ops;
369  set< address > addrs;
370  };
371  vector< claim_tx > claim_txs;
372 
373  for( const asset_id_type& a : bal_types )
374  {
376  op.deposit_to_account = claimer.id;
377  for( const balance_object& b : balances )
378  {
379  if( b.balance.asset_id == a )
380  {
381  op.total_claimed = b.available( dpo.time );
382  if( op.total_claimed.amount == 0 )
383  continue;
384  op.balance_to_claim = b.id;
385  op.balance_owner_key = keys[b.owner].get_public_key();
386  if( (claim_txs.empty()) || (claim_txs.back().ops.size() >= max_ops_per_tx) )
387  claim_txs.emplace_back();
388  claim_txs.back().ops.push_back(op);
389  claim_txs.back().addrs.insert(b.owner);
390  }
391  }
392  }
393 
394  vector< signed_transaction > result;
395 
396  for( const claim_tx& ctx : claim_txs )
397  {
399  tx.operations.reserve( ctx.ops.size() );
400  for( const balance_claim_operation& op : ctx.ops )
401  tx.operations.emplace_back( op );
402  set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees() );
403  tx.validate();
404  signed_transaction signed_tx = sign_transaction( tx, false );
405  for( const address& addr : ctx.addrs )
406  signed_tx.sign( keys[addr], _chain_id );
407  // if the key for a balance object was the same as a key for the account we're importing it into,
408  // we may end up with duplicate signatures, so remove those
409  boost::erase(signed_tx.signatures, boost::unique<boost::return_found_end>(boost::sort(signed_tx.signatures)));
410  result.push_back( signed_tx );
411  if( broadcast )
412  _remote_net_broadcast->broadcast_transaction(signed_tx);
413  }
414 
415  return result;
416  } FC_CAPTURE_AND_RETHROW( (name_or_id) ) }
417 
418  vector<flat_set<account_id_type>> wallet_api_impl::get_key_references(const vector<public_key_type> &keys) const
419  {
420  return _remote_db->get_key_references(keys);
421  }
422 
423 }}} // namespace graphene::wallet::detail
graphene::wallet::detail::normalize_brain_key
string normalize_brain_key(string s)
Definition: wallet_sign.cpp:68
graphene::protocol::transaction::operations
vector< operation > operations
Definition: transaction.hpp:89
GRAPHENE_1_PERCENT
#define GRAPHENE_1_PERCENT
Definition: config.hpp:103
FC_CAPTURE_AND_RETHROW
#define FC_CAPTURE_AND_RETHROW(...)
Definition: exception.hpp:479
graphene::db::object::id
object_id_type id
Definition: object.hpp:69
graphene::chain::dynamic_global_property_object
Maintains global state information (committee_member list, current fees)
Definition: global_property_object.hpp:62
graphene::protocol::account_whitelist_operation::authorizing_account
account_id_type authorizing_account
The account which is specifying an opinion of another account.
Definition: account.hpp:210
graphene::protocol::custom_operation
provides a generic way to add higher level protocols on top of witness consensus
Definition: custom.hpp:38
wlog
#define wlog(FORMAT,...)
Definition: logger.hpp:123
graphene::chain::dynamic_global_property_object::time
time_point_sec time
Definition: global_property_object.hpp:68
graphene::wallet::detail::wallet_api_impl::register_account
signed_transaction register_account(string name, public_key_type owner, public_key_type active, string registrar_account, string referrer_account, uint32_t referrer_percent, bool broadcast=false)
Definition: wallet_account.cpp:44
graphene::wallet::detail::wallet_api_impl::upgrade_account
signed_transaction upgrade_account(string name, bool broadcast)
Definition: wallet_account.cpp:84
fc::static_variant
Definition: raw_fwd.hpp:27
pts_address.hpp
graphene::utilities::key_to_wif
std::string key_to_wif(const fc::sha256 &private_secret)
Definition: key_conversion.cpp:30
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::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::detail::wallet_api_impl::get_account_id
account_id_type get_account_id(string account_name_or_id) const
Definition: wallet_account.cpp:217
graphene::protocol::signed_transaction::sign
const signature_type & sign(const private_key_type &key, const chain_id_type &chain_id)
Definition: transaction.cpp:77
graphene::protocol::balance_claim_operation::deposit_to_account
account_id_type deposit_to_account
Definition: balance.hpp:45
graphene::wallet::detail::wallet_api_impl::_remote_db
fc::api< database_api > _remote_db
Definition: wallet_api_impl.hpp:414
graphene::wallet::detail::wallet_api_impl::import_balance
vector< signed_transaction > import_balance(string name_or_id, const vector< string > &wif_keys, bool broadcast)
Definition: wallet_account.cpp:312
graphene::protocol::pts_address
Definition: pts_address.hpp:41
graphene::wallet::detail::wallet_api_impl::sign_transaction
signed_transaction sign_transaction(signed_transaction tx, bool broadcast=false)
Definition: wallet_sign.cpp:336
graphene::wallet::detail::wallet_api_impl::set_operation_fees
void set_operation_fees(signed_transaction &tx, const fee_schedule &s) const
Definition: wallet_api_impl.cpp:197
graphene::protocol::account_create_operation::active
authority active
Definition: account.hpp:110
fc::ecc::public_key
contains only the public point of an elliptic curve key.
Definition: elliptic.hpp:35
wallet_api_impl.hpp
graphene::protocol::account_create_operation::registrar
account_id_type registrar
This account pays the fee. Must be a lifetime member.
Definition: account.hpp:100
graphene::protocol::public_key_type
Definition: types.hpp:312
graphene::custom_operations::account_storage_map
Definition: custom_operations.hpp:35
graphene::wallet::detail::wallet_api_impl::get_account
account_object get_account(account_id_type id) const
Definition: wallet_account.cpp:193
graphene::chain::account_object::is_lifetime_member
bool is_lifetime_member() const
Definition: account_object.hpp:304
graphene::protocol::custom_operation::payer
account_id_type payer
Definition: custom.hpp:46
graphene::wallet::detail::wallet_api_impl::get_key_references
vector< flat_set< account_id_type > > get_key_references(const vector< public_key_type > &keys) const
Definition: wallet_account.cpp:424
graphene::wallet::wallet_data::pending_witness_registrations
map< string, string > pending_witness_registrations
Definition: wallet_structs.hpp:189
fc::ecc::private_key
an elliptic curve private key.
Definition: elliptic.hpp:89
graphene::protocol::account_create_operation::referrer
account_id_type referrer
This account receives a portion of the fee split between registrar and referrer. Must be a member.
Definition: account.hpp:103
graphene::chain::vesting_balance_object
Definition: vesting_balance_object.hpp:151
graphene::protocol::signed_transaction
adds a signature to a transaction
Definition: transaction.hpp:134
graphene::protocol::account_whitelist_operation::account_to_list
account_id_type account_to_list
The account being opined about.
Definition: account.hpp:212
graphene::wallet::detail::wallet_api_impl::_chain_id
chain_id_type _chain_id
Definition: wallet_api_impl.hpp:412
graphene::protocol::balance_claim_operation::total_claimed
asset total_claimed
Definition: balance.hpp:48
fc::remove
bool remove(const path &p)
Definition: filesystem.cpp:327
graphene::protocol::account_create_operation::name
string name
Definition: account.hpp:108
wallet.hpp
graphene::protocol::account_create_operation
Definition: account.hpp:81
graphene::chain::account_object
This class represents an account on the object graph.
Definition: account_object.hpp:180
graphene::protocol::account_upgrade_operation::account_to_upgrade
account_id_type account_to_upgrade
The account to upgrade; must not already be a lifetime member.
Definition: account.hpp:244
fc::time_point_sec
Definition: time.hpp:74
graphene::protocol::account_options::memo_key
public_key_type memo_key
Definition: account.hpp:44
graphene::wallet::detail::wallet_api_impl::save_wallet_file
void save_wallet_file(string wallet_filename="")
Definition: wallet_api_impl.cpp:428
graphene::protocol::account_upgrade_operation::upgrade_to_lifetime_member
bool upgrade_to_lifetime_member
If true, the account will be upgraded to a lifetime member; otherwise, it will add a year to the subs...
Definition: account.hpp:246
graphene::wallet::detail::wallet_api_impl::import_key
bool import_key(string account_name_or_id, string wif_key)
Definition: wallet_sign.cpp:428
graphene::protocol::balance_claim_operation::balance_to_claim
balance_id_type balance_to_claim
Definition: balance.hpp:46
graphene::protocol::balance_claim_operation
Claim a balance in a graphene::chain::balance_object.
Definition: balance.hpp:40
graphene::chain::account_object::referrer_rewards_percentage
uint16_t referrer_rewards_percentage
Definition: account_object.hpp:206
fc::ecc::private_key::get_public_key
public_key get_public_key() const
Definition: elliptic_impl_priv.cpp:70
graphene::wallet::detail::wallet_api_impl::_keys
map< public_key_type, string > _keys
Definition: wallet_api_impl.hpp:409
graphene::wallet::detail::wallet_api_impl::create_account_with_brain_key
signed_transaction create_account_with_brain_key(string brain_key, string account_name, string registrar_account, string referrer_account, bool broadcast=false, bool save_wallet=true)
Definition: wallet_account.cpp:101
graphene::protocol::account_create_operation::owner
authority owner
Definition: account.hpp:109
graphene::wallet::detail::wallet_api_impl::_wallet
wallet_data _wallet
Definition: wallet_api_impl.hpp:407
graphene::protocol::account_create_operation::options
account_options options
Definition: account.hpp:112
graphene::protocol::custom_operation::data
vector< char > data
Definition: custom.hpp:49
FC_ASSERT
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
Definition: exception.hpp:345
graphene::protocol::signed_transaction::signatures
vector< signature_type > signatures
Definition: transaction.hpp:217
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::transaction::validate
virtual void validate() const
Definition: transaction.cpp:58
graphene::wallet::detail::wallet_api_impl::_remote_net_broadcast
fc::api< network_broadcast_api > _remote_net_broadcast
Definition: wallet_api_impl.hpp:415
graphene::protocol::asset::amount
share_type amount
Definition: asset.hpp:36
graphene::protocol::account_whitelist_operation::account_listing
account_listing
Definition: account.hpp:200
graphene::custom_operations::account_storage_map::key_values
flat_map< string, optional< string > > key_values
Definition: custom_operations.hpp:39
graphene::protocol::account_upgrade_operation
Manage an account's membership status.
Definition: account.hpp:235
graphene::wallet::detail::wallet_api_impl::get_object
graphene::db::object_downcast_t< const ID & > get_object(const ID &id) const
Definition: wallet_api_impl.hpp:129
graphene::chain::balance_object
Definition: balance_object.hpp:30
graphene::wallet::detail::wallet_api_impl::is_locked
bool is_locked() const
Definition: wallet_api_impl.cpp:304
graphene::db::abstract_object::get_id
object_id< SpaceID, TypeID > get_id() const
Definition: object.hpp:113
graphene::wallet::detail::wallet_api_impl::whitelist_account
signed_transaction whitelist_account(string authorizing_account, string account_to_list, account_whitelist_operation::account_listing new_listing_status, bool broadcast)
Definition: wallet_account.cpp:273
graphene::custom_operations::account_storage_map::catalog
string catalog
Definition: custom_operations.hpp:38
graphene::protocol::authority
Identifies a weighted set of keys and accounts that must approve operations.
Definition: authority.hpp:34
fc::optional
provides stack-based nullable value similar to boost::optional
Definition: optional.hpp:20
graphene::custom_operations::account_storage_map::remove
bool remove
Definition: custom_operations.hpp:37
graphene::protocol::account_whitelist_operation
This operation is used to whitelist and blacklist accounts, primarily for transacting in whitelisted ...
Definition: account.hpp:197
graphene::wallet::detail::wallet_api_impl::create_account_with_private_key
signed_transaction create_account_with_private_key(fc::ecc::private_key owner_privkey, string account_name, string registrar_account, string referrer_account, bool broadcast=false, bool save_wallet=true)
Definition: wallet_account.cpp:222
graphene::wallet::detail::wallet_api_impl::get_vesting_balances
vector< vesting_balance_object_with_info > get_vesting_balances(string account_name)
Definition: wallet_account.cpp:289
graphene::protocol::account_create_operation::referrer_percent
uint16_t referrer_percent
Definition: account.hpp:106
graphene::protocol::account_whitelist_operation::new_listing
uint8_t new_listing
Definition: account.hpp:215
graphene::protocol::is_valid_name
bool is_valid_name(const string &name)
Definition: account.cpp:64
graphene::protocol::balance_claim_operation::balance_owner_key
public_key_type balance_owner_key
Definition: balance.hpp:47
graphene::wallet::wallet_data::extra_keys
map< account_id_type, set< public_key_type > > extra_keys
Definition: wallet_structs.hpp:184
graphene::wallet::wallet_data::pending_account_registrations
map< string, vector< string > > pending_account_registrations
Definition: wallet_structs.hpp:188
graphene
Definition: api.cpp:48
graphene::protocol::address
a 160 bit hash of a public key
Definition: address.hpp:44
fc::raw::pack
void pack(Stream &s, const flat_set< T, A... > &value, uint32_t _max_depth)
Definition: flat.hpp:11
elog
#define elog(FORMAT,...)
Definition: logger.hpp:129
graphene::wallet::detail::wallet_api_impl::account_store_map
signed_transaction account_store_map(string account, string catalog, bool remove, flat_map< string, optional< string >> key_values, bool broadcast)
Definition: wallet_account.cpp:116