orderbook

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2018 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DBName   = "dexy"
	FileName = "orders"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DepthResult added in v1.1.0

type DepthResult struct {
	Make struct {
		Token  types.Address `bson:"token"`
		Amount types.Int     `bson:"amount"`
	} `bson:"make"`
	Take struct {
		Token  types.Address `bson:"token"`
		Amount types.Int     `bson:"amount"`
	} `bson:"take"`
}

type MongoOrderBook

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

func NewMongoOrderBook

func NewMongoOrderBook(connection string) (*MongoOrderBook, error)

func (*MongoOrderBook) Asks

func (ob *MongoOrderBook) Asks(token types.Address, limit int) []types.Order

func (*MongoOrderBook) Bids

func (ob *MongoOrderBook) Bids(token types.Address, limit int) []types.Order

func (*MongoOrderBook) GetDepths added in v1.1.0

func (ob *MongoOrderBook) GetDepths(tokens []types.Address) (map[types.Address]types.Int, error)

this is ugly

func (*MongoOrderBook) GetHighestBids

func (ob *MongoOrderBook) GetHighestBids(tokens []types.Address) (types.Prices, error)

func (*MongoOrderBook) GetLowestAsks

func (ob *MongoOrderBook) GetLowestAsks(tokens []types.Address) (types.Prices, error)

func (*MongoOrderBook) GetOrderByHash

func (ob *MongoOrderBook) GetOrderByHash(hash types.Hash) *types.Order

func (*MongoOrderBook) GetOrders

func (ob *MongoOrderBook) GetOrders(token types.Address, user *types.Address, limit int) []types.Order

func (*MongoOrderBook) HasOrders added in v1.0.2

func (ob *MongoOrderBook) HasOrders(token types.Address, user types.Address) (bool, error)

func (*MongoOrderBook) InsertOrder

func (ob *MongoOrderBook) InsertOrder(order types.Order) error

func (*MongoOrderBook) RemoveOrder

func (ob *MongoOrderBook) RemoveOrder(hash types.Hash) bool

func (*MongoOrderBook) SetOrderStatuses added in v1.0.2

func (ob *MongoOrderBook) SetOrderStatuses(token types.Address, user types.Address, status types.OrderStatus) error

func (*MongoOrderBook) UpdateOrderFilledAmount

func (ob *MongoOrderBook) UpdateOrderFilledAmount(hash types.Hash, amount types.Int) error

type OrderBook

type OrderBook interface {
	InsertOrder(order types.Order) error
	RemoveOrder(hash types.Hash) bool
	Bids(token types.Address, limit int) []types.Order
	Asks(token types.Address, limit int) []types.Order
	UpdateOrderFilledAmount(hash types.Hash, amount types.Int) error
	GetOrderByHash(hash types.Hash) *types.Order
	GetOrders(token types.Address, user *types.Address, limit int) []types.Order
	GetDepths(tokens []types.Address) (map[types.Address]types.Int, error)
	HasOrders(token types.Address, user types.Address) (bool, error)
	SetOrderStatuses(token types.Address, user types.Address, status types.OrderStatus) error
}

Jump to

Keyboard shortcuts

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