swapper

package
Version: v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	SwappedMNTP      prometheus.Counter
	RequestConfirmed prometheus.Counter
	RequestFailed    prometheus.Counter
}

Metrics data

type Swapper

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

Swapper tries to send MNT transactions via mint-sender external service. Reads new MNTP swap events from the specified channel, initiates MNT emission and waits for completion

func New

func New(
	d db.DAO,
	chNewSwaps <-chan *types.Swap,
	alerter alert.Alerter,
	mintsenderURL, mintsenderPrefix, mintsenderService string,
	logger *logrus.Entry,
) (*Swapper, error)

New instance

func (*Swapper) AddMetrics

func (s *Swapper) AddMetrics(m *Metrics)

AddMetrics adds metrics counters and should be called before service launch

func (*Swapper) Close

func (s *Swapper) Close() error

Close instance

func (*Swapper) Task

func (s *Swapper) Task(token *gotask.Token)

Task loop

Jump to

Keyboard shortcuts

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