Documentation
¶
Overview ¶
Package query implements indexing and querying of annotated blockchain data.
Index ¶
Constants ¶
View Source
const ( // TxPinName is used to identify the pin associated // with the transaction block processor. TxPinName = "tx" )
Variables ¶
View Source
var ( ErrBadAfter = errors.New("malformed pagination parameter after") ErrParameterCountMismatch = errors.New("wrong number of parameters to query") )
Functions ¶
This section is empty.
Types ¶
type AccountKey ¶
type AnnotatedAccount ¶
type AnnotatedAccount struct {
ID string `json:"id"`
Alias string `json:"alias,omitempty"`
Keys []*AccountKey `json:"keys"`
Quorum int `json:"quorum"`
Tags *json.RawMessage `json:"tags"`
}
type AnnotatedAsset ¶
type AnnotatedAsset struct {
ID bc.AssetID `json:"id"`
Alias string `json:"alias,omitempty"`
IssuanceProgram chainjson.HexBytes `json:"issuance_program"`
Keys []*AssetKey `json:"keys"`
Quorum int `json:"quorum"`
Definition *json.RawMessage `json:"definition"`
Tags *json.RawMessage `json:"tags"`
IsLocal Bool `json:"is_local"`
}
type AnnotatedInput ¶
type AnnotatedInput struct {
Type string `json:"type"`
AssetID bc.AssetID `json:"asset_id"`
AssetAlias string `json:"asset_alias,omitempty"`
AssetDefinition *json.RawMessage `json:"asset_definition"`
AssetTags *json.RawMessage `json:"asset_tags,omitempty"`
AssetIsLocal Bool `json:"asset_is_local"`
Amount uint64 `json:"amount"`
IssuanceProgram chainjson.HexBytes `json:"issuance_program,omitempty"`
ControlProgram chainjson.HexBytes `json:"-"`
SpentOutputID *bc.Hash `json:"spent_output_id,omitempty"`
AccountID string `json:"account_id,omitempty"`
AccountAlias string `json:"account_alias,omitempty"`
AccountTags *json.RawMessage `json:"account_tags,omitempty"`
ReferenceData *json.RawMessage `json:"reference_data"`
IsLocal Bool `json:"is_local"`
}
type AnnotatedOutput ¶
type AnnotatedOutput struct {
Type string `json:"type"`
Purpose string `json:"purpose,omitempty"`
OutputID bc.Hash `json:"id"`
TransactionID *bc.Hash `json:"transaction_id,omitempty"`
Position int `json:"position"`
AssetID bc.AssetID `json:"asset_id"`
AssetAlias string `json:"asset_alias,omitempty"`
AssetDefinition *json.RawMessage `json:"asset_definition"`
AssetTags *json.RawMessage `json:"asset_tags"`
AssetIsLocal Bool `json:"asset_is_local"`
Amount uint64 `json:"amount"`
AccountID string `json:"account_id,omitempty"`
AccountAlias string `json:"account_alias,omitempty"`
AccountTags *json.RawMessage `json:"account_tags,omitempty"`
ControlProgram chainjson.HexBytes `json:"control_program"`
ReferenceData *json.RawMessage `json:"reference_data"`
IsLocal Bool `json:"is_local"`
}
type AnnotatedTx ¶
type AnnotatedTx struct {
ID bc.Hash `json:"id"`
Timestamp time.Time `json:"timestamp"`
BlockID bc.Hash `json:"block_id"`
BlockHeight uint64 `json:"block_height"`
Position uint32 `json:"position"`
BlockTransactionsCount uint32 `json:"block_transactions_count,omitempty"`
ReferenceData *json.RawMessage `json:"reference_data"`
IsLocal Bool `json:"is_local"`
Inputs []*AnnotatedInput `json:"inputs"`
Outputs []*AnnotatedOutput `json:"outputs"`
}
type Annotator ¶
type Annotator func(ctx context.Context, txs []*AnnotatedTx) error
Annotator describes a function capable of adding annotations to transactions, inputs and outputs.
type Indexer ¶
type Indexer struct {
// contains filtered or unexported fields
}
Indexer creates, updates and queries against indexes.
func NewIndexer ¶
NewIndexer constructs a new indexer for indexing transactions.
func (*Indexer) ProcessBlocks ¶
func (*Indexer) RegisterAnnotator ¶
RegisterAnnotator adds an additional annotator capable of mutating the annotated transaction object.
type OutputsAfter ¶
type OutputsAfter struct {
// contains filtered or unexported fields
}
func DecodeOutputsAfter ¶
func DecodeOutputsAfter(str string) (c *OutputsAfter, err error)
func (OutputsAfter) String ¶
func (cur OutputsAfter) String() string
type TxAfter ¶
type TxAfter struct {
// FromBlockHeight and FromPosition uniquely identify the last transaction returned
// by a list-transactions query.
//
// If list-transactions is called with a time range instead of an `after`, these fields
// are populated with the position of the transaction at the start of the time range.
FromBlockHeight uint64 // exclusive
FromPosition uint32 // exclusive
// StopBlockHeight identifies the last block that should be included in a transaction
// list. It is used when list-transactions is called with a time range instead
// of an `after`.
StopBlockHeight uint64 // inclusive
}
func DecodeTxAfter ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.