From 699144c173bd80a53beb1c0d9f45353630e1c696 Mon Sep 17 00:00:00 2001 From: Scott Howard Date: Fri, 30 Oct 2015 17:11:34 -0400 Subject: [PATCH] add cancel_order to wallet api --- libraries/wallet/include/graphene/wallet/wallet.hpp | 9 +++++++++ libraries/wallet/wallet.cpp | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/libraries/wallet/include/graphene/wallet/wallet.hpp b/libraries/wallet/include/graphene/wallet/wallet.hpp index 952b1b33..4d2c2d82 100644 --- a/libraries/wallet/include/graphene/wallet/wallet.hpp +++ b/libraries/wallet/include/graphene/wallet/wallet.hpp @@ -847,6 +847,14 @@ class wallet_api signed_transaction borrow_asset(string borrower_name, string amount_to_borrow, string asset_symbol, string amount_of_collateral, bool broadcast = false); + /** Cancel an existing order + * + * @param order_id the id of order to be cancelled + * @param broadcast true to broadcast the transaction on the network + * @returns the signed transaction canceling the order + */ + signed_transaction cancel_order(object_id_type order_id, bool broadcast = false); + /** Creates a new user-issued or market-issued asset. * * Many options can be changed later using \c update_asset() @@ -1488,6 +1496,7 @@ FC_API( graphene::wallet::wallet_api, (create_account_with_brain_key) (sell_asset) (borrow_asset) + (cancel_order) (transfer) (transfer2) (get_transaction_id) diff --git a/libraries/wallet/wallet.cpp b/libraries/wallet/wallet.cpp index 3858f4c1..96c8263b 100644 --- a/libraries/wallet/wallet.cpp +++ b/libraries/wallet/wallet.cpp @@ -3453,6 +3453,12 @@ signed_transaction wallet_api::borrow_asset(string seller_name, string amount_to return my->borrow_asset(seller_name, amount_to_sell, asset_symbol, amount_of_collateral, broadcast); } +signed_transaction wallet_api::cancel_order(object_id_type order_id, bool broadcast) +{ + FC_ASSERT(!is_locked()); + return my->cancel_order(order_id, broadcast); +} + string wallet_api::get_key_label( public_key_type key )const { auto key_itr = my->_wallet.labeled_keys.get().find(key);