pubkey = $pubkey; $this->npub = $keys->convertPublicKeyToBech32($pubkey); try { $this->user = $this->redisCache->get('user_' . $this->npub, function () { try { $meta = $this->nostrClient->getNpubMetadata($this->npub); return (array) json_decode($meta->content); } catch (InvalidArgumentException|\Exception) { return null; } }); } catch (InvalidArgumentException $e) { $this->user = null; } } }