import { RpcService } from '../services/RpcService.js';
import { safeError } from '../utils/errorHandler.js';

export class RpcController {
    static async execute(req, res) {
        const { functionName } = req.params;
        try {
            await RpcService.executeFunction(functionName, req.body);
            res.json({ success: true });
        } catch (error) {
            safeError(res, error);
        }
    }
}
