Documentation ¶
Overview ¶
Package algod provides the core business API of handling everything algod related.
Index ¶
- func ConvertBlockRawBytes(ctx context.Context, rawBlock []byte) (db.NewBlock, error)
- func ExtractAccountAddrsFromTxn(txn models.Transaction) []string
- func ExtractApplicationIdsFromTxn(txn models.Transaction) []uint64
- func ExtractAssetIdsFromTxn(txn models.Transaction, block types.Block) []uint64
- func PrintBlockInfoFromRawBytes(rawBlock []byte) error
- func PrintTransactionInBlock(txn types.SignedTxnInBlock, padding int)
- func PrintableUTF8OrEmpty(in string) string
- func ProcessTransactionInBlock(txn types.SignedTxnInBlock, blockInfo types.Block) models.Transaction
- type Core
- func (c Core) GetAccount(ctx context.Context, traceID string, address string) (*models.Account, error)
- func (c Core) GetApplication(ctx context.Context, traceID string, appID uint64) (*models.Application, error)
- func (c Core) GetAsset(ctx context.Context, traceID string, assetID uint64) (*models.Asset, error)
- func (c Core) GetCurrentRound(ctx context.Context, traceID string) (*db.NewBlock, error)
- func (c Core) GetCurrentRoundNum(ctx context.Context) (uint64, error)
- func (c Core) GetRound(ctx context.Context, traceID string, roundNum uint64) (*db.NewBlock, error)
- func (c Core) GetRoundInRawBytes(ctx context.Context, roundNum uint64) ([]byte, error)
- func (c Core) GetSupply(ctx context.Context, traceID string) (*models.Supply, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertBlockRawBytes ¶
ConvertBlockRawBytes processes the block in byte format and returns it in a struct.
func ExtractAccountAddrsFromTxn ¶
func ExtractAccountAddrsFromTxn(txn models.Transaction) []string
func ExtractApplicationIdsFromTxn ¶
func ExtractApplicationIdsFromTxn(txn models.Transaction) []uint64
func ExtractAssetIdsFromTxn ¶
func ExtractAssetIdsFromTxn(txn models.Transaction, block types.Block) []uint64
func PrintBlockInfoFromRawBytes ¶
PrintBlockInfoFromRawBytes processes the raw block bytes and prints all the block information out
func PrintTransactionInBlock ¶
func PrintTransactionInBlock(txn types.SignedTxnInBlock, padding int)
func PrintableUTF8OrEmpty ¶
PrintableUTF8OrEmpty checks to see if the entire string is a UTF8 printable string. If this is the case, the string is returned as is. Otherwise, the empty string is returned. https://github.com/algorand/indexer/blob/5ad47734a19f0ff319c7ae852053f45bfc226475/util/util.go#L13
func ProcessTransactionInBlock ¶
func ProcessTransactionInBlock(txn types.SignedTxnInBlock, blockInfo types.Block) models.Transaction
ProcessTransactionInBlock transforms a transaction found inside a block into the desired transaction model References:
https://github.com/algorand/indexer/blob/6e4d737f2e4e49088b436a234caee6681435053d/api/handlers.go https://github.com/algorand/indexer/blob/fac3b03349d108457abc27c083bd44052590c487/importer/importer.go https://github.com/algorand/indexer/blob/6e4d737f2e4e49088b436a234caee6681435053d/api/converter_utils.go
Types ¶
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
func (Core) GetAccount ¶
func (c Core) GetAccount(ctx context.Context, traceID string, address string) (*models.Account, error)
GetAccount retrieves account info from the Algod API based on the account address given
func (Core) GetApplication ¶
func (c Core) GetApplication(ctx context.Context, traceID string, appID uint64) (*models.Application, error)
GetApplication retrieves application info from the Algod API based on the application ID given
func (Core) GetCurrentRound ¶
GetCurrentRound retrieves retrieves the current block from the Algod API
func (Core) GetCurrentRoundNum ¶
GetCurrentRoundNum retrieves the current round number from the Algod API
func (Core) GetRound ¶
GetRound retrieves a block from the Algod API based on the round number given
func (Core) GetRoundInRawBytes ¶
GetRoundInRawBytes retrieves the specified round and returns result in byte format.