Modules built: - Home: landing page with live chain stats and service directory - Chain: DaemonRpc singleton, config, events - Explorer: web + API controllers (block, tx, alias, search, stats) - Names: TLD registrar (availability, lookup, directory, registration) - Trade: DEX controllers + API (config, pairs, orders) - Pool: dashboard + PoolClient service (stats, blocks, payments, miner) Infrastructure: - composer.json: lthn/lthn.io deps (core/php + laravel 12) - Dockerfile: FrankenPHP with Caddy - Caddyfile: PHP server config Co-Authored-By: Charon <charon@lethean.io>
41 lines
1 KiB
PHP
41 lines
1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Mod\Trade;
|
|
|
|
use Core\Front\Events\ApiRoutesRegistering;
|
|
use Core\Front\Events\WebRoutesRegistering;
|
|
use Illuminate\Support\Facades\Event;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
/**
|
|
* Decentralised exchange module.
|
|
*
|
|
* Provides DEX trading, token swaps, and P2P marketplace.
|
|
* Replaces zano_trade_backend + zano_trade_frontend.
|
|
*/
|
|
class Boot
|
|
{
|
|
public function __invoke(): void
|
|
{
|
|
app('config')->set('trade', require __DIR__ . '/config.php');
|
|
$this->registerListeners();
|
|
}
|
|
|
|
protected function registerListeners(): void
|
|
{
|
|
Event::listen(WebRoutesRegistering::class, [$this, 'onWebRoutesRegistering']);
|
|
Event::listen(ApiRoutesRegistering::class, [$this, 'onApiRoutesRegistering']);
|
|
}
|
|
|
|
public function onWebRoutesRegistering(): void
|
|
{
|
|
Route::prefix('trade')->group(__DIR__ . '/Routes/web.php');
|
|
}
|
|
|
|
public function onApiRoutesRegistering(): void
|
|
{
|
|
Route::prefix('v1/trade')->group(__DIR__ . '/Routes/api.php');
|
|
}
|
|
}
|