keeper

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 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.

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey storetypes.StoreKey,
	ps paramtypes.Subspace,
	betKeeper types.BetKeeper,
	ovmKeeper types.OVMKeeper,
	subaccountKeeper types.SubaccountKeeper,
	expectedKeepers SdkExpectedKeepers,
) *Keeper

func (Keeper) Campaign

func (Keeper) Campaigns

func (Keeper) DistributeRewards

func (k Keeper) DistributeRewards(ctx sdk.Context, receiver types.Receiver) (uint64, error)

DistributeRewards distributes the rewards according to the input distribution list.

func (Keeper) GetAllCampaign

func (k Keeper) GetAllCampaign(ctx sdk.Context) (list []types.Campaign)

GetAllCampaign returns all campaign

func (Keeper) GetAllPromoter added in v1.6.0

func (k Keeper) GetAllPromoter(ctx sdk.Context) (list []types.Promoter)

GetAllPromoter returns all promoters

func (Keeper) GetAllRewards

func (k Keeper) GetAllRewards(ctx sdk.Context) (list []types.Reward)

GetAllRewards returns all reward

func (Keeper) GetAllRewardsByCampaign

func (k Keeper) GetAllRewardsByCampaign(ctx sdk.Context) (list []types.RewardByCampaign)

GetAllRewardsByCampaign returns all rewards by campaign

func (Keeper) GetAllRewardsByReceiverAndCategory

func (k Keeper) GetAllRewardsByReceiverAndCategory(ctx sdk.Context) (list []types.RewardByCategory)

GetAllRewardsByReceiverAndCategory returns all rewards by receiver and category

func (Keeper) GetCampaign

func (k Keeper) GetCampaign(
	ctx sdk.Context,
	uid string,
) (val types.Campaign, found bool)

GetCampaign returns a campaign from its index

func (Keeper) GetParams

func (k Keeper) GetParams(_ sdk.Context) types.Params

GetParams get all parameters as types.Params

func (Keeper) GetPromoter added in v1.6.0

func (k Keeper) GetPromoter(
	ctx sdk.Context,
	uid string,
) (val types.Promoter, found bool)

GetPromoter returns a promoter,

func (Keeper) GetPromoterByAddress added in v1.6.0

func (k Keeper) GetPromoterByAddress(ctx sdk.Context, address string) (val types.PromoterByAddress, found bool)

GetPromoter returns a promoter,

func (Keeper) GetReward

func (k Keeper) GetReward(
	ctx sdk.Context,
	uid string,
) (val types.Reward, found bool)

GetReward returns a reward from its index

func (Keeper) GetRewardGrantsStats added in v1.6.0

func (k Keeper) GetRewardGrantsStats(ctx sdk.Context, campaignUID, accAddr string) (val uint64, found bool)

func (Keeper) GetRewardsOfReceiverByPromoterAndCategory added in v1.6.0

func (k Keeper) GetRewardsOfReceiverByPromoterAndCategory(
	ctx sdk.Context,
	promoterUID, addr string,
	category types.RewardCategory,
) (list []types.RewardByCategory, err error)

GetRewardsOfReceiverByPromoterAndCategory returns all rewards by address and category.

func (Keeper) HasRewardOfReceiverByPromoter added in v1.6.0

func (k Keeper) HasRewardOfReceiverByPromoter(ctx sdk.Context, promoterUID, addr string, category types.RewardCategory) bool

HasRewardByReceiver returns true if there is a record for the category and reward receiver

func (Keeper) IsPromoter added in v1.6.0

func (k Keeper) IsPromoter(ctx sdk.Context, address string) bool

IsPromoter returns true if there is a promoter with address

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

func (Keeper) Params

func (Keeper) PromoterByAddress added in v1.6.0

func (Keeper) Promoters added in v1.6.0

func (Keeper) RemoveCampaign

func (k Keeper) RemoveCampaign(
	ctx sdk.Context,
	uid string,
)

RemoveCampaign removes a campaign from the store

func (Keeper) RemoveReward

func (k Keeper) RemoveReward(
	ctx sdk.Context,
	uid string,
)

RemoveReward removes a reward from the store

func (Keeper) Reward

func (Keeper) Rewards

func (Keeper) SetCampaign

func (k Keeper) SetCampaign(ctx sdk.Context, campaign types.Campaign)

SetCampaign set a specific campaign in the store from its index

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) SetPromoter added in v1.6.0

func (k Keeper) SetPromoter(ctx sdk.Context, promoter types.Promoter)

SetPromoter set a specific promoter in the store from its index

func (Keeper) SetPromoterByAddress added in v1.6.0

func (k Keeper) SetPromoterByAddress(ctx sdk.Context, promoterByAddress types.PromoterByAddress)

SetPromoterByAddress set a specific promoter in the store from its address

func (Keeper) SetReward

func (k Keeper) SetReward(ctx sdk.Context, reward types.Reward)

SetReward set a specific reward in the store from its index

func (Keeper) SetRewardByCampaign

func (k Keeper) SetRewardByCampaign(ctx sdk.Context, rewByCampaign types.RewardByCampaign)

func (Keeper) SetRewardGrantsStats added in v1.6.0

func (k Keeper) SetRewardGrantsStats(ctx sdk.Context, campaignUID, accAddr string, count uint64)

func (Keeper) SetRewardOfReceiverByPromoterAndCategory added in v1.6.0

func (k Keeper) SetRewardOfReceiverByPromoterAndCategory(ctx sdk.Context, promoterUID string, rByCategory types.RewardByCategory)

func (Keeper) UpdateCampaignPool

func (k Keeper) UpdateCampaignPool(ctx sdk.Context, campaign types.Campaign, receiver types.Receiver)

UpdateCampaignPool updates campaign pool according to the total receiving amount of receiver

type SdkExpectedKeepers

type SdkExpectedKeepers struct {
	AuthzKeeper   types.AuthzKeeper
	BankKeeper    types.BankKeeper
	AccountKeeper types.AccountKeeper
}

SdkExpectedKeepers contains expected keepers parameter needed by NewKeeper

Jump to

Keyboard shortcuts

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