Skip to content

Commit

Permalink
#3593: Added RC API functions to the cli wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
sgerbino committed Feb 25, 2020
1 parent e51fbaa commit bbcecbf
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 0 deletions.
12 changes: 12 additions & 0 deletions libraries/wallet/include/steem/wallet/remote_node_api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ struct remote_node_api
vector< database_api::api_proposal_vote_object > list_proposal_votes( fc::variant, uint32_t, database_api::sort_order_type, database_api::order_direction_type, database_api::proposal_status );
vector< asset_symbol_type > get_nai_pool(void);
vector< database_api::api_smt_account_balance_object > get_smt_balances( vector< std::pair < string, string > > );
vector< rc::rc_account_api_object > find_rc_accounts( vector< account_name_type >);
vector< rc::rc_account_api_object > list_rc_accounts( account_name_type, uint32_t, rc::sort_order_type );
vector< rc::rc_delegation_pool_api_object > find_rc_delegation_pools( vector< account_name_type > );
vector< rc::rc_delegation_pool_api_object > list_rc_delegation_pools( account_name_type, uint32_t, rc::sort_order_type );
vector< rc::rc_indel_edge_api_object > find_rc_delegations( account_name_type );
vector< rc::rc_indel_edge_api_object > list_rc_delegations( account_name_type, uint32_t, rc::sort_order_type );
};

} }
Expand Down Expand Up @@ -206,4 +212,10 @@ FC_API( steem::wallet::remote_node_api,
(list_proposal_votes)
(get_nai_pool)
(get_smt_balances)
(find_rc_accounts)
(list_rc_accounts)
(find_rc_delegation_pools)
(list_rc_delegation_pools)
(find_rc_delegations)
(list_rc_delegations)
)
58 changes: 58 additions & 0 deletions libraries/wallet/include/steem/wallet/wallet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,64 @@ class wallet_api
account_name_type signer,
bool broadcast );

/**
* Retrieve RC information for the given accounts.
*
* @param accounts The vector of accounts
*/
vector< rc::rc_account_api_object > find_rc_accounts( vector< account_name_type > accounts );

/**
* List RC accounts.
*
* @param account The starting account
* @param limit The limit of returned results
* @param order The sort order
*/
vector< rc::rc_account_api_object > list_rc_accounts(
account_name_type account,
uint32_t limit,
rc::sort_order_type order );

/**
* Retrieve RC delegation pools for the given accounts.
*
* @param accounts The vector of accounts
*/
vector< rc::rc_delegation_pool_api_object > find_rc_delegation_pools( vector< account_name_type > accounts );

/**
* List RC delegation pools.
*
* @param account The starting account
* @param limit The limit of returned results
* @param order The sort order
*/
vector< rc::rc_delegation_pool_api_object > list_rc_delegation_pools(
account_name_type account,
uint32_t limit,
rc::sort_order_type order );

/**
* Retrieve RC delegations information for the given account.
*
* @param account The account
*/
vector< rc::rc_indel_edge_api_object > find_rc_delegations( account_name_type account );

/**
* List RC delegations.
*
* @param account The starting account
* @param limit The limit of returned results
* @param order The sort order
*/
vector< rc::rc_indel_edge_api_object > list_rc_delegations(
account_name_type account,
uint32_t limit,
rc::sort_order_type order );


std::map<string,std::function<string(fc::variant,const fc::variants&)>> get_result_formatters() const;
fc::signal<void(bool)> lock_changed;

Expand Down
31 changes: 31 additions & 0 deletions libraries/wallet/remote_node_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,4 +449,35 @@ vector< asset_symbol_type > remote_node_api::get_nai_pool()
FC_ASSERT( false );
}

vector< rc::rc_account_api_object > remote_node_api::find_rc_accounts( vector< account_name_type >)
{
FC_ASSERT( false );
}

vector< rc::rc_account_api_object > remote_node_api::list_rc_accounts( account_name_type, uint32_t, rc::sort_order_type )
{
FC_ASSERT( false );
}

vector< rc::rc_delegation_pool_api_object > remote_node_api::find_rc_delegation_pools( vector< account_name_type > )
{
FC_ASSERT( false );
}

vector< rc::rc_delegation_pool_api_object > remote_node_api::list_rc_delegation_pools( account_name_type, uint32_t, rc::sort_order_type )
{
FC_ASSERT( false );
}

vector< rc::rc_indel_edge_api_object > remote_node_api::find_rc_delegations( account_name_type )
{
FC_ASSERT( false );
}

vector< rc::rc_indel_edge_api_object > remote_node_api::list_rc_delegations( account_name_type, uint32_t, rc::sort_order_type )
{
FC_ASSERT( false );
}


} }
39 changes: 39 additions & 0 deletions libraries/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2881,4 +2881,43 @@ condenser_api::legacy_signed_transaction wallet_api::follow( string follower, st
return my->sign_transaction( trx, broadcast );
}

vector< rc::rc_account_api_object > wallet_api::find_rc_accounts( vector< account_name_type > accounts )
{
return my->_remote_api->find_rc_accounts( accounts );
}

vector< rc::rc_account_api_object > wallet_api::list_rc_accounts(
account_name_type account,
uint32_t limit,
rc::sort_order_type order )
{
return my->_remote_api->list_rc_accounts( account, limit, order );
}

vector< rc::rc_delegation_pool_api_object > wallet_api::find_rc_delegation_pools( vector< account_name_type > accounts )
{
return my->_remote_api->find_rc_delegation_pools( accounts );
}

vector< rc::rc_delegation_pool_api_object > wallet_api::list_rc_delegation_pools(
account_name_type account,
uint32_t limit,
rc::sort_order_type order )
{
return my->_remote_api->list_rc_delegation_pools( account, limit, order );
}

vector< rc::rc_indel_edge_api_object > wallet_api::find_rc_delegations( account_name_type account )
{
return my->_remote_api->find_rc_delegations( account );
}

vector< rc::rc_indel_edge_api_object > wallet_api::list_rc_delegations(
account_name_type account,
uint32_t limit,
rc::sort_order_type order )
{
return my->_remote_api->list_rc_delegations( account, limit, order );
}

} } // steem::wallet

0 comments on commit bbcecbf

Please sign in to comment.