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

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

	account := params.prefilledAccount()

	makeECDSAFunc := h.jsonPrivateKeyToECDSA(
		jsonBlob, jsonKeyStorePassword)

	id, err := h.fillAndSaveAccount(
		logger, account, makeECDSAFunc, true)
	if err != nil {
		return nil, err
	}

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

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

	account := params.prefilledAccount()

	makeECDSAFunc := h.jsonPrivateKeyToECDSA(
		jsonBlob, jsonKeyStorePassword)

	id, err := h.fillAndSaveAccount(
		logger, account, makeECDSAFunc, true)
	if err != nil {
		return nil, err
	}

	return &id, nil
}
// ImportAccountFromJSON imports private key from JSON blob with password,
// creates account and initiates JobAccountUpdateBalances job.