order

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: Apache-2.0, Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryList = "list"
)
View Source
const (
	TableKey = "order_meta"
)

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

func RegisterRoutes

func RegisterRoutes(ctx context.CLIContext, r *mux.Router, cdc *codec.Codec)

Types

type IteratorCB

type IteratorCB func(order Order) bool

type Keeper

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

func NewKeeper

func NewKeeper(db dbm.DB, cdc *codec.Codec) Keeper

func (Keeper) Get

func (k Keeper) Get(id store.EntityID) (Order, sdk.Error)

func (Keeper) OnEvent

func (k Keeper) OnEvent(event interface{}) error

func (Keeper) OnFillEvent

func (k Keeper) OnFillEvent(event types.Fill) sdk.Error

func (Keeper) OnOrderCancelledEvent

func (k Keeper) OnOrderCancelledEvent(event types.OrderCancelled) sdk.Error

func (Keeper) OnOrderCreatedEvent

func (k Keeper) OnOrderCreatedEvent(event types.OrderCreated)

func (Keeper) OpenOrdersByMarket

func (k Keeper) OpenOrdersByMarket(mktID store.EntityID) []Order

func (Keeper) OrdersByOwner

func (k Keeper) OrdersByOwner(owner sdk.AccAddress, cb IteratorCB)

func (Keeper) ReverseIterator

func (k Keeper) ReverseIterator(cb IteratorCB)

func (Keeper) ReverseIteratorFrom

func (k Keeper) ReverseIteratorFrom(startID store.EntityID, cb IteratorCB)

func (Keeper) ReverseIteratorOpenOrders

func (k Keeper) ReverseIteratorOpenOrders(cb IteratorCB)

func (Keeper) Set

func (k Keeper) Set(order Order)

type ListQueryRequest

type ListQueryRequest struct {
	Start store.EntityID
	Owner sdk.AccAddress
}

type ListQueryResult

type ListQueryResult struct {
	NextID store.EntityID `json:"next_id"`
	Orders []Order        `json:"orders"`
}

type Order

type Order struct {
	ID             store.EntityID     `json:"id"`
	Owner          sdk.AccAddress     `json:"owner"`
	MarketID       store.EntityID     `json:"market_id"`
	Direction      matcheng.Direction `json:"direction"`
	Price          sdk.Uint           `json:"price"`
	Quantity       sdk.Uint           `json:"quantity"`
	Status         string             `json:"status"`
	Type           string             `json:"type"`
	TimeInForce    uint16             `json:"time_in_force"`
	QuantityFilled sdk.Uint           `json:"quantity_filled"`
	CreatedBlock   int64              `json:"created_block"`
}

Jump to

Keyboard shortcuts

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