Versions in this module Expand all Collapse all v1 v1.1.2 Sep 16, 2021 Changes in this version + var ErrDuplicateAlias = errors.New("duplicate asset alias") + var ErrDuplicateAsset = errors.New("duplicate asset id") + var ErrFindAsset = errors.New("fail to find asset") + var ErrInternalAsset = errors.New("btm has been defined as the internal asset") + var ErrMarshalAsset = errors.New("failed marshal asset") + var ErrNullAlias = errors.New("null asset alias") + var ErrSerializing = errors.New("serializing asset definition") + func Annotated(a *Asset) (*query.AnnotatedAsset, error) + func ExtAssetKey(id *bc.AssetID) []byte + func Key(id *bc.AssetID) []byte + type Asset struct + Alias *string + AssetID bc.AssetID + DefinitionMap map[string]interface{} + IssuanceProgram chainjson.HexBytes + RawDefinitionByte chainjson.HexBytes + VMVersion uint64 + var DefaultNativeAsset *Asset + type Image struct + Assets []*Asset + type Registry struct + func NewRegistry(db dbm.DB, chain *protocol.Chain) *Registry + func (reg *Registry) Backup() (*Image, error) + func (reg *Registry) DecodeIssueAction(data []byte) (txbuilder.Action, error) + func (reg *Registry) Define(xpubs []chainkd.XPub, quorum int, definition map[string]interface{}, ...) (*Asset, error) + func (reg *Registry) FindByAlias(alias string) (*Asset, error) + func (reg *Registry) FindByID(ctx context.Context, id *bc.AssetID) (*Asset, error) + func (reg *Registry) GetAliasByID(id string) string + func (reg *Registry) GetAsset(id string) (*Asset, error) + func (reg *Registry) ListAssets(id string) ([]*Asset, error) + func (reg *Registry) NewIssueAction(assetAmount bc.AssetAmount) txbuilder.Action + func (reg *Registry) Restore(image *Image) error + func (reg *Registry) SaveAsset(a *Asset, alias string) error + func (reg *Registry) UpdateAssetAlias(id, newAlias string) error