sendRequest(new RpcRequest('createSession', Utilities::randomCrc32(), [ 'public_key' => $keyPair->getPublicKey() ])); if($response === null) { throw new RpcException('Failed to create the session, no response received'); } if($response instanceof RpcError) { throw RpcException::fromRpcError($response); } $this->setSessionUuid($response->getResult()); $this->setPrivateKey($keyPair->getPrivateKey()); return $response->getResult(); } }