Documentation ¶
Index ¶
- Constants
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- type ExpectedKeepers
- type Keeper
- func (k Keeper) AcceptRewards(ctx sdk.Context, senderModuleAccName string, rewardAmount sdk.Int) error
- func (k Keeper) BettorLoses(ctx sdk.Context, address sdk.AccAddress, betAmount sdk.Int, ...) error
- func (k Keeper) BettorWins(ctx sdk.Context, bettorAddress sdk.AccAddress, betAmount sdk.Int, ...) error
- func (k Keeper) DepositDenom(ctx sdk.Context) (res string)
- func (k Keeper) GetBetReserveAcc(ctx sdk.Context) authtypes.ModuleAccountI
- func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)
- func (k Keeper) GetReserver(ctx sdk.Context) (reserver types.Reserver)
- func (k Keeper) GetSRPoolAcc(ctx sdk.Context) authtypes.ModuleAccountI
- func (k Keeper) GetSRPoolBalance(ctx sdk.Context) sdk.Coin
- func (k Keeper) GetWinningsCollectorAcc(ctx sdk.Context) authtypes.ModuleAccountI
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) ProcessBetPlacement(ctx sdk.Context, bettorAddress sdk.AccAddress, betFee sdk.Coin, ...) error
- func (k Keeper) RefundBettor(ctx sdk.Context, bettorAddress sdk.AccAddress, betAmount sdk.Int, ...) error
- func (k Keeper) Reserver(c context.Context, _ *types.QueryReserverRequest) (*types.QueryReserverResponse, error)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetReserver(ctx sdk.Context, reserver types.Reserver)
Constants ¶
const ( ErrTextInvalidRequest = consts.ErrTextInvalidRequest ErrTextNilReserver = "stored reserver should not have been nil" )
nolint
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the bank MsgServer interface for the provided Keeper.
Types ¶
type ExpectedKeepers ¶
type ExpectedKeepers struct { BankKeeper types.BankKeeper AccountKeeper types.AccountKeeper }
ExpectedKeepers contains expected keepers parameter needed by NewKeeper
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, expectedKeepers ExpectedKeepers, ) *Keeper
NewKeeper returns a new keeper object
func (Keeper) AcceptRewards ¶
func (k Keeper) AcceptRewards(ctx sdk.Context, senderModuleAccName string, rewardAmount sdk.Int) error
AcceptRewards gets rewards from module account and transfer to SRPool module account
func (Keeper) BettorLoses ¶
func (k Keeper) BettorLoses(ctx sdk.Context, address sdk.AccAddress, betAmount sdk.Int, extraPayout sdk.Int, uniqueLock string) error
BettorLoses unlocks the extra payout in the `sr_pool`. It transfers the bet amount (house winnings) from the `bet_reserve` to the `winnings_collector` module account of SR. It should be called when the bettor loses the bet. payout = bet amount * odds value extra payout = payout - bet amount
func (Keeper) BettorWins ¶
func (k Keeper) BettorWins( ctx sdk.Context, bettorAddress sdk.AccAddress, betAmount sdk.Int, extraPayout sdk.Int, uniqueLock string, ) error
BettorWins pays the payout to the bettor from the `bet_reserve` of the SR. Also, it transfers the extra payout locked in the `sr_pool` to the `bet_reserve`. It should be called when the bettor wins the bet. payout = bet amount * odds value extra payout = payout - bet amount
func (Keeper) DepositDenom ¶
DepositDenom returns deposit coin denomination
func (Keeper) GetBetReserveAcc ¶
func (k Keeper) GetBetReserveAcc(ctx sdk.Context) authtypes.ModuleAccountI
GetBetReserveAcc returns the `bet_reserve` module account
func (Keeper) GetReserver ¶
GetReserver returns the reserver
func (Keeper) GetSRPoolAcc ¶
func (k Keeper) GetSRPoolAcc(ctx sdk.Context) authtypes.ModuleAccountI
GetSRPoolAcc returns the `sr_pool` module account
func (Keeper) GetSRPoolBalance ¶
GetSRPoolBalance returns the balance of `sr_pool` module account
func (Keeper) GetWinningsCollectorAcc ¶
func (k Keeper) GetWinningsCollectorAcc(ctx sdk.Context) authtypes.ModuleAccountI
GetWinningsCollectorAcc returns the `winnings_collector` module account
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params returns the Params for the strategic reserve
func (Keeper) ProcessBetPlacement ¶
func (k Keeper) ProcessBetPlacement( ctx sdk.Context, bettorAddress sdk.AccAddress, betFee sdk.Coin, betAmount sdk.Int, extraPayout sdk.Int, uniqueLock string, endTs uint64, ) error
ProcessBetPlacement transfers the bet fee from the bettor's account to the bet module account and the bet amount from the given bettor's account to the `bet_reserve` account of SR and locks the extra payout in the `sr_pool` account of SR. payout = bet amount * odds value extra payout = payout - bet amount
func (Keeper) RefundBettor ¶
func (k Keeper) RefundBettor(ctx sdk.Context, bettorAddress sdk.AccAddress, betAmount sdk.Int, extraPayout sdk.Int, uniqueLock string) error
RefundBettor refunds back the bet amount from the `bet_reserve` to the bettor in case a sports event gets cancelled or aborted. It should be called when a sports event is cancelled or aborted and the bet amount needs to be refunded back to the bettor. payout = bet amount * odds value extra payout = payout - bet amount
func (Keeper) Reserver ¶
func (k Keeper) Reserver(c context.Context, _ *types.QueryReserverRequest) (*types.QueryReserverResponse, error)
Reserver returns current reserver.