keeper

package
v0.0.0-...-3ec3047 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: 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

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

Bets returns all bets

func (Keeper) BetsByCreator

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

func (Keeper) BetsByUIDs

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

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)

GetBetStats 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) GetPendingBets

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

GetPendingBets returns list of the pending bets

func (Keeper) GetSettledBets

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

GetSettledBets returns list of the pending bets

func (Keeper) IsAnyPendingBetForMarket

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 (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) PendingBets

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

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

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) SetMarketKeeper

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

SetMarketKeeper sets market 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

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

SetPendingBet sets an pending bet

func (*Keeper) SetSRKeeper

func (k *Keeper) SetSRKeeper(srKeeper types.SRKeeper)

SetSRKeeper sets sr keeper to the bet keeper.

func (Keeper) SetSettledBet

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

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