Documentation ¶
Index ¶
- Constants
- Variables
- func NewMsgServerImpl(keeper Keeper) types.MsgServer
- func NewQueryServerImpl(k Keeper) types.QueryServer
- type Keeper
- func (k Keeper) AccountLockedCoins(ctx sdk.Context, account sdk.AccAddress) (coins sdk.Coins, err error)
- func (k Keeper) AccountUnlockedCoins(ctx sdk.Context, account sdk.AccAddress) (coins sdk.Coins, err error)
- func (k Keeper) InitiateUnlocking(ctx sdk.Context, lockID uint64) (updatedLock *types.Lock, err error)
- func (k Keeper) LockTokens(ctx sdk.Context, owner sdk.AccAddress, coins sdk.Coins, duration time.Duration) (*types.Lock, error)
- func (k Keeper) LocksByDenom(ctx sdk.Context, do func(lock *types.Lock) (stop bool)) (coins sdk.Coins, err error)
- func (k Keeper) LocksByDenomUnlockingAfter(ctx sdk.Context, denom string, duration time.Duration, ...)
- func (k Keeper) LocksState(ctx sdk.Context) LockState
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) TotalLockedCoins(ctx sdk.Context) (coins sdk.Coins, err error)
- func (k Keeper) UnlockAvailableCoins(ctx sdk.Context, account sdk.AccAddress) (coins sdk.Coins, err error)
- func (k Keeper) UnlockTokens(ctx sdk.Context, lockID uint64) (unlockedTokens sdk.Coins, err error)
- type LockState
- func (s LockState) Create(l *types.Lock)
- func (s LockState) Delete(l *types.Lock) error
- func (s LockState) Get(id uint64) (*types.Lock, error)
- func (s LockState) IterateCoinsByDenomUnlockingAfter(denom string, unlockingAfter time.Time, f func(id uint64) (stop bool))
- func (s LockState) IterateCoinsByDenomUnlockingBefore(denom string, unlockingBefore time.Time, f func(id uint64) (stop bool))
- func (s LockState) IterateLockedCoins(addr sdk.AccAddress) sdk.Coins
- func (s LockState) IterateLocks(do func(lock *types.Lock) (stop bool))
- func (s LockState) IterateLocksByAddress(addr sdk.AccAddress, do func(id uint64) (stop bool))
- func (s LockState) IterateTotalLockedCoins() sdk.Coins
- func (s LockState) IterateUnlockedCoins(addr sdk.AccAddress) sdk.Coins
- func (s LockState) UnlockedIDsByAddress(addr sdk.AccAddress) []uint64
- func (s LockState) Update(update *types.Lock) error
Constants ¶
const ( // LockStartID is the ID of the first lock. LockStartID uint64 = 0 )
Variables ¶
var ( // MaxTime is the maximum golang time that can be represented. // It is a date so forward in the future that identifies a // lockup which did not yet start to unlock. // NOTE: this is not maximum golang time because, since we encode it // using timestampb.Timestamp under the hood we need to adhere to proto time // rules. Equivalent to: time.Date(9999, time.December, 31, 23, 59, 59, 0, time.UTC) MaxTime = time.Unix(253402297199, 0).UTC() )
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl returns an instance of MsgServer.
func NewQueryServerImpl ¶ added in v0.2.2
func NewQueryServerImpl(k Keeper) types.QueryServer
Types ¶
type Keeper ¶ added in v0.2.2
type Keeper struct {
// contains filtered or unexported fields
}
Keeper provides a way to manage module storage.
func NewLockupKeeper ¶
func NewLockupKeeper(cdc codec.Codec, storeKey sdk.StoreKey, ak types.AccountKeeper, bk types.BankKeeper, dk types.DistrKeeper) Keeper
NewLockupKeeper returns an instance of Keeper.
func (Keeper) AccountLockedCoins ¶ added in v0.2.2
func (k Keeper) AccountLockedCoins(ctx sdk.Context, account sdk.AccAddress) (coins sdk.Coins, err error)
AccountLockedCoins returns the locked coins of the given sdk.AccAddress
func (Keeper) AccountUnlockedCoins ¶ added in v0.2.2
func (k Keeper) AccountUnlockedCoins(ctx sdk.Context, account sdk.AccAddress) (coins sdk.Coins, err error)
AccountUnlockedCoins returns the unlocked coins of the given sdk.AccAddress
func (Keeper) InitiateUnlocking ¶ added in v0.2.2
func (k Keeper) InitiateUnlocking(ctx sdk.Context, lockID uint64) (updatedLock *types.Lock, err error)
InitiateUnlocking starts the unlocking process of a lockup.
func (Keeper) LockTokens ¶ added in v0.2.2
func (k Keeper) LockTokens(ctx sdk.Context, owner sdk.AccAddress, coins sdk.Coins, duration time.Duration) (*types.Lock, error)
LockTokens lock tokens from an account for specified duration.
func (Keeper) LocksByDenom ¶ added in v0.2.2
func (k Keeper) LocksByDenom(ctx sdk.Context, do func(lock *types.Lock) (stop bool)) (coins sdk.Coins, err error)
LocksByDenom allows to iterate over types.Lock associated with a denom. CONTRACT: no writes on store can happen until the function exits.
func (Keeper) LocksByDenomUnlockingAfter ¶ added in v0.2.2
func (k Keeper) LocksByDenomUnlockingAfter(ctx sdk.Context, denom string, duration time.Duration, do func(lock *types.Lock) (stop bool))
LocksByDenomUnlockingAfter allows to iterate over types.Lock associated with a denom that unlock after the provided duration. CONTRACT: no writes on store can happen until the function exits.
func (Keeper) TotalLockedCoins ¶ added in v0.2.2
TotalLockedCoins returns the module account locked coins.
func (Keeper) UnlockAvailableCoins ¶ added in v0.2.2
func (k Keeper) UnlockAvailableCoins(ctx sdk.Context, account sdk.AccAddress) (coins sdk.Coins, err error)
UnlockAvailableCoins unlocks all the available coins for the provided account sdk.AccAddress.
func (Keeper) UnlockTokens ¶ added in v0.2.2
UnlockTokens returns tokens back from the module account address to the lock owner. The ID associated with the lock must exist, and the current block time must be after lock end time.
type LockState ¶
type LockState struct {
// contains filtered or unexported fields
}
func (LockState) IterateCoinsByDenomUnlockingAfter ¶ added in v0.1.0
func (LockState) IterateCoinsByDenomUnlockingBefore ¶ added in v0.1.0
func (LockState) IterateLockedCoins ¶
func (s LockState) IterateLockedCoins(addr sdk.AccAddress) sdk.Coins
func (LockState) IterateLocks ¶ added in v0.2.6
func (LockState) IterateLocksByAddress ¶ added in v0.2.2
func (s LockState) IterateLocksByAddress(addr sdk.AccAddress, do func(id uint64) (stop bool))
func (LockState) IterateTotalLockedCoins ¶
IterateTotalLockedCoins returns the total amount of locked coins
func (LockState) IterateUnlockedCoins ¶
func (s LockState) IterateUnlockedCoins(addr sdk.AccAddress) sdk.Coins
func (LockState) UnlockedIDsByAddress ¶
func (s LockState) UnlockedIDsByAddress(addr sdk.AccAddress) []uint64
UnlockedIDsByAddress returns the list of types.Lock IDs which can be unlocked given the lock owner sdk.AccAddress.