Golos
Разработчикам Статистика Баунти Документация Партнеры Github
Public Member Functions | Public Attributes | List of all members
golos::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 (string destination_filename)
 
bool is_locked () const
 
variant info () const
 
variant_object about () const
 
account_api_obj get_account (string account_name) const
 
proposal_object get_proposal (string account_name, integral_id_type id) const
 
optional< asset_objectfind_asset (asset_symbol_type asset_symbol) const
 
optional< asset_objectfind_asset (string asset_symbol) const
 
asset_object get_asset (string asset_symbol) const
 
asset_bitasset_data_object get_bitasset_data (string asset_symbol) const
 
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 (string wif_key)
 
bool load_wallet_file (string wallet_filename="")
 
void save_wallet_file (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, string account_name, string creator_account_name, bool broadcast=false, bool save_wallet=true)
 
signed_transaction set_voting_proxy (string account_to_modify, string proxy, bool broadcast)
 
optional< witness_api_objget_witness (string owner_account)
 
void set_transaction_expiration (uint32_t tx_expiration_seconds)
 
annotated_signed_transaction sign_transaction (signed_transaction tx, bool broadcast=false)
 
std::map< string, std::function< string(fc::variant, const fc::variants &)> > get_result_formatters () const
 
void use_network_node_api ()
 
void use_remote_message_api ()
 
void use_follow_api ()
 
void use_remote_account_by_key_api ()
 
void use_remote_market_history_api ()
 
void network_add_nodes (const vector< string > &nodes)
 
vector< variant > network_get_connected_peers ()
 
operation get_prototype_operation (string operation_name)
 
transaction_handle_type begin_builder_transaction ()
 
void add_operation_to_builder_transaction (transaction_handle_type transaction_handle, const operation &op)
 
void replace_operation_in_builder_transaction (transaction_handle_type handle, uint32_t operation_index, const operation &new_op)
 
transaction preview_builder_transaction (transaction_handle_type handle)
 
signed_transaction sign_builder_transaction (transaction_handle_type transaction_handle, bool broadcast=true)
 
signed_transaction propose_builder_transaction (transaction_handle_type handle, time_point_sec expiration=time_point::now()+fc::minutes(1), uint32_t review_period_seconds=0, bool broadcast=true)
 
signed_transaction propose_builder_transaction2 (transaction_handle_type handle, string account_name_or_id, time_point_sec expiration=time_point::now()+fc::minutes(1), uint32_t review_period_seconds=0, bool broadcast=true)
 
void remove_builder_transaction (transaction_handle_type handle)
 
signed_transaction bid_collateral (string bidder_name, string debt_amount, string debt_symbol, string additional_collateral, bool broadcast)
 

Public Attributes

api_documentation method_documentation
 
wallet_apiself
 
string _wallet_filename
 
wallet_data _wallet
 
map< public_key_type, string > _keys
 
map< transaction_handle_type, signed_transaction > _builder_transactions
 
fc::sha512 _checksum
 
fc::api< login_api_remote_api
 
fc::api< database_api_remote_db
 
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< market_history::market_history_api > > _remote_market_history_api
 
optional< fc::api< private_message_api > > _remote_message_api
 
optional< fc::api< follow::follow_api > > _remote_follow_api
 
uint32_t _tx_expiration_seconds = 30
 
flat_map< string, operation > _prototype_ops
 
static_variant_map _operation_which_map = create_static_variant_map<operation>()
 
const string _wallet_filename_extension = ".wallet"
 
map< asset_name_type, asset_object_asset_cache
 

Detailed Description

Definition at line 232 of file wallet.cpp.

Constructor & Destructor Documentation

◆ wallet_api_impl()

golos::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 260 of file wallet.cpp.

◆ ~wallet_api_impl()

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

Definition at line 271 of file wallet.cpp.

Member Function Documentation

◆ about()

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

Definition at line 338 of file wallet.cpp.

◆ add_operation_to_builder_transaction()

void golos::wallet::detail::wallet_api_impl::add_operation_to_builder_transaction ( transaction_handle_type  transaction_handle,
const operation &  op 
)
inline

Definition at line 1056 of file wallet.cpp.

◆ begin_builder_transaction()

transaction_handle_type golos::wallet::detail::wallet_api_impl::begin_builder_transaction ( )
inline

Definition at line 1050 of file wallet.cpp.

◆ bid_collateral()

signed_transaction golos::wallet::detail::wallet_api_impl::bid_collateral ( string  bidder_name,
string  debt_amount,
string  debt_symbol,
string  additional_collateral,
bool  broadcast 
)
inline

