Documentation
¶
Index ¶
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func PercentageCoinMul(percentage math.LegacyDec, coins sdk.Coins) sdk.Coins
- type Keeper
- func (k Keeper) BeginBlocker(ctx sdk.Context) error
- func (k Keeper) DistributeFromCommunityPool(ctx sdk.Context, amount sdk.Coins, receiveAddr sdk.AccAddress) error
- func (k Keeper) DistributeFunds(ctx sdk.Context) error
- func (k Keeper) ExportGenesis(ctx sdk.Context) (*types.GenesisState, error)
- func (k Keeper) FundCommunityPool(ctx sdk.Context, amount sdk.Coins, sender sdk.AccAddress) error
- func (k Keeper) GetAllContinuousFunds(ctx sdk.Context) ([]types.ContinuousFund, error)
- func (k Keeper) GetAuthority() string
- func (k Keeper) GetCommunityPool(ctx sdk.Context) (sdk.Coins, error)
- func (k Keeper) GetCommunityPoolModule() string
- func (k Keeper) InitGenesis(ctx sdk.Context, data *types.GenesisState) error
- type MsgServer
- func (k MsgServer) CancelContinuousFund(ctx context.Context, msg *types.MsgCancelContinuousFund) (*types.MsgCancelContinuousFundResponse, error)
- func (k MsgServer) CommunityPoolSpend(ctx context.Context, msg *types.MsgCommunityPoolSpend) (*types.MsgCommunityPoolSpendResponse, error)
- func (k MsgServer) CreateContinuousFund(ctx context.Context, msg *types.MsgCreateContinuousFund) (*types.MsgCreateContinuousFundResponse, error)
- func (k MsgServer) FundCommunityPool(ctx context.Context, msg *types.MsgFundCommunityPool) (*types.MsgFundCommunityPoolResponse, error)
- func (k MsgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error)
- type Querier
- func (k Querier) CommunityPool(ctx context.Context, req *types.QueryCommunityPoolRequest) (*types.QueryCommunityPoolResponse, error)
- func (k Querier) ContinuousFund(ctx context.Context, req *types.QueryContinuousFundRequest) (*types.QueryContinuousFundResponse, error)
- func (k Querier) ContinuousFunds(ctx context.Context, req *types.QueryContinuousFundsRequest) (*types.QueryContinuousFundsResponse, error)
- func (k Querier) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an implementation of the protocolpool MsgServer interface for the provided Keeper.
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) 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 ¶
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 (Keeper) FundCommunityPool ¶
FundCommunityPool allows an account to directly fund the community fund pool.
func (Keeper) GetAllContinuousFunds ¶
GetAllContinuousFunds gets all continuous funds in the store.
func (Keeper) GetAuthority ¶
GetAuthority returns the x/protocolpool module's authority.
func (Keeper) GetCommunityPool ¶
GetCommunityPool gets the community pool balance.
func (Keeper) GetCommunityPoolModule ¶
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 ¶
type MsgServer ¶
type MsgServer struct {
Keeper
}
func (MsgServer) CancelContinuousFund ¶
func (k MsgServer) CancelContinuousFund(ctx context.Context, msg *types.MsgCancelContinuousFund) (*types.MsgCancelContinuousFundResponse, error)
func (MsgServer) CommunityPoolSpend ¶
func (k MsgServer) CommunityPoolSpend(ctx context.Context, msg *types.MsgCommunityPoolSpend) (*types.MsgCommunityPoolSpendResponse, error)
func (MsgServer) CreateContinuousFund ¶
func (k MsgServer) CreateContinuousFund(ctx context.Context, msg *types.MsgCreateContinuousFund) (*types.MsgCreateContinuousFundResponse, error)
func (MsgServer) FundCommunityPool ¶
func (k MsgServer) FundCommunityPool(ctx context.Context, msg *types.MsgFundCommunityPool) (*types.MsgFundCommunityPoolResponse, error)
func (MsgServer) UpdateParams ¶
func (k MsgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (*types.MsgUpdateParamsResponse, error)
type Querier ¶
type Querier struct {
Keeper
}
func NewQuerier ¶
func (Querier) CommunityPool ¶
func (k Querier) CommunityPool(ctx context.Context, req *types.QueryCommunityPoolRequest) (*types.QueryCommunityPoolResponse, error)
CommunityPool queries the community pool coins
func (Querier) ContinuousFund ¶
func (k Querier) ContinuousFund(ctx context.Context, req *types.QueryContinuousFundRequest) (*types.QueryContinuousFundResponse, error)
ContinuousFund queries a continuous fund by its recipient address.
func (Querier) ContinuousFunds ¶
func (k Querier) ContinuousFunds(ctx context.Context, req *types.QueryContinuousFundsRequest) (*types.QueryContinuousFundsResponse, error)
ContinuousFunds queries all continuous funds in the store.
func (Querier) Params ¶
func (k Querier) Params(ctx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params queries params of x/protocolpool module.