keeper

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2023 License: Apache-2.0 Imports: 16 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) ActiveBets added in v0.0.5

ActiveBets returns active bets of a sport-event

func (Keeper) BatchSportEventSettlements added in v0.0.5

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

BatchSportEventSettlements settles bets of resolved sport-events in batch. The sport-events get into account according in FIFO.

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

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

func (Keeper) BetsByUIDs added in v0.0.4

Bets returns bets with selected uids

func (Keeper) GetActiveBets added in v0.0.5

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

GetActiveBets returns list of the active bets

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)

GetBet 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) GetSettledBets added in v0.0.5

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

GetSettledBets returns list of the active bets

func (Keeper) IsAnyActiveBetForSportEvent added in v0.0.5

func (k Keeper) IsAnyActiveBetForSportEvent(ctx sdk.Context, sportEventUID string) (thereIs bool, err error)

IsAnyActiveBetForSportEvent checks if there is any active bet for the sport-event

func (Keeper) Logger

func (k 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) PlaceBet

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

PlaceBet stores a new bet in KVStore

func (Keeper) RemoveActiveBet added in v0.0.5

func (k Keeper) RemoveActiveBet(ctx sdk.Context, sportEventUID string, betID uint64)

RemoveActiveBet removes an active bet

func (Keeper) SetActiveBet added in v0.0.5

func (k Keeper) SetActiveBet(ctx sdk.Context, activeBet *types.ActiveBet, id uint64, sportEventUID string)

SetActiveBet sets an active 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) SetDVMKeeper added in v0.0.5

func (k *Keeper) SetDVMKeeper(dvmKeeper types.DVMKeeper)

SetDVMKeeper sets dvm keeper to the bet keeper.

func (*Keeper) SetOrderBookKeeper added in v0.0.5

func (k *Keeper) SetOrderBookKeeper(orderBookKeeper types.OrderBookKeeper)

SetOrderBookKeeper sets order book keeper to the bet keeper.

func (Keeper) SetParams

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

SetParams set the params

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) SetSportEventKeeper added in v0.0.5

func (k *Keeper) SetSportEventKeeper(sportEventKeeper types.SportEventKeeper)

SetSportEventKeeper sets sport-event keeper to the bet keeper.

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