Documentation ¶
Index ¶
- Variables
- type Config
- type Endpoint
- type LatestPayments
- type Payment
- type Service
- func (service *Service) AllPayments(ctx context.Context, satelliteID string, from map[int64]int64) (_ LatestPayments, err error)
- func (service *Service) GetChainIds(ctx context.Context) (chainIds map[int64]string, err error)
- func (service *Service) GetEndpoints() []common.EthEndpoint
- func (service *Service) Payments(ctx context.Context, address common.Address, from map[int64]int64) (_ LatestPayments, err error)
- func (service *Service) PingAll(ctx context.Context) (err error)
Constants ¶
This section is empty.
Variables ¶
var ErrEndpoint = errs.Class("tokens endpoint")
ErrEndpoint - tokens endpoint error class.
var ErrService = errs.Class("tokens service")
ErrService - tokens service error class.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Endpoints string `` /* 395-byte string literal not displayed */
}
Config holds tokens service configuration.
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
Endpoint for querying ERC20 token information from ethereum chain.
architecture: Endpoint
func NewEndpoint ¶
NewEndpoint creates new payments endpoint instance.
func (*Endpoint) AllPayments ¶
func (endpoint *Endpoint) AllPayments(w http.ResponseWriter, r *http.Request)
AllPayments endpoint retrieves all ERC20 token payments claimed by one satellite starting from particular block for ethereum address.
type LatestPayments ¶
type LatestPayments struct { LatestBlocks []blockchain.Header Payments []Payment }
LatestPayments contains latest payments and latest chain block header.
type Payment ¶
type Payment struct { ChainID int64 From common.Address To common.Address TokenValue currency.Amount USDValue currency.Amount BlockHash common.Hash BlockNumber int64 Transaction common.Hash LogIndex int Timestamp time.Time }
Payment is on chain payment made for particular contract and deposit wallet.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service for querying ERC20 token information from ethereum chain.
architecture: Service
func NewService ¶
func NewService( log *zap.Logger, endpoints []common.EthEndpoint, headersCache *blockchain.HeadersCache, events *events.Service, tokenPrice *tokenprice.Service) *Service
NewService creates new token service instance.
func (*Service) AllPayments ¶
func (service *Service) AllPayments(ctx context.Context, satelliteID string, from map[int64]int64) (_ LatestPayments, err error)
AllPayments returns all the payments across all configured endpoints starting from a particular block per chain associated with the current satellite.
func (*Service) GetChainIds ¶ added in v1.0.5
GetChainIds returns the chain ids of the currently configured endpoints.
func (*Service) GetEndpoints ¶ added in v1.0.6
func (service *Service) GetEndpoints() []common.EthEndpoint
GetEndpoints returns the currently configured endpoints.