coin

package
v2.14.14 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: MIT Imports: 17 Imported by: 0

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 {
	DB *pg.DB
	// contains filtered or unexported fields
}

func NewRepository

func NewRepository(db *pg.DB) *Repository

func (*Repository) Add

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

func (*Repository) DeleteBySymbol

func (r *Repository) DeleteBySymbol(symbol string) error

func (*Repository) FindCoinIdBySymbol

func (r *Repository) FindCoinIdBySymbol(symbol string) (uint, error)

Find coin id by symbol

func (*Repository) FindSymbolById

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

func (*Repository) GetAllCoins

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

func (*Repository) GetById

func (r *Repository) GetById(id uint) (*models.Coin, error)

func (*Repository) GetCoinBySymbol

func (r *Repository) GetCoinBySymbol(symbol string) ([]models.Coin, error)

func (*Repository) GetLastCoinId

func (r *Repository) GetLastCoinId() (uint, error)

func (*Repository) RemoveFromCacheBySymbol

func (r *Repository) RemoveFromCacheBySymbol(symbol string)

func (*Repository) Save

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

func (*Repository) SaveAllIfNotExist

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

func (*Repository) SaveAllNewIfNotExist

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

func (*Repository) Update

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

func (*Repository) UpdateAll

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

func (*Repository) UpdateOwnerBySymbol

func (r *Repository) UpdateOwnerBySymbol(symbol string, id uint) error

type Service

type Service struct {
	Storage *Repository
	// contains filtered or unexported fields
}

func NewService

func NewService(env *env.ExtenderEnvironment, nodeApi *grpc_client.Client, repository *Repository,
	addressRepository *address.Repository, logger *logrus.Entry) *Service

func (*Service) BurnToken added in v2.12.0

func (s *Service) BurnToken(tx *api_pb.TransactionResponse) error

func (*Service) ChangeOwner

func (s *Service) ChangeOwner(symbol, owner string) error

func (*Service) CreateNewCoins

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

func (*Service) CreatePoolToken added in v2.12.0

func (s *Service) CreatePoolToken(tx *api_pb.TransactionResponse) (*models.Coin, error)

func (*Service) ExtractFromTx

func (s *Service) ExtractFromTx(tx *api_pb.TransactionResponse, blockId uint64) (*models.Coin, error)

func (*Service) GetBySymbolAndVersion added in v2.12.0

func (s *Service) GetBySymbolAndVersion(symbol string, version uint) (*models.Coin, error)

func (*Service) GetCoinFromNode

func (s *Service) GetCoinFromNode(coinId uint64, optionalHeight ...uint64) (*models.Coin, error)

func (*Service) GetUpdateCoinsFromCoinsMapJobChannel

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

func (*Service) GetUpdateCoinsFromTxsJobChannel

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

func (Service) HandleCoinsFromBlock added in v2.12.0

func (s Service) HandleCoinsFromBlock(block *api_pb.BlockResponse) error

func (*Service) MintToken added in v2.12.0

func (s *Service) MintToken(tx *api_pb.TransactionResponse) error

func (*Service) RecreateCoin

func (s *Service) RecreateCoin(newCoin *models.Coin) error

func (*Service) RecreateToken added in v2.12.0

func (s *Service) RecreateToken(data *api_pb.RecreateTokenData, txTags map[string]string, height uint64) error

func (*Service) UpdateCoinsInfo

func (s *Service) UpdateCoinsInfo(coinIds []uint64) error

func (Service) UpdateCoinsInfoFromCoinsMap

func (s Service) UpdateCoinsInfoFromCoinsMap(job <-chan map[uint64]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