Documentation ¶
Overview ¶
Package asset maintains a registry of all assets on a blockchain.
Index ¶
- Constants
- Variables
- func Annotated(a *Asset) (*query.AnnotatedAsset, error)
- type Asset
- type Registry
- func (reg *Registry) AnnotateTxs(ctx context.Context, 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(indexer Saver)
- func (reg *Registry) NewIssueAction(assetAmount bc.AssetAmount, referenceData chainjson.Map) txbuilder.Action
- func (reg *Registry) ProcessBlocks(ctx context.Context)
- func (reg *Registry) UpdateTags(ctx context.Context, id, alias *string, tags map[string]interface{}) error
- type Saver
Constants ¶
View Source
const PinName = "asset"
PinName is used to identify the pin associated with the asset block processor.
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 Signer *signers.Signer Tags map[string]interface{} // contains filtered or unexported fields }
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 (*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 ¶
FindByAlias retrieves an Asset record along with its signer, given an asset alias.
func (*Registry) IndexAssets ¶
func (*Registry) NewIssueAction ¶
func (*Registry) ProcessBlocks ¶
Click to show internal directories.
Click to hide internal directories.