struct eosio::asset

Class List > eosio :: asset

Public Attributes

Type Name
int64_t amount
symbol symbol

Public Static Attributes

Type Name
static constexpr int64_t max_amount

Public Functions

Type Name
asset ()
asset (int64_t a, class symbol s)
bool is_amount_within_range () const
bool is_valid () const
void set_amount (int64_t a)
std::string to_string () const
asset to std::string
void print () const
Print the asset

Detailed Description

Stores information for owner of asset

Public Attributes Documentation

variable amount

int64_t eosio::asset::amount;

The amount of the asset

variable symbol

symbol eosio::asset::symbol;

The symbol name of the asset

Public Static Attributes Documentation

variable max_amount

constexpr int64_t eosio::asset::max_amount;

Maximum amount possible for this asset. It's capped to 2^62 - 1

Public Functions Documentation

function asset (1/2)

eosio::asset::asset ()

function asset (2/2)

eosio::asset::asset (
    int64_t a,
    class symbol s

Construct a new asset given the symbol name and the amount


  • a - The amount of the asset
  • s - The name of the symbol

function is_amount_within_range

bool eosio::asset::is_amount_within_range () const

Check if the amount doesn't exceed the max amount


true - if the amount doesn't exceed the max amount


false - otherwise

function is_valid

bool eosio::asset::is_valid () const

Check if the asset is valid. A valid asset has its amount <= max_amount and its symbol name valid


true - if the asset is valid


false - otherwise

function set_amount

void eosio::asset::set_amount (
    int64_t a

Set the amount of the asset


  • a - New amount for the asset

function to_string

std::string eosio::asset::to_string () const

asset to std::string

asset to std::string

function print

void eosio::asset::print () const

Print the asset

Print the asset

The documentation for this class was generated from the following file: in/eosio.cdt/libraries/eosiolib/core/eosio/asset.hpp

results matching ""

    No results matching ""