Documentation ¶
Index ¶
- Variables
- func Annotated(a *Asset) (*query.AnnotatedAsset, error)
- func Key(name string) []byte
- type Asset
- type Registry
- func (reg *Registry) DecodeIssueAction(data []byte) (txbuilder.Action, error)
- func (reg *Registry) Define(ctx context.Context, xpubs []chainkd.XPub, quorum int, ...) (*Asset, error)
- func (reg *Registry) FindByAlias(ctx context.Context, alias string) (*Asset, error)
- func (reg *Registry) GetAliasByID(id string) string
- func (reg *Registry) ListAssets(id string) ([]annotatedAsset, error)
- func (reg *Registry) NewIssueAction(assetAmount bc.AssetAmount, referenceData chainjson.Map) txbuilder.Action
- func (reg *Registry) UpdateTags(ctx context.Context, assetInfo string, tags map[string]interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDuplicateAlias = errors.New("duplicate asset alias") ErrDuplicateAsset = errors.New("duplicate asset id") ErrSerializing = errors.New("serializing asset definition") ErrMarshalAsset = errors.New("failed marshal asset") ErrFindAsset = errors.New("fail to find asset") )
pre-define errors for supporting bytom errorFormatter
Functions ¶
Types ¶
type Asset ¶
type Asset struct { AssetID bc.AssetID Alias *string VMVersion uint64 IssuanceProgram []byte InitialBlockHash bc.Hash *signers.Signer Tags map[string]interface{} RawDefinitionByte []byte DefinitionMap map[string]interface{} }
Asset describe asset on bytom chain
func (*Asset) RawDefinition ¶
RawDefinition return asset in the raw format
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry tracks and stores all known assets on a blockchain.
func NewRegistry ¶
NewRegistry create new registry
func (*Registry) DecodeIssueAction ¶
DecodeIssueAction unmarshal JSON-encoded data of asset issue action
func (*Registry) Define ¶
func (reg *Registry) Define(ctx context.Context, xpubs []chainkd.XPub, quorum int, definition map[string]interface{}, alias string, tags map[string]interface{}, clientToken string) (*Asset, error)
Define defines a new Asset.
func (*Registry) FindByAlias ¶
FindByAlias retrieves an Asset record along with its signer, given an asset alias.
func (*Registry) GetAliasByID ¶ added in v0.3.0
func (*Registry) ListAssets ¶ added in v0.3.0
ListAssets returns the accounts in the db
func (*Registry) NewIssueAction ¶
func (reg *Registry) NewIssueAction(assetAmount bc.AssetAmount, referenceData chainjson.Map) txbuilder.Action
NewIssueAction create a new asset issue action
Click to show internal directories.
Click to hide internal directories.