import { prismaClient } from '../database/prismaClient.js';
import { isChainType } from '../utils/typeChecks.js';
export async function createConnection(address, chainType) {
    const parsedChainType = chainType.toLowerCase();
    if (!isChainType(parsedChainType)) {
        throw new Error(`Invalid chain type: ${chainType}`);
    }
    return await prismaClient.connection.create({
        data: {
            address,
            chain: parsedChainType,
        },
    });
}
