Documentation ¶
Overview ¶
Package indexer provides the core business API of handling everything account related.
Index ¶
- func PrintBlockInfoFromJSONBlock(jsonBlock models.Block) error
- func PrintTransactionInBlock(txn models.Transaction, padding int)
- type Core
- func (c Core) GetAccount(ctx context.Context, accountID string) (models.Account, error)
- func (c Core) GetApplication(ctx context.Context, appID uint64) (models.Application, error)
- func (c Core) GetAsset(ctx context.Context, assetID uint64) (models.Asset, error)
- func (c Core) GetRound(ctx context.Context, traceID string, roundNum uint64) (models.Block, error)
- func (c Core) GetTransaction(ctx context.Context, traceID string, transactionID string) (models.Transaction, error)
- func (c Core) LookupRoundInJSON(ctx context.Context, roundNum uint64) (models.Block, error)
- func (c Core) LookupTransactionInJSON(ctx context.Context, transactionID string) (models.Transaction, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
GetAccount retrieves account info from the Indexer API based on the account address given.
func (Core) GetApplication ¶
GetApplication retrieves application info from the Indexer API based on the application ID given.
func (Core) GetAsset ¶
GetAsset retrieves asset info from the Indexer API based on the asset ID given.
func (Core) GetRound ¶
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 ¶
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.