"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AdapterFactory = void 0;
const alchemy_1 = require("./alchemy");
const moralis_1 = require("./moralis");
class AdapterFactory {
    static createAdapter(providerConfig) {
        const AdapterClass = this.registry[providerConfig.name.toLowerCase()];
        if (!AdapterClass) {
            throw new Error(`Unknown indexed API provider: "${providerConfig.name}". ` +
                `Available: ${Object.keys(this.registry).join(', ')}`);
        }
        return new AdapterClass(providerConfig);
    }
    static registerAdapter(name, adapterClass) {
        this.registry[name.toLowerCase()] = adapterClass;
    }
    static getSupportedProviders() {
        return Object.keys(this.registry);
    }
}
exports.AdapterFactory = AdapterFactory;
AdapterFactory.registry = {
    alchemy: alchemy_1.AlchemyAdapter,
    moralis: moralis_1.MoralisAdapter
};
//# sourceMappingURL=factory.js.map