"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.VotingEscrowTemplateContractPositionFetcher = void 0;
const image_present_1 = require("../../app-toolkit/helpers/presentation/image.present");
const position_interface_1 = require("../../position/position.interface");
const position_utils_1 = require("../../position/position.utils");
const contract_position_template_position_fetcher_1 = require("../../position/template/contract-position.template.position-fetcher");
class VotingEscrowTemplateContractPositionFetcher extends contract_position_template_position_fetcher_1.ContractPositionTemplatePositionFetcher {
    getContract(address) {
        return this.getEscrowContract(address);
    }
    getDefinitions() {
        return __awaiter(this, void 0, void 0, function* () {
            return [{ address: this.veTokenAddress }];
        });
    }
    getTokenDefinitions(params) {
        return __awaiter(this, void 0, void 0, function* () {
            return [
                { metaType: position_interface_1.MetaType.SUPPLIED, address: yield this.getEscrowedTokenAddress(params), network: this.network },
            ];
        });
    }
    getLabel({ contractPosition }) {
        return __awaiter(this, void 0, void 0, function* () {
            const suppliedToken = contractPosition.tokens.find(position_utils_1.isSupplied);
            return `Voting Escrow ${(0, image_present_1.getLabelFromToken)(suppliedToken)}`;
        });
    }
    getTokenBalancesPerPosition(params) {
        return __awaiter(this, void 0, void 0, function* () {
            return [yield this.getEscrowedTokenBalance(params)];
        });
    }
}
exports.VotingEscrowTemplateContractPositionFetcher = VotingEscrowTemplateContractPositionFetcher;
//# sourceMappingURL=voting-escrow.template.contract-position-fetcher.js.map