BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
wallet_asset.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 Cryptonomex, Inc., and contributors.
3  *
4  * The MIT License
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  */
24 #include "wallet_api_impl.hpp"
26 
27 namespace graphene { namespace wallet { namespace detail {
28 
29  std::string wallet_api_impl::asset_id_to_string(asset_id_type id) const
30  {
31  std::string asset_id = fc::to_string(id.space_id) +
32  "." + fc::to_string(id.type_id) +
33  "." + fc::to_string(id.instance.value);
34  return asset_id;
35  }
36 
38  {
39  auto rec = _remote_db->get_assets({asset_id_to_string(id)}, {}).front();
40  return rec;
41  }
42 
44  {
45  FC_ASSERT( asset_symbol_or_id.size() > 0 );
46 
47  if( auto id = maybe_id<asset_id_type>(asset_symbol_or_id) )
48  {
49  // It's an ID
50  return find_asset(*id);
51  } else {
52  // It's a symbol
53  auto rec = _remote_db->lookup_asset_symbols({asset_symbol_or_id}).front();
54  if( rec )
55  {
56  if( rec->symbol != asset_symbol_or_id )
57  return optional<asset_object>();
58  }
59  return rec;
60  }
61  }
62 
64  {
65  auto opt = find_asset(id);
66  FC_ASSERT(opt);
67  return *opt;
68  }
69 
70  extended_asset_object wallet_api_impl::get_asset(string asset_symbol_or_id)const
71  {
72  auto opt = find_asset(asset_symbol_or_id);
73  FC_ASSERT(opt);
74  return *opt;
75  }
76 
77  asset_id_type wallet_api_impl::get_asset_id(const string& asset_symbol_or_id) const
78  {
79  FC_ASSERT( asset_symbol_or_id.size() > 0 );
80  vector<optional<extended_asset_object>> opt_asset;
81  if( std::isdigit( asset_symbol_or_id.front() ) )
82  return fc::variant(asset_symbol_or_id, 1).as<asset_id_type>( 1 );
83  opt_asset = _remote_db->lookup_asset_symbols( {asset_symbol_or_id} );
84  FC_ASSERT( (opt_asset.size() > 0) && (opt_asset[0].valid()) );
85  return opt_asset[0]->get_id();
86  }
87 
88  signed_transaction wallet_api_impl::create_asset(string issuer, string symbol,
89  uint8_t precision, asset_options common, fc::optional<bitasset_options> bitasset_opts,
90  bool broadcast )
91  { try {
92  account_object issuer_account = get_account( issuer );
93  FC_ASSERT(!find_asset(symbol).valid(), "Asset with that symbol already exists!");
94 
95  asset_create_operation create_op;
96  create_op.issuer = issuer_account.id;
97  create_op.symbol = symbol;
98  create_op.precision = precision;
99  create_op.common_options = common;
100  create_op.bitasset_opts = bitasset_opts;
101 
103  tx.operations.push_back( create_op );
104  set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees());
105  tx.validate();
106 
107  return sign_transaction( tx, broadcast );
108  } FC_CAPTURE_AND_RETHROW( (issuer)(symbol)(precision)(common)(bitasset_opts)(broadcast) ) }
109 
111  asset_options new_options, bool broadcast /* = false */)
112  { try {
113  optional<asset_object> asset_to_update = find_asset(symbol);
114  if (!asset_to_update)
115  FC_THROW("No asset with that symbol exists!");
116  optional<account_id_type> new_issuer_account_id;
117  if (new_issuer)
118  {
119  FC_THROW( "The use of 'new_issuer' is no longer supported. Please use `update_asset_issuer' instead!" );
120  }
121 
122  asset_update_operation update_op;
123  update_op.issuer = asset_to_update->issuer;
124  update_op.asset_to_update = asset_to_update->id;
125  update_op.new_issuer = new_issuer_account_id;
126  update_op.new_options = new_options;
127 
129  tx.operations.push_back( update_op );
130  set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees());
131  tx.validate();
132 
133  return sign_transaction( tx, broadcast );
134  } FC_CAPTURE_AND_RETHROW( (symbol)(new_issuer)(new_options)(broadcast) ) }
135 
137  bool broadcast /* = false */)
138  { try {
139  optional<asset_object> asset_to_update = find_asset(symbol);
140  if (!asset_to_update)
141  FC_THROW("No asset with that symbol exists!");
142 
143  account_object new_issuer_account = get_account(new_issuer);
144 
145  asset_update_issuer_operation update_issuer;
146  update_issuer.issuer = asset_to_update->issuer;
147  update_issuer.asset_to_update = asset_to_update->id;
148  update_issuer.new_issuer = new_issuer_account.id;
149 
151  tx.operations.push_back( update_issuer );
152  set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees());
153  tx.validate();
154 
155  return sign_transaction( tx, broadcast );
156  } FC_CAPTURE_AND_RETHROW( (symbol)(new_issuer)(broadcast) ) }
157 
159  bool broadcast /* = false */)
160  { try {
161  optional<asset_object> asset_to_update = find_asset(symbol);
162  if (!asset_to_update)
163  FC_THROW("No asset with that symbol exists!");
164 
166  update_op.issuer = asset_to_update->issuer;
167  update_op.asset_to_update = asset_to_update->id;
168  update_op.new_options = new_options;
169 
171  tx.operations.push_back( update_op );
172  set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees());
173  tx.validate();
174 
175  return sign_transaction( tx, broadcast );
176  } FC_CAPTURE_AND_RETHROW( (symbol)(new_options)(broadcast) ) }
177 
179  flat_set<string> new_feed_producers, bool broadcast /* = false */)
180  { try {
181  optional<asset_object> asset_to_update = find_asset(symbol);
182  if (!asset_to_update)
183  FC_THROW("No asset with that symbol exists!");
184 
186  update_op.issuer = asset_to_update->issuer;
187  update_op.asset_to_update = asset_to_update->id;
188  update_op.new_feed_producers.reserve(new_feed_producers.size());
189  std::transform(new_feed_producers.begin(), new_feed_producers.end(),
190  std::inserter(update_op.new_feed_producers, update_op.new_feed_producers.end()),
191  [this](const std::string& account_name_or_id){ return get_account_id(account_name_or_id); });
192 
194  tx.operations.push_back( update_op );
195  set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees());
196  tx.validate();
197 
198  return sign_transaction( tx, broadcast );
199  } FC_CAPTURE_AND_RETHROW( (symbol)(new_feed_producers)(broadcast) ) }
200 
201  signed_transaction wallet_api_impl::publish_asset_feed(string publishing_account, string symbol,
202  price_feed feed, bool broadcast /* = false */)
203  { try {
204  optional<asset_object> asset_to_update = find_asset(symbol);
205  if (!asset_to_update)
206  FC_THROW("No asset with that symbol exists!");
207 
208  asset_publish_feed_operation publish_op;
209  publish_op.publisher = get_account_id(publishing_account);
210  publish_op.asset_id = asset_to_update->id;
211  publish_op.feed = feed;
212 
214  tx.operations.push_back( publish_op );
215  set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees());
216  tx.validate();
217 
218  return sign_transaction( tx, broadcast );
219  } FC_CAPTURE_AND_RETHROW( (publishing_account)(symbol)(feed)(broadcast) ) }
220 
221  signed_transaction wallet_api_impl::fund_asset_fee_pool(string from, string symbol, string amount,
222  bool broadcast /* = false */)
223  { try {
224  account_object from_account = get_account(from);
225  optional<asset_object> asset_to_fund = find_asset(symbol);
226  if (!asset_to_fund)
227  FC_THROW("No asset with that symbol exists!");
228  auto core_asset = get_asset(asset_id_type());
229 
231  fund_op.from_account = from_account.id;
232  fund_op.asset_id = asset_to_fund->id;
233  fund_op.amount = core_asset.amount_from_string(amount).amount;
234 
236  tx.operations.push_back( fund_op );
237  set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees());
238  tx.validate();
239 
240  return sign_transaction( tx, broadcast );
241  } FC_CAPTURE_AND_RETHROW( (from)(symbol)(amount)(broadcast) ) }
242 
244  bool broadcast /* = false */)
245  { try {
246  optional<asset_object> asset_pool_to_claim = find_asset(symbol);
247  if (!asset_pool_to_claim)
248  FC_THROW("No asset with that symbol exists!");
249  auto core_asset = get_asset(asset_id_type());
250 
252  claim_op.issuer = asset_pool_to_claim->issuer;
253  claim_op.asset_id = asset_pool_to_claim->id;
254  claim_op.amount_to_claim = core_asset.amount_from_string(amount).amount;
255 
257  tx.operations.push_back( claim_op );
258  set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees());
259  tx.validate();
260 
261  return sign_transaction( tx, broadcast );
262  } FC_CAPTURE_AND_RETHROW( (symbol)(amount)(broadcast) ) }
263 
264 
265  signed_transaction wallet_api_impl::reserve_asset(string from, string amount, string symbol,
266  bool broadcast /* = false */)
267  { try {
268  account_object from_account = get_account(from);
269  optional<asset_object> asset_to_reserve = find_asset(symbol);
270  if (!asset_to_reserve)
271  FC_THROW("No asset with that symbol exists!");
272 
273  asset_reserve_operation reserve_op;
274  reserve_op.payer = from_account.id;
275  reserve_op.amount_to_reserve = asset_to_reserve->amount_from_string(amount);
276 
278  tx.operations.push_back( reserve_op );
279  set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees());
280  tx.validate();
281 
282  return sign_transaction( tx, broadcast );
283  } FC_CAPTURE_AND_RETHROW( (from)(amount)(symbol)(broadcast) ) }
284 
286  bool broadcast /* = false */)
287  { try {
288  optional<asset_object> asset_to_settle = find_asset(symbol);
289  if (!asset_to_settle)
290  FC_THROW("No asset with that symbol exists!");
291 
293  settle_op.issuer = asset_to_settle->issuer;
294  settle_op.asset_to_settle = asset_to_settle->id;
295  settle_op.settle_price = settle_price;
296 
298  tx.operations.push_back( settle_op );
299  set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees());
300  tx.validate();
301 
302  return sign_transaction( tx, broadcast );
303  } FC_CAPTURE_AND_RETHROW( (symbol)(settle_price)(broadcast) ) }
304 
305  signed_transaction wallet_api_impl::settle_asset(string account_to_settle, string amount_to_settle,
306  string symbol, bool broadcast /* = false */)
307  { try {
308  optional<asset_object> asset_to_settle = find_asset(symbol);
309  if (!asset_to_settle)
310  FC_THROW("No asset with that symbol exists!");
311 
312  asset_settle_operation settle_op;
313  settle_op.account = get_account_id(account_to_settle);
314  settle_op.amount = asset_to_settle->amount_from_string(amount_to_settle);
315 
317  tx.operations.push_back( settle_op );
318  set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees());
319  tx.validate();
320 
321  return sign_transaction( tx, broadcast );
322  } FC_CAPTURE_AND_RETHROW( (account_to_settle)(amount_to_settle)(symbol)(broadcast) ) }
323 
324  signed_transaction wallet_api_impl::issue_asset(string to_account, string amount, string symbol,
325  string memo, bool broadcast )
326  {
327  auto asset_obj = get_asset(symbol);
328 
329  account_object to = get_account(to_account);
330  account_object issuer = get_account(asset_obj.issuer);
331 
332  asset_issue_operation issue_op;
333  issue_op.issuer = asset_obj.issuer;
334  issue_op.asset_to_issue = asset_obj.amount_from_string(amount);
335  issue_op.issue_to_account = to.id;
336 
337  if( memo.size() )
338  {
339  issue_op.memo = memo_data();
340  issue_op.memo->from = issuer.options.memo_key;
341  issue_op.memo->to = to.options.memo_key;
342  issue_op.memo->set_message(get_private_key(issuer.options.memo_key),
343  to.options.memo_key, memo);
344  }
345 
347  tx.operations.push_back(issue_op);
348  set_operation_fees(tx,_remote_db->get_global_properties().parameters.get_current_fees());
349  tx.validate();
350 
351  return sign_transaction(tx, broadcast);
352  }
353 
354  signed_transaction wallet_api_impl::bid_collateral(string bidder_name, string debt_amount, string debt_symbol,
355  string additional_collateral, bool broadcast )
356  { try {
357  optional<asset_object> debt_asset = find_asset(debt_symbol);
358  if (!debt_asset)
359  FC_THROW("No asset with that symbol exists!");
360 
361  FC_ASSERT(debt_asset->bitasset_data_id.valid(), "Not a bitasset, bidding not possible.");
362  const asset_object& collateral =
363  get_asset(get_object(*debt_asset->bitasset_data_id).options.short_backing_asset);
364 
366  op.bidder = get_account_id(bidder_name);
367  op.debt_covered = debt_asset->amount_from_string(debt_amount);
368  op.additional_collateral = collateral.amount_from_string(additional_collateral);
369 
371  tx.operations.push_back( op );
372  set_operation_fees( tx, _remote_db->get_global_properties().parameters.get_current_fees());
373  tx.validate();
374 
375  return sign_transaction( tx, broadcast );
376  } FC_CAPTURE_AND_RETHROW( (bidder_name)(debt_amount)(debt_symbol)(additional_collateral)(broadcast) ) }
377 
378 
379 }}} // namespace graphene::wallet::detail
graphene::wallet::detail::wallet_api_impl::create_asset
signed_transaction create_asset(string issuer, string symbol, uint8_t precision, asset_options common, fc::optional< bitasset_options > bitasset_opts, bool broadcast=false)
Definition: wallet_asset.cpp:88
graphene::protocol::bid_collateral_operation::bidder
account_id_type bidder
pays fee and additional collateral
Definition: market.hpp:247
graphene::protocol::asset_create_operation::issuer
account_id_type issuer
This account must sign and pay the fee for this operation. Later, this account may update the asset.
Definition: asset_ops.hpp:203
graphene::protocol::transaction::operations
vector< operation > operations
Definition: transaction.hpp:89
FC_CAPTURE_AND_RETHROW
#define FC_CAPTURE_AND_RETHROW(...)
Definition: exception.hpp:479
graphene::wallet::detail::wallet_api_impl::get_asset_id
asset_id_type get_asset_id(const string &asset_symbol_or_id) const
Definition: wallet_asset.cpp:77
graphene::db::object::id
object_id_type id
Definition: object.hpp:69
graphene::protocol::asset_update_issuer_operation::issuer
account_id_type issuer
Definition: asset_ops.hpp:572
graphene::wallet::detail::wallet_api_impl::issue_asset
signed_transaction issue_asset(string to_account, string amount, string symbol, string memo, bool broadcast=false)
Definition: wallet_asset.cpp:324
graphene::wallet::detail::wallet_api_impl::get_asset
extended_asset_object get_asset(asset_id_type id) const
Definition: wallet_asset.cpp:63
graphene::protocol::asset_issue_operation::memo
optional< memo_data > memo
Definition: asset_ops.hpp:499
graphene::chain::asset_object::bitasset_data_id
optional< asset_bitasset_data_id_type > bitasset_data_id
Extra data associated with BitAssets. This field is non-null if and only if is_market_issued() return...
Definition: asset_object.hpp:142
fc::to_string
std::string to_string(double)
Definition: string.cpp:73
graphene::protocol::bid_collateral_operation
Definition: market.hpp:241
graphene::protocol::price
The price struct stores asset prices in the BitShares system.
Definition: asset.hpp:108
graphene::wallet::detail::wallet_api_impl::get_account_id
account_id_type get_account_id(string account_name_or_id) const
Definition: wallet_account.cpp:217
graphene::wallet::detail::wallet_api_impl::get_private_key
fc::ecc::private_key get_private_key(const public_key_type &id) const
Definition: wallet_sign.cpp:406
graphene::app::extended_asset_object
Definition: api_objects.hpp:161
FC_THROW
#define FC_THROW( ...)
Definition: exception.hpp:366
graphene::protocol::asset_update_issuer_operation::asset_to_update
asset_id_type asset_to_update
Definition: asset_ops.hpp:573
graphene::wallet::detail::wallet_api_impl::_remote_db
fc::api< database_api > _remote_db
Definition: wallet_api_impl.hpp:414
graphene::protocol::asset_reserve_operation::payer
account_id_type payer
Definition: asset_ops.hpp:518
graphene::wallet::detail::wallet_api_impl::update_asset_feed_producers
signed_transaction update_asset_feed_producers(string symbol, flat_set< string > new_feed_producers, bool broadcast)
Definition: wallet_asset.cpp:178
graphene::wallet::detail::wallet_api_impl::reserve_asset
signed_transaction reserve_asset(string from, string amount, string symbol, bool broadcast)
Definition: wallet_asset.cpp:265
graphene::protocol::asset_create_operation::bitasset_opts
optional< bitasset_options > bitasset_opts
Options only available for BitAssets. MUST be non-null if and only if the asset is market-issued.
Definition: asset_ops.hpp:217
graphene::protocol::asset_update_issuer_operation
Update issuer of an asset.
Definition: asset_ops.hpp:565
graphene::chain::asset_object
tracks the parameters of an asset
Definition: asset_object.hpp:75
graphene::wallet::detail::wallet_api_impl::sign_transaction
signed_transaction sign_transaction(signed_transaction tx, bool broadcast=false)
Definition: wallet_sign.cpp:336
graphene::wallet::detail::wallet_api_impl::set_operation_fees
void set_operation_fees(signed_transaction &tx, const fee_schedule &s) const
Definition: wallet_api_impl.cpp:197
graphene::protocol::asset_publish_feed_operation::asset_id
asset_id_type asset_id
asset for which the feed is published
Definition: asset_ops.hpp:474
graphene::wallet::detail::wallet_api_impl::update_asset
signed_transaction update_asset(string symbol, optional< string > new_issuer, asset_options new_options, bool broadcast)
Definition: wallet_asset.cpp:110
graphene::protocol::bid_collateral_operation::debt_covered
asset debt_covered
the amount of debt to take over
Definition: market.hpp:249
wallet_api_impl.hpp
graphene::protocol::bid_collateral_operation::additional_collateral
asset additional_collateral
the amount of collateral to bid for the debt
Definition: market.hpp:248
graphene::protocol::asset_options
The asset_options struct contains options available on all assets in the network.
Definition: asset_ops.hpp:47
graphene::chain::asset_object::amount_from_string
asset amount_from_string(string amount_string) const
Definition: asset_object.cpp:152
graphene::protocol::asset_update_operation::asset_to_update
asset_id_type asset_to_update
Definition: asset_ops.hpp:372
graphene::protocol::bitasset_options
The bitasset_options struct contains configurable options available only to BitAssets.
Definition: asset_ops.hpp:109
graphene::wallet::detail::wallet_api_impl::get_account
account_object get_account(account_id_type id) const
Definition: wallet_account.cpp:193
graphene::protocol::asset_claim_pool_operation::asset_id
asset_id_type asset_id
Definition: asset_ops.hpp:609
graphene::protocol::asset_issue_operation::issuer
account_id_type issuer
Must be asset_to_issue->asset_id->issuer.
Definition: asset_ops.hpp:493
graphene::protocol::signed_transaction
adds a signature to a transaction
Definition: transaction.hpp:134
graphene::protocol::asset_update_bitasset_operation::new_options
bitasset_options new_options
Definition: asset_ops.hpp:406
graphene::wallet::detail::wallet_api_impl::asset_id_to_string
std::string asset_id_to_string(asset_id_type id) const
Definition: wallet_asset.cpp:29
graphene::chain::account_object::options
account_options options
Definition: account_object.hpp:222
graphene::protocol::asset_reserve_operation
used to take an asset out of circulation, returning to the issuer
Definition: asset_ops.hpp:513
graphene::protocol::asset_update_operation
Update options common to all assets.
Definition: asset_ops.hpp:351
fc::optional::valid
bool valid() const
Definition: optional.hpp:186
wallet.hpp
graphene::protocol::asset_settle_operation::account
account_id_type account
Account requesting the force settlement. This account pays the fee.
Definition: asset_ops.hpp:281
graphene::protocol::asset_global_settle_operation::asset_to_settle
asset_id_type asset_to_settle
Definition: asset_ops.hpp:244
graphene::chain::account_object
This class represents an account on the object graph.
Definition: account_object.hpp:180
graphene::protocol::asset_create_operation::precision
uint8_t precision
Number of digits to the right of decimal point, must be less than or equal to 12.
Definition: asset_ops.hpp:207
graphene::protocol::asset_claim_pool_operation::issuer
account_id_type issuer
Definition: asset_ops.hpp:608
graphene::wallet::detail::wallet_api_impl::settle_asset
signed_transaction settle_asset(string account_to_settle, string amount_to_settle, string symbol, bool broadcast)
Definition: wallet_asset.cpp:305
graphene::protocol::asset_issue_operation::asset_to_issue
asset asset_to_issue
Definition: asset_ops.hpp:494
graphene::protocol::account_options::memo_key
public_key_type memo_key
Definition: account.hpp:44
fc::variant::as
T as(uint32_t max_depth) const
Definition: variant.hpp:337
graphene::protocol::price_feed
defines market parameters for margin positions
Definition: asset.hpp:160
graphene::wallet::detail::wallet_api_impl::global_settle_asset
signed_transaction global_settle_asset(string symbol, price settle_price, bool broadcast)
Definition: wallet_asset.cpp:285
graphene::protocol::asset_publish_feed_operation::publisher
account_id_type publisher
Definition: asset_ops.hpp:473
graphene::protocol::asset_update_bitasset_operation
Update options specific to BitAssets.
Definition: asset_ops.hpp:398
graphene::protocol::asset_create_operation::symbol
string symbol
The ticker symbol of this asset.
Definition: asset_ops.hpp:205
graphene::protocol::asset_publish_feed_operation
Publish price feeds for market-issued assets.
Definition: asset_ops.hpp:462
graphene::wallet::detail::wallet_api_impl::claim_asset_fee_pool
signed_transaction claim_asset_fee_pool(string symbol, string amount, bool broadcast)
Definition: wallet_asset.cpp:243
fc::typelist::transform
typename impl::transform< List, Transformer >::type transform
Transform elements of a typelist.
Definition: typelist.hpp:170
graphene::wallet::detail::wallet_api_impl::find_asset
optional< extended_asset_object > find_asset(asset_id_type id) const
Definition: wallet_asset.cpp:37
graphene::protocol::asset_issue_operation::issue_to_account
account_id_type issue_to_account
Definition: asset_ops.hpp:495
graphene::protocol::asset_update_operation::new_options
asset_options new_options
Definition: asset_ops.hpp:376
graphene::protocol::asset_reserve_operation::amount_to_reserve
asset amount_to_reserve
Definition: asset_ops.hpp:519
FC_ASSERT
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
Definition: exception.hpp:345
graphene::chain::asset_object::issuer
account_id_type issuer
ID of the account which issued this asset.
Definition: asset_object.hpp:135
graphene::protocol::asset_update_operation::issuer
account_id_type issuer
Definition: asset_ops.hpp:371
graphene::protocol::asset_update_feed_producers_operation
Update the set of feed-producing accounts for a BitAsset.
Definition: asset_ops.hpp:430
graphene::protocol::transaction::validate
virtual void validate() const
Definition: transaction.cpp:58
fc::variant
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Definition: variant.hpp:198
graphene::protocol::asset_settle_operation
Schedules a market-issued asset for automatic settlement.
Definition: asset_ops.hpp:267
graphene::protocol::asset_update_feed_producers_operation::asset_to_update
asset_id_type asset_to_update
Definition: asset_ops.hpp:436
graphene::protocol::asset_create_operation::common_options
asset_options common_options
Definition: asset_ops.hpp:215
graphene::wallet::detail::wallet_api_impl::fund_asset_fee_pool
signed_transaction fund_asset_fee_pool(string from, string symbol, string amount, bool broadcast)
Definition: wallet_asset.cpp:221
graphene::protocol::asset::amount
share_type amount
Definition: asset.hpp:36
graphene::protocol::asset_global_settle_operation::settle_price
price settle_price
Definition: asset_ops.hpp:245
graphene::protocol::asset_update_feed_producers_operation::new_feed_producers
flat_set< account_id_type > new_feed_producers
Definition: asset_ops.hpp:438
graphene::protocol::asset_update_bitasset_operation::asset_to_update
asset_id_type asset_to_update
Definition: asset_ops.hpp:404
graphene::wallet::detail::wallet_api_impl::bid_collateral
signed_transaction bid_collateral(string bidder_name, string debt_amount, string debt_symbol, string additional_collateral, bool broadcast)
Definition: wallet_asset.cpp:354
graphene::wallet::detail::wallet_api_impl::get_object
graphene::db::object_downcast_t< const ID & > get_object(const ID &id) const
Definition: wallet_api_impl.hpp:129
graphene::protocol::asset_fund_fee_pool_operation::amount
share_type amount
core asset
Definition: asset_ops.hpp:329
graphene::wallet::detail::wallet_api_impl::publish_asset_feed
signed_transaction publish_asset_feed(string publishing_account, string symbol, price_feed feed, bool broadcast)
Definition: wallet_asset.cpp:201
graphene::protocol::memo_data
defines the keys used to derive the shared secret
Definition: memo.hpp:40
graphene::protocol::asset_fund_fee_pool_operation
Definition: asset_ops.hpp:322
graphene::protocol::asset_update_bitasset_operation::issuer
account_id_type issuer
Definition: asset_ops.hpp:403
graphene::protocol::asset_fund_fee_pool_operation::from_account
account_id_type from_account
Definition: asset_ops.hpp:327
graphene::wallet::detail::wallet_api_impl::update_asset_issuer
signed_transaction update_asset_issuer(string symbol, string new_issuer, bool broadcast)
Definition: wallet_asset.cpp:136
fc::optional
provides stack-based nullable value similar to boost::optional
Definition: optional.hpp:20
graphene::wallet::detail::wallet_api_impl::update_bitasset
signed_transaction update_bitasset(string symbol, bitasset_options new_options, bool broadcast)
Definition: wallet_asset.cpp:158
graphene::protocol::asset_global_settle_operation::issuer
account_id_type issuer
must equal issuer of asset_to_settle
Definition: asset_ops.hpp:243
graphene::protocol::asset_update_feed_producers_operation::issuer
account_id_type issuer
Definition: asset_ops.hpp:435
graphene::protocol::asset_update_operation::new_issuer
optional< account_id_type > new_issuer
If the asset is to be given a new issuer, specify his ID here.
Definition: asset_ops.hpp:375
graphene::protocol::asset_issue_operation
Definition: asset_ops.hpp:485
graphene::protocol::asset_update_issuer_operation::new_issuer
account_id_type new_issuer
Definition: asset_ops.hpp:574
graphene::protocol::asset_global_settle_operation
allows global settling of bitassets (black swan or prediction markets)
Definition: asset_ops.hpp:238
graphene
Definition: api.cpp:48
graphene::protocol::asset_create_operation
Definition: asset_ops.hpp:192
graphene::protocol::asset_claim_pool_operation::amount_to_claim
asset amount_to_claim
fee.asset_id must != asset_id
Definition: asset_ops.hpp:610
graphene::protocol::asset_claim_pool_operation
Transfers BTS from the fee pool of a specified asset back to the issuer's balance.
Definition: asset_ops.hpp:601
graphene::protocol::asset_fund_fee_pool_operation::asset_id
asset_id_type asset_id
Definition: asset_ops.hpp:328
graphene::protocol::asset_settle_operation::amount
asset amount
Amount of asset to force settle. This must be a market-issued asset.
Definition: asset_ops.hpp:283
graphene::protocol::asset_publish_feed_operation::feed
price_feed feed
Definition: asset_ops.hpp:475