Documentation ¶
Index ¶
- func NewMsgServer(k *Keeper) types.MsgServer
- type Keeper
- func (k *Keeper) AddToUserInsuranceFund(ctx sdk.Context, user sdk.AccAddress, amount sdk.Coins) error
- func (k *Keeper) BurnCoinsUnbondingQueueIterator(ctx sdk.Context, endTime time.Time) storetypes.Iterator
- func (k *Keeper) BurnVestedRepresentation(ctx sdk.Context, accAddress sdk.AccAddress, amount sdk.Coins) error
- func (k *Keeper) CanWithdrawFromInsuranceFund(ctx sdk.Context, user sdk.AccAddress, amount sdk.Coins) (bool, error)
- func (k *Keeper) CompleteBurnCoins(ctx sdk.Context) error
- func (k *Keeper) DequeueAllBurnCoinsFromUnbondingQueue(ctx sdk.Context, currTime time.Time) (burnCoins []types.BurnCoins)
- func (k *Keeper) ExportGenesis(ctx sdk.Context) (*types.GenesisState, error)
- func (k *Keeper) GetAllBurnCoins(ctx sdk.Context) []types.BurnCoins
- func (k *Keeper) GetBurnCoinsQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvPairs []types.BurnCoins)
- func (k *Keeper) GetInsuranceFundBalance(ctx sdk.Context) (sdk.Coins, error)
- func (k *Keeper) GetParams(ctx sdk.Context) (types.Params, error)
- func (k *Keeper) GetUnbondedCoinsFromQueue(ctx sdk.Context, endTime time.Time) []types.BurnCoins
- func (k *Keeper) GetUserInsuranceFund(ctx sdk.Context, user sdk.AccAddress) (types.UserInsuranceFund, error)
- func (k *Keeper) GetUserInsuranceFundBalance(ctx sdk.Context, user sdk.AccAddress) (sdk.Coins, error)
- func (k *Keeper) InitGenesis(ctx sdk.Context, state *types.GenesisState) error
- func (k *Keeper) InsertBurnCoinsToUnbondingQueue(ctx sdk.Context, burnCoins types.BurnCoins)
- func (k *Keeper) IsBurner(ctx sdk.Context, user sdk.AccAddress) (bool, error)
- func (k *Keeper) IsMinter(ctx sdk.Context, user sdk.AccAddress) (bool, error)
- func (k *Keeper) IterateBurnCoinsUnbondingQueue(ctx sdk.Context, endTime time.Time, ...) error
- func (k *Keeper) Logger(ctx sdk.Context) log.Logger
- func (k *Keeper) MintVestedRepresentation(ctx sdk.Context, user sdk.AccAddress, amount sdk.Coins) (sdk.Coins, error)
- func (k *Keeper) SendRestrictionFn(goCtx context.Context, from sdk.AccAddress, to sdk.AccAddress, ...) (sdk.AccAddress, error)
- func (k *Keeper) SetBurnCoinsQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []types.BurnCoins)
- func (k *Keeper) SetParams(ctx sdk.Context, params types.Params) error
- func (k *Keeper) WithdrawFromUserInsuranceFund(ctx sdk.Context, user sdk.AccAddress, amount sdk.Coins) error
- type Querier
- func (q Querier) InsuranceFund(goCtx context.Context, _ *types.QueryInsuranceFundRequest) (*types.QueryInsuranceFundResponse, error)
- func (q Querier) Params(goCtx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (q Querier) UserInsuranceFund(goCtx context.Context, req *types.QueryUserInsuranceFundRequest) (*types.QueryUserInsuranceFundResponse, error)
- func (q Querier) UserInsuranceFunds(goCtx context.Context, req *types.QueryUserInsuranceFundsRequest) (*types.QueryUserInsuranceFundsResponse, error)
- func (q Querier) UserRestakableAssets(goCtx context.Context, req *types.QueryUserRestakableAssetsRequest) (*types.QueryUserRestakableAssetsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServer ¶
Types ¶
type Keeper ¶
type Keeper struct { // Addresses ModuleAddress string // contains filtered or unexported fields }
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, storeKey storetypes.StoreKey, storeService corestoretypes.KVStoreService, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, operatorsKeeper types.OperatorsKeeper, poolsKeeper types.PoolsKeeper, servicesKeeper types.ServicesKeeper, restakingKeeper types.RestakingKeeper, moduleAddress string, authority string, ) *Keeper
func (*Keeper) AddToUserInsuranceFund ¶
func (k *Keeper) AddToUserInsuranceFund( ctx sdk.Context, user sdk.AccAddress, amount sdk.Coins, ) error
AddToUserInsuranceFund adds the provided amount to the user's insurance fund. NOTE: We assume that the amount that will be added to the user's insurance fund is already present in the module account balance.
func (*Keeper) BurnCoinsUnbondingQueueIterator ¶
func (k *Keeper) BurnCoinsUnbondingQueueIterator(ctx sdk.Context, endTime time.Time) storetypes.Iterator
BurnCoinsQueueIterator returns all the BurnCoins from time 0 until endTime.
func (*Keeper) BurnVestedRepresentation ¶
func (k *Keeper) BurnVestedRepresentation( ctx sdk.Context, accAddress sdk.AccAddress, amount sdk.Coins, ) error
BurnVestedRepresentation burns the vested staking representation from the user's balance. NOTE: If the coins are restaked they will be unstaked first.
func (*Keeper) CanWithdrawFromInsuranceFund ¶
func (k *Keeper) CanWithdrawFromInsuranceFund(ctx sdk.Context, user sdk.AccAddress, amount sdk.Coins) (bool, error)
CanWithdrawFromInsuranceFund returns true if the user can withdraw the provided amount from their insurance fund.
func (*Keeper) CompleteBurnCoins ¶
CompleteBurnCoins runs the endblocker logic to burn the coins after the undelegation completes.
func (*Keeper) DequeueAllBurnCoinsFromUnbondingQueue ¶
func (k *Keeper) DequeueAllBurnCoinsFromUnbondingQueue(ctx sdk.Context, currTime time.Time) (burnCoins []types.BurnCoins)
DequeueAllBurnCoinsFromUnbondingQueue returns a concatenated list of all the timeslices inclusively previous to currTime, and deletes the timeslices from the queue.
func (*Keeper) ExportGenesis ¶
ExportGenesis returns the GenesisState associated with the given context
func (*Keeper) GetAllBurnCoins ¶
GetAllBurnCoins returns all the coins that are scheduled to be burned.
func (*Keeper) GetBurnCoinsQueueTimeSlice ¶
func (k *Keeper) GetBurnCoinsQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvPairs []types.BurnCoins)
GetBurnCoinsQueueTimeSlice gets a specific burn coins queue timeslice. A timeslice is a slice of BurnCoins corresponding to the BurnCoins that needs to be burned at a certain time.
func (*Keeper) GetInsuranceFundBalance ¶
GetInsuranceFundBalance returns the amount of coins in the insurance fund.
func (*Keeper) GetUnbondedCoinsFromQueue ¶
GetUnbondedCoinsFromQueue returns a concatenated list of all the timeslices inclusively previous to endTime.
func (*Keeper) GetUserInsuranceFund ¶
func (k *Keeper) GetUserInsuranceFund( ctx sdk.Context, user sdk.AccAddress, ) (types.UserInsuranceFund, error)
GetUserInsuranceFund returns the user's insurance fund.
func (*Keeper) GetUserInsuranceFundBalance ¶
func (k *Keeper) GetUserInsuranceFundBalance( ctx sdk.Context, user sdk.AccAddress, ) (sdk.Coins, error)
GetUserInsuranceFundBalance returns the amount of coins in the user's insurance fund.
func (*Keeper) InitGenesis ¶
InitGenesis initializes the state from a GenesisState
func (*Keeper) InsertBurnCoinsToUnbondingQueue ¶
InsertBurnCoinsToUnbondingQueue inserts an BurnCoin to the appropriate timeslice in the burn coins queue.
func (*Keeper) IsBurner ¶
IsBurner tells if a user have the permissions to burn tokens from a user's balance.
func (*Keeper) IterateBurnCoinsUnbondingQueue ¶
func (k *Keeper) IterateBurnCoinsUnbondingQueue(ctx sdk.Context, endTime time.Time, iterF func(burnCoin types.BurnCoins) (bool, error)) error
IterateBurnCoinsUnbondingQueue iterates all the BurnCoins from time 0 until endTime.
func (*Keeper) MintVestedRepresentation ¶
func (k *Keeper) MintVestedRepresentation( ctx sdk.Context, user sdk.AccAddress, amount sdk.Coins, ) (sdk.Coins, error)
MintVestedRepresentation mints the vested staked representation of the provided amount to the user.
func (*Keeper) SendRestrictionFn ¶
func (k *Keeper) SendRestrictionFn( goCtx context.Context, from sdk.AccAddress, to sdk.AccAddress, amount sdk.Coins, ) (sdk.AccAddress, error)
SendRestrictionFn function that can be used in the x/bank module to block the transfer of the vested representation tokens.
func (*Keeper) SetBurnCoinsQueueTimeSlice ¶
func (k *Keeper) SetBurnCoinsQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []types.BurnCoins)
SetBurnCoinsQueueTimeSlice sets a specific burn coins queue timeslice.
func (*Keeper) WithdrawFromUserInsuranceFund ¶
func (k *Keeper) WithdrawFromUserInsuranceFund( ctx sdk.Context, user sdk.AccAddress, amount sdk.Coins, ) error
WithdrawFromUserInsuranceFund withdraws coins from the user's insurance fund and sends them to the user.
type Querier ¶
type Querier struct {
*Keeper
}
func NewQuerier ¶
func (Querier) InsuranceFund ¶
func (q Querier) InsuranceFund(goCtx context.Context, _ *types.QueryInsuranceFundRequest) (*types.QueryInsuranceFundResponse, error)
InsuranceFund implements types.QueryServer.
func (Querier) Params ¶
func (q Querier) Params(goCtx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params implements types.QueryServer.
func (Querier) UserInsuranceFund ¶
func (q Querier) UserInsuranceFund(goCtx context.Context, req *types.QueryUserInsuranceFundRequest) (*types.QueryUserInsuranceFundResponse, error)
UserInsuranceFund implements types.QueryServer.
func (Querier) UserInsuranceFunds ¶
func (q Querier) UserInsuranceFunds(goCtx context.Context, req *types.QueryUserInsuranceFundsRequest) (*types.QueryUserInsuranceFundsResponse, error)
UserInsuranceFunds implements types.QueryServer.
func (Querier) UserRestakableAssets ¶
func (q Querier) UserRestakableAssets(goCtx context.Context, req *types.QueryUserRestakableAssetsRequest) (*types.QueryUserRestakableAssetsResponse, error)
UserRestakableAssets implements types.QueryServer.