keeper

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: Apache-2.0 Imports: 20 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 storetypes.StoreKey,
	ps paramtypes.Subspace,
	authority string,
) *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) GetAuthority added in v1.4.5

func (k Keeper) GetAuthority() string

GetAuthority returns the x/bet module's authority.

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) GetConstraints added in v1.0.0

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

GetConstraints get bet constraint values of the bet wager constraints

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) 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) PrepareBetObject added in v1.3.0

func (k Keeper) PrepareBetObject(ctx sdk.Context, creator string, props *types.WagerProps) (*types.Bet, map[string]*types.BetOddsCompact, error)

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) Settle added in v1.0.1

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

Settle 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

func (Keeper) Wager added in v1.0.1

func (k Keeper) Wager(ctx sdk.Context, bet *types.Bet, betOdds map[string]*types.BetOddsCompact) error

Wager stores a new bet in KVStore

Jump to

Keyboard shortcuts

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