"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDeployments = void 0;
const helpers_1 = require("../../helpers");
const getDeployments = (args) => {
    const { chainInfo, isHub, useStaging, deployer: _deployer } = args;
    const chain = chainInfo.chain;
    let deployer;
    if (chainInfo.zksync) {
        deployer = _deployer.connect(chainInfo.rpc);
    }
    else {
        deployer = _deployer.connect(chainInfo.rpc);
    }
    // Get all the Hub connectors, if applicable.
    const connectors = isHub
        ? (0, helpers_1.getHubConnectors)(+chain, useStaging ? "staging" : "production", deployer)
        : [(0, helpers_1.getSpokeConnector)(+chain, useStaging ? "staging" : "production", deployer)];
    return {
        Connext: (0, helpers_1.getContract)("Connext_DiamondProxy", chain, useStaging, deployer),
        messaging: isHub
            ? {
                RootManager: (0, helpers_1.getContract)("RootManager", chain, useStaging, deployer),
                MainnetConnector: (0, helpers_1.getContract)("MainnetSpokeConnector", chain, useStaging, deployer),
                WatcherManager: (0, helpers_1.getContract)("WatcherManager", chain, useStaging, deployer),
                HubConnectors: connectors,
                MerkleTreeManagerForRoot: (0, helpers_1.getContract)("MerkleTreeManagerRootUpgradeBeaconProxy", chain, useStaging, deployer),
                MerkleTreeManagerForSpoke: (0, helpers_1.getContract)("MerkleTreeManagerSpokeUpgradeBeaconProxy", chain, useStaging, deployer),
                RelayerProxy: (0, helpers_1.getContract)("RelayerProxyHub", chain, useStaging, deployer),
            }
            : {
                SpokeConnector: connectors[0],
                MerkleTreeManager: (0, helpers_1.getContract)("MerkleTreeManagerUpgradeBeaconProxy", chain, useStaging, deployer),
                WatcherManager: (0, helpers_1.getContract)("WatcherManager", chain, useStaging, deployer),
                RelayerProxy: (0, helpers_1.getContract)("RelayerProxy", chain, useStaging, deployer),
            },
    };
};
exports.getDeployments = getDeployments;
//# sourceMappingURL=deployments.js.map