httpClient = $httpClient; } public function resolveHandle(string $handle): string { try { $response = $this->httpClient->request( 'GET', 'xrpc/com.atproto.identity.resolveHandle', ['query' => ['handle' => $handle]] ); } catch (GuzzleException $e) { throw new AppViewException( sprintf('AppView resolveHandle request failed: %s', $e->getMessage()), 0, $e ); } $payload = json_decode((string) $response->getBody(), true); if (!is_array($payload) || !isset($payload['did']) || !is_string($payload['did'])) { throw new AppViewException('AppView resolveHandle response is missing a string `did`.'); } return $payload['did']; } }