coin

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendIfMissing

func AppendIfMissing(slice []*models.Coin, c *models.Coin) []*models.Coin

func GetCapitalization

func GetCapitalization(volumeStr string, priceStr string) string

func GetTokenPrice

func GetTokenPrice(volumeStr string, reserveStr string, crr uint64) string

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) FindCoinByID

func (r *Repository) FindCoinByID(id uint64) (*models.Coin, error)

Find coin by symbol

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) ResetCoinDelegationNotInListIds

func (r Repository) ResetCoinDelegationNotInListIds(idList []uint64) error

func (*Repository) Save

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

func (Repository) SaveAllIfNotExist

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

func (*Repository) SelectCoinsWithBrokenMeta added in v0.2.4

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

func (*Repository) UpdateCoinDelegation

func (r *Repository) UpdateCoinDelegation(id uint64, delegated uint64) error

func (*Repository) UpdateCoinMetaInfo added in v0.2.4

func (r *Repository) UpdateCoinMetaInfo(symbol string, trxId, ownerAddrId uint64) error

type Service

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

func NewService

func NewService(env *models.ExtenderEnvironment, nodeApi *noah_node_go_api.NoahNodeApi, repository *Repository,
	addressRepository *address.Repository, logger *logrus.Entry, dbBadger *badger.DB, ns stan.Conn) *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) SelectCoinsWithBrokenMeta added in v0.2.4

func (s *Service) SelectCoinsWithBrokenMeta() (*[]models.Coin, error)

func (*Service) UpdateCoinMetaInfo added in v0.2.4

func (s *Service) UpdateCoinMetaInfo(symbol string, trxId, ownerAddrId uint64) error

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