frontend

package
v0.0.0-...-04e8804 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoAcceptFrontend

type AutoAcceptFrontend struct{}

func (AutoAcceptFrontend) ApproveOffer

func (f AutoAcceptFrontend) ApproveOffer(siacoin types.Currency, offer trader.Offer, binding bool) (bool, error)

func (AutoAcceptFrontend) CheckSimilarity

func (f AutoAcceptFrontend) CheckSimilarity(a trader.Offer, b trader.Offer) bool

type ConsoleFrontend

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

func NewConsoleFrontend

func NewConsoleFrontend(similarityPercentage int64, useExchangeRate bool, exchangeRate Fetcher) *ConsoleFrontend

func (*ConsoleFrontend) ApproveOffer

func (f *ConsoleFrontend) ApproveOffer(siacoin types.Currency, offer trader.Offer, binding bool) (bool, error)

func (*ConsoleFrontend) CheckSimilarity

func (f *ConsoleFrontend) CheckSimilarity(a trader.Offer, b trader.Offer) bool

type Fetcher

type Fetcher interface {
	Fetch(id string) (*big.Rat, error)
}

type Frontend

type Frontend interface {
	ApproveOffer(siacoin types.Currency, offer trader.Offer, binding bool) (bool, error)
	CheckSimilarity(a trader.Offer, b trader.Offer) bool
}

type RuleBasedFrontend

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

func NewRuleBasedFrontend

func NewRuleBasedFrontend(absDiffRule float64, relDiffRule float64, exchangeRate Fetcher) *RuleBasedFrontend

func (*RuleBasedFrontend) ApproveOffer

func (f *RuleBasedFrontend) ApproveOffer(siacoin types.Currency, offer trader.Offer, binding bool) (bool, error)

func (*RuleBasedFrontend) CheckSimilarity

func (f *RuleBasedFrontend) CheckSimilarity(a trader.Offer, b trader.Offer) bool

Jump to

Keyboard shortcuts

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