Definition at line 1132 of file wallet.cpp.

◆ copy_wallet_file()

bool golos::wallet::detail::wallet_api_impl::copy_wallet_file ( string  destination_filename)
inline

Definition at line 284 of file wallet.cpp.

◆ create_account_with_private_key()

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

Definition at line 565 of file wallet.cpp.

◆ encrypt_keys()

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

Definition at line 274 of file wallet.cpp.

◆ find_asset() [1/2]

optional<asset_object> golos::wallet::detail::wallet_api_impl::find_asset ( asset_symbol_type  asset_symbol) const
inline

Definition at line 400 of file wallet.cpp.

◆ find_asset() [2/2]

optional<asset_object> golos::wallet::detail::wallet_api_impl::find_asset ( string  asset_symbol) const
inline

Definition at line 414 of file wallet.cpp.

◆ find_first_unused_derived_key_index()

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

Definition at line 540 of file wallet.cpp.

◆ get_account()

account_api_obj golos::wallet::detail::wallet_api_impl::get_account ( string  account_name) const
inline

Definition at line 385 of file wallet.cpp.

◆ get_asset()

asset_object golos::wallet::detail::wallet_api_impl::get_asset ( string  asset_symbol) const
inline

Definition at line 429 of file wallet.cpp.

◆ get_bitasset_data()

asset_bitasset_data_object golos::wallet::detail::wallet_api_impl::get_bitasset_data ( string  asset_symbol) const
inline

Definition at line 435 of file wallet.cpp.

◆ get_private_key()

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

Definition at line 456 of file wallet.cpp.

◆ get_private_key_for_account()

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

Definition at line 463 of file wallet.cpp.

◆ get_proposal()

proposal_object golos::wallet::detail::wallet_api_impl::get_proposal ( string  account_name,
integral_id_type  id 
) const
inline

Definition at line 391 of file wallet.cpp.

◆ get_prototype_operation()

operation golos::wallet::detail::wallet_api_impl::get_prototype_operation ( string  operation_name)
inline

Definition at line 1043 of file wallet.cpp.

◆ get_result_formatters()

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

Definition at line 786 of file wallet.cpp.

◆ get_wallet_filename()

string golos::wallet::detail::wallet_api_impl::get_wallet_filename ( ) const
inline

Definition at line 444 of file wallet.cpp.

◆ get_witness()

optional<witness_api_obj> golos::wallet::detail::wallet_api_impl::get_witness ( string  owner_account)
inline

Definition at line 621 of file wallet.cpp.

◆ import_key()

bool golos::wallet::detail::wallet_api_impl::import_key ( string  wif_key)
inline

Definition at line 474 of file wallet.cpp.

◆ info()

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

Definition at line 316 of file wallet.cpp.

◆ is_locked()

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

Definition at line 312 of file wallet.cpp.

◆ load_wallet_file()

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

Definition at line 484 of file wallet.cpp.

◆ network_add_nodes()

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

Definition at line 1023 of file wallet.cpp.

◆ network_get_connected_peers()

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

Definition at line 1030 of file wallet.cpp.

◆ preview_builder_transaction()

transaction golos::wallet::detail::wallet_api_impl::preview_builder_transaction ( transaction_handle_type  handle)
inline

Definition at line 1070 of file wallet.cpp.

◆ propose_builder_transaction()

signed_transaction golos::wallet::detail::wallet_api_impl::propose_builder_transaction ( transaction_handle_type  handle,
time_point_sec  expiration = time_point::now() + fc::minutes(1),
uint32_t  review_period_seconds = 0,
bool  broadcast = true 
)
inline

Definition at line 1083 of file wallet.cpp.

◆ propose_builder_transaction2()

signed_transaction golos::wallet::detail::wallet_api_impl::propose_builder_transaction2 ( transaction_handle_type  handle,
string  account_name_or_id,
time_point_sec  expiration = time_point::now() + fc::minutes(1),
uint32_t  review_period_seconds = 0,
bool  broadcast = true 
)
inline

Definition at line 1105 of file wallet.cpp.

◆ remove_builder_transaction()

void golos::wallet::detail::wallet_api_impl::remove_builder_transaction ( transaction_handle_type  handle)
inline

Definition at line 1128 of file wallet.cpp.

◆ replace_operation_in_builder_transaction()

void golos::wallet::detail::wallet_api_impl::replace_operation_in_builder_transaction ( transaction_handle_type  handle,
uint32_t  operation_index,
const operation &  new_op 
)
inline

