keeper

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package keeper contains dao module keeper.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Keeper

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

Keeper is a dao keeper struct.

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey sdk.StoreKey,
	ps types.ParamSubspace,
	bankKeeper types.BankKeeper,
	accountKeeper types.AccountKeeper,
	distributionKeeper types.DistributionKeeper,
	govKeeper types.GovKeeper,
	mintKeeper types.MintKeeper,
	stakingKeeper types.StakingKeeper,
) *Keeper

NewKeeper creates new dao keeper.

func (Keeper) ExchangeWithTreasuryProposal

func (k Keeper) ExchangeWithTreasuryProposal(ctx sdk.Context, request *types.ExchangeWithTreasuryProposal) error

ExchangeWithTreasuryProposal submits the ExchangeWithTreasuryProposal.

func (Keeper) ExportGenesis

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

ExportGenesis returns a GenesisState for a given context and keeper.

func (Keeper) FundAccountProposal

func (k Keeper) FundAccountProposal(ctx sdk.Context, request *types.FundAccountProposal) error

FundAccountProposal submits the FundAccountProposal.

func (Keeper) FundTreasuryProposal

func (k Keeper) FundTreasuryProposal(ctx sdk.Context, request *types.FundTreasuryProposal) error

FundTreasuryProposal submits the FundTreasuryProposal.

func (Keeper) GetBalance added in v1.1.0

func (k Keeper) GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin

GetBalance returns account balance.

func (Keeper) GetDaoDelegationSupply

func (k Keeper) GetDaoDelegationSupply(ctx sdk.Context) sdk.Dec

GetDaoDelegationSupply returns total amount of the treasury bonded coins.

func (Keeper) GetParams

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

GetParams returns the total set of dao parameters.

func (Keeper) InflateDao added in v1.1.0

func (k Keeper) InflateDao(ctx sdk.Context) (err error)

InflateDao inflates treasury by APR from minter.

func (Keeper) InitGenesis

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

InitGenesis sets dao module information from genesis.

func (Keeper) Logger

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

Logger returns keeper logger.

func (Keeper) MaxProposalRate

func (k Keeper) MaxProposalRate(ctx sdk.Context) (res sdk.Dec)

MaxProposalRate - the rate of max allowed proposal from the treasury amount.

func (Keeper) MaxValCommission

func (k Keeper) MaxValCommission(ctx sdk.Context) (res sdk.Dec)

MaxValCommission - the max validator's commission to be staked by the dao.

func (Keeper) PoolRate

func (k Keeper) PoolRate(ctx sdk.Context) (res sdk.Dec)

PoolRate - the rate of total dao's staking coins to keep unstaked.

func (Keeper) ReBalanceDelegation

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

ReBalanceDelegation re-balances the DAO staking among validators bases on the current validators self bond.

func (Keeper) SendCoins added in v1.1.0

func (k Keeper) SendCoins(ctx sdk.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error

SendCoins transfers coins from one account to another.

func (Keeper) SetParams

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

SetParams set the params.

func (Keeper) Treasury

func (k Keeper) Treasury(ctx sdk.Context) sdk.Coins

Treasury returns the treasury balance.

func (Keeper) UndelegateAllValidators added in v1.1.0

func (k Keeper) UndelegateAllValidators(ctx sdk.Context) (err error)

UndelegateAllValidators undelegate all validators.

func (Keeper) VoteAbstain

func (k Keeper) VoteAbstain(ctx sdk.Context) (err error)

VoteAbstain votes abstain on all the proposals from the DAO account.

func (Keeper) WithdrawReward

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

WithdrawReward withdraw dao delegation reward.

func (Keeper) WithdrawRewardPeriod

func (k Keeper) WithdrawRewardPeriod(ctx sdk.Context) (res int64)

WithdrawRewardPeriod - the blocks period to dao staking reward.

type QueryServer

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

QueryServer is keep wrapper which provides query capabilities.

func NewQueryServer

func NewQueryServer(keeper Keeper) *QueryServer

NewQueryServer creates a new instance of QueryServer.

func (QueryServer) Params

Params return dao module current params values.

func (QueryServer) Treasury

Treasury returns the treasury balance.

Jump to

Keyboard shortcuts

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