github.com/cosmos/cosmos-sdk@v0.50.10/x/auth/vesting/types/msgs.go (about)

     1  package types
     2  
     3  import (
     4  	sdk "github.com/cosmos/cosmos-sdk/types"
     5  )
     6  
     7  var (
     8  	_ sdk.Msg = &MsgCreateVestingAccount{}
     9  	_ sdk.Msg = &MsgCreatePermanentLockedAccount{}
    10  	_ sdk.Msg = &MsgCreatePeriodicVestingAccount{}
    11  )
    12  
    13  // NewMsgCreateVestingAccount returns a reference to a new MsgCreateVestingAccount.
    14  func NewMsgCreateVestingAccount(fromAddr, toAddr sdk.AccAddress, amount sdk.Coins, endTime int64, delayed bool) *MsgCreateVestingAccount {
    15  	return &MsgCreateVestingAccount{
    16  		FromAddress: fromAddr.String(),
    17  		ToAddress:   toAddr.String(),
    18  		Amount:      amount,
    19  		EndTime:     endTime,
    20  		Delayed:     delayed,
    21  	}
    22  }
    23  
    24  // NewMsgCreatePermanentLockedAccount returns a reference to a new MsgCreatePermanentLockedAccount.
    25  func NewMsgCreatePermanentLockedAccount(fromAddr, toAddr sdk.AccAddress, amount sdk.Coins) *MsgCreatePermanentLockedAccount {
    26  	return &MsgCreatePermanentLockedAccount{
    27  		FromAddress: fromAddr.String(),
    28  		ToAddress:   toAddr.String(),
    29  		Amount:      amount,
    30  	}
    31  }
    32  
    33  // NewMsgCreatePeriodicVestingAccount returns a reference to a new MsgCreatePeriodicVestingAccount.
    34  func NewMsgCreatePeriodicVestingAccount(fromAddr, toAddr sdk.AccAddress, startTime int64, periods []Period) *MsgCreatePeriodicVestingAccount {
    35  	return &MsgCreatePeriodicVestingAccount{
    36  		FromAddress:    fromAddr.String(),
    37  		ToAddress:      toAddr.String(),
    38  		StartTime:      startTime,
    39  		VestingPeriods: periods,
    40  	}
    41  }