Documentation
¶
Index ¶
- Variables
- func Annotated(a *Asset) (*query.AnnotatedAsset, error)
- type Asset
- type Registry
- func (reg *Registry) AnnotateTxs(txs []*query.AnnotatedTx) error
- 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) IndexAssets(b *legacy.Block)
- func (reg *Registry) NewIssueAction(assetAmount bc.AssetAmount, referenceData chainjson.Map) txbuilder.Action
- func (reg *Registry) QueryAll(ctx context.Context) (interface{}, error)
- func (reg *Registry) UpdateTags(ctx context.Context, id, alias *string, tags map[string]interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrDuplicateAlias = errors.New("duplicate asset alias") ErrBadIdentifier = errors.New("either ID or alias must be specified, and not both") )
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{} BlockHeight uint64 }
func (*Asset) Definition ¶
func (*Asset) RawDefinition ¶
func (*Asset) SetDefinition ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry tracks and stores all known assets on a blockchain.
func (*Registry) AnnotateTxs ¶
func (reg *Registry) AnnotateTxs(txs []*query.AnnotatedTx) error
AnnotateTxs adds asset data to transactions
func (*Registry) DecodeIssueAction ¶
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 ¶
func (*Registry) IndexAssets ¶
IndexAssets is run on every block and indexes all non-local assets.
func (*Registry) NewIssueAction ¶
Click to show internal directories.
Click to hide internal directories.