29 namespace graphene {
namespace wallet {
namespace detail {
38 return "RIPEMD160 " + hash.
str();
43 return "SHA1 " + hash.
str();
48 return "SHA256 " + hash.
str();
52 return "HASH160 " + hash.
str();
58 return wallet.get_asset(a.
asset_id).amount_to_pretty_string(a);
63 out <<
" (Fee: " << format_asset(a) <<
")";
69 std::string str_result = result.visit(rprinter);
70 if( str_result !=
"" )
72 out <<
" result: " << str_result;
81 if( wallet.is_locked() )
83 out <<
" -- Unlock wallet to see memo.";
86 FC_ASSERT( wallet._keys.count(memo->
to) > 0 || wallet._keys.count(memo->
from) > 0,
87 "Memo is encrypted to a key ${to} or ${from} not in this wallet.",
88 (
"to", memo->
to)(
"from",memo->
from) );
89 if( wallet._keys.count(memo->
to) > 0 ) {
91 FC_ASSERT(my_key,
"Unable to recover private key to decrypt memo. Wallet may be corrupted.");
93 out <<
" -- Memo: " << outstr;
96 FC_ASSERT(my_key,
"Unable to recover private key to decrypt memo. Wallet may be corrupted.");
98 out <<
" -- Memo: " << outstr;
101 out <<
" -- could not decrypt memo";
110 if (preimage.size() == 0)
112 out <<
" with preimage \"";
114 auto flags = out.flags();
115 out << std::hex << setw(2) << setfill(
'0');
116 for (
size_t i = 0; i < std::min<size_t>(300, preimage.size()); i++)
119 if (preimage.size() > 300)
120 out <<
"...(truncated due to size)";
125 const std::string& redeemer,
const std::vector<char>& preimage,
128 out << redeemer <<
" redeemed HTLC with id " 129 << std::string( static_cast<object_id_type>(
id));
130 print_preimage( preimage );
136 auto receiver = wallet.get_account( op.
to );
139 <<
" received " << format_asset( op.
amount ) <<
" from blinded balance";
144 auto sender = wallet.get_account( op.
from );
147 <<
" sent " << format_asset( op.
amount ) <<
" to " << op.
outputs.size()
148 <<
" blinded balance" << (op.
outputs.size()>1?
"s":
"");
155 out <<
"Transfer " << format_asset(op.
amount)
156 <<
" from " << wallet.get_account(op.
from).name <<
" to " << wallet.get_account(op.
to).name;
157 std::string memo = print_memo( op.
memo );
164 out << wallet.get_account(op.
issuer).name
165 <<
" force-transfer " << format_asset(op.
amount)
166 <<
" from " << wallet.get_account(op.
from).name <<
" to " << wallet.get_account(op.
to).name;
167 std::string memo = print_memo( op.
memo );
174 out <<
"Create Account '" << op.
name <<
"' with registrar " 175 << wallet.get_account(op.
registrar).name <<
" and referrer " 176 << wallet.get_account(op.
referrer).name;
184 out <<
"Update Account '" << wallet.get_account(op.
account).name <<
"'";
195 out <<
"User-Issue Asset ";
196 out <<
"'" << op.
symbol <<
"' with issuer " << wallet.get_account(op.
issuer).name;
204 out <<
"Update asset '" << wallet.get_asset(op.
asset_to_update).symbol <<
"'";
211 out <<
"Update bitasset options of '" << wallet.get_asset(op.
asset_to_update).symbol <<
"'";
218 out << wallet.get_account(op.
issuer).name
221 std::string memo = print_memo( op.
memo );
235 out <<
"Force-settle " << format_asset(op.
amount);
243 out <<
"Fund " << format_asset(op.
amount) <<
" into asset fee pool of " 244 << wallet.get_asset(op.
asset_id).symbol;
252 out <<
"Claim " << format_asset(op.
amount_to_claim) <<
" from asset fee pool of " 253 << wallet.get_asset(op.
asset_id).symbol;
261 out <<
"Update price feed producers of asset " << wallet.get_asset(op.
asset_to_update).symbol
263 vector<string> accounts;
267 accounts.push_back( wallet.get_account( account_id ).name );
287 out <<
"Adjust debt position with delta debt amount " << format_asset(op.
delta_debt)
296 out <<
"Create limit order to sell " << format_asset(op.
amount_to_sell)
305 out <<
"Cancel limit order " << std::string( static_cast<object_id_type>(op.
order) );
313 out <<
"Pays " << format_asset(op.
pays) <<
" for " << format_asset(op.
receives)
314 <<
" for order " << std::string( static_cast<object_id_type>(op.
order_id) )
315 <<
" as " << ( op.
is_maker ?
"maker" :
"taker" );
323 out <<
"Update proposal " << std::string( static_cast<object_id_type>(op.
proposal) );
344 auto fee_asset = wallet.get_asset( op.
fee.
asset_id );
345 auto to = wallet.get_account( op.
to );
346 auto from = wallet.get_account( op.
from );
348 std::string database_id = result.visit(rprinter);
350 out <<
"Create HTLC from " << from.name <<
" to " << to.name
351 <<
" with id " << database_id
355 int32_t pending_blocks = hist.block_num - wallet.get_dynamic_global_properties().last_irreversible_block_num;
356 if (pending_blocks > 0)
357 out <<
" (pending " <<
std::to_string(pending_blocks) <<
" blocks)";
369 return std::string(oid);
374 return _wallet.get_asset(a.
asset_id).amount_to_pretty_string(a);
static string to_string(const variant &v, output_formatting format=stringify_large_ints_and_doubles, uint32_t max_depth=DEFAULT_MAX_RECURSION_DEPTH)
account_id_type registrar
This account pays the fee. Must be a lifetime member.
Update the set of feed-producing accounts for a BitAssetBitAssets have price feeds selected by taking...
optional< memo_data > memo
result_type operator()(const fc::sha256 &hash) const
account_id_type from
Account to transfer asset from.
flat_set< account_id_type > new_feed_producers
asset_id_type asset_to_update
asset amount
Amount of asset to force settle. This must be a market-issued asset.
std::vector< char > preimage
fc::optional< fc::ecc::private_key > wif_to_key(const std::string &wif_key)
std::string operator()(const T &op) const
std::string print_memo(const fc::optional< graphene::protocol::memo_data > &memo) const
Update an existing account.
Used to generate a useful error report when an exception is thrown.At each level in the stack where t...
Schedules a market-issued asset for automatic settlementHolders of market-issued assests may request ...
result_type operator()(const fc::ripemd160 &hash) const
std::string get_message(const fc::ecc::private_key &priv, const fc::ecc::public_key &pub) const
asset_id_type asset_to_update
visitor::result_type visit(visitor &v)
asset delta_collateral
the amount of collateral to add to the margin position
Publish price feeds for market-issued assetsPrice feed providers use this operation to publish their ...
Allows the issuer of an asset to transfer an asset from any account to any account if they have overr...
extension< additional_options_type > extensions
asset amount
The amount of asset to transfer from from to to.
string symbol
The ticker symbol of this asset.
used to take an asset out of circulation, returning to the issuer
void print_result() const
Transfers an amount of one asset from one account to another.
Converts blinded/stealth balance to a public account balance.
account_id_type referrer
This account receives a portion of the fee split between registrar and referrer. Must be a member...
instructs the blockchain to attempt to sell one asset for anotherThe blockchain will atempt to sell a...
Update options specific to BitAssetsBitAssets have some options which are not relevant to other asset...
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
optional< memo_data > memo
User provided data encrypted to the memo key of the "to" account.
std::string operator()(const graphene::protocol::void_result &x) const
account_id_type issuer
Must be asset_to_issue->asset_id->issuer.
Update options common to all assetsThere are a number of options which all assets in the network use...
std::vector< char > preimage
result_type operator()(const fc::sha1 &hash) const
account_id_type issuer
This account must sign and pay the fee for this operation. Later, this account may update the asset...
optional< memo_data > memo
User provided data encrypted to the memo key of the "to" account.
asset_id_type asset_to_update
Transfers BTS from the fee pool of a specified asset back to the issuer's balance.
share_type amount
core asset
void print_redeem(const graphene::protocol::htlc_id_type &id, const std::string &redeemer, const std::vector< char > &preimage, const graphene::protocol::asset &op_fee) const
proposal_id_type proposal
account_id_type to
Account to transfer asset to.
account_id_type account
The account to update.
void print_preimage(const std::vector< char > &preimage) const
asset amount
The amount of asset to transfer from from to to.
std::string to_string(double)
asset delta_debt
the amount of the debt to be paid off, may be negative to issue new debt
The proposal_update_operation updates an existing transaction proposalThis operation allows accounts ...
optional< bitasset_options > bitasset_opts
Options only available for BitAssets. MUST be non-null if and only if the asset is market-issued...
account_id_type from
Account to transfer asset from.
vector< blind_output > outputs
limit_order_id_type order
asset amount_to_claim
fee.asset_id must != asset_id
result_type operator()(const fc::hash160 &hash) const
asset fee
paid for by publisher
account_id_type to
Account to transfer asset to.
Converts public account balance to a blinded or stealth balance.
account_id_type issue_to_account