market

package
v0.0.16-bugfix-2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2019 License: BSD-2-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StoreKey   = types.StoreKey
	ModuleName = types.ModuleName
)
View Source
const (
	IntegrationNetSubString = types.IntegrationNetSubString
	OrderIDPartsNum         = types.OrderIDPartsNum
	SymbolSeparator         = types.SymbolSeparator
	LimitOrder              = types.LimitOrder
	GTE                     = types.GTE
	BID                     = types.BID
	ASK                     = types.ASK
	BUY                     = types.BUY
	SELL                    = types.SELL
)

Variables

View Source
var (
	NewBaseKeeper       = keepers.NewKeeper
	DefaultParams       = types.DefaultParams
	DecToBigEndianBytes = types.DecToBigEndianBytes
	ValidateOrderID     = types.ValidateOrderID
	IsValidTradingPair  = types.IsValidTradingPair
	ModuleCdc           = types.ModuleCdc
)
View Source
var (
	EventTypeMarket = "market"

	AttributeKeyTradingPair      = "trading-pair"
	AttributeKeyOrder            = "order"
	AttributeKeyStock            = "stock"
	AttributeKeyMoney            = "money"
	AttributeKeyPricePrecision   = "price-precision"
	AttributeKeyLastExecutePrice = "last-execute-price"
	AttributeKeySender           = "sender"

	AttributeKeySequence    = "sequence"
	AttributeKeyOrderType   = "order-type"
	AttributeKeyPrice       = "price"
	AttributeKeyQuantity    = "quantity"
	AttributeKeySide        = "side"
	AttributeKeyHeight      = "height"
	AttributeKeyTimeInForce = "time-in-force"

	AttributeKeyDelOrderReason = "del-order-reason"
	AttributeKeyDelOrderHeight = "del-order-height"
	AttributeKeyUsedCommission = "used-commission"
	AttributeKeyLeftStock      = "left-stock"
	AttributeKeyDealStock      = "deal-stock"
	AttributeKeyRemainAmount   = "remain-amount"
	AttributeKeyDealMoney      = "deal-money"

	AttributeKeyEffectiveTime = "effective-time"

	AttributeKeyOldPricePrecision = "old-price-precision"
	AttributeKeyNewPricePrecision = "new-price-precision"
)

Market module event types

Functions

func EndBlocker

func EndBlocker(ctx sdk.Context, keeper keepers.Keeper)

func InitGenesis

func InitGenesis(ctx sdk.Context, keeper keepers.Keeper, data GenesisState)

InitGenesis - Init store state from genesis data

func NewHandler

func NewHandler(k keepers.Keeper) sdk.Handler

Types

type AppModule added in v0.0.4

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

___________________________ app module object

func NewAppModule added in v0.0.4

func NewAppModule(marketKeeper keepers.Keeper) AppModule

NewAppModule creates a new AppModule object

func (AppModule) BeginBlock added in v0.0.4

func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock)

func (AppModule) EndBlock added in v0.0.4

func (AppModule) ExportGenesis added in v0.0.4

func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage

func (AppModule) InitGenesis added in v0.0.4

func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate

func (AppModule) NewHandler added in v0.0.4

func (am AppModule) NewHandler() sdk.Handler

func (AppModule) NewQuerierHandler added in v0.0.4

func (am AppModule) NewQuerierHandler() sdk.Querier

func (AppModule) QuerierRoute added in v0.0.4

func (am AppModule) QuerierRoute() string

func (AppModule) RegisterInvariants added in v0.0.4

func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)

registers

func (AppModule) Route added in v0.0.4

func (am AppModule) Route() string

routes

type AppModuleBasic added in v0.0.4

type AppModuleBasic struct {
}

app module basics object

func (AppModuleBasic) DefaultGenesis added in v0.0.4

func (AppModuleBasic) DefaultGenesis() json.RawMessage

genesis

func (AppModuleBasic) GetQueryCmd added in v0.0.4

func (amb AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command

func (AppModuleBasic) GetTxCmd added in v0.0.4

func (amb AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command

func (AppModuleBasic) Name added in v0.0.4

func (AppModuleBasic) Name() string

func (AppModuleBasic) RegisterCodec added in v0.0.4

func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)

func (AppModuleBasic) RegisterRESTRoutes added in v0.0.4

func (amb AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)

client functionality

func (AppModuleBasic) ValidateGenesis added in v0.0.4

func (AppModuleBasic) ValidateGenesis(data json.RawMessage) error

type CancelOrderInfo

type CancelOrderInfo = types.CancelOrderInfo

type CreateOrderInfo

type CreateOrderInfo = types.CreateOrderInfo

type FillOrderInfo

type FillOrderInfo = types.FillOrderInfo

type GenesisState

type GenesisState struct {
	Params         types.Params       `json:"params"`
	Orders         []*types.Order     `json:"orders"`
	MarketInfos    []types.MarketInfo `json:"market_infos"`
	OrderCleanTime int64              `json:"order_clean_time"`
}

func DefaultGenesisState

func DefaultGenesisState() GenesisState

DefaultGenesisState - Return a default genesis state

func ExportGenesis

func ExportGenesis(ctx sdk.Context, k keepers.Keeper) GenesisState

ExportGenesis returns a GenesisState for a given context and keeper

func NewGenesisState

func NewGenesisState(params types.Params, orders []*types.Order, infos []types.MarketInfo, cleanTime int64) GenesisState

NewGenesisState - Create a new genesis state

func (GenesisState) Validate

func (data GenesisState) Validate() error

ValidateGenesis performs basic validation of market genesis data returning an error for any failed validation criteria.

type InfoForDeal

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

Some handlers which are useful when orders are matched and traded.

type Keeper

type Keeper = keepers.Keeper

type MarketInfo

type MarketInfo = types.MarketInfo

type MsgCancelOrder

type MsgCancelOrder = types.MsgCancelOrder

type MsgCancelTradingPair added in v0.0.3

type MsgCancelTradingPair = types.MsgCancelTradingPair

type MsgCreateOrder

type MsgCreateOrder = types.MsgCreateOrder

type MsgCreateTradingPair added in v0.0.3

type MsgCreateTradingPair = types.MsgCreateTradingPair

type MsgModifyPricePrecision added in v0.0.15

type MsgModifyPricePrecision = types.MsgModifyPricePrecision

type Order

type Order = types.Order

type WrappedOrder

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

Wrapper an order with InfoForDeal, which contains useful handlers

func (*WrappedOrder) Deal

func (wo *WrappedOrder) Deal(otherSide match.OrderForTrade, amount int64, price sdk.Dec)

func (*WrappedOrder) GetAmount

func (wo *WrappedOrder) GetAmount() int64

func (*WrappedOrder) GetHash

func (wo *WrappedOrder) GetHash() []byte

func (*WrappedOrder) GetHeight

func (wo *WrappedOrder) GetHeight() int64

func (*WrappedOrder) GetOwner

func (wo *WrappedOrder) GetOwner() match.Account

func (*WrappedOrder) GetPrice

func (wo *WrappedOrder) GetPrice() sdk.Dec

WrappedOrder implements OrderForTrade interface

func (*WrappedOrder) GetSide

func (wo *WrappedOrder) GetSide() int

func (*WrappedOrder) String

func (wo *WrappedOrder) String() string

Directories

Path Synopsis
client
cli
internal

Jump to

Keyboard shortcuts

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