"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.EthereumMstableEarnContractPositionFetcher = 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 EARN_FARMS = [
    {
        address: '0x9b4aba35b35eee7481775ccb4055ce4e176c9a6f',
        stakedTokenAddress: '0x0d0d65e7a7db277d3e0f5e1676325e75f3340455',
        rewardTokenAddresses: ['0xa3bed4e1c75d00fa6f4e5e6922db7261b5e9acd2'],
    },
    {
        address: '0x0d4cd2c24a4c9cd31fcf0d3c4682d234d9f94be4',
        stakedTokenAddress: '0x4019ba88158daa468a063ac48171a3bfe8cd9f3b',
        rewardTokenAddresses: ['0xa3bed4e1c75d00fa6f4e5e6922db7261b5e9acd2'],
    },
    {
        address: '0x25970282aac735cd4c76f30bfb0bf2bc8dad4e70',
        stakedTokenAddress: '0x003a70265a3662342010823bea15dc84c6f7ed54',
        rewardTokenAddresses: ['0xa3bed4e1c75d00fa6f4e5e6922db7261b5e9acd2'],
    },
    {
        address: '0x881c72d1e6317f10a1cdcbe05040e7564e790c80',
        stakedTokenAddress: '0x72cd8f4504941bf8c5a21d1fd83a96499fd71d2c',
        rewardTokenAddresses: ['0xa3bed4e1c75d00fa6f4e5e6922db7261b5e9acd2'],
    },
    {
        address: '0xf4a7d2d85f4ba11b5c73c35e27044c0c49f7f027',
        stakedTokenAddress: '0xa5da8cc7167070b62fdcb332ef097a55a68d8824',
        rewardTokenAddresses: ['0xa3bed4e1c75d00fa6f4e5e6922db7261b5e9acd2'],
    },
    {
        address: '0xf7575d4d4db78f6ba43c734616c51e9fd4baa7fb',
        stakedTokenAddress: '0xe036cce08cf4e23d33bc6b18e53caf532afa8513',
        rewardTokenAddresses: ['0xa3bed4e1c75d00fa6f4e5e6922db7261b5e9acd2'],
    },
    {
        address: '0xe6e6e25efda5f69687aa9914f8d750c523a1d261',
        stakedTokenAddress: '0x1aef73d49dedc4b1778d0706583995958dc862e6',
        rewardTokenAddresses: ['0xa3bed4e1c75d00fa6f4e5e6922db7261b5e9acd2'],
    },
];
let EthereumMstableEarnContractPositionFetcher = class EthereumMstableEarnContractPositionFetcher extends single_staking_template_contract_position_fetcher_1.SingleStakingFarmTemplateContractPositionFetcher {
    constructor(appToolkit, contractFactory) {
        super(appToolkit);
        this.appToolkit = appToolkit;
        this.contractFactory = contractFactory;
        this.groupLabel = 'Earn';
    }
    getContract(address) {
        return this.contractFactory.mstableStaking({ address, network: this.network });
    }
    getFarmDefinitions() {
        return __awaiter(this, void 0, void 0, function* () {
            return EARN_FARMS;
        });
    }
    getRewardRates({ contract }) {
        return contract.rewardRate();
    }
    getStakedTokenBalance({ address, contract }) {
        return contract.balanceOf(address);
    }
    getRewardTokenBalances({ address, contract }) {
        return contract.earned(address);
    }
};
EthereumMstableEarnContractPositionFetcher = __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.MstableContractFactory)),
    __metadata("design:paramtypes", [Object, contracts_1.MstableContractFactory])
], EthereumMstableEarnContractPositionFetcher);
exports.EthereumMstableEarnContractPositionFetcher = EthereumMstableEarnContractPositionFetcher;
//# sourceMappingURL=mstable.earn.contract-position-fetcher.js.map