func NewAccountIDFromStr(str string) (AccountID, error) {
	if str == "" {
		return EmptyAccountID(), nil
	}
	if len(str) <= NameStrLenMax {
		n, err := NewName(str)
		if err != nil {
			return AccountID{}, err
		}
		return NewAccountIDFromName(n), nil
	}
	accAdd, err := sdk.AccAddressFromBech32(str)
	if err != nil {
		return AccountID{}, err
	}
	return NewAccountIDFromAccAdd(accAdd), nil
}
NewAccountIDFromStr new accountID from string
package types
import (
	"bytes"
	"encoding/json"
	"fmt"
	sdk "github.com/cosmos/cosmos-sdk/types"
	"github.com/pkg/errors"
	"github.com/tendermint/tendermint/libs/math"
)
const (
	accountIDTypeNil byte = iota
	accountIDTypeName
	accountIDTypeAccAddress
	accountIDTypeIdxLen
)
const (
	AccIDStoreKeyLen = sdk.AddrLen + 1
)
var _ sdk.Address = &AccountID{}
type AccountID struct {
	Value []byte `json:"value,omitempty" yaml:"value"`
}
type AccountIDes struct {
	Addresses []AccountID `json:"addresses"`
}
func NewAccountIDFromName(n Name) (res AccountID) {
	res.Value = make([]byte, len(n.Value))
	copy(res.Value, n.Value)
	return res
}
func NewAccountIDFromByte(bytes []byte) AccountID {
	return AccountID{
		Value: bytes,
	}
}
func NewAccountIDFromAccAdd(add sdk.AccAddress) AccountID {
	bs := make([]byte, 0, len(add)+1)
	bs = append(bs, accountIDTypeAccAddress)
	bs = append(bs, add...)
	return AccountID{bs}
}
func NewAccountIDFromAdd(add sdk.Address) AccountID {
	bs := make([]byte, 0, len(add.Bytes())+1)
	bs = append(bs, accountIDTypeAccAddress)
	bs = append(bs, add.Bytes()...)
	return AccountID{bs}
}
func NewAccountIDFromValAdd(add sdk.ValAddress) AccountID {
	return NewAccountIDFromAccAdd(sdk.AccAddress(add))
}
func NewAccountIDFromConsAdd(add sdk.ConsAddress) AccountID {
	return NewAccountIDFromAccAdd(sdk.AccAddress(add))
}
func EmptyAccountID() AccountID {
	return AccountID{
		Value: []byte{accountIDTypeNil}[:],
	}
}