Scorum
Public Member Functions | Public Attributes | List of all members
scorum::wallet::detail::wallet_api_impl Class Reference

Public Member Functions

 wallet_api_impl (wallet_api &s, const wallet_data &initial_data, fc::api< login_api > rapi)
 
virtual ~wallet_api_impl ()
 
void encrypt_keys ()
 
bool copy_wallet_file (const std::string &destination_filename)
 
bool is_locked () const
 
variant info () const
 
variant_object about () const
 
account_api_obj get_account (const std::string &account_name) const
 
std::string get_wallet_filename () const
 
optional< fc::ecc::private_key > try_get_private_key (const public_key_type &id) const
 
fc::ecc::private_key get_private_key (const public_key_type &id) const
 
fc::ecc::private_key get_private_key_for_account (const account_api_obj &account) const
 
bool import_key (const std::string &wif_key)
 
bool load_wallet_file (std::string wallet_filename="")
 
void save_wallet_file (std::string wallet_filename="")
 
int find_first_unused_derived_key_index (const fc::ecc::private_key &parent_key)
 
signed_transaction create_account_with_private_key (fc::ecc::private_key owner_privkey, const std::string &account_name, const std::string &creator_account_name, bool broadcast=false, bool save_wallet=true)
 
signed_transaction set_voting_proxy (const std::string &account_to_modify, const std::string &proxy, bool broadcast)
 
optional< witness_api_objget_witness (const std::string &owner_account)
 
void set_transaction_expiration (uint32_t tx_expiration_seconds)
 
annotated_signed_transaction sign_transaction (signed_transaction tx, bool broadcast=false)
 
std::string print_atomicswap_secret2str (const std::string &secret) const
 
std::string print_atomicswap_contract2str (const atomicswap_contract_info_api_obj &rt) const
 
std::map< std::string, std::function< std::string(fc::variant, const fc::variants &)> > get_result_formatters () const
 
void use_network_node_api ()
 
void use_remote_account_by_key_api ()
 
void use_remote_account_history_api ()
 
void use_remote_devcommittee_history_api ()
 
void use_remote_blockchain_history_api ()
 
void network_add_nodes (const std::vector< std::string > &nodes)
 
std::vector< variant > network_get_connected_peers ()
 
operation get_prototype_operation (const std::string &operation_name)
 

Public Attributes

api_documentation method_documentation
 
wallet_apiself
 
std::string _wallet_filename
 
wallet_data _wallet
 
std::map< public_key_type, std::string > _keys
 
fc::sha512 _checksum
 
chain_id_type _chain_id
 
fc::api< login_api_remote_api
 
fc::api< database_api_remote_db
 
fc::api< chain_api_chain_api
 
fc::api< network_broadcast_api_remote_net_broadcast
 
optional< fc::api< network_node_api > > _remote_net_node
 
optional< fc::api< account_by_key::account_by_key_api > > _remote_account_by_key_api
 
optional< fc::api< blockchain_history::account_history_api > > _remote_account_history_api
 
optional< fc::api< blockchain_history::blockchain_history_api > > _remote_blockchain_history_api
 
optional< fc::api< blockchain_history::devcommittee_history_api > > _remote_devcommittee_history_api
 
uint32_t _tx_expiration_seconds = 30
 
flat_map< std::string, operation_prototype_ops
 
static_variant_map _operation_which_map = create_static_variant_map<operation>()
 
const std::string _wallet_filename_extension = ".wallet"
 

Detailed Description

Definition at line 110 of file wallet.cpp.

Constructor & Destructor Documentation

◆ wallet_api_impl()

scorum::wallet::detail::wallet_api_impl::wallet_api_impl ( wallet_api s,
const wallet_data initial_data,
fc::api< login_api rapi 
)
inline

Definition at line 142 of file wallet.cpp.

◆ ~wallet_api_impl()

virtual scorum::wallet::detail::wallet_api_impl::~wallet_api_impl ( )
inlinevirtual

Definition at line 165 of file wallet.cpp.

Member Function Documentation

◆ about()

variant_object scorum::wallet::detail::wallet_api_impl::about ( ) const
inline

Definition at line 237 of file wallet.cpp.

◆ copy_wallet_file()

bool scorum::wallet::detail::wallet_api_impl::copy_wallet_file ( const std::string &  destination_filename)
inline

Definition at line 181 of file wallet.cpp.

◆ create_account_with_private_key()

signed_transaction scorum::wallet::detail::wallet_api_impl::create_account_with_private_key ( fc::ecc::private_key  owner_privkey,
const std::string &  account_name,
const std::string &  creator_account_name,
bool  broadcast = false,
bool  save_wallet = true 
)
inline

