Documentation ¶
Overview ¶
Package asset maintains a registry of all assets on a blockchain.
Index ¶
- 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
- type Saver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry tracks and stores all known assets on a blockchain.
func NewRegistry ¶
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 ¶
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.