"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BaseTransport = void 0;
const errors_1 = require("./errors");
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 errors_1.RpcError(`EVM JSON-RPC ${method} failed: ${message}`, error);
    }
}
exports.BaseTransport = BaseTransport;
