keeper

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

Types

type Keeper

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

Keeper is the type for module properties

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey sdk.StoreKey,
	ps paramtypes.Subspace,
) *Keeper

NewKeeper creates new keeper object

func (Keeper) BatchMarketSettlements added in v0.0.6

func (k Keeper) BatchMarketSettlements(ctx sdk.Context) error

BatchMarketSettlements settles bets of resolved markets in batch. The markets get into account in FIFO manner.

func (Keeper) Bet

Bet returns a specific bet by its UID

func (Keeper) Bets added in v0.0.3

Bets returns all bets

func (Keeper) BetsByCreator added in v0.0.4

BetsByCreator returns all bets of certain creator sort-able by pagination attributes

func (Keeper) BetsByUIDs added in v0.0.4

BetsByUIDs returns bets with selected uids

func (Keeper) GetBet

func (k Keeper) GetBet(ctx sdk.Context, creator string, id uint64) (val types.Bet, found bool)

GetBet returns a bet by its UID

func (Keeper) GetBetID added in v0.0.4

func (k Keeper) GetBetID(ctx sdk.Context, uid string) (val types.UID2ID, found bool)

GetBetID returns a bet ID by its UID

func (Keeper) GetBetIDs added in v0.0.5

func (k Keeper) GetBetIDs(ctx sdk.Context) (list []types.UID2ID, err error)

GetBetIDs returns list of uid2id

func (Keeper) GetBetStats added in v0.0.4

func (k Keeper) GetBetStats(ctx sdk.Context) (val types.BetStats)

GetBetStats returns bet stats

func (Keeper) GetBets added in v0.0.3

func (k Keeper) GetBets(ctx sdk.Context) (list []types.Bet, err error)

GetBets returns list of bets

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams get all parameters as types.Params

func (Keeper) GetPendingBets added in v0.0.6

func (k Keeper) GetPendingBets(ctx sdk.Context) (list []types.PendingBet, err error)

GetPendingBets returns list of the pending bets

func (Keeper) GetPlacementConstraints added in v0.0.9

func (k Keeper) GetPlacementConstraints(ctx sdk.Context) (params types.Constraints)

GetPlacementConstraints get bet constraint values of the bet placement constraints

func (Keeper) GetSettledBets added in v0.0.5

func (k Keeper) GetSettledBets(ctx sdk.Context) (list []types.SettledBet, err error)

GetSettledBets returns list of the pending bets

func (Keeper) IsAnyPendingBetForMarket added in v0.0.6

func (k Keeper) IsAnyPendingBetForMarket(ctx sdk.Context, marketUID string) (thereIs bool, err error)

IsAnyPendingBetForMarket checks if there is any pending bet for the market

func (Keeper) Logger

func (Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns the logger of the keeper

func (Keeper) Params added in v0.0.5

Params returns the params of the module

func (Keeper) PendingBets added in v0.0.6

PendingBets returns pending bets of a market

func (Keeper) PlaceBet

func (k Keeper) PlaceBet(ctx sdk.Context, bet *types.Bet) error

PlaceBet stores a new bet in KVStore

func (Keeper) RemovePendingBet added in v0.0.6

func (k Keeper) RemovePendingBet(ctx sdk.Context, marketUID string, betID uint64)

RemovePendingBet removes an pending bet

func (Keeper) SetBet

func (k Keeper) SetBet(ctx sdk.Context, bet types.Bet, id uint64)

SetBet sets a specific bet in the store

func (Keeper) SetBetID added in v0.0.4

func (k Keeper) SetBetID(ctx sdk.Context, uid2ID types.UID2ID)

SetBetID sets a specific bet id map in the store

func (Keeper) SetBetStats added in v0.0.4

func (k Keeper) SetBetStats(ctx sdk.Context, stats types.BetStats)

SetBetStats sets bet statistics in the store

func (*Keeper) SetMarketKeeper added in v0.0.6

func (k *Keeper) SetMarketKeeper(marketKeeper types.MarketKeeper)

SetMarketKeeper sets market keeper to the bet keeper.

func (*Keeper) SetOVMKeeper added in v0.0.6

func (k *Keeper) SetOVMKeeper(ovmKeeper types.OVMKeeper)

SetOVMKeeper sets ovm keeper to the bet keeper.

func (*Keeper) SetOrderbookKeeper added in v0.0.8

func (k *Keeper) SetOrderbookKeeper(orderbookKeeper types.OrderbookKeeper)

SetOrderbookKeeper sets orderbook keeper to the bet keeper.

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams set the params

func (Keeper) SetPendingBet added in v0.0.6

func (k Keeper) SetPendingBet(
	ctx sdk.Context,
	pendingBet *types.PendingBet,
	id uint64,
	marketUID string,
)

SetPendingBet sets an pending bet

func (Keeper) SetSettledBet added in v0.0.5

func (k Keeper) SetSettledBet(
	ctx sdk.Context,
	settledBet *types.SettledBet,
	id uint64,
	blockHeight int64,
)

SetSettledBet sets a settled bet

func (Keeper) SettleBet

func (k Keeper) SettleBet(ctx sdk.Context, bettorAddressStr, betUID string) error

SettleBet settles a single bet and updates it in KVStore

func (Keeper) SettledBetsOfHeight added in v0.0.5

SettledBetsOfHeight returns settled bets of a certain height

Jump to

Keyboard shortcuts

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