BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
tracks the parameters of an asset More...
#include <asset_object.hpp>
Public Member Functions | |
bool | is_market_issued () const |
bool | is_liquidity_pool_share_asset () const |
bool | can_force_settle () const |
bool | can_global_settle () const |
bool | charges_market_fees () const |
bool | is_transfer_restricted () const |
bool | can_override () const |
bool | allow_confidential () const |
bool | can_update_max_supply () const |
bool | can_create_new_supply () const |
bool | can_owner_update_mcr () const |
bool | can_owner_update_icr () const |
bool | can_owner_update_mssr () const |
bool | can_owner_update_bsrm () const |
bool | can_bid_collateral () const |
asset | amount (share_type a) const |
Helper function to get an asset object with the given amount in this asset's type. More... | |
asset | amount_from_string (string amount_string) const |
string | amount_to_string (share_type amount) const |
Convert an asset to a textual representation, i.e. "123.45". More... | |
string | amount_to_string (const asset &amount) const |
Convert an asset to a textual representation, i.e. "123.45". More... | |
string | amount_to_pretty_string (share_type amount) const |
Convert an asset to a textual representation with symbol, i.e. "123.45 USD". More... | |
string | amount_to_pretty_string (const asset &amount) const |
Convert an asset to a textual representation with symbol, i.e. "123.45 USD". More... | |
void | validate () const |
template<class DB > | |
const asset_bitasset_data_object & | bitasset_data (const DB &db) const |
template<class DB > | |
const asset_dynamic_data_object & | dynamic_data (const DB &db) const |
template<class DB > | |
share_type | reserved (const DB &db) const |
template<class DB > | |
bool | can_accumulate_fee (const DB &db, const asset &fee) const |
template<class DB > | |
void | accumulate_fee (DB &db, const asset &fee) const |
Public Member Functions inherited from graphene::db::abstract_object< asset_object, protocol_ids, asset_object_type > | |
abstract_object () | |
object_id< SpaceID, TypeID > | get_id () const |
Public Member Functions inherited from graphene::db::base_abstract_object< asset_object > | |
std::unique_ptr< object > | clone () const override |
void | move_from (object &obj) override |
fc::variant | to_variant () const override |
std::vector< char > | pack () const override |
object ()=default | |
object (uint8_t space_id, uint8_t type_id) | |
Public Member Functions inherited from graphene::db::object | |
object ()=default | |
object (uint8_t space_id, uint8_t type_id) | |
virtual | ~object ()=default |
virtual std::unique_ptr< object > | clone () const =0 |
virtual fc::variant | to_variant () const =0 |
virtual std::vector< char > | pack () const =0 |
Static Public Member Functions | |
static bool | is_valid_symbol (const string &symbol) |
Public Attributes | |
string | symbol |
Ticker symbol for this asset, i.e. "USD". More... | |
uint8_t | precision = 0 |
Maximum number of digits after the decimal point (must be <= 12) More... | |
account_id_type | issuer |
ID of the account which issued this asset. More... | |
asset_options | options |
asset_dynamic_data_id_type | dynamic_asset_data_id |
Current supply, fee pool, and collected fees are stored in a separate object as they change frequently. More... | |
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() returns true. More... | |
optional< account_id_type > | buyback_account |
optional< liquidity_pool_id_type > | for_liquidity_pool |
The ID of the liquidity pool if the asset is the share asset of a liquidity pool. More... | |
uint32_t | creation_block_num = 0 |
The block number when the asset object was created. More... | |
time_point_sec | creation_time |
The time when the asset object was created. More... | |
Public Attributes inherited from graphene::db::object | |
object_id_type | id |
Additional Inherited Members | |
Static Public Attributes inherited from graphene::db::abstract_object< asset_object, protocol_ids, asset_object_type > | |
static constexpr uint8_t | space_id |
static constexpr uint8_t | type_id |
tracks the parameters of an asset
All assets have a globally unique symbol name that controls how they are traded and an issuer who has authority over the parameters of the asset.
Definition at line 75 of file asset_object.hpp.
|
inline |
Definition at line 201 of file asset_object.hpp.
|
inline |
Definition at line 96 of file asset_object.hpp.
|
inline |
Helper function to get an asset object with the given amount in this asset's type.
Definition at line 114 of file asset_object.hpp.
asset graphene::chain::asset_object::amount_from_string | ( | string | amount_string | ) | const |
Convert a string amount (i.e. "123.45") to an asset object with this asset's type The string may have a decimal and/or a negative sign.
Definition at line 152 of file asset_object.cpp.
|
inline |
Convert an asset to a textual representation with symbol, i.e. "123.45 USD".
Definition at line 127 of file asset_object.hpp.
|
inline |
Convert an asset to a textual representation with symbol, i.e. "123.45 USD".
Definition at line 124 of file asset_object.hpp.
|
inline |
Convert an asset to a textual representation, i.e. "123.45".
Definition at line 121 of file asset_object.hpp.
string graphene::chain::asset_object::amount_to_string | ( | share_type | amount | ) | const |
Convert an asset to a textual representation, i.e. "123.45".
Definition at line 207 of file asset_object.cpp.
|
inline |
Definition at line 166 of file asset_object.hpp.
|
inline |
Definition at line 187 of file asset_object.hpp.
|
inline |
Definition at line 111 of file asset_object.hpp.
|
inline |
Definition at line 101 of file asset_object.hpp.
|
inline |
Definition at line 88 of file asset_object.hpp.
|
inline |
Definition at line 90 of file asset_object.hpp.
|
inline |
Definition at line 95 of file asset_object.hpp.
|
inline |
Definition at line 109 of file asset_object.hpp.
|
inline |
Definition at line 105 of file asset_object.hpp.
|
inline |
Definition at line 103 of file asset_object.hpp.
|
inline |
Definition at line 107 of file asset_object.hpp.
|
inline |
Definition at line 99 of file asset_object.hpp.
|
inline |
Definition at line 92 of file asset_object.hpp.
|
inline |
Definition at line 175 of file asset_object.hpp.
|
inline |
Definition at line 86 of file asset_object.hpp.
|
inline |
Definition at line 84 of file asset_object.hpp.
|
inline |
Definition at line 94 of file asset_object.hpp.
|
static |
This function does not check if any registered asset has this symbol or not; it simply checks whether the symbol would be valid.
|
inline |
The total amount of an asset that is reserved for future issuance.
Definition at line 182 of file asset_object.hpp.
|
inline |
Definition at line 154 of file asset_object.hpp.
optional<asset_bitasset_data_id_type> graphene::chain::asset_object::bitasset_data_id |
Extra data associated with BitAssets. This field is non-null if and only if is_market_issued() returns true.
Definition at line 142 of file asset_object.hpp.
optional<account_id_type> graphene::chain::asset_object::buyback_account |
Definition at line 144 of file asset_object.hpp.
uint32_t graphene::chain::asset_object::creation_block_num = 0 |
The block number when the asset object was created.
Definition at line 150 of file asset_object.hpp.
time_point_sec graphene::chain::asset_object::creation_time |
The time when the asset object was created.
Definition at line 152 of file asset_object.hpp.
asset_dynamic_data_id_type graphene::chain::asset_object::dynamic_asset_data_id |
Current supply, fee pool, and collected fees are stored in a separate object as they change frequently.
Definition at line 140 of file asset_object.hpp.
optional<liquidity_pool_id_type> graphene::chain::asset_object::for_liquidity_pool |
The ID of the liquidity pool if the asset is the share asset of a liquidity pool.
Definition at line 147 of file asset_object.hpp.
account_id_type graphene::chain::asset_object::issuer |
ID of the account which issued this asset.
Definition at line 135 of file asset_object.hpp.
asset_options graphene::chain::asset_object::options |
Definition at line 137 of file asset_object.hpp.
uint8_t graphene::chain::asset_object::precision = 0 |
Maximum number of digits after the decimal point (must be <= 12)
Definition at line 133 of file asset_object.hpp.
string graphene::chain::asset_object::symbol |
Ticker symbol for this asset, i.e. "USD".
Definition at line 131 of file asset_object.hpp.