order

package
v0.0.0-...-f05cc18 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: AGPL-3.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidOrderQty = errors.New("invalid-order-quantity")
)
View Source
var (
	ErrInvalidSide = errors.New("invalid-order-side")
)
View Source
var (
	ErrInvalidType = errors.New("invalid-order-type")
)
View Source
var (
	Sides = []Side{
		SideIsBuy,
		SideIsSell,
	}
)
View Source
var (
	Types = []Type{
		TypeIsMarket,
	}
)

Functions

This section is empty.

Types

type Order

type Order struct {
	ID            uuid.UUID
	ExecutionTime *time.Time
	Type          Type
	Exchange      string
	Pair          string
	Side          Side
	Quantity      float64
	Price         float64
}

func (Order) Validate

func (o Order) Validate() error

type Side

type Side string
const (
	SideIsBuy  Side = "buy"
	SideIsSell Side = "sell"
)

func (Side) String

func (s Side) String() string

func (Side) Validate

func (s Side) Validate() error

type Type

type Type string
const (
	TypeIsMarket Type = "market"
)

func (Type) String

func (t Type) String() string

func (Type) Validate

func (t Type) Validate() error

Jump to

Keyboard shortcuts

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