"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 __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());
    });
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ArbitrumWombatExchangePoolTokenFetcher = void 0;
const bignumber_js_1 = __importDefault(require("bignumber.js"));
const position_template_decorator_1 = require("../../../app-toolkit/decorators/position-template.decorator");
const wombat_exchange_pool_token_fetcher_1 = require("../common/wombat-exchange.pool.token-fetcher");
let ArbitrumWombatExchangePoolTokenFetcher = class ArbitrumWombatExchangePoolTokenFetcher extends wombat_exchange_pool_token_fetcher_1.WombatExchangePoolTokenFetcher {
    constructor() {
        super(...arguments);
        this.groupLabel = 'Pools';
        this.poolAddresses = [
            '0xc6bc781e20f9323012f6e422bdf552ff06ba6cd1',
            '0xcf20fda54e37f3fb456930f02fb07fccf49e4849',
            '0x29eeb257a2a6ecde2984acedf80a1b687f18ec91',
            '0x917caf2b4d6040a9d67a5f8cefc4f89d1b214c1a',
            '0x90ecddec4e4116e30769a4e1ea52c319aca338b6',
            '0xee9b42b40852a53c7361f527e638b485d49750cd',
            '0x12fa5ab079cff564d599466d39715d35d90af978',
            '0x4a8686df475d4c44324210ffa3fc1dea705296e0',
        ];
    }
    getPricePerShare({ contract, multicall, appToken }) {
        return __awaiter(this, void 0, void 0, function* () {
            const poolAddress = yield contract.pool();
            const _pool = this.contractFactory.wombatExchangePool({ address: poolAddress, network: this.network });
            const pool = multicall.wrap(_pool);
            const amount = new bignumber_js_1.default(10).pow(18).toFixed(0);
            const pricePerShareRaw = yield pool.quotePotentialWithdraw(appToken.tokens[0].address, amount);
            const pricePerShare = Number(pricePerShareRaw.amount) / Math.pow(10, appToken.tokens[0].decimals);
            return [pricePerShare];
        });
    }
};
ArbitrumWombatExchangePoolTokenFetcher = __decorate([
    (0, position_template_decorator_1.PositionTemplate)()
], ArbitrumWombatExchangePoolTokenFetcher);
exports.ArbitrumWombatExchangePoolTokenFetcher = ArbitrumWombatExchangePoolTokenFetcher;
//# sourceMappingURL=wombat-exchange.pool.token-fetcher.js.map