lthn.io/app/Website/Lethean/Controllers/HomeController.php
Claude 0899881138
feat(lthn.io): name registration API, Blade views, wallet RPC
- POST /v1/names/register endpoint with wallet RPC integration
- WalletRpc service for alias registration via daemon wallet
- Blade views for homepage, explorer, names directory, network status
- Explorer and Names modules with view namespaces and web controllers
- Pool endpoint graceful offline handling
- Explorer block detail, aliases, search views

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 23:04:27 +01:00

51 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
namespace Website\Lethean\Controllers;
use Illuminate\Routing\Controller;
use Mod\Chain\Services\DaemonRpc;
/**
* lthn.io homepage.
*
* GET / — TLD landing with live chain stats
*/
class HomeController extends Controller
{
public function __construct(
private readonly DaemonRpc $rpc,
) {}
public function index(): \Illuminate\View\View
{
$info = $this->rpc->getInfo();
$aliases = $this->rpc->getAllAliases();
return view('lethean::home', [
'height' => number_format($info['height'] ?? 0),
'aliases' => count($aliases['aliases'] ?? []),
'transactions' => number_format($info['tx_count'] ?? 0),
'difficulty' => [
'pow' => number_format($info['pow_difficulty'] ?? 0),
'pos' => $info['pos_difficulty'] ?? '0',
],
]);
}
public function about(): \Illuminate\View\View
{
return view('lethean::about');
}
public function network(): \Illuminate\View\View
{
$info = $this->rpc->getInfo();
return view('lethean::network', [
'info' => $info,
]);
}
}