keeper

package
v0.53.6 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: Apache-2.0 Imports: 14 Imported by: 9

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 protocolpool MsgServer interface for the provided Keeper.

func PercentageCoinMul

func PercentageCoinMul(percentage math.LegacyDec, coins sdk.Coins) sdk.Coins

PercentageCoinMul multiplies each coin in an sdk.Coins struct by the given percentage and returns the new value.

When performing multiplication, the resulting values are truncated to an sdk.Int.

Types

type Keeper

type Keeper struct {

	// State
	Schema          collections.Schema
	ContinuousFunds collections.Map[sdk.AccAddress, types.ContinuousFund]
	Params          collections.Item[types.Params]
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, storeService store.KVStoreService, ak types.AccountKeeper, bk types.BankKeeper, authority string,
) Keeper

func (Keeper) BeginBlocker

func (k Keeper) BeginBlocker(ctx sdk.Context) error

func (Keeper) DistributeFromCommunityPool

func (k Keeper) DistributeFromCommunityPool(ctx sdk.Context, amount sdk.Coins, receiveAddr sdk.AccAddress) error

DistributeFromCommunityPool distributes funds from the protocolpool module account to a receiver address.

func (Keeper) DistributeFunds

func (k Keeper) DistributeFunds(ctx sdk.Context) error

DistributeFunds sets the amount to be distributed among recipients. Get all valid continuous funds: - for each continuous fund, check if expired and remove if so - for each continuous fund, distribute funds according to percentage - distribute remaining funds to the community pool

This function is run at the BeginBlocker method and therefore must be very safe.

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx sdk.Context) (*types.GenesisState, error)

func (Keeper) FundCommunityPool

func (k Keeper) FundCommunityPool(ctx sdk.Context, amount sdk.Coins, sender sdk.AccAddress) error

FundCommunityPool allows an account to directly fund the community fund pool.

func (Keeper) GetAllContinuousFunds

func (k Keeper) GetAllContinuousFunds(ctx sdk.Context) ([]types.ContinuousFund, error)

GetAllContinuousFunds gets all continuous funds in the store.

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the x/protocolpool module's authority.

func (Keeper) GetCommunityPool

func (k Keeper) GetCommunityPool(ctx sdk.Context) (sdk.Coins, error)

GetCommunityPool gets the community pool balance.

func (Keeper) GetCommunityPoolModule

func (k Keeper) GetCommunityPoolModule() string

GetCommunityPoolModule gets the module name that funds should be sent to for the community pool. This is the address that x/distribution will send funds to for external management.

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState) error

type MsgServer

type MsgServer struct {
	Keeper
}

func (MsgServer) FundCommunityPool

func (MsgServer) UpdateParams

type Querier

type Querier struct {
	Keeper
}

func NewQuerier

func NewQuerier(keeper Keeper) Querier

func (Querier) CommunityPool

CommunityPool queries the community pool coins

func (Querier) ContinuousFund

ContinuousFund queries a continuous fund by its recipient address.

func (Querier) ContinuousFunds

ContinuousFunds queries all continuous funds in the store.

func (Querier) Params

Params queries params of x/protocolpool module.

Jump to

Keyboard shortcuts

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