coin

package
v2.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2019 License: MIT Imports: 11 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateCoinData

type CreateCoinData struct {
	Name           string `json:"name"`
	Symbol         string `json:"symbol"`
	InitialAmount  string `json:"initial_amount"`
	InitialReserve string `json:"initial_reserve"`
	Crr            string `json:"crr"`
}

type Repository

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

func NewRepository

func NewRepository(db *pg.DB) *Repository

func (Repository) DeleteBySymbol

func (r Repository) DeleteBySymbol(symbol string) error

func (*Repository) FindIdBySymbol

func (r *Repository) FindIdBySymbol(symbol string) (uint64, error)

Find coin id by symbol

func (*Repository) FindSymbolById

func (r *Repository) FindSymbolById(id uint64) (string, error)

func (*Repository) GetAllCoins

func (r *Repository) GetAllCoins() ([]*models.Coin, error)

func (*Repository) Save

func (r *Repository) Save(c *models.Coin) error

func (Repository) SaveAllIfNotExist

func (r Repository) SaveAllIfNotExist(coins []*models.Coin) error

type Service

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

func NewService

func NewService(env *models.ExtenderEnvironment, nodeApi *minter_node_go_api.MinterNodeApi, repository *Repository,
	addressRepository *address.Repository, logger *logrus.Entry) *Service

func (*Service) CreateNewCoins

func (s *Service) CreateNewCoins(coins []*models.Coin) error

func (Service) ExtractCoinsFromTransactions

func (s Service) ExtractCoinsFromTransactions(transactions []responses.Transaction) ([]*models.Coin, error)

func (*Service) ExtractFromTx

func (s *Service) ExtractFromTx(tx responses.Transaction) (*models.Coin, error)

func (*Service) GetCoinFromNode

func (s *Service) GetCoinFromNode(symbol string) (*models.Coin, error)

func (*Service) GetUpdateCoinsFromCoinsMapJobChannel

func (s *Service) GetUpdateCoinsFromCoinsMapJobChannel() chan map[string]struct{}

func (*Service) GetUpdateCoinsFromTxsJobChannel

func (s *Service) GetUpdateCoinsFromTxsJobChannel() chan []*models.Transaction

func (*Service) UpdateCoinsInfo

func (s *Service) UpdateCoinsInfo(symbols []string) error

func (Service) UpdateCoinsInfoFromCoinsMap

func (s Service) UpdateCoinsInfoFromCoinsMap(job <-chan map[string]struct{})

func (*Service) UpdateCoinsInfoFromTxsWorker

func (s *Service) UpdateCoinsInfoFromTxsWorker(jobs <-chan []*models.Transaction)

Jump to

Keyboard shortcuts

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