Documentation
¶
Index ¶
- func NewMsgServer(k *Keeper) types.MsgServer
- func NewQueryServer(k *Keeper) types.QueryServer
- type Keeper
- func (k *Keeper) CreateMarket(ctx sdk.Context, market types.Market) error
- func (k *Keeper) DeleteMarket(ctx sdk.Context, tickerStr string) (bool, error)
- func (k *Keeper) DisableMarket(ctx sdk.Context, tickerStr string) error
- func (k *Keeper) EnableMarket(ctx sdk.Context, tickerStr string) error
- func (k *Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
- func (k *Keeper) GetAllMarkets(ctx sdk.Context) (map[string]types.Market, error)
- func (k *Keeper) GetAllMarketsList(ctx sdk.Context) ([]types.Market, error)
- func (k *Keeper) GetLastUpdated(ctx sdk.Context) (uint64, error)
- func (k *Keeper) GetMarket(ctx sdk.Context, tickerStr string) (types.Market, error)
- func (k *Keeper) GetParams(ctx sdk.Context) (types.Params, error)
- func (k *Keeper) HasMarket(ctx sdk.Context, tickerStr string) (bool, error)
- func (k *Keeper) Hooks() types.MarketMapHooks
- func (k *Keeper) InitGenesis(ctx sdk.Context, gs types.GenesisState)
- func (k *Keeper) InitializeForGenesis(_ sdk.Context)
- func (k *Keeper) IsMarketValid(ctx sdk.Context, market types.Market) error
- func (k *Keeper) SetDeleteMarketValidationHooks(hooks types.MarketValidationHooks)
- func (k *Keeper) SetHooks(mmh types.MarketMapHooks)
- func (k *Keeper) SetLastUpdated(ctx sdk.Context, height uint64) error
- func (k *Keeper) SetParams(ctx sdk.Context, params types.Params) error
- func (k *Keeper) UpdateMarket(ctx sdk.Context, market types.Market) error
- func (k *Keeper) ValidateState(ctx sdk.Context, updates []types.Market) error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServer ¶
NewMsgServer returns the default implementation of the x/marketmap message service.
func NewQueryServer ¶
func NewQueryServer(k *Keeper) types.QueryServer
NewQueryServer returns an implementation of the x/marketmap QueryServer.
Types ¶
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
Keeper is the module's keeper implementation.
func NewKeeper ¶
func NewKeeper(ss store.KVStoreService, cdc codec.BinaryCodec, authority sdk.AccAddress, opts ...Option) *Keeper
NewKeeper initializes the keeper and its backing stores.
func (*Keeper) CreateMarket ¶
CreateMarket initializes a new Market. The Ticker.String corresponds to a market, and must be unique.
func (*Keeper) DeleteMarket ¶
DeleteMarket removes a Market. If the market does not exist, this is a no-op and nil is returned. If the market exists, all DeleteMarketValidationHooks are called on the market before deletion. Additionally, returns true if the market was deleted.
func (*Keeper) DisableMarket ¶
DisableMarket sets the Enabled field of a Market Ticker to false.
func (*Keeper) EnableMarket ¶
EnableMarket sets the Enabled field of a Market Ticker to true.
func (*Keeper) ExportGenesis ¶
func (k *Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState
ExportGenesis retrieves the genesis from state.
func (*Keeper) GetAllMarkets ¶
GetAllMarkets returns the set of Market objects currently stored in state as a map[TickerString] -> Markets.
func (*Keeper) GetAllMarketsList ¶
GetAllMarketsList returns the set of Market objects currently stored in state as a list.
func (*Keeper) GetLastUpdated ¶
GetLastUpdated gets the last block-height the market map was updated.
func (*Keeper) GetMarket ¶
GetMarket returns a market from the store by its currency pair string ID.
func (*Keeper) Hooks ¶
func (k *Keeper) Hooks() types.MarketMapHooks
Hooks gets the hooks for x/marketmap keeper.
func (*Keeper) InitGenesis ¶
func (k *Keeper) InitGenesis(ctx sdk.Context, gs types.GenesisState)
InitGenesis initializes the genesis state. Panics if there is an error. Any modules that integrate with x/marketmap must set their InitGenesis to occur before the x/marketmap module's InitGenesis. This is so that logic any consuming modules may want to implement in AfterMarketGenesis will be run properly.
func (*Keeper) InitializeForGenesis ¶
InitializeForGenesis is a no-op.
func (*Keeper) IsMarketValid ¶
IsMarketValid checks if a market is valid by statefully checking if each of the currency pairs specified by its provider configs are valid and in state.
func (*Keeper) SetDeleteMarketValidationHooks ¶
func (k *Keeper) SetDeleteMarketValidationHooks(hooks types.MarketValidationHooks)
SetDeleteMarketValidationHooks sets the MarketValidationHooks for deletion in the keeper.
func (*Keeper) SetHooks ¶
func (k *Keeper) SetHooks(mmh types.MarketMapHooks)
SetHooks sets the x/marketmap hooks. In contrast to other receivers, this method must take a pointer due to nature of the hooks interface and SDK start up sequence.
func (*Keeper) SetLastUpdated ¶
SetLastUpdated sets the lastUpdated field to the current block height.
func (*Keeper) UpdateMarket ¶
UpdateMarket updates a Market. The Ticker.String corresponds to a market, and exist unique.
type Option ¶
type Option func(*Keeper)
Option is a type that modifies a keeper during instantiation. These can be passed variadically into NewKeeper to specify keeper behavior.
func WithDeleteValidationHooks ¶
func WithDeleteValidationHooks(hooks []types.MarketValidationHook) Option
WithDeleteValidationHooks sets the keeper deleteMarketValidationHooks to the given hooks.
func WithHooks ¶
func WithHooks(hooks types.MarketMapHooks) Option
WithHooks sets the keeper hooks to the given hooks.