func (fes *APIServer) GetVerifiedUsernameToPKIDMap() (_verificationMap map[string]*lib.PKID, _err error) {
	verifiedMapBytes, err := fes.GlobalStateGet(_GlobalStatePrefixForVerifiedMap)
	if err != nil {
		return nil, fmt.Errorf("GetVerifiedUsernameToPKIDMap: Cannot Decode Verification Map: %v", err)
	}
	verifiedMapStruct := VerifiedUsernameToPKID{}
	if len(verifiedMapBytes) > 0 {
		err = gob.NewDecoder(bytes.NewReader(verifiedMapBytes)).Decode(&verifiedMapStruct)
		if err != nil {
			return nil, fmt.Errorf("GetVerifiedUsernameToPKIDMap: Cannot Decode Verification Map: %v", err)
		}
	} else {
		verifiedMapStruct.VerifiedUsernameToPKID = make(map[string]*lib.PKID)
		metadataDataBuf := bytes.NewBuffer([]byte{})
		gob.NewEncoder(metadataDataBuf).Encode(verifiedMapStruct)
		err = fes.GlobalStatePut(_GlobalStatePrefixForVerifiedMap, metadataDataBuf.Bytes())
		if err != nil {
			return nil, fmt.Errorf("GetVerifiedUsernameToPKIDMap: Cannot Decode Verification Map: %v", err)
		}
	}
	return verifiedMapStruct.VerifiedUsernameToPKID, nil
}
GetVerifiedUsernameToPKIDMap

Acts as a helper function for dealing with the verified usernames map.
If the map does not already exist, this function will create one in global state.
Returns nil it encounters an error. Returning nil is not dangerous, as
_profileEntryToResponse() will ignore the map entirely in that case.
package routes
import (
	"bytes"
	"encoding/gob"
	"encoding/json"
	"fmt"
	"net/http"
	"time"
	"github.com/deso-protocol/core/lib"
	"github.com/golang/glog"
	"github.com/pkg/errors"
	"github.com/tyler-smith/go-bip39"
)
func _AddBadRequestError(ww http.ResponseWriter, errorString string) {
	_AddHttpError(ww, errorString, http.StatusBadRequest)
}
func _AddNotFoundError(ww http.ResponseWriter, errorString string) {
	_AddHttpError(ww, errorString, http.StatusNotFound)
}
func _AddInternalServerError(ww http.ResponseWriter, errorString string) {
	_AddHttpError(ww, errorString, http.StatusInternalServerError)
}
func _AddHttpError(ww http.ResponseWriter, errorString string, statusCode int) {
	glog.Error(errorString)
	ww.WriteHeader(statusCode)
	json.NewEncoder(ww).Encode(struct {
		Error string `json:"error"`
	}{Error: errorString})
}
type TransactionInfo struct {
	TotalInputNanos          uint64
	SpendAmountNanos         uint64
	ChangeAmountNanos        uint64
	FeeNanos                 uint64
	TransactionIDBase58Check string
	RecipientPublicKeys   []string
	RecipientAmountsNanos []uint64
	TransactionHex string
	TimeAdded int64
}
type MessageEntryResponse struct {
	SenderPublicKeyBase58Check    string
	RecipientPublicKeyBase58Check string
	EncryptedText string
	TstampNanos   uint64
	IsSender bool
	V2 bool
}
type MessageContactResponse struct {
	PublicKeyBase58Check string
	Messages             []*MessageEntryResponse
	ProfileEntryResponse *ProfileEntryResponse
	NumMessagesRead int64
}
type User struct {
	PublicKeyBase58Check string
	ProfileEntryResponse *ProfileEntryResponse
	Utxos               []*UTXOEntryResponse
	BalanceNanos        uint64
	UnminedBalanceNanos uint64
	PublicKeysBase58CheckFollowedByUser []string
	UsersYouHODL         []*BalanceEntryResponse
	UsersWhoHODLYouCount int
	HasPhoneNumber   bool
	CanCreateProfile bool
	BlockedPubKeys   map[string]struct{}
	HasEmail         bool
	EmailVerified    bool
	JumioStartTime uint64
	JumioFinishedTime uint64
	JumioVerified    bool
	JumioReturned    bool
	IsAdmin bool
	IsSuperAdmin bool
	IsBlacklisted bool
	IsGraylisted  bool
	TutorialStatus TutorialStatus
	CreatorPurchasedInTutorialUsername *string `json:",omitempty"`
	CreatorCoinsPurchasedInTutorial uint64
	MustCompleteTutorial bool
}
type BalanceEntryResponse struct {
	HODLerPublicKeyBase58Check string
	CreatorPublicKeyBase58Check string
	HasPurchased bool
	BalanceNanos uint64
	NetBalanceInMempool int64
	ProfileEntryResponse *ProfileEntryResponse `json:",omitempty"`
}
func (fes *APIServer) GetBalanceForPublicKey(publicKeyBytes []byte) (
	_balanceNanos uint64, _err error) {
	utxoEntries, err := fes.blockchain.GetSpendableUtxosForPublicKey(publicKeyBytes, fes.backendServer.GetMempool(), nil)
	if err != nil {
		return 0, fmt.Errorf(
			"GetBalanceForPublicKey: Problem getting utxos from view: %v", err)
	}
	totalBalanceNanos := uint64(0)
	for _, utxoEntry := range utxoEntries {
		totalBalanceNanos += utxoEntry.AmountNanos
	}
	return totalBalanceNanos, nil
}