payouts

package
v0.0.0-...-d7b061b Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

Package payouts provides the high-level functions called by the CLI utility

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBPathFromDir

func DBPathFromDir(dir string) string

func Import

func Import(ctx context.Context, dir string, csvPath string) error

func PayoutsFromCSV

func PayoutsFromCSV(rows []csv.Row) []*pipelinedb.Payout

func Run

func Run(ctx context.Context, log *zap.Logger, config Config, db *pipelinedb.DB, paymentPayer payer.Payer) error

Types

type AuditSink

type AuditSink interface {
	ReportStatus(format string, args ...interface{})
	ReportWarn(format string, args ...interface{})
	ReportError(format string, args ...interface{})
}

type AuditStats

type AuditStats struct {
	Total          int64
	Confirmed      int64
	FalseConfirmed int64
	Overpaid       int64
	Unstarted      int64
	Pending        int64
	Failed         int64
	Dropped        int64
	Unknown        int64
	Mismatched     int64
	DoublePays     int64
	DoublePayStorj *big.Int
}

func Audit

func Audit(ctx context.Context, dir string, csvPath string, payerType payer.PayerType, nodeAddress string, chainID int, sink AuditSink, receiptsOut string, receiptsForce bool) (*AuditStats, error)

type Config

type Config struct {
	DataDir string

	Name string

	Quoter coinmarketcap.Quoter

	EstimateCacheExpiry time.Duration

	PipelineLimit int

	TxDelay time.Duration

	Drain bool

	PromptConfirm func(label string) error
}

type RowStats

type RowStats struct {
	// Addresses is the number of addresses
	Addresses int

	// Payouts is the number of payouts to addresses
	Payouts int

	// USD is the total USD of all payouts
	USD decimal.Decimal
}

func GetRowStats

func GetRowStats(rows []csv.Row) RowStats

Jump to

Keyboard shortcuts

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