Golos
Разработчикам Статистика Баунти Документация Партнеры Github
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
golos::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 golos::chain::asset_object:

Public Member Functions

template<typename Constructor , typename Allocator >
 asset_object (Constructor &&c, allocator< Allocator > a)
 
 asset_object ()
 
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
 
protocol::asset< 0, 17, 0 > amount (share_type a) const
 Helper function to get an asset object with the given amount in this asset's type. More...
 
protocol::asset< 0, 17, 0 > 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 protocol::asset< 0, 17, 0 > &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 protocol::asset< 0, 17, 0 > &amount) const
 Convert an asset to a textual representation with symbol, i.e. "123.45 USD". More...
 
void validate () const
 

Static Public Member Functions

static bool is_valid_symbol (const string &symbol)
 

Public Attributes

id_type id
 
protocol::asset_name_type asset_name
 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_name_type issuer
 ID of the account which issued this asset. More...
 
protocol::asset_options< 0, 17, 0 > options
 
bool market_issued = false
 Extra data associated with BitAssets. This field is non-null if and only if is_market_issued() returns true. More...
 
optional< account_name_type > buyback_account
 

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

Constructor & Destructor Documentation

◆ asset_object() [1/2]

template<typename Constructor , typename Allocator >
golos::chain::asset_object::asset_object ( Constructor &&  c,
allocator< Allocator >  a 
)
inline

Definition at line 70 of file asset_object.hpp.

◆ asset_object() [2/2]

golos::chain::asset_object::asset_object ( )
inline

Definition at line 74 of file asset_object.hpp.

Member Function Documentation

◆ allow_confidential()

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

Definition at line 113 of file asset_object.hpp.

◆ amount()

protocol::asset<0, 17, 0> golos::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 119 of file asset_object.hpp.

◆ amount_from_string()

asset< 0, 17, 0 > golos::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 69 of file asset_object.cpp.

◆ amount_to_pretty_string() [1/2]

string golos::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 137 of file asset_object.hpp.

◆ amount_to_pretty_string() [2/2]

string golos::chain::asset_object::amount_to_pretty_string ( const protocol::asset< 0, 17, 0 > &  amount) const
inline

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

Definition at line 142 of file asset_object.hpp.

◆ amount_to_string() [1/2]

string golos::chain::asset_object::amount_to_string ( share_type  amount) const

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

Definition at line 126 of file asset_object.cpp.

◆ amount_to_string() [2/2]

string golos::chain::asset_object::amount_to_string ( const protocol::asset< 0, 17, 0 > &  amount) const
inline

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

Definition at line 131 of file asset_object.hpp.

◆ can_force_settle()

bool golos::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 golos::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 95 of file asset_object.hpp.

◆ can_override()

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

Definition at line 109 of file asset_object.hpp.

◆ charges_market_fees()

bool golos::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 100 of file asset_object.hpp.

◆ is_market_issued()

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

Definition at line 85 of file asset_object.hpp.

◆ is_transfer_restricted()

bool golos::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 105 of file asset_object.hpp.

◆ is_valid_symbol()

static bool golos::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.

◆ validate()

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

Definition at line 161 of file asset_object.hpp.

Member Data Documentation

◆ asset_name

protocol::asset_name_type golos::chain::asset_object::asset_name

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

Definition at line 148 of file asset_object.hpp.

◆ buyback_account

optional<account_name_type> golos::chain::asset_object::buyback_account

Definition at line 159 of file asset_object.hpp.

◆ id

id_type golos::chain::asset_object::id

Definition at line 77 of file asset_object.hpp.

◆ issuer

account_name_type golos::chain::asset_object::issuer

ID of the account which issued this asset.

Definition at line 152 of file asset_object.hpp.

◆ market_issued

bool golos::chain::asset_object::market_issued = false

Extra data associated with BitAssets. This field is non-null if and only if is_market_issued() returns true.

Definition at line 157 of file asset_object.hpp.

◆ options

protocol::asset_options<0, 17, 0> golos::chain::asset_object::options

Definition at line 154 of file asset_object.hpp.

◆ precision

uint8_t golos::chain::asset_object::precision = 0

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

Definition at line 150 of file asset_object.hpp.


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