keeper

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 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

ActiveBets returns active bets of a sport-event

func (Keeper) BatchSportEventSettlements

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

Bets returns all bets

func (Keeper) BetsByCreator

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

func (Keeper) BetsByUIDs

Bets returns bets with selected uids

func (Keeper) GetActiveBets

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

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

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

GetBetIDs returns list of uid2id

func (Keeper) GetBetStats

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

GetBet returns bet stats

func (Keeper) GetBets

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

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

GetSettledBets returns list of the active bets

func (Keeper) IsAnyActiveBetForSportEvent

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

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

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

RemoveActiveBet removes an active bet

func (Keeper) SetActiveBet

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

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

SetBetID sets a specific bet id map in the store

func (Keeper) SetBetStats

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

SetBetStats sets bet statistics in the store

func (*Keeper) SetDVMKeeper

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

SetDVMKeeper sets dvm keeper to the bet keeper.

func (*Keeper) SetOrderBookKeeper

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

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

SetSettledBet sets a settled bet

func (*Keeper) SetSportEventKeeper

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

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