Documentation ¶
Index ¶
- func NewMsgServer(k *Keeper) types.MsgServer
- type Keeper
- func (k *Keeper) AddToUserInsuranceFund(ctx context.Context, user string, amount sdk.Coins) error
- func (k *Keeper) BurnCoinsUnbondingQueueIterator(ctx context.Context, endTime time.Time) (storetypes.Iterator, error)
- func (k *Keeper) BurnLockedRepresentation(ctx context.Context, accAddress sdk.AccAddress, amount sdk.Coins) error
- func (k *Keeper) CanWithdrawFromInsuranceFund(ctx context.Context, user string, amount sdk.Coins) (bool, error)
- func (k *Keeper) CompleteBurnCoins(ctx sdk.Context) error
- func (k *Keeper) DequeueAllBurnCoinsFromUnbondingQueue(ctx context.Context, currTime time.Time) (burnCoins []types.BurnCoins, err error)
- func (k *Keeper) ExportGenesis(ctx sdk.Context) (*types.GenesisState, error)
- func (k *Keeper) GetAllBurnCoins(ctx context.Context) []types.BurnCoins
- func (k *Keeper) GetAllUserActiveLockedRepresentations(ctx context.Context, userAddress string) (sdk.DecCoins, error)
- func (k *Keeper) GetAllUserRestakedLockedRepresentations(ctx context.Context, userAddress string) (sdk.DecCoins, error)
- func (k *Keeper) GetAllUserUnbondingLockedRepresentations(ctx context.Context, userAddress string) sdk.Coins
- func (k *Keeper) GetAllUsersInsuranceFundsEntries(ctx sdk.Context) ([]types.UserInsuranceFundEntry, error)
- func (k *Keeper) GetBurnCoinsQueueTimeSlice(ctx context.Context, timestamp time.Time) (dvPairs []types.BurnCoins, err error)
- func (k *Keeper) GetInsuranceFundBalance(ctx context.Context) (sdk.Coins, error)
- func (k *Keeper) GetParams(ctx context.Context) (types.Params, error)
- func (k *Keeper) GetUnbondedCoinsFromQueue(ctx context.Context, endTime time.Time) ([]types.BurnCoins, error)
- func (k *Keeper) GetUserInsuranceFund(ctx context.Context, user string) (types.UserInsuranceFund, error)
- func (k *Keeper) GetUserInsuranceFundBalance(ctx context.Context, user string) (sdk.Coins, error)
- func (k *Keeper) GetUserUsedInsuranceFund(ctx context.Context, userAddress string) (sdk.Coins, error)
- func (k *Keeper) InitGenesis(ctx sdk.Context, state *types.GenesisState) error
- func (k *Keeper) InsertBurnCoinsToUnbondingQueue(ctx context.Context, burnCoins types.BurnCoins) error
- func (k *Keeper) IsBurner(ctx context.Context, user sdk.AccAddress) (bool, error)
- func (k *Keeper) IsMinter(ctx context.Context, user sdk.AccAddress) (bool, error)
- func (k *Keeper) IterateBurnCoinsUnbondingQueue(ctx context.Context, endTime time.Time, ...) error
- func (k *Keeper) Logger(ctx sdk.Context) log.Logger
- func (k *Keeper) MintLockedRepresentation(ctx context.Context, user sdk.AccAddress, amount sdk.Coins) (sdk.Coins, error)
- func (k *Keeper) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, ...) error
- func (k *Keeper) RestakeRestrictionFn(ctx context.Context, restakerAddress string, amount sdk.Coins, ...) error
- func (k *Keeper) SendRestrictionFn(ctx context.Context, from sdk.AccAddress, to sdk.AccAddress, amount sdk.Coins) (sdk.AccAddress, error)
- func (k *Keeper) SetBurnCoinsQueueTimeSlice(ctx context.Context, timestamp time.Time, keys []types.BurnCoins) error
- func (k *Keeper) SetParams(ctx context.Context, params types.Params) error
- func (k *Keeper) WithdrawFromUserInsuranceFund(ctx context.Context, user string, amount sdk.Coins) error
- type Querier
- func (q Querier) InsuranceFund(ctx context.Context, _ *types.QueryInsuranceFundRequest) (*types.QueryInsuranceFundResponse, error)
- func (q Querier) Params(ctx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (q Querier) UserInsuranceFund(ctx context.Context, req *types.QueryUserInsuranceFundRequest) (*types.QueryUserInsuranceFundResponse, error)
- func (q Querier) UserInsuranceFunds(ctx context.Context, req *types.QueryUserInsuranceFundsRequest) (*types.QueryUserInsuranceFundsResponse, error)
- func (q Querier) UserRestakableAssets(ctx 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, 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 ¶
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 context.Context, endTime time.Time) (storetypes.Iterator, error)
BurnCoinsUnbondingQueueIterator returns all the BurnCoins from time 0 until endTime.
func (*Keeper) BurnLockedRepresentation ¶
func (k *Keeper) BurnLockedRepresentation( ctx context.Context, accAddress sdk.AccAddress, amount sdk.Coins, ) error
BurnLockedRepresentation burns the locked 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 context.Context, user string, 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 context.Context, currTime time.Time) (burnCoins []types.BurnCoins, err error)
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) GetAllUserActiveLockedRepresentations ¶
func (k *Keeper) GetAllUserActiveLockedRepresentations(ctx context.Context, userAddress string) (sdk.DecCoins, error)
GetAllUserActiveLockedRepresentations gets all the locked representation tokens that are restaked or are currently unbonding for the provided user.
func (*Keeper) GetAllUserRestakedLockedRepresentations ¶
func (k *Keeper) GetAllUserRestakedLockedRepresentations(ctx context.Context, userAddress string) (sdk.DecCoins, error)
GetAllUserRestakedLockedRepresentations returns all restaked coins that are locked representation tokens for the provided user.
func (*Keeper) GetAllUserUnbondingLockedRepresentations ¶
func (k *Keeper) GetAllUserUnbondingLockedRepresentations(ctx context.Context, userAddress string) sdk.Coins
GetAllUserUnbondingLockedRepresentations returns all the locked representation tokens that are currently unbonding for the provided user.
func (*Keeper) GetAllUsersInsuranceFundsEntries ¶
func (*Keeper) GetBurnCoinsQueueTimeSlice ¶
func (k *Keeper) GetBurnCoinsQueueTimeSlice(ctx context.Context, timestamp time.Time) (dvPairs []types.BurnCoins, err error)
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 ¶
func (k *Keeper) GetUnbondedCoinsFromQueue(ctx context.Context, endTime time.Time) ([]types.BurnCoins, error)
GetUnbondedCoinsFromQueue returns a concatenated list of all the timeslices inclusively previous to endTime.
func (*Keeper) GetUserInsuranceFund ¶
func (k *Keeper) GetUserInsuranceFund(ctx context.Context, user string) (types.UserInsuranceFund, error)
GetUserInsuranceFund returns the user's insurance fund.
func (*Keeper) GetUserInsuranceFundBalance ¶
GetUserInsuranceFundBalance returns the amount of coins in the user's insurance fund.
func (*Keeper) GetUserUsedInsuranceFund ¶
func (k *Keeper) GetUserUsedInsuranceFund(ctx context.Context, userAddress string) (sdk.Coins, error)
GetUserUsedInsuranceFund returns the amount of coins that are used to cover the user's locked representation tokens that have been restaked.
func (*Keeper) InitGenesis ¶
InitGenesis initializes the state from a GenesisState
func (*Keeper) InsertBurnCoinsToUnbondingQueue ¶
func (k *Keeper) InsertBurnCoinsToUnbondingQueue(ctx context.Context, burnCoins types.BurnCoins) error
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 context.Context, endTime time.Time, iterF func(burnCoin types.BurnCoins) (bool, error)) error
IterateBurnCoinsUnbondingQueue iterates all the BurnCoins from time 0 until endTime.
func (*Keeper) MintLockedRepresentation ¶
func (k *Keeper) MintLockedRepresentation(ctx context.Context, user sdk.AccAddress, amount sdk.Coins) (sdk.Coins, error)
MintLockedRepresentation mints the locked staked representation of the provided amount to the user.
func (*Keeper) OnRecvPacket ¶
func (k *Keeper) OnRecvPacket( ctx sdk.Context, packet channeltypes.Packet, data transfertypes.FungibleTokenPacketData, msgDepositInsurance types.MsgDepositInsurance, ) error
OnRecvPacket processes the packet received from the IBC handler
func (*Keeper) RestakeRestrictionFn ¶
func (k *Keeper) RestakeRestrictionFn(ctx context.Context, restakerAddress string, amount sdk.Coins, _ restakingtypes.DelegationTarget) error
func (*Keeper) SendRestrictionFn ¶
func (k *Keeper) SendRestrictionFn(ctx 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 locked representation tokens.
func (*Keeper) SetBurnCoinsQueueTimeSlice ¶
func (k *Keeper) SetBurnCoinsQueueTimeSlice(ctx context.Context, timestamp time.Time, keys []types.BurnCoins) error
SetBurnCoinsQueueTimeSlice sets a specific burn coins queue timeslice.
type Querier ¶
type Querier struct {
*Keeper
}
func NewQuerier ¶
func (Querier) InsuranceFund ¶
func (q Querier) InsuranceFund(ctx context.Context, _ *types.QueryInsuranceFundRequest) (*types.QueryInsuranceFundResponse, error)
InsuranceFund implements types.QueryServer.
func (Querier) Params ¶
func (q Querier) Params(ctx context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
Params implements types.QueryServer.
func (Querier) UserInsuranceFund ¶
func (q Querier) UserInsuranceFund(ctx context.Context, req *types.QueryUserInsuranceFundRequest) (*types.QueryUserInsuranceFundResponse, error)
UserInsuranceFund implements types.QueryServer.
func (Querier) UserInsuranceFunds ¶
func (q Querier) UserInsuranceFunds(ctx context.Context, req *types.QueryUserInsuranceFundsRequest) (*types.QueryUserInsuranceFundsResponse, error)
UserInsuranceFunds implements types.QueryServer.
func (Querier) UserRestakableAssets ¶
func (q Querier) UserRestakableAssets(ctx context.Context, req *types.QueryUserRestakableAssetsRequest) (*types.QueryUserRestakableAssetsResponse, error)
UserRestakableAssets implements types.QueryServer.