Definition at line 425 of file wallet.cpp.

◆ encrypt_keys()

void scorum::wallet::detail::wallet_api_impl::encrypt_keys ( )
inline

Definition at line 169 of file wallet.cpp.

◆ find_first_unused_derived_key_index()

int scorum::wallet::detail::wallet_api_impl::find_first_unused_derived_key_index ( const fc::ecc::private_key &  parent_key)
inline

Definition at line 394 of file wallet.cpp.

◆ get_account()

account_api_obj scorum::wallet::detail::wallet_api_impl::get_account ( const std::string &  account_name) const
inline

Definition at line 284 of file wallet.cpp.

◆ get_private_key()

fc::ecc::private_key scorum::wallet::detail::wallet_api_impl::get_private_key ( const public_key_type id) const
inline

Definition at line 304 of file wallet.cpp.

◆ get_private_key_for_account()

fc::ecc::private_key scorum::wallet::detail::wallet_api_impl::get_private_key_for_account ( const account_api_obj account) const
inline

Definition at line 311 of file wallet.cpp.

◆ get_prototype_operation()

operation scorum::wallet::detail::wallet_api_impl::get_prototype_operation ( const std::string &  operation_name)
inline

Definition at line 992 of file wallet.cpp.

◆ get_result_formatters()

std::map<std::string, std::function<std::string(fc::variant, const fc::variants&)> > scorum::wallet::detail::wallet_api_impl::get_result_formatters ( ) const
inline

Definition at line 723 of file wallet.cpp.

◆ get_wallet_filename()

std::string scorum::wallet::detail::wallet_api_impl::get_wallet_filename ( ) const
inline

Definition at line 291 of file wallet.cpp.

◆ get_witness()

optional<witness_api_obj> scorum::wallet::detail::wallet_api_impl::get_witness ( const std::string &  owner_account)
inline

Definition at line 487 of file wallet.cpp.

◆ import_key()

bool scorum::wallet::detail::wallet_api_impl::import_key ( const std::string &  wif_key)
inline

Definition at line 323 of file wallet.cpp.

◆ info()

variant scorum::wallet::detail::wallet_api_impl::info ( ) const
inline

Definition at line 217 of file wallet.cpp.

◆ is_locked()

bool scorum::wallet::detail::wallet_api_impl::is_locked ( ) const
inline

Definition at line 212 of file wallet.cpp.

◆ load_wallet_file()

bool scorum::wallet::detail::wallet_api_impl::load_wallet_file ( std::string  wallet_filename = "")
inline

Definition at line 335 of file wallet.cpp.

◆ network_add_nodes()

void scorum::wallet::detail::wallet_api_impl::network_add_nodes ( const std::vector< std::string > &  nodes)
inline

Definition at line 968 of file wallet.cpp.

◆ network_get_connected_peers()

std::vector<variant> scorum::wallet::detail::wallet_api_impl::network_get_connected_peers ( )
inline

Definition at line 977 of file wallet.cpp.

◆ print_atomicswap_contract2str()

std::string scorum::wallet::detail::wallet_api_impl::print_atomicswap_contract2str ( const atomicswap_contract_info_api_obj rt) const
inline

Definition at line 674 of file wallet.cpp.

◆ print_atomicswap_secret2str()

std::string scorum::wallet::detail::wallet_api_impl::print_atomicswap_secret2str ( const std::string &  secret) const
inline

Definition at line 664 of file wallet.cpp.

◆ save_wallet_file()

void scorum::wallet::detail::wallet_api_impl::save_wallet_file ( std::string  wallet_filename = "")
inline

Definition at line 351 of file wallet.cpp.

◆ set_transaction_expiration()

void scorum::wallet::detail::wallet_api_impl::set_transaction_expiration ( uint32_t  tx_expiration_seconds)
inline

Definition at line 492 of file wallet.cpp.

◆ set_voting_proxy()

signed_transaction scorum::wallet::detail::wallet_api_impl::set_voting_proxy ( const std::string &  account_to_modify,
const std::string &  proxy,
bool  broadcast 
)
inline

Definition at line 470 of file wallet.cpp.

◆ sign_transaction()

annotated_signed_transaction scorum::wallet::detail::wallet_api_impl::sign_transaction ( signed_transaction  tx,
bool  broadcast = false 
)
inline

TODO: fetch the accounts specified via other_auths as well.

TODO: recursively check one layer deeper in the authority tree for keys

Definition at line 498 of file wallet.cpp.

◆ try_get_private_key()

optional<fc::ecc::private_key> scorum::wallet::detail::wallet_api_impl::try_get_private_key ( const public_key_type id) const
inline

