Documentation ¶
Index ¶
- Constants
- Variables
- func BeginBlocker(ctx sdk.Context, keeper keeper.Keeper)
- func CalculateGas(msg sdk.Msg, params *types.Params) (gas uint64)
- func EndBlocker(ctx sdk.Context, keeper keeper.Keeper)
- func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, data GenesisState)
- func NewOrderHandler(keeper keeper.Keeper) sdk.Handler
- func ValidateGenesis(data GenesisState) error
- func ValidateMsgCancelOrders(ctx sdk.Context, keeper keeper.Keeper, msg types.MsgCancelOrders) error
- func ValidateMsgNewOrders(ctx sdk.Context, k keeper.Keeper, msg types.MsgNewOrders) (*sdk.Result, error)
- 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 (AppModule) QuerierRoute() string
- func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
- func (AppModule) Route() string
- type AppModuleBasic
- func (AppModuleBasic) DefaultGenesis() json.RawMessage
- func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
- func (AppModuleBasic) Name() string
- func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
- func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
- func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
- type BlockMatchResult
- type Deal
- type DepthBook
- type GenesisState
- type Keeper
- type MatchResult
- type MsgCancelOrder
- type MsgCancelOrders
- type MsgNewOrder
- type MsgNewOrders
- type Order
- type Params
Constants ¶
const ( ModuleName = types.ModuleName RouterKey = types.RouterKey QuerierRoute = types.QuerierRoute DefaultParamspace = types.DefaultParamspace DefaultCodespace = types.DefaultCodespace OrderStoreKey = types.OrderStoreKey )
nolint const params aliases
Variables ¶
var ( RegisterCodec = types.RegisterCodec DefaultParams = types.DefaultParams NewMsgNewOrder = types.NewMsgNewOrder NewMsgCancelOrder = types.NewMsgCancelOrder NewKeeper = keeper.NewKeeper NewQuerier = keeper.NewQuerier FormatOrderIDsKey = types.FormatOrderIDsKey )
nolint functions aliases
Functions ¶
func BeginBlocker ¶
BeginBlocker runs the logic of BeginBlocker with version 0. BeginBlocker resets keeper cache.
func EndBlocker ¶
EndBlocker called every block 1. execute matching engine 2. flush cache
func InitGenesis ¶
func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, data GenesisState)
InitGenesis initialize default parameters and the keeper's address to pubkey map
func NewOrderHandler ¶
NewOrderHandler returns the handler with version 0.
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis validates the slashing genesis parameters
func ValidateMsgCancelOrders ¶
func ValidateMsgCancelOrders(ctx sdk.Context, keeper keeper.Keeper, msg types.MsgCancelOrders) error
ValidateMsgCancelOrders validates whether the msg of cancelOrders is valid.
Types ¶
type AppModule ¶
type AppModule struct { AppModuleBasic // contains filtered or unexported fields }
AppModule : app module
func NewAppModule ¶
func NewAppModule(v version.ProtocolVersionType, keeper keeper.Keeper, supplyKeeper auth.SupplyKeeper) AppModule
NewAppModule : creates a new AppModule object
func (AppModule) BeginBlock ¶
func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock)
BeginBlock : module begin-block
func (AppModule) EndBlock ¶
func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate
EndBlock : module end-block
func (AppModule) ExportGenesis ¶
func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage
ExportGenesis : module export genesis
func (AppModule) InitGenesis ¶
func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate
InitGenesis : module init-genesis
func (AppModule) NewHandler ¶
NewHandler : module handler
func (AppModule) NewQuerierHandler ¶
NewQuerierHandler : module querier
func (AppModule) QuerierRoute ¶
QuerierRoute : module querier route name
func (AppModule) RegisterInvariants ¶
func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)
RegisterInvariants : register invariants
type AppModuleBasic ¶
type AppModuleBasic struct{}
AppModuleBasic : app module basics object
func (AppModuleBasic) DefaultGenesis ¶
func (AppModuleBasic) DefaultGenesis() json.RawMessage
DefaultGenesis : default genesis state
func (AppModuleBasic) GetQueryCmd ¶
func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command
GetQueryCmd : get the root query command of this module
func (AppModuleBasic) GetTxCmd ¶
func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command
GetTxCmd : get the root tx command of this module
func (AppModuleBasic) RegisterCodec ¶
func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)
RegisterCodec : register module codec
func (AppModuleBasic) RegisterRESTRoutes ¶
func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)
RegisterRESTRoutes : register rest routes
func (AppModuleBasic) ValidateGenesis ¶
func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error
ValidateGenesis : module validate genesis
type GenesisState ¶
type GenesisState struct { Params types.Params `json:"params"` OpenOrders []*types.Order `json:"open_orders"` }
GenesisState - all order state that must be provided at genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState - default GenesisState used by Cosmos Hub
func ExportGenesis ¶
func ExportGenesis(ctx sdk.Context, keeper keeper.Keeper) (data GenesisState)
ExportGenesis writes the current store values to a genesis file, which can be imported again with InitGenesis