Bitshares-Core  2.0.181105
BitShares blockchain implementation and command-line interface software
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
graphene::chain::asset_object Class Reference

tracks the parameters of an assetAll 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. More...

#include <asset_object.hpp>

Inheritance diagram for graphene::chain::asset_object:

Public Member Functions

bool is_market_issued () 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
 
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...
 
asset_id_type get_id () const
 
void validate () const
 
template<class DB >
const asset_bitasset_data_objectbitasset_data (const DB &db) const
 
template<class DB >
const asset_dynamic_data_objectdynamic_data (const DB &db) const
 
template<class DB >
share_type reserved (const DB &db) const
 

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_typebitasset_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_typebuyback_account
 

Static Public Attributes

static const uint8_t space_id = protocol_ids
 
static const uint8_t type_id = asset_object_type
 

Detailed Description

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 76 of file asset_object.hpp.

Member Function Documentation

◆ allow_confidential()

bool graphene::chain::asset_object::allow_confidential ( ) const
inline

Definition at line 98 of file asset_object.hpp.

◆ amount()

asset graphene::chain::asset_object::amount ( share_type  a) const
inline

Helper function to get an asset object with the given amount in this asset's type.

Definition at line 101 of file asset_object.hpp.

◆ amount_from_string()

asset 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 107 of file asset_object.cpp.

◆ amount_to_pretty_string() [1/2]

string graphene::chain::asset_object::amount_to_pretty_string ( share_type  amount) const
inline

Convert an asset to a textual representation with symbol, i.e. "123.45 USD".

Definition at line 111 of file asset_object.hpp.

◆ amount_to_pretty_string() [2/2]

string graphene::chain::asset_object::amount_to_pretty_string ( const asset amount) const
inline

Convert an asset to a textual representation with symbol, i.e. "123.45 USD".

Definition at line 114 of file asset_object.hpp.

◆ amount_to_string() [1/2]

string asset_object::amount_to_string ( share_type  amount) const

Convert an asset to a textual representation, i.e. "123.45".

Definition at line 162 of file asset_object.cpp.

◆ amount_to_string() [2/2]

string graphene::chain::asset_object::amount_to_string ( const asset amount) const
inline

Convert an asset to a textual representation, i.e. "123.45".

Definition at line 108 of file asset_object.hpp.

◆ bitasset_data()

template<class DB >
const asset_bitasset_data_object& graphene::chain::asset_object::bitasset_data ( const DB &  db) const
inline

Definition at line 147 of file asset_object.hpp.

◆ can_force_settle()

bool graphene::chain::asset_object::can_force_settle ( ) const
inline
Returns
true if users may request force-settlement of this market-issued asset; false otherwise

Definition at line 90 of file asset_object.hpp.

◆ can_global_settle()

bool graphene::chain::asset_object::can_global_settle ( ) const
inline
Returns
true if the issuer of this market-issued asset may globally settle the asset; false otherwise

Definition at line 92 of file asset_object.hpp.

◆ can_override()

bool graphene::chain::asset_object::can_override ( ) const
inline

Definition at line 97 of file asset_object.hpp.

◆ charges_market_fees()

bool graphene::chain::asset_object::charges_market_fees ( ) const
inline
Returns
true if this asset charges a fee for the issuer on market operations; false otherwise

Definition at line 94 of file asset_object.hpp.

◆ dynamic_data()

template<class DB >
const asset_dynamic_data_object& graphene::chain::asset_object::dynamic_data ( const DB &  db) const
inline

Definition at line 156 of file asset_object.hpp.

◆ get_id()

asset_id_type graphene::chain::asset_object::get_id ( ) const
inline

Definition at line 134 of file asset_object.hpp.

◆ is_market_issued()

bool graphene::chain::asset_object::is_market_issued ( ) const
inline
Returns
true if this is a market-issued asset; false otherwise.

Definition at line 88 of file asset_object.hpp.

◆ is_transfer_restricted()

bool graphene::chain::asset_object::is_transfer_restricted ( ) const
inline
Returns
true if this asset may only be transferred to/from the issuer or market orders

Definition at line 96 of file asset_object.hpp.

◆ is_valid_symbol()

static bool graphene::chain::asset_object::is_valid_symbol ( const string &  symbol)
static

This function does not check if any registered asset has this symbol or not; it simply checks whether the symbol would be valid.

Returns
true if symbol is a valid ticker symbol; false otherwise.

◆ reserved()

template<class DB >
share_type graphene::chain::asset_object::reserved ( const DB &  db) const
inline

The total amount of an asset that is reserved for future issuance.

Definition at line 163 of file asset_object.hpp.

◆ validate()

void graphene::chain::asset_object::validate ( ) const
inline

Definition at line 136 of file asset_object.hpp.

Member Data Documentation

◆ bitasset_data_id

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 130 of file asset_object.hpp.

◆ buyback_account

optional<account_id_type> graphene::chain::asset_object::buyback_account

Definition at line 132 of file asset_object.hpp.

◆ dynamic_asset_data_id

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 128 of file asset_object.hpp.

◆ issuer

account_id_type graphene::chain::asset_object::issuer

ID of the account which issued this asset.

Definition at line 122 of file asset_object.hpp.

◆ options

asset_options graphene::chain::asset_object::options

Definition at line 124 of file asset_object.hpp.

◆ precision

uint8_t graphene::chain::asset_object::precision = 0

Maximum number of digits after the decimal point (must be <= 12)

Definition at line 120 of file asset_object.hpp.

◆ space_id

const uint8_t graphene::chain::asset_object::space_id = protocol_ids
static

Definition at line 79 of file asset_object.hpp.

◆ symbol

string graphene::chain::asset_object::symbol

Ticker symbol for this asset, i.e. "USD".

Definition at line 118 of file asset_object.hpp.

◆ type_id

const uint8_t graphene::chain::asset_object::type_id = asset_object_type
static

Definition at line 80 of file asset_object.hpp.


The documentation for this class was generated from the following files: