"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
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.EthereumSynthetixFarmContractPositionFetcher = void 0;
const common_1 = require("@nestjs/common");
const app_toolkit_interface_1 = require("../../../app-toolkit/app-toolkit.interface");
const position_template_decorator_1 = require("../../../app-toolkit/decorators/position-template.decorator");
const single_staking_template_contract_position_fetcher_1 = require("../../../position/template/single-staking.template.contract-position-fetcher");
const contracts_1 = require("../contracts");
const FARMS = [
    {
        address: '0x167009dcda2e49930a71712d956f02cc980dcc1b',
        stakedTokenAddress: '0xd6014ea05bde904448b743833ddf07c3c7837481',
        rewardTokenAddresses: ['0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f'],
    },
    {
        address: '0x6d4f135af7dfcd4bdf6dcb9d7911f5d243872a52',
        stakedTokenAddress: '0xa9859874e1743a32409f75bb11549892138bba1e',
        rewardTokenAddresses: ['0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f'],
    },
    {
        address: '0x3f27c540adae3a9e8c875c61e3b970b559d7f65d',
        stakedTokenAddress: '0xa9859874e1743a32409f75bb11549892138bba1e',
        rewardTokenAddresses: ['0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f'],
    },
    {
        address: '0xc0d8994cd78ee1980885df1a0c5470fc977b5cfe',
        stakedTokenAddress: '0x194ebd173f6cdace046c53eacce9b953f28411d1',
        rewardTokenAddresses: ['0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f'],
    },
    {
        address: '0x13c1542a468319688b89e323fe9a3be3a90ebb27',
        stakedTokenAddress: '0xb94865e18b25114b2b10bd9ecbd689c877f949e8',
        rewardTokenAddresses: ['0x075b1bb99792c9e1041ba13afef80c91a1e70fb3'],
    },
    {
        address: '0x13c1542a468319688b89e323fe9a3be3a90ebb27',
        stakedTokenAddress: '0xb94865e18b25114b2b10bd9ecbd689c877f949e8',
        rewardTokenAddresses: ['0x075b1bb99792c9e1041ba13afef80c91a1e70fb3'],
    },
    {
        address: '0x7af65f1740c0eb816a27fd808eaf6ab09f6fa646',
        stakedTokenAddress: '0xb94865e18b25114b2b10bd9ecbd689c877f949e8',
        rewardTokenAddresses: ['0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f'],
    },
    {
        address: '0xdc338c7544654c7dadfeb7e44076e457963113b0',
        stakedTokenAddress: '0x74821343b5b969c0d4b31aff3931e00a40990cfd',
        rewardTokenAddresses: ['0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f'],
    },
    {
        address: '0x1c1d97f6338759ab814a5a717ae359573ab5d5d4',
        stakedTokenAddress: '0x2e27d4160b257708375a7bf23381110d2328bc1b',
        rewardTokenAddresses: ['0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f'],
    },
    {
        address: '0x26fa0665660c1d3a3666584669511d3c66ad37cb',
        stakedTokenAddress: '0x3f2d077acff8a66c4e0c79c37b6a662a7197889b',
        rewardTokenAddresses: ['0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f'],
    },
    {
        address: '0x6fb7f0e78582746bd01bcb6dfbfe62ca5f4f9175',
        stakedTokenAddress: '0x608410f602ce8967d1e59f599566aed340280efc',
        rewardTokenAddresses: ['0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f'],
    },
    {
        address: '0x9d003cc298e7ea141a809c241c0a703176da3ba3',
        stakedTokenAddress: '0x41c91eb43b7f0afd332725461b86a0e39e143789',
        rewardTokenAddresses: ['0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f'],
    },
    {
        address: '0x8ef8ca2acaaafec19fb366c11561718357f780f2',
        stakedTokenAddress: '0x6418c69b0de51873a1cc01cf73ba6e408acc1940',
        rewardTokenAddresses: ['0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f'],
    },
    {
        address: '0xf0de877f2f9e7a60767f9ba662f10751566ad01c',
        stakedTokenAddress: '0x055db9aff4311788264798356bbf3a733ae181c6',
        rewardTokenAddresses: ['0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f'],
    },
];
let EthereumSynthetixFarmContractPositionFetcher = class EthereumSynthetixFarmContractPositionFetcher extends single_staking_template_contract_position_fetcher_1.SingleStakingFarmTemplateContractPositionFetcher {
    constructor(appToolkit, contractFactory) {
        super(appToolkit);
        this.appToolkit = appToolkit;
        this.contractFactory = contractFactory;
        this.groupLabel = 'Farms';
    }
    getContract(address) {
        return this.contractFactory.synthetixRewards({ address, network: this.network });
    }
    getFarmDefinitions() {
        return __awaiter(this, void 0, void 0, function* () {
            return FARMS;
        });
    }
    getRewardRates({ contract }) {
        return __awaiter(this, void 0, void 0, function* () {
            return contract.rewardRate();
        });
    }
    getStakedTokenBalance({ address, contract }) {
        return __awaiter(this, void 0, void 0, function* () {
            return contract.balanceOf(address);
        });
    }
    getRewardTokenBalances({ address, contract }) {
        return __awaiter(this, void 0, void 0, function* () {
            return contract.earned(address);
        });
    }
};
EthereumSynthetixFarmContractPositionFetcher = __decorate([
    (0, position_template_decorator_1.PositionTemplate)(),
    __param(0, (0, common_1.Inject)(app_toolkit_interface_1.APP_TOOLKIT)),
    __param(1, (0, common_1.Inject)(contracts_1.SynthetixContractFactory)),
    __metadata("design:paramtypes", [Object, contracts_1.SynthetixContractFactory])
], EthereumSynthetixFarmContractPositionFetcher);
exports.EthereumSynthetixFarmContractPositionFetcher = EthereumSynthetixFarmContractPositionFetcher;
//# sourceMappingURL=synthetix.farm.contract-position-fetcher.js.map