exported

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account interface {
	GetAddress() sdk.AccAddress
	SetAddress(sdk.AccAddress) error // errors if already set.

	GetPubKey() crypto.PubKey // can return nil.
	SetPubKey(crypto.PubKey) error

	GetAccountNumber() uint64
	SetAccountNumber(uint64) error

	GetSequence() uint64
	SetSequence(uint64) error

	GetTokens() sdk.Tokens
	SetTokens(sdk.Tokens) error

	// Calculates the amount of tokens that can be sent to other accounts given
	// the current time.
	SpendableTokens(blockTime time.Time) sdk.Tokens

	// Ensure that account implements stringer
	String() string
}

Account is an interface used to store tokens at a given address within state. It presumes a notion of sequence numbers for replay protection, a notion of account numbers for replay protection for previously pruned accounts, and a pubkey for authentication purposes.

Many complex conditions can be used in the concrete struct which implements Account.

type VestingAccount

type VestingAccount interface {
	Account

	// Delegation and undelegation accounting that returns the resulting base
	// tokens amount.
	TrackDelegation(blockTime time.Time, amount sdk.Tokens)
	TrackUndelegation(amount sdk.Tokens)

	GetVestedTokens(blockTime time.Time) sdk.Tokens
	GetVestingTokens(blockTime time.Time) sdk.Tokens

	GetStartTime() int64
	GetEndTime() int64

	GetOriginalVesting() sdk.Tokens
	GetDelegatedFree() sdk.Tokens
	GetDelegatedVesting() sdk.Tokens
}

VestingAccount defines an account type that vests tokens via a vesting schedule.

Jump to

Keyboard shortcuts

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