Definition at line 1062 of file wallet.cpp.

◆ save_wallet_file()

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

Definition at line 500 of file wallet.cpp.

◆ set_transaction_expiration()

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

Definition at line 625 of file wallet.cpp.

◆ set_voting_proxy()

signed_transaction golos::wallet::detail::wallet_api_impl::set_voting_proxy ( string  account_to_modify,
string  proxy,
bool  broadcast 
)
inline

Definition at line 606 of file wallet.cpp.

◆ sign_builder_transaction()

signed_transaction golos::wallet::detail::wallet_api_impl::sign_builder_transaction ( transaction_handle_type  transaction_handle,
bool  broadcast = true 
)
inline

Definition at line 1075 of file wallet.cpp.

◆ sign_transaction()

annotated_signed_transaction golos::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 630 of file wallet.cpp.

◆ try_get_private_key()

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

Definition at line 448 of file wallet.cpp.

◆ use_follow_api()

void golos::wallet::detail::wallet_api_impl::use_follow_api ( )
inline

Definition at line 982 of file wallet.cpp.

◆ use_network_node_api()

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

Definition at line 956 of file wallet.cpp.

◆ use_remote_account_by_key_api()

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

Definition at line 995 of file wallet.cpp.

◆ use_remote_market_history_api()

void golos::wallet::detail::wallet_api_impl::use_remote_market_history_api ( )
inline

Definition at line 1009 of file wallet.cpp.

◆ use_remote_message_api()

void golos::wallet::detail::wallet_api_impl::use_remote_message_api ( )
inline

Definition at line 968 of file wallet.cpp.

Member Data Documentation

◆ _asset_cache

map<asset_name_type, asset_object> golos::wallet::detail::wallet_api_impl::_asset_cache
mutable

Definition at line 1180 of file wallet.cpp.

◆ _builder_transactions

map<transaction_handle_type, signed_transaction> golos::wallet::detail::wallet_api_impl::_builder_transactions

Definition at line 1158 of file wallet.cpp.

◆ _checksum

fc::sha512 golos::wallet::detail::wallet_api_impl::_checksum

Definition at line 1160 of file wallet.cpp.

◆ _keys

map<public_key_type, string> golos::wallet::detail::wallet_api_impl::_keys

Definition at line 1157 of file wallet.cpp.

◆ _operation_which_map

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

Definition at line 1173 of file wallet.cpp.

◆ _prototype_ops

flat_map<string, operation> golos::wallet::detail::wallet_api_impl::_prototype_ops

Definition at line 1171 of file wallet.cpp.

◆ _remote_account_by_key_api

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

Definition at line 1165 of file wallet.cpp.

◆ _remote_api

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

Definition at line 1161 of file wallet.cpp.

◆ _remote_db

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

Definition at line 1162 of file wallet.cpp.

◆ _remote_follow_api

optional<fc::api<follow::follow_api> > golos::wallet::detail::wallet_api_impl::_remote_follow_api

Definition at line 1168 of file wallet.cpp.

◆ _remote_market_history_api

optional<fc::api<market_history::market_history_api> > golos::wallet::detail::wallet_api_impl::_remote_market_history_api

Definition at line 1166 of file wallet.cpp.

◆ _remote_message_api

optional<fc::api<private_message_api> > golos::wallet::detail::wallet_api_impl::_remote_message_api

Definition at line 1167 of file wallet.cpp.

◆ _remote_net_broadcast

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

Definition at line 1163 of file wallet.cpp.

◆ _remote_net_node

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

Definition at line 1164 of file wallet.cpp.

◆ _tx_expiration_seconds

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

Definition at line 1169 of file wallet.cpp.

◆ _wallet

wallet_data golos::wallet::detail::wallet_api_impl::_wallet

Definition at line 1155 of file wallet.cpp.

◆ _wallet_filename

string golos::wallet::detail::wallet_api_impl::_wallet_filename

Definition at line 1154 of file wallet.cpp.

◆ _wallet_filename_extension

const string golos::wallet::detail::wallet_api_impl::_wallet_filename_extension = ".wallet"

Definition at line 1178 of file wallet.cpp.

◆ method_documentation

api_documentation golos::wallet::detail::wallet_api_impl::method_documentation

Definition at line 234 of file wallet.cpp.

◆ self

wallet_api& golos::wallet::detail::wallet_api_impl::self

Definition at line 258 of file wallet.cpp.


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