"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.connectContracts = void 0;
// Contract addresses
// eslint-disable-next-line @typescript-eslint/no-var-requires
const DEPLOYED_CONTRACTS = require('@graphprotocol/contracts/addresses.json');
// Contract factories
const Curation__factory_1 = require("@graphprotocol/contracts/dist/types/factories/Curation__factory");
const DisputeManager__factory_1 = require("@graphprotocol/contracts/dist/types/factories/DisputeManager__factory");
const EpochManager__factory_1 = require("@graphprotocol/contracts/dist/types/factories/EpochManager__factory");
const GNS__factory_1 = require("@graphprotocol/contracts/dist/types/factories/GNS__factory");
const RewardsManager__factory_1 = require("@graphprotocol/contracts/dist/types/factories/RewardsManager__factory");
const ServiceRegistry__factory_1 = require("@graphprotocol/contracts/dist/types/factories/ServiceRegistry__factory");
const Staking__factory_1 = require("@graphprotocol/contracts/dist/types/factories/Staking__factory");
const GraphToken__factory_1 = require("@graphprotocol/contracts/dist/types/factories/GraphToken__factory");
const Controller__factory_1 = require("@graphprotocol/contracts/dist/types/factories/Controller__factory");
exports.connectContracts = (providerOrSigner, chainId) => __awaiter(void 0, void 0, void 0, function* () {
    const deployedContracts = DEPLOYED_CONTRACTS[`${chainId}`];
    return {
        curation: Curation__factory_1.Curation__factory.connect(deployedContracts.Curation.address, providerOrSigner),
        disputeManager: DisputeManager__factory_1.DisputeManager__factory.connect(deployedContracts.DisputeManager.address, providerOrSigner),
        epochManager: EpochManager__factory_1.EpochManager__factory.connect(deployedContracts.EpochManager.address, providerOrSigner),
        gns: GNS__factory_1.GNS__factory.connect(deployedContracts.GNS.address, providerOrSigner),
        rewardsManager: RewardsManager__factory_1.RewardsManager__factory.connect(deployedContracts.RewardsManager.address, providerOrSigner),
        serviceRegistry: ServiceRegistry__factory_1.ServiceRegistry__factory.connect(deployedContracts.ServiceRegistry.address, providerOrSigner),
        staking: Staking__factory_1.Staking__factory.connect(deployedContracts.Staking.address, providerOrSigner),
        token: GraphToken__factory_1.GraphToken__factory.connect(deployedContracts.GraphToken.address, providerOrSigner),
        controller: Controller__factory_1.Controller__factory.connect(deployedContracts.Controller.address, providerOrSigner),
    };
});
//# sourceMappingURL=index.js.map