import { RpcError } from './errors';
export class BaseTransport {
    async batch(requests) {
        const results = [];
        for (const req of requests) {
            try {
                results.push(await this.request(req.method, req.params));
            }
            catch (error) {
                results.push(null);
            }
        }
        return results;
    }
    close() { }
    normalizeError(error, method) {
        const message = error instanceof Error ? error.message : String(error);
        return new RpcError(`EVM JSON-RPC ${method} failed: ${message}`, error);
    }
}
