keeper

package
v1.0.1-rc0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Day    = "day"
	Hour   = "hour"
	Minute = "minute"
	Second = "second"
)

Variables

This section is empty.

Functions

func CalculateWithdrawable

func CalculateWithdrawable(current time.Time, vesting types.VestingPool) sdk.Int

func ConvertVestingTypesToGenesisVestingTypes

func ConvertVestingTypesToGenesisVestingTypes(vestingTypes *types.VestingTypes) []types.GenesisVestingType

func DurationFromUnits

func DurationFromUnits(unit PeriodUnit, value int64) time.Duration

func GetVestingAccountIDBytes

func GetVestingAccountIDBytes(id uint64) []byte

GetVestingAccountIDBytes returns the byte representation of the ID

func GetVestingAccountIDFromBytes

func GetVestingAccountIDFromBytes(bz []byte) uint64

GetVestingAccountIDFromBytes returns ID in uint64 format from a byte array

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey,
	memKey sdk.StoreKey,
	ps paramtypes.Subspace,
	bank types.BankKeeper,
	staking types.StakingKeeper,
	account types.AccountKeeper,
	distribution types.DistributionKeeper,
	gov types.GovKeeper,
) *Keeper

func (Keeper) AppendVestingAccount

func (k Keeper) AppendVestingAccount(
	ctx sdk.Context,
	vestingAccount types.VestingAccount,
) uint64

AppendVestingAccount appends a vestingAccount in the store with a new id and update the count

func (Keeper) CreateVestingAccount

func (k Keeper) CreateVestingAccount(ctx sdk.Context, fromAddress string, toAddress string,
	amount sdk.Coins, startTime int64, endTime int64) error

func (Keeper) CreateVestingPool

func (k Keeper) CreateVestingPool(ctx sdk.Context, addr string, name string, amount sdk.Int, duration time.Duration, vestingType string) error

func (Keeper) DeleteAccountVestings

func (k Keeper) DeleteAccountVestings(ctx sdk.Context, accountAddress string) (accountVestings types.AccountVestings)

get the vesting types

func (Keeper) Denom

func (k Keeper) Denom(ctx sdk.Context) (res string)

Denom returns the denom param

func (Keeper) GetAccountVestings

func (k Keeper) GetAccountVestings(ctx sdk.Context, accountAddress string) (accountVestings types.AccountVestings, found bool)

get the vesting types

func (Keeper) GetAllAccountVestings

func (k Keeper) GetAllAccountVestings(ctx sdk.Context) (list []types.AccountVestings)

GetAllAccountVestings returns all AccountVestings

func (Keeper) GetAllVestingAccount

func (k Keeper) GetAllVestingAccount(ctx sdk.Context) (list []types.VestingAccount)

GetAllVestingAccount returns all vestingAccount

func (Keeper) GetParams

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

GetParams get all parameters as types.Params

func (Keeper) GetVestingAccount

func (k Keeper) GetVestingAccount(ctx sdk.Context, id uint64) (val types.VestingAccount, found bool)

GetVestingAccount returns a vestingAccount from its id

func (Keeper) GetVestingAccountCount

func (k Keeper) GetVestingAccountCount(ctx sdk.Context) uint64

GetVestingAccountCount get the total number of vestingAccount

func (Keeper) GetVestingType

func (k Keeper) GetVestingType(ctx sdk.Context, name string) (vestingType types.VestingType, err error)

get the vesting type by name

func (Keeper) GetVestingTypes

func (k Keeper) GetVestingTypes(ctx sdk.Context) (vestingTypes types.VestingTypes)

get the vesting types

func (Keeper) Logger

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

func (Keeper) Params

func (Keeper) RemoveVestingAccount

func (k Keeper) RemoveVestingAccount(ctx sdk.Context, id uint64)

RemoveVestingAccount removes a vestingAccount from the store

func (Keeper) SendToNewVestingAccount

func (k Keeper) SendToNewVestingAccount(ctx sdk.Context, fromAddr string, toAddr string, vestingId int32, amount sdk.Int, restartVesting bool) (withdrawn sdk.Coin, returnedError error)

func (Keeper) SetAccountVestings

func (k Keeper) SetAccountVestings(ctx sdk.Context, accountVestings types.AccountVestings)

set the vesting types

func (Keeper) SetParams

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

SetParams set the params

func (Keeper) SetVestingAccount

func (k Keeper) SetVestingAccount(ctx sdk.Context, vestingAccount types.VestingAccount)

SetVestingAccount set a specific vestingAccount in the store

func (Keeper) SetVestingAccountCount

func (k Keeper) SetVestingAccountCount(ctx sdk.Context, count uint64)

SetVestingAccountCount set the total number of vestingAccount

func (Keeper) SetVestingTypes

func (k Keeper) SetVestingTypes(ctx sdk.Context, vestingTypes types.VestingTypes)

set the vesting types

func (Keeper) Vestings

func (Keeper) WithdrawAllAvailable

func (k Keeper) WithdrawAllAvailable(ctx sdk.Context, addr string) (withdrawn sdk.Coin, returnedError error)

type PeriodUnit

type PeriodUnit string

func UnitsFromDuration

func UnitsFromDuration(duration time.Duration) (unit PeriodUnit, value int64)

Jump to

Keyboard shortcuts

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