manager

package
v0.0.0-...-24518c4 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOrderNotFound = errors.New("order not found")
)

Functions

This section is empty.

Types

type Manager

type Manager struct {
	Wallet        *wallet.Wallet
	Client        *blockclient.Client
	ChainID       int64
	RouterHex     string
	OrderChannels map[uint]chan bool

	DB  *database.DB
	Bot *telebot.Bot
	// contains filtered or unexported fields
}

func New

func New(bot *telebot.Bot, wallet *wallet.Wallet, db *database.DB, chainID int64, rpcURL, routerHex string) (*Manager, error)

Returns a new order manager

func (*Manager) AddOrder

func (m *Manager) AddOrder(order *order.Order) (*order.Order, error)

Adds a new order to the manager

func (*Manager) NotifyFailure

func (m *Manager) NotifyFailure(order *order.Order, notifyErr error) error

Sends a failure message to the user

func (*Manager) NotifySuccess

func (m *Manager) NotifySuccess(order *order.Order) error

Sends a success message to the user

func (*Manager) RemoveOrder

func (m *Manager) RemoveOrder(id uint) error

Removes an order from the manager

func (*Manager) StartDBOrders

func (m *Manager) StartDBOrders() error

Add the existing database orders to the manager

Jump to

Keyboard shortcuts

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