"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const __1 = require("..");
const routes_1 = require("../../providers/chain-state/evm/api/routes");
const EVMVerificationPeer_1 = require("../../providers/chain-state/evm/p2p/EVMVerificationPeer");
const p2p_1 = require("../moralis/p2p/p2p");
const csp_1 = require("./api/csp");
class MultiProviderModule extends __1.BaseModule {
    constructor(services, chain, network, _config) {
        super(services);
        // Reuse MoralisP2PWorker for now (handles webhook sync).
        // When Alchemy webhooks are added, this can be replaced with a
        // multi-provider P2P worker.
        services.P2P.register(chain, network, p2p_1.MoralisP2PWorker);
        const csp = new csp_1.MultiProviderEVMStateProvider(chain);
        services.CSP.registerService(chain, network, csp);
        services.Api.app.use(new routes_1.EVMRouter(csp, chain).getRouter());
        services.Verification.register(chain, network, EVMVerificationPeer_1.EVMVerificationPeer);
    }
}
exports.default = MultiProviderModule;
//# sourceMappingURL=index.js.map