github.com/Finschia/finschia-sdk@v0.49.1/x/auth/vesting/exported/exported.go (about)

     1  package exported
     2  
     3  import (
     4  	"time"
     5  
     6  	sdk "github.com/Finschia/finschia-sdk/types"
     7  	"github.com/Finschia/finschia-sdk/x/auth/types"
     8  )
     9  
    10  // VestingAccount defines an account type that vests coins via a vesting schedule.
    11  type VestingAccount interface {
    12  	types.AccountI
    13  
    14  	// LockedCoins returns the set of coins that are not spendable (i.e. locked),
    15  	// defined as the vesting coins that are not delegated.
    16  	//
    17  	// To get spendable coins of a vesting account, first the total balance must
    18  	// be retrieved and the locked tokens can be subtracted from the total balance.
    19  	// Note, the spendable balance can be negative.
    20  	LockedCoins(blockTime time.Time) sdk.Coins
    21  
    22  	// TrackDelegation performs internal vesting accounting necessary when
    23  	// delegating from a vesting account. It accepts the current block time, the
    24  	// delegation amount and balance of all coins whose denomination exists in
    25  	// the account's original vesting balance.
    26  	TrackDelegation(blockTime time.Time, balance, amount sdk.Coins)
    27  
    28  	// TrackUndelegation performs internal vesting accounting necessary when a
    29  	// vesting account performs an undelegation.
    30  	TrackUndelegation(amount sdk.Coins)
    31  
    32  	GetVestedCoins(blockTime time.Time) sdk.Coins
    33  	GetVestingCoins(blockTime time.Time) sdk.Coins
    34  
    35  	GetStartTime() int64
    36  	GetEndTime() int64
    37  
    38  	GetOriginalVesting() sdk.Coins
    39  	GetDelegatedFree() sdk.Coins
    40  	GetDelegatedVesting() sdk.Coins
    41  }