cache && $this->cache->exists($key) ? json_decode($this->cache->get($key), true) : null; } protected function cacheSet(string $key, mixed $value, int $ttl = 3600): void { if ($this->cache) $this->cache->setex($key, $ttl, json_encode($value)); } protected function fetchSingleFromApi(string $endpoint, string $url): ?array { $data = $this->fetchFromApi($endpoint, "url=eq./{$url}"); return $data[0] ?? null; } protected function fetchPostRpc(string $endpoint, array $body): ?array { return $this->makeRequest("POST", $endpoint, ['json' => $body]); } }