"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); }
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.EthereumRariFuseSupplyTokenFetcher = 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 rari_fuse_supply_token_fetcher_1 = require("../common/rari-fuse.supply.token-fetcher");
const contracts_1 = require("../contracts");
let EthereumRariFuseSupplyTokenFetcher = class EthereumRariFuseSupplyTokenFetcher extends rari_fuse_supply_token_fetcher_1.RariFuseSupplyTokenFetcher {
    constructor(appToolkit, contractFactory) {
        super(appToolkit);
        this.appToolkit = appToolkit;
        this.contractFactory = contractFactory;
        this.groupLabel = 'Lending';
        this.poolDirectoryAddress = '0x835482fe0532f169024d5e9410199369aad5c77e';
        this.lensAddress = '0x8da38681826f4abbe089643d2b3fe4c6e4730493';
    }
    getPoolDirectoryContract(address) {
        return this.contractFactory.rariFusePoolsDirectory({ address, network: this.network });
    }
    getComptrollerContract(address) {
        return this.contractFactory.rariFuseComptroller({ address, network: this.network });
    }
    getTokenContract(address) {
        return this.contractFactory.rariFuseToken({ address, network: this.network });
    }
    getLensContract(address) {
        return this.contractFactory.rariFusePoolLens({ address, network: this.network });
    }
    getPools(contract) {
        return contract.getAllPools();
    }
    getMarketTokenAddresses(contract) {
        return contract.getAllMarkets();
    }
    getUnderlyingTokenAddress(contract) {
        return contract.underlying();
    }
    getExchangeRateCurrent(contract) {
        return contract.exchangeRateCurrent();
    }
    getSupplyRateRaw(contract) {
        return contract.supplyRatePerBlock();
    }
    getPoolsBySupplier(address, contract) {
        return contract.getPoolsBySupplier(address);
    }
};
EthereumRariFuseSupplyTokenFetcher = __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.RariFuseContractFactory)),
    __metadata("design:paramtypes", [Object, contracts_1.RariFuseContractFactory])
], EthereumRariFuseSupplyTokenFetcher);
exports.EthereumRariFuseSupplyTokenFetcher = EthereumRariFuseSupplyTokenFetcher;
//# sourceMappingURL=rari-fuse.supply.token-fetcher.js.map