chore: update DBIS contracts and integrate EIP-712 helper

- Updated DBIS_ConversionRouter and DBIS_SettlementRouter to utilize IDBIS_EIP712Helper for EIP-712 hashing and signature recovery, improving stack depth management.
- Refactored minting logic in DBIS_GRU_MintController to streamline recipient processing.
- Enhanced BUILD_NOTES.md with updated build instructions and test coverage details.
- Added new functions in DBIS_SignerRegistry for duplicate signer checks and active signer validation.
- Introduced a new submodule, DBIS_EIP712Helper, to encapsulate EIP-712 related functionalities.

Made-with: Cursor
This commit is contained in:
defiQUG
2026-03-04 02:00:09 -08:00
parent 51b9b7458b
commit 1511f33857
50 changed files with 1315 additions and 272 deletions

View File

@@ -1,5 +1,6 @@
import { Pool, PoolConfig } from 'pg';
import * as dotenv from 'dotenv';
import { logger } from '../utils/logger';
dotenv.config();
@@ -39,7 +40,7 @@ export function getDatabasePool(): Pool {
pool = new Pool(config);
pool.on('error', (err) => {
console.error('Unexpected error on idle database client', err);
logger.error('Unexpected error on idle database client', err);
});
return pool;

View File

@@ -27,7 +27,7 @@ export interface ApiEndpoint {
isActive: boolean;
requiresAuth: boolean;
authType?: 'jwt' | 'api_key' | 'basic' | 'none';
authConfig?: any;
authConfig?: Record<string, unknown>;
rateLimitPerMinute?: number;
timeoutMs: number;
healthCheckEnabled: boolean;
@@ -98,7 +98,7 @@ export class AdminRepository {
async getApiKeys(provider?: string): Promise<ApiKey[]> {
let query = `SELECT * FROM api_keys WHERE is_active = true`;
const params: any[] = [];
const params: (string | number)[] = [];
if (provider) {
query += ` AND provider = $1`;
@@ -119,7 +119,7 @@ export class AdminRepository {
async updateApiKey(id: number, updates: Partial<ApiKey>): Promise<void> {
const fields: string[] = [];
const values: any[] = [];
const values: (string | number | boolean | Date | null)[] = [];
let paramCount = 1;
if (updates.isActive !== undefined) {
@@ -180,7 +180,7 @@ export class AdminRepository {
async getEndpoints(chainId?: number, endpointType?: string): Promise<ApiEndpoint[]> {
let query = `SELECT * FROM api_endpoints WHERE is_active = true`;
const params: any[] = [];
const params: (string | number)[] = [];
let paramCount = 1;
if (chainId) {
@@ -200,7 +200,7 @@ export class AdminRepository {
async updateEndpoint(id: number, updates: Partial<ApiEndpoint>): Promise<void> {
const fields: string[] = [];
const values: any[] = [];
const values: (string | number | boolean | Date | null)[] = [];
let paramCount = 1;
if (updates.endpointUrl !== undefined) {
@@ -256,7 +256,7 @@ export class AdminRepository {
async getDexFactories(chainId?: number): Promise<DexFactoryConfig[]> {
let query = `SELECT * FROM dex_factory_config WHERE is_active = true`;
const params: any[] = [];
const params: (string | number)[] = [];
if (chainId) {
query += ` AND chain_id = $1`;
@@ -301,8 +301,8 @@ export class AdminRepository {
action: string,
resourceType: string,
resourceId: number | null,
oldValues: any,
newValues: any,
oldValues: Record<string, unknown> | null,
newValues: Record<string, unknown> | null,
ipAddress?: string,
userAgent?: string
): Promise<void> {
@@ -325,7 +325,8 @@ export class AdminRepository {
);
}
// Mappers
// Mappers (row from pg has dynamic keys; use type assertion for type safety)
/* eslint-disable @typescript-eslint/no-explicit-any */
private mapApiKey(row: any): ApiKey {
return {
id: row.id,

View File

@@ -183,6 +183,7 @@ export class PoolRepository {
}));
}
/* eslint-disable @typescript-eslint/no-explicit-any */
private mapRowToPool(row: any): LiquidityPool {
return {
id: row.id,