payouts

package
v0.0.0-...-b4d4280 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: AGPL-3.0 Imports: 20 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 FromCSV

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

func Import

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

func Preview

func Preview(ctx context.Context, config Config, db *pipelinedb.DB, paymentPayer payer.Payer) error

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 {
	ReportStatusf(format string, args ...interface{})
	ReportWarnf(format string, args ...interface{})
	ReportErrorf(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.Type, nodeAddress string, chainID int, sink AuditSink, receiptsOut string, receiptsForce bool) (*AuditStats, error)

type Config

type Config struct {
	Quoter coinmarketcap.Quoter

	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