ui/account.go
func (h *Handler) GenerateAccount(
	tkn string, params *AccountParams) (*string, error) {
	logger := h.logger.Add("method", "GenerateAccount")

	if !h.token.Check(tkn) {
		logger.Warn("access denied")
		return nil, ErrAccessDenied
	}

	account := params.prefilledAccount()

	id, err := h.fillAndSaveAccount(
		logger, account, crypto.GenerateKey, false)
	if err != nil {
		return nil, err
	}

	return &id, nil
}
func (h *Handler) GenerateAccount(
	tkn string, params *AccountParams) (*string, error) {
	logger := h.logger.Add("method", "GenerateAccount")

	if !h.token.Check(tkn) {
		logger.Warn("access denied")
		return nil, ErrAccessDenied
	}

	account := params.prefilledAccount()

	id, err := h.fillAndSaveAccount(
		logger, account, crypto.GenerateKey, false)
	if err != nil {
		return nil, err
	}

	return &id, nil
}
// GenerateAccount generates new private key and creates new account.