keeper

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 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

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

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

GetDepositEnabled returns enable/disable status of deposit

func (Keeper) GetLockedBalances

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

GetLockedBalances returns the locked balances of an account.

func (Keeper) GetParams

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

GetParams return parameters of the module

func (Keeper) GetSubAccountByOwner

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

GetSubAccountByOwner returns the subaccount ID of an owner.

func (Keeper) GetSubAccountOwner

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

func (k Keeper) GetUnlockedBalance(ctx sdk.Context, subAccountAddress sdk.AccAddress) sdkmath.Int

GetUnlockedBalance returns the unlocked balance of an account.

func (Keeper) GetWagerEnabled

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

GetWagerEnabled returns enable/disable status of wager

func (Keeper) Hooks

func (k Keeper) Hooks() Hooks

Create new distribution hooks

func (Keeper) IsSubAccount

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

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,
	lockedBalance []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