Documentation ¶
Index ¶
- Constants
- Variables
- func EndBlocker(ctx sdk.Context, keeper keepers.Keeper)
- func InitGenesis(ctx sdk.Context, keeper keepers.Keeper, data GenesisState)
- func NewHandler(k keepers.Keeper) sdk.Handler
- type AppModule
- func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock)
- func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
- func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
- func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
- func (am AppModule) NewHandler() sdk.Handler
- func (am AppModule) NewQuerierHandler() sdk.Querier
- func (am AppModule) QuerierRoute() string
- func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
- func (am AppModule) Route() string
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis() json.RawMessage
- func (amb AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
- func (amb AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (amb AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
- func (AppModuleBasic) ValidateGenesis(data json.RawMessage) error
- type CancelOrderInfo
- type CreateOrderInfo
- type FillOrderInfo
- type GenesisState
- type InfoForDeal
- type Keeper
- type MarketInfo
- type MsgCancelOrder
- type MsgCancelTradingPair
- type MsgCreateOrder
- type MsgCreateTradingPair
- type MsgModifyPricePrecision
- type Order
- type WrappedOrder
- func (wo *WrappedOrder) Deal(otherSide match.OrderForTrade, amount int64, price sdk.Dec)
- func (wo *WrappedOrder) GetAmount() int64
- func (wo *WrappedOrder) GetHash() []byte
- func (wo *WrappedOrder) GetHeight() int64
- func (wo *WrappedOrder) GetOwner() match.Account
- func (wo *WrappedOrder) GetPrice() sdk.Dec
- func (wo *WrappedOrder) GetSide() int
- func (wo *WrappedOrder) String() string
Constants ¶
const ( StoreKey = types.StoreKey ModuleName = types.ModuleName )
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 ¶
var ( NewBaseKeeper = keepers.NewKeeper DefaultParams = types.DefaultParams DecToBigEndianBytes = types.DecToBigEndianBytes ValidateOrderID = types.ValidateOrderID IsValidTradingPair = types.IsValidTradingPair ModuleCdc = types.ModuleCdc )
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 InitGenesis ¶
func InitGenesis(ctx sdk.Context, keeper keepers.Keeper, data GenesisState)
InitGenesis - Init store state from genesis data
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
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 (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
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 (AppModule) NewQuerierHandler ¶ added in v0.0.4
func (AppModule) QuerierRoute ¶ added in v0.0.4
func (AppModule) RegisterInvariants ¶ added in v0.0.4
func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)
registers
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 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 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