feat(omnl): settlement terminal, compliance gates, and HYBX integration foundation
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m12s
CI/CD Pipeline / Security Scanning (push) Successful in 2m21s
CI/CD Pipeline / Lint and Format (push) Failing after 36s
CI/CD Pipeline / Terraform Validation (push) Failing after 22s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 25s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 23s
Validation / validate-genesis (push) Successful in 26s
Validation / validate-terraform (push) Failing after 21s
Validation / validate-kubernetes (push) Failing after 9s
Validation / validate-smart-contracts (push) Failing after 8s
Validation / validate-security (push) Failing after 1m15s
Validation / validate-documentation (push) Failing after 15s
OMNL reconcile anchor / Run omnl:reconcile and upload artifacts (push) Failing after 26s
Verify Deployment / Verify Deployment (push) Failing after 56s

Add operator settlement terminal UI/API, swift-listener service, compliance
idempotency gates, GRU reserve dashboards, and @dbis/integration-foundation
for typed HYBX/ISO adapter contracts.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
defiQUG
2026-06-07 21:51:32 -07:00
parent b6ddd236e2
commit d717b504a6
182 changed files with 10852 additions and 40 deletions

View File

@@ -21,7 +21,9 @@ import plannerV2Routes from './routes/planner-v2';
import omnlRoutes from './routes/omnl';
import omnlIpsasRoutes from './routes/omnl-ipsas';
import omnlComplianceRoutes from './routes/omnl-compliance-routes';
import omnlTerminalRoutes from './routes/omnl-terminal-routes';
import checkpointRoutes from './routes/checkpoint';
import reserveCapacityRoutes from './routes/reserve-capacity';
import { MultiChainIndexer } from '../indexer/chain-indexer';
import { OmnlEventPoller } from '../indexer/omnl-event-poller';
import { getDatabasePool } from '../database/client';
@@ -120,12 +122,25 @@ export class ApiServer {
} as const;
this.app.use('/static', express.static(publicPath, staticOpts));
this.app.use('/omnl/static', express.static(publicPath, staticOpts));
this.app.use('/reserve/static', express.static(publicPath, staticOpts));
}
}
private setupRoutes(): void {
// Health check
this.app.get('/health', async (req: Request, res: Response) => {
if (process.env.OMNL_SETTLEMENT_TERMINAL_ONLY === '1') {
res.json({
status: 'healthy',
mode: 'omnl-settlement-terminal-only',
timestamp: new Date().toISOString(),
services: {
database: 'skipped',
indexer: 'disabled',
},
});
return;
}
try {
// Check database connection
const pool = getDatabasePool();
@@ -150,6 +165,9 @@ export class ApiServer {
const dashboardPath = path.join(__dirname, '../../public/omnl-dashboard.html');
const complianceConsolePath = path.join(__dirname, '../../public/omnl-compliance-console.html');
const settlementTerminalPath = path.join(__dirname, '../../public/omnl-settlement-terminal.html');
const reserveDashboardPath = path.join(__dirname, '../../public/reserve-dashboard.html');
const reserveInstitutionalPath = path.join(__dirname, '../../public/reserve-institutional.html');
const authorizeOmnlHtml = (req: Request, res: Response): boolean => {
const tok = process.env.OMNL_DASHBOARD_TOKEN?.trim();
@@ -181,6 +199,34 @@ export class ApiServer {
res.type('html').send(readFileSync(dashboardPath, 'utf8'));
});
this.app.get('/omnl/terminal', (req: Request, res: Response) => {
if (!authorizeOmnlHtml(req, res)) return;
if (!existsSync(settlementTerminalPath)) {
res.status(404).type('text/plain').send('omnl-settlement-terminal.html missing');
return;
}
res.type('html').send(readFileSync(settlementTerminalPath, 'utf8'));
});
/** Public semi-public reserve capacity dashboard (no auth). */
this.app.get('/reserve', (_req: Request, res: Response) => {
if (!existsSync(reserveDashboardPath)) {
res.status(404).type('text/plain').send('reserve-dashboard.html missing');
return;
}
res.type('html').send(readFileSync(reserveDashboardPath, 'utf8'));
});
/** Institutional wrapper (same API; used by reserve.d-bis.org NPM upstream). */
this.app.get('/reserve/institutional', (_req: Request, res: Response) => {
const file = existsSync(reserveInstitutionalPath) ? reserveInstitutionalPath : reserveDashboardPath;
if (!existsSync(file)) {
res.status(404).type('text/plain').send('reserve dashboard missing');
return;
}
res.type('html').send(readFileSync(file, 'utf8'));
});
// Public API catalog (register before routers so GET /api/v1 is not swallowed by middleware-only mounts)
const sendApiV1Catalog = (_req: Request, res: Response) => {
res.json({
@@ -209,6 +255,9 @@ export class ApiServer {
plannerRoutesPlan: '/api/v2/routes/plan',
plannerIntentsPlan: '/api/v2/intents/plan',
plannerInternalExecutionPlan: '/api/v2/routes/internal-execution-plan',
reserveCapacity: '/api/v1/reserve/capacity',
reserveProofIndex: '/api/v1/reserve/proof-index',
reserveDashboard: '/reserve',
},
});
};
@@ -228,7 +277,9 @@ export class ApiServer {
this.app.use('/api/v1', aggregatorRouteMatrixRoutes);
this.app.use('/api/v1', partnerPayloadRoutes);
this.app.use('/api/v1', checkpointRoutes);
this.app.use('/api/v1', reserveCapacityRoutes);
this.app.use('/api/v1', omnlComplianceRoutes);
this.app.use('/api/v1', omnlTerminalRoutes);
this.app.use('/api/v1', omnlRoutes);
this.app.use('/api/v1', omnlIpsasRoutes);
this.app.use('/api/v2', plannerV2Routes);
@@ -248,6 +299,7 @@ export class ApiServer {
omnlOpenApi: '/api/v1/omnl/openapi.json',
omnlCatalog: '/api/v1/omnl/catalog',
omnlDashboard: '/omnl/dashboard',
reserveDashboard: '/reserve',
},
});
});