Definition at line 296 of file wallet.cpp.

◆ use_network_node_api()

void scorum::wallet::detail::wallet_api_impl::use_network_node_api ( )
inline

Definition at line 885 of file wallet.cpp.

◆ use_remote_account_by_key_api()

void scorum::wallet::detail::wallet_api_impl::use_remote_account_by_key_api ( )
inline

Definition at line 900 of file wallet.cpp.

◆ use_remote_account_history_api()

void scorum::wallet::detail::wallet_api_impl::use_remote_account_history_api ( )
inline

Definition at line 917 of file wallet.cpp.

◆ use_remote_blockchain_history_api()

void scorum::wallet::detail::wallet_api_impl::use_remote_blockchain_history_api ( )
inline

Definition at line 951 of file wallet.cpp.

◆ use_remote_devcommittee_history_api()

void scorum::wallet::detail::wallet_api_impl::use_remote_devcommittee_history_api ( )
inline

Definition at line 934 of file wallet.cpp.

Member Data Documentation

◆ _chain_api

fc::api<chain_api> scorum::wallet::detail::wallet_api_impl::_chain_api

Definition at line 1010 of file wallet.cpp.

◆ _chain_id

chain_id_type scorum::wallet::detail::wallet_api_impl::_chain_id

Definition at line 1006 of file wallet.cpp.

◆ _checksum

fc::sha512 scorum::wallet::detail::wallet_api_impl::_checksum

Definition at line 1004 of file wallet.cpp.

◆ _keys

std::map<public_key_type, std::string> scorum::wallet::detail::wallet_api_impl::_keys

Definition at line 1003 of file wallet.cpp.

◆ _operation_which_map

static_variant_map scorum::wallet::detail::wallet_api_impl::_operation_which_map = create_static_variant_map<operation>()

Definition at line 1022 of file wallet.cpp.

◆ _prototype_ops

flat_map<std::string, operation> scorum::wallet::detail::wallet_api_impl::_prototype_ops

Definition at line 1020 of file wallet.cpp.

◆ _remote_account_by_key_api

optional<fc::api<account_by_key::account_by_key_api> > scorum::wallet::detail::wallet_api_impl::_remote_account_by_key_api

Definition at line 1013 of file wallet.cpp.

◆ _remote_account_history_api

optional<fc::api<blockchain_history::account_history_api> > scorum::wallet::detail::wallet_api_impl::_remote_account_history_api

Definition at line 1014 of file wallet.cpp.

◆ _remote_api

fc::api<login_api> scorum::wallet::detail::wallet_api_impl::_remote_api

Definition at line 1008 of file wallet.cpp.

◆ _remote_blockchain_history_api

optional<fc::api<blockchain_history::blockchain_history_api> > scorum::wallet::detail::wallet_api_impl::_remote_blockchain_history_api

Definition at line 1015 of file wallet.cpp.

◆ _remote_db

fc::api<database_api> scorum::wallet::detail::wallet_api_impl::_remote_db

Definition at line 1009 of file wallet.cpp.

◆ _remote_devcommittee_history_api

optional<fc::api<blockchain_history::devcommittee_history_api> > scorum::wallet::detail::wallet_api_impl::_remote_devcommittee_history_api

Definition at line 1016 of file wallet.cpp.

◆ _remote_net_broadcast

fc::api<network_broadcast_api> scorum::wallet::detail::wallet_api_impl::_remote_net_broadcast

Definition at line 1011 of file wallet.cpp.

◆ _remote_net_node

optional<fc::api<network_node_api> > scorum::wallet::detail::wallet_api_impl::_remote_net_node

Definition at line 1012 of file wallet.cpp.

◆ _tx_expiration_seconds

uint32_t scorum::wallet::detail::wallet_api_impl::_tx_expiration_seconds = 30

Definition at line 1018 of file wallet.cpp.

◆ _wallet

wallet_data scorum::wallet::detail::wallet_api_impl::_wallet

Definition at line 1001 of file wallet.cpp.

◆ _wallet_filename

std::string scorum::wallet::detail::wallet_api_impl::_wallet_filename

Definition at line 1000 of file wallet.cpp.

◆ _wallet_filename_extension

const std::string scorum::wallet::detail::wallet_api_impl::_wallet_filename_extension = ".wallet"

Definition at line 1027 of file wallet.cpp.

◆ method_documentation

api_documentation scorum::wallet::detail::wallet_api_impl::method_documentation

Definition at line 113 of file wallet.cpp.

◆ self

wallet_api& scorum::wallet::detail::wallet_api_impl::self

Definition at line 141 of file wallet.cpp.


The documentation for this class was generated from the following file: