From 63c286a769364e9459f0c01f7a369a006461b215 Mon Sep 17 00:00:00 2001 From: Daniel Larimer Date: Thu, 22 Oct 2015 10:05:34 -0400 Subject: [PATCH] adding transfer2 API that also returns the transaction id --- libraries/wallet/include/graphene/wallet/wallet.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libraries/wallet/include/graphene/wallet/wallet.hpp b/libraries/wallet/include/graphene/wallet/wallet.hpp index aec9c63a..17226b0f 100644 --- a/libraries/wallet/include/graphene/wallet/wallet.hpp +++ b/libraries/wallet/include/graphene/wallet/wallet.hpp @@ -686,6 +686,18 @@ class wallet_api string memo, bool broadcast = false); + /** + * This method works just like transfer, except it always broadcasts and + * returns the transaction ID along with the signed transaction. + */ + pair transfer2(string from, + string to, + string amount, + string asset_symbol, + string memo ) { + auto trx = transfer( from, to, amount, asset_symbol, memo, true ); + return std::make_pair(trx.id(),trx); + } /** These methods are used for stealth transfers */ @@ -1470,6 +1482,7 @@ FC_API( graphene::wallet::wallet_api, (sell_asset) (borrow_asset) (transfer) + (transfer2) (create_asset) (update_asset) (update_bitasset)