Asset 类
用来表示资产的数据结构。
命名空间: Neo.SmartContract.Framework.Services.Neo
程序集:Neo.SmartContract.Framework
注:本文中标记 new
和 已弃用
的地方是 2.0 版本相对 1.6 版本的更改之处。
语法
public class Asset
属性
名称 | 说明 | |
---|---|---|
Admin | 获得该资产的管理员(合约地址),有权对资产的属性(如总量,名称等)进行修改 | |
Amount | 获得该资产的总量 | |
AssetId | 获得该资产的 ID | |
AssetType | 获得该资产的类别 | |
Available | 获得该资产的已经发行出去的数量 | |
Issuer | 获得该资产的发行人(合约地址),有权进行资产的发行 | |
Owner | 获得该资产的所有人(公钥) | |
Precision | 获得该资产的精度(最小分割数量),单位为小数点之后的位数 |
方法
名称 | 说明 | |
---|---|---|
Create(byte, string, long, byte, byte[], byte[], byte[]) | new 在 NEO 区块链上注册资产 | |
Renew(byte) | new 为资产续费 |
构造方法
通过 Blockchain.GetAsset(byte[]) 方法来构造 Asset 对象。
通过 Asset.Create(byte, string, long, byte, byte[], byte[], byte[]) 方法来在区块链上创建新的资产,并返回 Asset 对象。