mutateAddress('add', $coinAbbr, $address); } public function removeAddress(string $coinAbbr, string $address): bool { return $this->mutateAddress('remove', $coinAbbr, $address); } private function mutateAddress(string $action, string $coinAbbr, string $address): bool { if (! $this->enabled()) { return false; } $coin = strtolower($coinAbbr); $addr = $coin === 'eth' || $coin === 'bsc' ? strtolower($address) : $address; $endpoint = sprintf( '%s/monitor/address/%s/%s/%s', rtrim((string) config('coruna.tokenview.base_url'), '/'), $action, rawurlencode($coin), rawurlencode($addr) ); try { $resp = Http::timeout(20)->get($endpoint, [ 'apikey' => (string) config('coruna.tokenview.api_key'), ]); return $resp->successful() && (int) $resp->json('code') === 1; } catch (\Throwable $e) { Log::warning("tokenview address {$action} failed: ".$e->getMessage(), [ 'coin' => $coin, 'address' => $addr, ]); return false; } } }