"use strict";
/**
 * @file Sumer
 * @desc This file defines the constructor of the `Sumer` class.
 * @hidden
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
const ethers_1 = require("ethers");
const eth = __importStar(require("./eth"));
const util = __importStar(require("./util"));
const comptroller = __importStar(require("./comptroller"));
const cToken = __importStar(require("./cToken"));
const errorABIs_1 = require("./errorABIs");
const abi_1 = require("./abi");
const constants_1 = require("./constants");
class Sumer {
    constructor(provider, options) {
        this._provider = provider;
        this._network = { id: options.networkId, name: options.networkName };
        this.supply = cToken.supply.bind(this);
        this.supplyWithPermit = cToken.supplyWithPermit.bind(this);
        this.redeem = cToken.redeem.bind(this);
        this.borrow = cToken.borrow.bind(this);
        this.repayBorrow = cToken.repayBorrow.bind(this);
        this.repayBorrowWithPermit = cToken.repayBorrowWithPermit.bind(this);
        this.liquidateBorrow = cToken.liquidateBorrow.bind(this);
        this.calcBorrowAmountForProtectedMint = cToken.calcBorrowAmountForProtectedMint.bind(this);
        this.protectedMint = cToken.protectedMint.bind(this);
        this.enterMarkets = comptroller.enterMarkets.bind(this);
        this.exitMarket = comptroller.exitMarket.bind(this);
        this.redeemFaceValue = comptroller.redeemFaceValue.bind(this);
        this.redeemFaceValueWithPermit = comptroller.redeemFaceValueWithPermit.bind(this);
        this.redeemFaceValuePreview = comptroller.redeemFaceValuePreview.bind(this);
        this.calcPlan = comptroller.calcPlan.bind(this);
    }
    getTokenPairBySymbol(symbol) {
        return (0, constants_1.getTokenPairBySymbol)(this._network.name, symbol);
    }
    getTokenPairByAddress(tokenAddress) {
        return (0, constants_1.getTokenPairByAddress)(this._network.name, tokenAddress);
    }
    getTokenPairsByGroupId(assetGroupId) {
        return (0, constants_1.getTokenPairsByGroupId)(this._network.name, assetGroupId);
    }
}
Sumer.eth = eth;
Sumer.util = util;
Sumer._ethers = ethers_1.ethers;
Sumer.abi = abi_1.abi;
Sumer.errorABIs = errorABIs_1.errorABIs;
Sumer.constants = constants_1.constants;
Sumer.getDecimals = constants_1.getDecimals;
Sumer.getAddress = constants_1.getAddress;
Sumer.getName = constants_1.getName;
Sumer.getTokenPairs = constants_1.getTokenPairs;
Sumer.getNetworkBlocksPerYear = constants_1.getNetworkBlocksPerYear;
Sumer.getRateModals = constants_1.getRateModals;
Sumer.getTokenPairByAddress = constants_1.getTokenPairByAddress;
Sumer.getTokenPairBySymbol = constants_1.getTokenPairBySymbol;
Sumer.getTokenPairsByGroupId = constants_1.getTokenPairsByGroupId;
Sumer.isUnderlyAllowed = constants_1.isUnderlyAllowed;
Sumer.isCTokenAllowed = constants_1.isCTokenAllowed;
Sumer.isEther = constants_1.isEther;
module.exports = Sumer;
//# sourceMappingURL=index.js.map