lottery

package
v0.0.0-...-91dbc65 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package lottery is in charge of handling the logic for the daily lotteries.

Index

Constants

View Source
const (

	// Lottery capacity divisor
	CapacityDivisor = 5
)

Prize pool percentages

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	PrizePool  int64  `json:"prize_pool"`
	Capacity   int64  `json:"capacity"`
	NextHeight uint32 `json:"next_height"`
}

Info contains details about the lottery.

func GetInfo

func GetInfo(ctx context.Context, lnd lightning.Client, db *db.DB) (Info, error)

GetInfo returns information about the lottery.

type Lottery

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

Lottery is in charge of handling the lottery's logic.

func New

func New(
	config config.Lottery,
	db *db.DB,
	lnd lightning.Client,
	notifier notification.Notifier,
	winnersCh chan<- []db.Winner,
	blocksCh <-chan *chainrpc.BlockEpoch,
) (*Lottery, error)

New returns a new Lottery object.

func (*Lottery) Start

func (l *Lottery) Start() error

Start executes the loop in charge of doing the periodic lottery.

Jump to

Keyboard shortcuts

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