topup

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

MIT License

Copyright (c) 2021 Fair Data Society

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stamp

type Stamp struct {
	BatchID       string `json:"batchID"`
	Utilization   int    `json:"utilization"`
	Usable        bool   `json:"usable"`
	Label         string `json:"label"`
	Depth         int    `json:"depth"`
	Amount        string `json:"amount"`
	BucketDepth   int    `json:"bucketDepth"`
	BlockNumber   int    `json:"blockNumber"`
	ImmutableFlag bool   `json:"immutableFlag"`
	Exists        bool   `json:"exists"`
	BatchTTL      int    `json:"batchTTL"`
}

type Topup

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

func NewTopupTask

func NewTopupTask(ctx context.Context, name, batchId, url, balanceEndpoint string, minAmount, topAmount *big.Int, interval time.Duration, cb func(*TopupAction) error, logger logging.Logger) (*Topup, error)

func (*Topup) Activate

func (t *Topup) Activate()

func (*Topup) Deactivate

func (t *Topup) Deactivate()

func (*Topup) Execute

func (t *Topup) Execute(context.Context) error

func (*Topup) Name

func (t *Topup) Name() string

func (*Topup) State

func (t *Topup) State() bool

func (*Topup) Stop

func (t *Topup) Stop()

type TopupAction

type TopupAction struct {
	Action          string
	BatchID         string
	PreviousBalance string
	CurrentBalance  string
	PreviousDepth   int
	CurrentDepth    int
	DoneAt          int64
	DepthAdded      int
	AmountTopped    string
}

Jump to

Keyboard shortcuts

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