Apart from some helpful additives (max amount, precision, checks for valid symbols,...) it stores more than the asset class. It keeps the owner of the asset (given by an account). For EOS it is account eosio.token
, which is the default account for the asset
constructor. (Reference)
A list of some examples where arguments might be *optional* is given. The extended_asset can be constructed by either:
extended_asset(amount, *extended_symbol*)
e.g. extended_asset(asset(150), extended symbol(S(4, EOS))
or
extended_asset(asset, *account*)
e.g. extended_asset(asset(150))
for eosio.token
and we have
asset(amount, *symbol*)
e.g. asset(150)
for eosio.token
extended_symbol(symbol, *account*)
e.g. extended_symbol(symbol, N(eosio.token))
symbol_type(symbol_name)
e.g. construct with S(4, EOS)
S(P,X)
a macro that takes precision and a string and converts it into a symbol
In total all 3 are neeeded: amount, symbol, account. Since your token is not owned by account eosio.token
you should use extended_asset
.