keeper

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 18 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.

func NewQueryServer

func NewQueryServer(keeper Keeper) types.QueryServer

Types

type Hooks

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

Hooks wrapper struct for slashing keeper

func (Hooks) AfterHouseFeeRefund

func (h Hooks) AfterHouseFeeRefund(ctx sdk.Context, house sdk.AccAddress, fee sdkmath.Int)

AfterHouseFeeRefund is subaccount module hook for house fee refund in subaccount deposit.

func (Hooks) AfterHouseLoss

func (h Hooks) AfterHouseLoss(ctx sdk.Context, house sdk.AccAddress, originalAmount, lostAmt sdkmath.Int)

AfterHouseLoss is subaccount module hook for house loss for subbacount.

func (Hooks) AfterHouseRefund

func (h Hooks) AfterHouseRefund(ctx sdk.Context, house sdk.AccAddress, originalAmount sdkmath.Int)

AfterHouseRefund is subaccount module hook for house refund in subaccount deposit.

func (Hooks) AfterHouseWin

func (h Hooks) AfterHouseWin(ctx sdk.Context, house sdk.AccAddress, originalAmount, profit sdkmath.Int)

AfterHouseWin is subaccount module hook for house winning over subbacount.

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.Codec,
	storeKey storetypes.StoreKey,
	ps paramtypes.Subspace,
	accountKeeper types.AccountKeeper,
	bankKeeper types.BankKeeper,
	ovmKeeper bettypes.OVMKeeper,
	betKeeper types.BetKeeper,
	obKeeper types.OrderBookKeeper,
	hk types.HouseKeeper,
) *Keeper

func (Keeper) CreateSubaccount added in v1.4.5

func (k Keeper) CreateSubaccount(ctx sdk.Context, creator, owner string,
	lockedBalances []types.LockedBalance,
) (string, error)

func (Keeper) GetAccountSummary

func (k Keeper) GetAccountSummary(ctx sdk.Context, subAccountAddress sdk.AccAddress) (types.AccountSummary, bool)

GetAccountSummary returns the balance of an account.

func (Keeper) GetAllSubaccounts

func (k Keeper) GetAllSubaccounts(ctx sdk.Context) []types.GenesisSubaccount

func (Keeper) GetBalances added in v1.4.5

func (k Keeper) GetBalances(ctx sdk.Context, subAccountAddress sdk.AccAddress, balanceType types.LockedBalanceStatus) ([]types.LockedBalance, sdkmath.Int)

etBalances returns the locked balances of an account.

func (Keeper) GetDepositEnabled

func (k Keeper) GetDepositEnabled(ctx sdk.Context) bool

GetDepositEnabled returns enable/disable status of deposit

func (Keeper) GetParams

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

GetParams return parameters of the module

func (Keeper) GetSubaccountByOwner added in v1.4.5

func (k Keeper) GetSubaccountByOwner(ctx sdk.Context, address sdk.AccAddress) (sdk.AccAddress, bool)

GetSubaccountByOwner returns the subaccount ID of an owner.

func (Keeper) GetSubaccountOwner added in v1.4.5

func (k Keeper) GetSubaccountOwner(ctx sdk.Context, subAccAddr sdk.AccAddress) (sdk.AccAddress, bool)

GetSubaccountOwner returns the owner of a subaccount given the subaccount address.

func (Keeper) GetWagerEnabled

func (k Keeper) GetWagerEnabled(ctx sdk.Context) bool

GetWagerEnabled returns enable/disable status of wager

func (Keeper) HasLockedBalances added in v1.4.5

func (k Keeper) HasLockedBalances(ctx sdk.Context, subAccAddr sdk.AccAddress, time uint64) bool

HasLockedBalances returns true if there is an existing locked balance for the sub account address.

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

Create new distribution hooks

func (Keeper) IsSubaccount added in v1.4.5

func (k Keeper) IsSubaccount(ctx sdk.Context, subAccAddr sdk.AccAddress) bool

IsSubaccount returns true if the address blongs to a sub account.

func (Keeper) IterateSubaccounts

func (k Keeper) IterateSubaccounts(ctx sdk.Context, cb func(subAccountAddress, subaccountOwner sdk.AccAddress) (stop bool))

func (Keeper) NextID

func (k Keeper) NextID(ctx sdk.Context) uint64

NextID returns the actual value, same as Peek, but also advances the subaccount ID.

func (Keeper) Params

func (Keeper) Peek

func (k Keeper) Peek(ctx sdk.Context) uint64

Peek returns the next value without advancing the subaccount ID.

func (Keeper) SetAccountSummary

func (k Keeper) SetAccountSummary(ctx sdk.Context, subAccountAddress sdk.AccAddress, accountSummary types.AccountSummary)

SetAccountSummary saves the balance of an account.

func (Keeper) SetID

func (k Keeper) SetID(ctx sdk.Context, id uint64)

SetID sets the ID to a given value.

func (Keeper) SetLockedBalances

func (k Keeper) SetLockedBalances(ctx sdk.Context, subAccountAddress sdk.AccAddress, lockedBalances []types.LockedBalance)

SetLockedBalances saves the locked balances of an account.

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) SetSubaccountOwner added in v1.4.5

func (k Keeper) SetSubaccountOwner(ctx sdk.Context, subAccountAddress, ownerAddress sdk.AccAddress)

SetSubaccountOwner sets the owner of a subaccount.

func (Keeper) TopUp

func (k Keeper) TopUp(ctx sdk.Context, creator, subAccOwnerAddr string,
	topUpBalances []types.LockedBalance,
) (string, error)

TopUp tops up the subaccount balance.

Jump to

Keyboard shortcuts

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