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

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