BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
Go to the documentation of this file.
27 namespace graphene {
namespace wallet {
namespace detail {
45 FC_ASSERT( asset_symbol_or_id.size() > 0 );
47 if(
auto id = maybe_id<asset_id_type>(asset_symbol_or_id) )
53 auto rec =
_remote_db->lookup_asset_symbols({asset_symbol_or_id}).front();
56 if( rec->symbol != asset_symbol_or_id )
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();
96 create_op.
issuer = issuer_account.
id;
114 if (!asset_to_update)
115 FC_THROW(
"No asset with that symbol exists!");
119 FC_THROW(
"The use of 'new_issuer' is no longer supported. Please use `update_asset_issuer' instead!" );
140 if (!asset_to_update)
141 FC_THROW(
"No asset with that symbol exists!");
162 if (!asset_to_update)
163 FC_THROW(
"No asset with that symbol exists!");
179 flat_set<string> new_feed_producers,
bool broadcast )
182 if (!asset_to_update)
183 FC_THROW(
"No asset with that symbol exists!");
189 std::transform(new_feed_producers.begin(), new_feed_producers.end(),
191 [
this](
const std::string& account_name_or_id){ return get_account_id(account_name_or_id); });
205 if (!asset_to_update)
206 FC_THROW(
"No asset with that symbol exists!");
211 publish_op.
feed = feed;
227 FC_THROW(
"No asset with that symbol exists!");
228 auto core_asset =
get_asset(asset_id_type());
233 fund_op.
amount = core_asset.amount_from_string(amount).amount;
247 if (!asset_pool_to_claim)
248 FC_THROW(
"No asset with that symbol exists!");
249 auto core_asset =
get_asset(asset_id_type());
270 if (!asset_to_reserve)
271 FC_THROW(
"No asset with that symbol exists!");
274 reserve_op.
payer = from_account.
id;
289 if (!asset_to_settle)
290 FC_THROW(
"No asset with that symbol exists!");
306 string symbol,
bool broadcast )
309 if (!asset_to_settle)
310 FC_THROW(
"No asset with that symbol exists!");
325 string memo,
bool broadcast )
333 issue_op.
issuer = asset_obj.issuer;
355 string additional_collateral,
bool broadcast )
359 FC_THROW(
"No asset with that symbol exists!");
signed_transaction create_asset(string issuer, string symbol, uint8_t precision, asset_options common, fc::optional< bitasset_options > bitasset_opts, bool broadcast=false)
account_id_type bidder
pays fee and additional collateral
account_id_type issuer
This account must sign and pay the fee for this operation. Later, this account may update the asset.
vector< operation > operations
#define FC_CAPTURE_AND_RETHROW(...)
asset_id_type get_asset_id(const string &asset_symbol_or_id) const
signed_transaction issue_asset(string to_account, string amount, string symbol, string memo, bool broadcast=false)
extended_asset_object get_asset(asset_id_type id) const
optional< memo_data > memo
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...
std::string to_string(double)
The price struct stores asset prices in the BitShares system.
account_id_type get_account_id(string account_name_or_id) const
fc::ecc::private_key get_private_key(const public_key_type &id) const
asset_id_type asset_to_update
fc::api< database_api > _remote_db
signed_transaction update_asset_feed_producers(string symbol, flat_set< string > new_feed_producers, bool broadcast)
signed_transaction reserve_asset(string from, string amount, string symbol, bool broadcast)
optional< bitasset_options > bitasset_opts
Options only available for BitAssets. MUST be non-null if and only if the asset is market-issued.
Update issuer of an asset.
tracks the parameters of an asset
signed_transaction sign_transaction(signed_transaction tx, bool broadcast=false)
void set_operation_fees(signed_transaction &tx, const fee_schedule &s) const
asset_id_type asset_id
asset for which the feed is published
signed_transaction update_asset(string symbol, optional< string > new_issuer, asset_options new_options, bool broadcast)
asset debt_covered
the amount of debt to take over
asset additional_collateral
the amount of collateral to bid for the debt
The asset_options struct contains options available on all assets in the network.
asset amount_from_string(string amount_string) const
asset_id_type asset_to_update
The bitasset_options struct contains configurable options available only to BitAssets.
account_object get_account(account_id_type id) const
account_id_type issuer
Must be asset_to_issue->asset_id->issuer.
adds a signature to a transaction
bitasset_options new_options
std::string asset_id_to_string(asset_id_type id) const
used to take an asset out of circulation, returning to the issuer
Update options common to all assets.
account_id_type account
Account requesting the force settlement. This account pays the fee.
asset_id_type asset_to_settle
This class represents an account on the object graph.
uint8_t precision
Number of digits to the right of decimal point, must be less than or equal to 12.
signed_transaction settle_asset(string account_to_settle, string amount_to_settle, string symbol, bool broadcast)
T as(uint32_t max_depth) const
defines market parameters for margin positions
signed_transaction global_settle_asset(string symbol, price settle_price, bool broadcast)
account_id_type publisher
Update options specific to BitAssets.
string symbol
The ticker symbol of this asset.
Publish price feeds for market-issued assets.
signed_transaction claim_asset_fee_pool(string symbol, string amount, bool broadcast)
typename impl::transform< List, Transformer >::type transform
Transform elements of a typelist.
optional< extended_asset_object > find_asset(asset_id_type id) const
account_id_type issue_to_account
asset_options new_options
#define FC_ASSERT(TEST,...)
Checks a condition and throws an assert_exception if the test is FALSE.
account_id_type issuer
ID of the account which issued this asset.
Update the set of feed-producing accounts for a BitAsset.
virtual void validate() const
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Schedules a market-issued asset for automatic settlement.
asset_id_type asset_to_update
asset_options common_options
signed_transaction fund_asset_fee_pool(string from, string symbol, string amount, bool broadcast)
flat_set< account_id_type > new_feed_producers
asset_id_type asset_to_update
signed_transaction bid_collateral(string bidder_name, string debt_amount, string debt_symbol, string additional_collateral, bool broadcast)
graphene::db::object_downcast_t< const ID & > get_object(const ID &id) const
share_type amount
core asset
signed_transaction publish_asset_feed(string publishing_account, string symbol, price_feed feed, bool broadcast)
defines the keys used to derive the shared secret
account_id_type from_account
signed_transaction update_asset_issuer(string symbol, string new_issuer, bool broadcast)
provides stack-based nullable value similar to boost::optional
signed_transaction update_bitasset(string symbol, bitasset_options new_options, bool broadcast)
account_id_type issuer
must equal issuer of asset_to_settle
optional< account_id_type > new_issuer
If the asset is to be given a new issuer, specify his ID here.
account_id_type new_issuer
allows global settling of bitassets (black swan or prediction markets)
asset amount_to_claim
fee.asset_id must != asset_id
Transfers BTS from the fee pool of a specified asset back to the issuer's balance.
asset amount
Amount of asset to force settle. This must be a market-issued asset.