Skip to content

Commit

Permalink
Merge pull request #39 from SophiaTX/bugfix/get_applications
Browse files Browse the repository at this point in the history
Added get_applications call to wallet and deamon
  • Loading branch information
MatusKysel authored Jun 26, 2018
2 parents db8e6bb + 32c9f8b commit f4278b3
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.idea
libraries/manifest/steem_manifest/__pycache__/
libraries/manifest/sophiatx_manifest/__pycache__/
cmake-build-debug
CMakeCache.txt
CMakeFiles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,28 +85,6 @@ class alexandria_api
*/
vector< account_name_type > get_active_witnesses()const;

/** Lists all accounts registered in the blockchain.
* This returns a list of all account names and their account ids, sorted by account name.
*
* Use the \c lowerbound and limit parameters to page through the list. To retrieve all accounts,
* start by setting \c lowerbound to the empty string \c "", and then each iteration, pass
* the last account name returned as the \c lowerbound for the next \c list_accounts() call.
*
* @param lowerbound the name of the first account to return. If the named account does not exist,
* the list will start at the account that comes after \c lowerbound
* @param limit the maximum number of accounts to return (max: 1000)
* @returns a list of accounts mapping account names to account ids
*/
vector< account_name_type > list_accounts(const string& lowerbound, uint32_t limit);

/** Returns the block chain's rapidly-changing properties.
* The returned object contains information that changes every block interval
* such as the head block number, the next witness, etc.
* @see \c get_global_properties() for less-frequently changing properties
* @returns the dynamic global properties
*/
condenser_api::extended_dynamic_global_properties get_dynamic_global_properties() const;

/** Returns information about the given account.
*
* @param account_name the name of the account to provide information about
Expand Down Expand Up @@ -406,6 +384,13 @@ class alexandria_api
* @return signle transaction with all the operations
*/
signed_transaction create_simple_transaction(operation op) const;

/**
* Get all app objects
* @param names - array of names of applications
* @return array of application objects
*/
vector< condenser_api::api_application_object > get_applications(vector<string> names);
};

} }
Expand All @@ -425,6 +410,8 @@ FC_API( sophiatx::wallet::alexandria_api,
(get_block)
(get_ops_in_block)
(get_feed_history)
(get_application_buyings)
(get_applications)

/// transaction api
(create_account)
Expand All @@ -442,7 +429,6 @@ FC_API( sophiatx::wallet::alexandria_api,
(delete_application)
(buy_application)
(cancel_application_buying)
(get_application_buyings)

/// helper api
(serialize_transaction)
Expand Down
5 changes: 5 additions & 0 deletions libraries/alexandria/lib_alexandria.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,5 +648,10 @@ operation alexandria_api::delete_account(string account_name) {
}FC_CAPTURE_AND_RETHROW( (account_name))
}

vector<condenser_api::api_application_object> alexandria_api::get_applications(vector<string> names) {
try{
return my->_remote_api->get_applications(names);
}FC_CAPTURE_AND_RETHROW((names))
}
} } // sophiatx::wallet

46 changes: 18 additions & 28 deletions libraries/wallet/include/sophiatx/wallet/wallet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,6 @@ class wallet_api
*/
vector< account_name_type > list_accounts(const string& lowerbound, uint32_t limit);

/** Returns the block chain's rapidly-changing properties.
* The returned object contains information that changes every block interval
* such as the head block number, the next witness, etc.
* @see \c get_global_properties() for less-frequently changing properties
* @returns the dynamic global properties
*/
condenser_api::extended_dynamic_global_properties get_dynamic_global_properties() const;

/** Returns information about the given account.
*
* @param account_name the name of the account to provide information about
Expand Down Expand Up @@ -644,25 +636,15 @@ class wallet_api
*/
annotated_signed_transaction transfer_to_vesting(string from, string to, asset amount, bool broadcast = false);

/**
* @param from - the account that initiated the transfer
* @param request_id - an unique ID assigned by from account, the id is used to cancel the operation and can be reused after the transfer completes
* @param to - the account getting the transfer
* @param amount - the amount of assets to be transfered
* @param memo A memo for the transactionm, encrypted with the to account's public memo key
* @param broadcast true if you wish to broadcast the transaction
*/
annotated_signed_transaction transfer_from_savings( string from, uint32_t request_id, string to, asset amount, string memo, bool broadcast = false );


/**
* Set up a vesting withdraw request. The request is fulfilled once a week over the next two year (104 weeks).
*
* @param from The account the VESTS are withdrawn from
* @param vesting_shares The amount of VESTS to withdraw over the next two years. Each week (amount/104) shares are
* withdrawn and deposited back as SOPHIATX. i.e. "10.000000 VESTS"
* @param broadcast true if you wish to broadcast the transaction
*/

/**
* Set up a vesting withdraw request. The request is fulfilled once a week over the next two year (104 weeks).
*
* @param from The account the VESTS are withdrawn from
* @param vesting_shares The amount of VESTS to withdraw over the next two years. Each week (amount/104) shares are
* withdrawn and deposited back as SOPHIATX. i.e. "10.000000 VESTS"
* @param broadcast true if you wish to broadcast the transaction
*/
annotated_signed_transaction withdraw_vesting( string from, asset vesting_shares, bool broadcast = false );

/**
Expand Down Expand Up @@ -823,6 +805,13 @@ class wallet_api
*/
vector< condenser_api::api_application_buying_object > get_application_buyings(string name, string search_type, uint32_t count);

/**
* Get all app objects
* @param names - array of names of applications
* @return array of application objects
*/
vector< condenser_api::api_application_object > get_applications(vector<string> names);


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

Expand Down Expand Up @@ -928,6 +917,8 @@ FC_API( sophiatx::wallet::wallet_api,
(get_feed_history)
(get_account_history)
(get_state)
(get_application_buyings)
(get_applications)

/// transaction api
(create_account)
Expand Down Expand Up @@ -964,7 +955,6 @@ FC_API( sophiatx::wallet::wallet_api,
(delete_application)
(buy_application)
(cancel_application_buying)
(get_application_buyings)

/// helper api
(get_prototype_operation)
Expand Down
6 changes: 6 additions & 0 deletions libraries/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1960,5 +1960,11 @@ annotated_signed_transaction wallet_api::delete_account(string account_name, boo
}FC_CAPTURE_AND_RETHROW( (account_name)(broadcast))
}

vector<condenser_api::api_application_object> wallet_api::get_applications(vector<string> names) {
try{
return my->_remote_api->get_applications(names);
}FC_CAPTURE_AND_RETHROW((names))
}

} } // sophiatx::wallet

0 comments on commit f4278b3

Please sign in to comment.