Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterInterfaces(registry codectypes.InterfaceRegistry)
- func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
- type LazyGradedVestingAccount
- func (*LazyGradedVestingAccount) Descriptor() ([]byte, []int)
- func (lgva LazyGradedVestingAccount) GetEndTime() int64
- func (lgva LazyGradedVestingAccount) GetStartTime() int64
- func (lgva LazyGradedVestingAccount) GetVestedCoins(blockTime time.Time) sdk.Coins
- func (lgva LazyGradedVestingAccount) GetVestingCoins(blockTime time.Time) sdk.Coins
- func (lgva LazyGradedVestingAccount) GetVestingSchedule(denom string) (VestingSchedule, bool)
- func (lgva LazyGradedVestingAccount) GetVestingSchedules() VestingSchedules
- func (lgva LazyGradedVestingAccount) LockedCoins(blockTime time.Time) sdk.Coins
- func (m *LazyGradedVestingAccount) Marshal() (dAtA []byte, err error)
- func (m *LazyGradedVestingAccount) MarshalTo(dAtA []byte) (int, error)
- func (m *LazyGradedVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (lgva LazyGradedVestingAccount) MarshalYAML() (interface{}, error)
- func (*LazyGradedVestingAccount) ProtoMessage()
- func (m *LazyGradedVestingAccount) Reset()
- func (m *LazyGradedVestingAccount) Size() (n int)
- func (lgva LazyGradedVestingAccount) String() string
- func (lgva *LazyGradedVestingAccount) TrackDelegation(blockTime time.Time, balance, amount sdk.Coins)
- func (m *LazyGradedVestingAccount) Unmarshal(dAtA []byte) error
- func (lgva LazyGradedVestingAccount) Validate() error
- func (m *LazyGradedVestingAccount) XXX_DiscardUnknown()
- func (m *LazyGradedVestingAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *LazyGradedVestingAccount) XXX_Merge(src proto.Message)
- func (m *LazyGradedVestingAccount) XXX_Size() int
- func (m *LazyGradedVestingAccount) XXX_Unmarshal(b []byte) error
- type Schedule
- func (*Schedule) Descriptor() ([]byte, []int)
- func (s Schedule) GetEndTime() int64
- func (s Schedule) GetRatio() sdk.Dec
- func (s Schedule) GetStartTime() int64
- func (m *Schedule) Marshal() (dAtA []byte, err error)
- func (m *Schedule) MarshalTo(dAtA []byte) (int, error)
- func (m *Schedule) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Schedule) ProtoMessage()
- func (m *Schedule) Reset()
- func (m *Schedule) Size() (n int)
- func (m *Schedule) String() string
- func (m *Schedule) Unmarshal(dAtA []byte) error
- func (s Schedule) Validate() error
- func (m *Schedule) XXX_DiscardUnknown()
- func (m *Schedule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Schedule) XXX_Merge(src proto.Message)
- func (m *Schedule) XXX_Size() int
- func (m *Schedule) XXX_Unmarshal(b []byte) error
- type Schedules
- type VestingSchedule
- func (*VestingSchedule) Descriptor() ([]byte, []int)
- func (vs VestingSchedule) GetDenom() string
- func (vs VestingSchedule) GetVestedRatio(blockTime int64) sdk.Dec
- func (m *VestingSchedule) Marshal() (dAtA []byte, err error)
- func (m *VestingSchedule) MarshalTo(dAtA []byte) (int, error)
- func (m *VestingSchedule) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*VestingSchedule) ProtoMessage()
- func (m *VestingSchedule) Reset()
- func (m *VestingSchedule) Size() (n int)
- func (m *VestingSchedule) String() string
- func (m *VestingSchedule) Unmarshal(dAtA []byte) error
- func (vs VestingSchedule) Validate() error
- func (m *VestingSchedule) XXX_DiscardUnknown()
- func (m *VestingSchedule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *VestingSchedule) XXX_Merge(src proto.Message)
- func (m *VestingSchedule) XXX_Size() int
- func (m *VestingSchedule) XXX_Unmarshal(b []byte) error
- type VestingSchedules
Constants ¶
const (
// ModuleName defines the module's name.
ModuleName = "vesting"
)
Variables ¶
var ( ErrInvalidLengthVesting = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowVesting = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupVesting = fmt.Errorf("proto: unexpected end of group") )
var ( // ModuleCdc references the global x/oracle module codec. Note, the codec should // ONLY be used in certain instances of tests and for JSON encoding as Amino is // still used for that purpose. // // The actual codec used for serialization should be provided to x/staking and // defined at the application level. ModuleCdc = codec.NewAminoCodec(amino) )
Functions ¶
func RegisterInterfaces ¶
func RegisterInterfaces(registry codectypes.InterfaceRegistry)
RegisterInterfaces associates protoName with AccountI and VestingAccount Interfaces and creates a registry of it's concrete implementations
func RegisterLegacyAminoCodec ¶
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)
RegisterLegacyAminoCodec registers the account interfaces and concrete types on the provided LegacyAmino codec. These types are used for Amino JSON serialization
Types ¶
type LazyGradedVestingAccount ¶
type LazyGradedVestingAccount struct { *types.BaseVestingAccount `` /* 147-byte string literal not displayed */ VestingSchedules VestingSchedules `` /* 154-byte string literal not displayed */ }
LazyGradedVestingAccount implements the LazyGradedVestingAccount interface. It vests all coins according to a predefined schedule.
func NewLazyGradedVestingAccount ¶
func NewLazyGradedVestingAccount(baseAcc *authtypes.BaseAccount, originalVesting sdk.Coins, lazyVestingSchedules VestingSchedules) *LazyGradedVestingAccount
NewLazyGradedVestingAccount returns a new LazyGradedVestingAccount
func NewLazyGradedVestingAccountRaw ¶
func NewLazyGradedVestingAccountRaw(baseVestingAcc *vesttypes.BaseVestingAccount, lazyVestingSchedules VestingSchedules) *LazyGradedVestingAccount
NewLazyGradedVestingAccountRaw creates a new LazyGradedVestingAccount object from BaseVestingAccount
func (*LazyGradedVestingAccount) Descriptor ¶
func (*LazyGradedVestingAccount) Descriptor() ([]byte, []int)
func (LazyGradedVestingAccount) GetEndTime ¶
func (lgva LazyGradedVestingAccount) GetEndTime() int64
GetEndTime returns zero since a lazy graded vesting account has no end time.
func (LazyGradedVestingAccount) GetStartTime ¶
func (lgva LazyGradedVestingAccount) GetStartTime() int64
GetStartTime returns zero since a lazy graded vesting account has no start time.
func (LazyGradedVestingAccount) GetVestedCoins ¶
func (lgva LazyGradedVestingAccount) GetVestedCoins(blockTime time.Time) sdk.Coins
GetVestedCoins returns the total amount of vested coins for a graded vesting account. All coins are vested continuously once the schedule's StartTime has elapsed until EndTime.
func (LazyGradedVestingAccount) GetVestingCoins ¶
func (lgva LazyGradedVestingAccount) GetVestingCoins(blockTime time.Time) sdk.Coins
GetVestingCoins returns the total number of vesting coins for a graded vesting account.
func (LazyGradedVestingAccount) GetVestingSchedule ¶
func (lgva LazyGradedVestingAccount) GetVestingSchedule(denom string) (VestingSchedule, bool)
GetVestingSchedule returns the VestingSchedule of the given denom
func (LazyGradedVestingAccount) GetVestingSchedules ¶
func (lgva LazyGradedVestingAccount) GetVestingSchedules() VestingSchedules
GetVestingSchedules returns the VestingSchedules of the graded lazy vesting account
func (LazyGradedVestingAccount) LockedCoins ¶
func (lgva LazyGradedVestingAccount) LockedCoins(blockTime time.Time) sdk.Coins
LockedCoins returns the set of coins that are not spendable (i.e. locked).
func (*LazyGradedVestingAccount) Marshal ¶
func (m *LazyGradedVestingAccount) Marshal() (dAtA []byte, err error)
func (*LazyGradedVestingAccount) MarshalTo ¶
func (m *LazyGradedVestingAccount) MarshalTo(dAtA []byte) (int, error)
func (*LazyGradedVestingAccount) MarshalToSizedBuffer ¶
func (m *LazyGradedVestingAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (LazyGradedVestingAccount) MarshalYAML ¶
func (lgva LazyGradedVestingAccount) MarshalYAML() (interface{}, error)
MarshalYAML returns the YAML representation of a LazyGradedVestingAccount.
func (*LazyGradedVestingAccount) ProtoMessage ¶
func (*LazyGradedVestingAccount) ProtoMessage()
func (*LazyGradedVestingAccount) Reset ¶
func (m *LazyGradedVestingAccount) Reset()
func (*LazyGradedVestingAccount) Size ¶
func (m *LazyGradedVestingAccount) Size() (n int)
func (LazyGradedVestingAccount) String ¶
func (lgva LazyGradedVestingAccount) String() string
String implements fmt.Stringer interface
func (*LazyGradedVestingAccount) TrackDelegation ¶
func (lgva *LazyGradedVestingAccount) TrackDelegation(blockTime time.Time, balance, amount sdk.Coins)
TrackDelegation tracks a delegation amount for any given vesting account type given the amount of coins currently vesting. It returns the resulting base coins.
CONTRACT: The account's coins, delegation coins, vesting coins, and delegated vesting coins must be sorted.
func (*LazyGradedVestingAccount) Unmarshal ¶
func (m *LazyGradedVestingAccount) Unmarshal(dAtA []byte) error
func (LazyGradedVestingAccount) Validate ¶
func (lgva LazyGradedVestingAccount) Validate() error
Validate checks for errors on the account fields
func (*LazyGradedVestingAccount) XXX_DiscardUnknown ¶
func (m *LazyGradedVestingAccount) XXX_DiscardUnknown()
func (*LazyGradedVestingAccount) XXX_Marshal ¶
func (m *LazyGradedVestingAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*LazyGradedVestingAccount) XXX_Merge ¶
func (m *LazyGradedVestingAccount) XXX_Merge(src proto.Message)
func (*LazyGradedVestingAccount) XXX_Size ¶
func (m *LazyGradedVestingAccount) XXX_Size() int
func (*LazyGradedVestingAccount) XXX_Unmarshal ¶
func (m *LazyGradedVestingAccount) XXX_Unmarshal(b []byte) error
type Schedule ¶
type Schedule struct { StartTime int64 `protobuf:"varint,1,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty" yaml:"start_time"` EndTime int64 `protobuf:"varint,2,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty" yaml:"end_time"` Ratio github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=ratio,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"ratio" yaml:"ratio"` }
Schedule - represent single schedule data for a vesting schedule
func NewSchedule ¶
NewSchedule returns new Schedule instance
func (*Schedule) Descriptor ¶
func (Schedule) GetStartTime ¶
GetStartTime returns start time
func (*Schedule) MarshalToSizedBuffer ¶
func (*Schedule) ProtoMessage ¶
func (*Schedule) ProtoMessage()
func (*Schedule) XXX_DiscardUnknown ¶
func (m *Schedule) XXX_DiscardUnknown()
func (*Schedule) XXX_Marshal ¶
func (*Schedule) XXX_Unmarshal ¶
type VestingSchedule ¶
type VestingSchedule struct { Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty" yaml:"start_time"` Schedules Schedules `protobuf:"bytes,2,rep,name=schedules,proto3,castrepeated=Schedules" json:"schedules" yaml:"schedules"` }
VestingSchedule defines vesting schedule for a denom
func NewVestingSchedule ¶
func NewVestingSchedule(denom string, schedules Schedules) VestingSchedule
NewVestingSchedule creates a new vesting lazy schedule instance.
func (*VestingSchedule) Descriptor ¶
func (*VestingSchedule) Descriptor() ([]byte, []int)
func (VestingSchedule) GetDenom ¶
func (vs VestingSchedule) GetDenom() string
GetDenom returns the denom of vesting schedule
func (VestingSchedule) GetVestedRatio ¶
func (vs VestingSchedule) GetVestedRatio(blockTime int64) sdk.Dec
GetVestedRatio returns the ratio of tokens that have vested by blockTime.
func (*VestingSchedule) Marshal ¶
func (m *VestingSchedule) Marshal() (dAtA []byte, err error)
func (*VestingSchedule) MarshalToSizedBuffer ¶
func (m *VestingSchedule) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*VestingSchedule) ProtoMessage ¶
func (*VestingSchedule) ProtoMessage()
func (*VestingSchedule) Reset ¶
func (m *VestingSchedule) Reset()
func (*VestingSchedule) Size ¶
func (m *VestingSchedule) Size() (n int)
func (*VestingSchedule) String ¶
func (m *VestingSchedule) String() string
func (*VestingSchedule) Unmarshal ¶
func (m *VestingSchedule) Unmarshal(dAtA []byte) error
func (VestingSchedule) Validate ¶
func (vs VestingSchedule) Validate() error
Validate checks that the vesting lazy schedule is valid.
func (*VestingSchedule) XXX_DiscardUnknown ¶
func (m *VestingSchedule) XXX_DiscardUnknown()
func (*VestingSchedule) XXX_Marshal ¶
func (m *VestingSchedule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*VestingSchedule) XXX_Merge ¶
func (m *VestingSchedule) XXX_Merge(src proto.Message)
func (*VestingSchedule) XXX_Size ¶
func (m *VestingSchedule) XXX_Size() int
func (*VestingSchedule) XXX_Unmarshal ¶
func (m *VestingSchedule) XXX_Unmarshal(b []byte) error
type VestingSchedules ¶
type VestingSchedules []VestingSchedule
VestingSchedules stores all vesting schedules passed as part of a LazyGradedVestingAccount