Documentation ¶
Overview ¶
Package asset maintains a registry of all assets on a blockchain.
Index ¶
- Constants
- Variables
- type Asset
- type Registry
- func (reg *Registry) AnnotateTxs(ctx context.Context, txs []map[string]interface{}) error
- func (reg *Registry) DecodeIssueAction(data []byte) (txbuilder.Action, error)
- func (reg *Registry) Define(ctx context.Context, xpubs []string, 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)
- 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")
Functions ¶
This section is empty.
Types ¶
type Asset ¶
type Asset struct { AssetID bc.AssetID Alias *string Definition map[string]interface{} IssuanceProgram []byte InitialBlockHash bc.Hash Signer *signers.Signer Tags map[string]interface{} // contains filtered or unexported fields }
func (*Asset) SerializedDefinition ¶
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 []string, 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 ¶
type Saver ¶
type Saver interface {
SaveAnnotatedAsset(context.Context, bc.AssetID, map[string]interface{}, string) error
}
A Saver is responsible for saving an annotated asset object for indexing and retrieval. If the Core is configured not to provide search services, SaveAnnotatedAsset can be a no-op.
Click to show internal directories.
Click to hide internal directories.