Clone an Asset object.
divide the asset with a factor.
divide factor.
Get the amount of Asset.
an uint64 value.
Get the encoded symbol. for example, if the symbol string is "ABC", then the symbol is 0x434241xx. Notice the last "xx" stands for the precisions.
To check if a symbol is valid or not. A valid symbol must fullfill two conditions:
To check if an Asset is valid or not.
multiple the asset with a factor.
multiple factor.
Set the amount of Asset.
new amount value.
Set new encoded symbol. Generate new symbol by calling function StringToSymbol
new symbol
Get symbol name without precision info.
Get the length of symbol name.
uint32
Get the precision of Asset.
query the balance of specific account.
account name for querying balance from.
Transfer some Assets from an account to another. It is an async method, if the operation failed, then an exception will be thrown and the transaction failed.
transfer Asset from this account.
transfer Asset to this account.
assets will be transfered.
a memo tip for this transaction.
Generated using TypeDoc
The class Asset manages the digital assets which stored on the chain. A valid asset has two parts: amount and symbol. Different assets have different symbols. for example, "1000 UGS" and "1000 SYS" are both valid assets, but they are different. You can do +,-,*, / and logic compare such as ==,!=, <=, >= on assets with same symbol.
Asset