indexer

package
v0.0.0-...-8401909 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package indexer provides the core business API of handling everything account related.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintBlockInfoFromJSONBlock

func PrintBlockInfoFromJSONBlock(jsonBlock models.Block) error

func PrintTransactionInBlock

func PrintTransactionInBlock(txn models.Transaction, padding int)

Types

type Core

type Core struct {
	// contains filtered or unexported fields
}

Core manages the set of API's for block access.

func NewCore

func NewCore(log *zap.SugaredLogger, indexerClient *indexerv2.Client) Core

NewCore constructs a core for product api access.

func (Core) GetAccount

func (c Core) GetAccount(ctx context.Context, accountID string) (models.Account, error)

GetAccount retrieves account info from the Indexer API based on the account address given.

func (Core) GetApplication

func (c Core) GetApplication(ctx context.Context, appID uint64) (models.Application, error)

GetApplication retrieves application info from the Indexer API based on the application ID given.

func (Core) GetAsset

func (c Core) GetAsset(ctx context.Context, assetID uint64) (models.Asset, error)

GetAsset retrieves asset info from the Indexer API based on the asset ID given.

func (Core) GetRound

func (c Core) GetRound(ctx context.Context, traceID string, roundNum uint64) (models.Block, error)

GetRound retrieves a block from the Indexer API based on the round number given. The difference between this method and LookupRoundInJSON is the data will be processed into block.NewBlock format instead of models.Block. func GetRound(ctx context.Context, traceID string, log *zap.SugaredLogger, indexerClient *indexerv2.Client, roundNum uint64) (*block.NewBlock, error) {

func (Core) GetTransaction

func (c Core) GetTransaction(ctx context.Context, traceID string, transactionID string) (models.Transaction, error)

GetTransaction retrieves a block from the Indexer API based on the round number given. The difference between this method and LookupRoundInJSON is the data will be processed into block.NewBlock format instead of models.Block. func GetRound(ctx context.Context, traceID string, log *zap.SugaredLogger, indexerClient *indexerv2.Client, roundNum uint64) (*block.NewBlock, error) {

func (Core) LookupRoundInJSON

func (c Core) LookupRoundInJSON(ctx context.Context, roundNum uint64) (models.Block, error)

LookupRoundInJSON searches for a block from the Indexer API based upon the round number given.

func (Core) LookupTransactionInJSON

func (c Core) LookupTransactionInJSON(ctx context.Context, transactionID string) (models.Transaction, error)

LookupTransactionInJSON searches for a transaction from the Indexer API based upon the transaction ID given.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL