tokenindexer

package
v1.1.15 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2021 License: MIT Imports: 11 Imported by: 4

Documentation

Index

Constants

View Source
const (
	TokenIndexer              = "TokenIndexer"
	SubscriptionsTokenIndexer = "SubscriptionsTokenIndexer"
)

Variables

This section is empty.

Functions

func CreateAssociations added in v1.1.15

func CreateAssociations(database *db.Instance, addressAssetsMap map[string][]string) error

func GetAssetsFromTransactions

func GetAssetsFromTransactions(txs []types.Tx) []models.Asset

func RunTokenIndexer

func RunTokenIndexer(database *db.Instance, delivery amqp.Delivery) error

func RunTokenIndexerSubscribe added in v1.1.15

func RunTokenIndexerSubscribe(database *db.Instance, apis map[uint]blockatlas.TokensAPI, delivery amqp.Delivery) error

Types

type Asset

type Asset struct {
	Asset  string `json:"asset"`
	Name   string `json:"name"`
	Symbol string `json:"symbol"`
	Type   string `json:"type"`

	Decimals uint `json:"decimals"`
}

type ConsumerIndexer added in v1.1.15

type ConsumerIndexer struct {
	Database   *db.Instance
	TokensAPIs map[uint]blockatlas.TokensAPI
	Delivery   func(*db.Instance, map[uint]blockatlas.TokensAPI, amqp.Delivery) error
}

func (ConsumerIndexer) Callback added in v1.1.15

func (c ConsumerIndexer) Callback(msg amqp.Delivery) error

type GetTokensByAddressRequest added in v1.1.15

type GetTokensByAddressRequest struct {
	AddressesByCoin map[string][]string `json:"addresses"`
	From            uint                `json:"from"`
}

type GetTokensByAddressResponse added in v1.1.15

type GetTokensByAddressResponse []string

type Instance

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

func Init

func Init(database *db.Instance) Instance

func (Instance) GetTokensByAddress added in v1.1.15

func (Instance) HandleNewTokensRequest

func (i Instance) HandleNewTokensRequest(r Request) (Response, error)

type Request

type Request struct {
	From int64
}

type Response

type Response struct {
	Assets []Asset `json:"assets"`
}

Jump to

Keyboard shortcuts

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