func NewMsgLockCoin(auth types.AccAddress, id types.AccountID, amount types.Coins, unlockBlockHeight int64) MsgLockCoin {
	return MsgLockCoin{
		*msg.MustNewKuMsg(
			RouterKeyName,
			msg.WithAuth(auth),
			msg.WithData(Cdc(), &MsgLockCoinData{
				Id:                id,
				Amount:            amount,
				UnlockBlockHeight: unlockBlockHeight,
			}),
		),
	}
}
NewMsgLockCoin create new lock coin msg
package types
import (
	"github.com/KuChainNetwork/kuchain/chain/msg"
	"github.com/KuChainNetwork/kuchain/chain/types"
	sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)
const RouterKey = ModuleName
var (
	RouterKeyName                    = types.MustName(RouterKey)
	_, _, _, _, _    types.KuMsgData = (*MsgCreateCoinData)(nil), (*MsgIssueCoinData)(nil), (*MsgBurnCoinData)(nil), (*MsgLockCoinData)(nil), (*MsgUnlockCoinData)(nil)
	_, _, _, _, _, _ types.Msg       = (*MsgTransfer)(nil), (*MsgCreateCoin)(nil), (*MsgIssueCoin)(nil), (*MsgBurnCoin)(nil), (*MsgLockCoin)(nil), (*MsgUnlockCoin)(nil)
)
type (
	KuMsg = types.KuMsg
)
type MsgTransfer struct {
	types.KuMsg
}
func NewMsgTransfer(auth types.AccAddress, from types.AccountID, to types.AccountID, amount Coins) MsgTransfer {
	return MsgTransfer{
		*msg.MustNewKuMsg(
			RouterKeyName,
			msg.WithAuth(auth),
			msg.WithTransfer(from, to, amount),
		),
	}
}
func (msg MsgTransfer) ValidateBasic() error {
	if err := msg.KuMsg.ValidateTransfer(); err != nil {
		return err
	}
	return nil
}
type MsgCreateCoin struct {
	types.KuMsg
}
type MsgCreateCoinData struct {
	Symbol        Name   `json:"symbol" yaml:"symbol"`                              
	Creator       Name   `json:"creator" yaml:"creator"`                            
	MaxSupply     Coin   `json:"max_supply" yaml:"max_supply"`                      
	CanIssue      bool   `json:"can_issue,omitempty" yaml:"can_issue"`              
	CanLock       bool   `json:"can_lock,omitempty" yaml:"can_lock"`                
	CanBurn       bool   `json:"can_burn,omitempty" yaml:"can_burn"`                
	IssueToHeight int64  `json:"issue_to_height,omitempty" yaml:"issue_to_height"`  
	InitSupply    Coin   `json:"init_supply" yaml:"init_supply"`                    
	Desc          []byte `json:"desc" yaml:"desc"`                                  
}
func (MsgCreateCoinData) Type() types.Name { return types.MustName("create@asset") }
func (msg MsgCreateCoinData) Sender() AccountID {
	return NewAccountIDFromName(msg.Creator)
}
func NewMsgCreate(auth types.AccAddress, creator types.Name, symbol types.Name, maxSupply types.Coin, canIssue, canLock, canBurn bool, issue2Height int64, initSupply types.Coin, desc []byte) MsgCreateCoin {
	return MsgCreateCoin{
		*msg.MustNewKuMsg(
			RouterKeyName,
			msg.WithAuth(auth),
			msg.WithData(Cdc(), &MsgCreateCoinData{
				Creator:       creator,
				Symbol:        symbol,
				MaxSupply:     maxSupply,
				CanIssue:      canIssue,
				CanLock:       canLock,
				CanBurn:       canBurn,
				IssueToHeight: issue2Height,
				InitSupply:    initSupply,
				Desc:          desc,
			}),
		),
	}
}
func (msg MsgCreateCoin) GetData() (MsgCreateCoinData, error) {
	res := MsgCreateCoinData{}
	if err := msg.UnmarshalData(Cdc(), &res); err != nil {
		return MsgCreateCoinData{}, sdkerrors.Wrapf(types.ErrKuMsgDataUnmarshal, "%s", err.Error())
	}
	return res, nil
}
func (msg MsgCreateCoin) ValidateBasic() error {
	if err := msg.KuMsg.ValidateTransfer(); err != nil {
		return err
	}
	data, err := msg.GetData()
	if err != nil {
		return err
	}
	if data.Creator.Empty() || data.Symbol.Empty() {
		return types.ErrNameNilString
	}
	if len(data.Desc) > CoinDescriptionLen {
		return ErrAssetDescriptorTooLarge
	}
	denom := types.CoinDenom(data.Creator, data.Symbol)
	if err := types.ValidateDenom(denom); err != nil {
		return err
	}
	if denom != data.MaxSupply.Denom || denom != data.InitSupply.Denom {
		return ErrAssetSymbolError
	}
	if data.MaxSupply.IsZero() {
		return ErrAssetIssueMaxSupplyShouldNoZero
	}
	if err := CheckCoinStatOpts(
		0,  
		data.CanIssue, data.CanLock,
		data.IssueToHeight,
		data.InitSupply, data.MaxSupply); err != nil {
		return err
	}
	return nil
}
type MsgIssueCoin struct {
	types.KuMsg
}
type MsgIssueCoinData struct {
	Symbol  Name `json:"symbol" yaml:"symbol"`    
	Creator Name `json:"creator" yaml:"creator"`  
	Amount  Coin `json:"amount" yaml:"amount"`    
}
func (MsgIssueCoinData) Type() types.Name { return types.MustName("issue") }
func (msg MsgIssueCoinData) Sender() AccountID {
	return NewAccountIDFromName(msg.Creator)
}
func NewMsgIssue(auth types.AccAddress, creator, symbol types.Name, amount types.Coin) MsgIssueCoin {
	return MsgIssueCoin{
		*msg.MustNewKuMsg(
			RouterKeyName,
			msg.WithAuth(auth),
			msg.WithData(Cdc(), &MsgIssueCoinData{
				Creator: creator,
				Symbol:  symbol,
				Amount:  amount,
			}),
		),
	}
}
func (msg MsgIssueCoin) GetData() (MsgIssueCoinData, error) {
	res := MsgIssueCoinData{}
	if err := msg.UnmarshalData(Cdc(), &res); err != nil {
		return MsgIssueCoinData{}, sdkerrors.Wrapf(types.ErrKuMsgDataUnmarshal, "%s", err.Error())
	}
	return res, nil
}
func (msg MsgIssueCoin) ValidateBasic() error {
	if err := msg.KuMsg.ValidateTransfer(); err != nil {
		return err
	}
	data, err := msg.GetData()
	if err != nil {
		return err
	}
	denom := types.CoinDenom(data.Creator, data.Symbol)
	if err := types.ValidateDenom(denom); err != nil {
		return err
	}
	if denom != data.Amount.Denom {
		return ErrAssetSymbolError
	}
	if data.Amount.IsNegative() {
		return ErrAssetCoinNoEnough
	}
	return nil
}
type MsgBurnCoin struct {
	types.KuMsg
}
type MsgBurnCoinData struct {
	Id     AccountID `json:"id" yaml:"id"`          
	Amount Coin      `json:"amount" yaml:"amount"`  
}
func (MsgBurnCoinData) Type() types.Name { return types.MustName("burn") }
func (msg MsgBurnCoinData) Sender() AccountID {
	return msg.Id
}
func NewMsgBurn(auth types.AccAddress, id types.AccountID, amount types.Coin) MsgBurnCoin {
	return MsgBurnCoin{
		*msg.MustNewKuMsg(
			RouterKeyName,
			msg.WithAuth(auth),
			msg.WithData(Cdc(), &MsgBurnCoinData{
				Id:     id,
				Amount: amount,
			}),
		),
	}
}
func (msg MsgBurnCoin) GetData() (MsgBurnCoinData, error) {
	res := MsgBurnCoinData{}
	if err := msg.UnmarshalData(Cdc(), &res); err != nil {
		return MsgBurnCoinData{}, sdkerrors.Wrapf(types.ErrKuMsgDataUnmarshal, "%s", err.Error())
	}
	return res, nil
}
func (msg MsgBurnCoin) ValidateBasic() error {
	if err := msg.KuMsg.ValidateTransfer(); err != nil {
		return err
	}
	data, err := msg.GetData()
	if err != nil {
		return err
	}
	if data.Id.Empty() {
		return types.ErrKuMsgAccountIDNil
	}
	if err := types.ValidateDenom(data.Amount.Denom); err != nil {
		return err
	}
	if data.Amount.IsNegative() {
		return ErrAssetCoinNoEnough
	}
	return nil
}
type MsgLockCoin struct {
	types.KuMsg
}
type MsgLockCoinData struct {
	Id                AccountID `json:"id" yaml:"id"`                                          
	Amount            Coins     `json:"amount" yaml:"amount"`                                  
	UnlockBlockHeight int64     `json:"unlockBlockHeight,omitempty" yaml:"unlockBlockHeight"`  
}
func (m *MsgLockCoinData) Type() types.Name { return types.MustName("lock@coin") }
func (m MsgLockCoinData) Sender() AccountID {
	return m.Id
}