"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
var _a, _b;
Object.defineProperty(exports, "__esModule", { value: true });
exports.REVERSE_SEPOLIA_CUSTOM_ASSET_MAPPINGS = exports.SEPOLIA_CUSTOM_ASSET_MAPPINGS = exports.REVERSE_GOERLI_CUSTOM_ASSET_MAPPINGS = exports.GOERLI_CUSTOM_ASSET_MAPPINGS = exports.findCustomTokenAddresses = exports.flipAndLowerCase = exports.REVERSE_OPTIMISM_ASSET_MAPPINGS = exports.OPTIMISM_ASSET_MAPPINGS = exports.REVERSE_MAINNET_ASSET_MAPPINGS = exports.MAINNET_ASSET_MAPPINGS = exports.ZERO_ADDRESS = exports.MAX_UINT_AMOUNT = exports.deployments = void 0;
const aave_1 = __importDefault(require("./markets/aave"));
const optimism_1 = __importDefault(require("./markets/optimism"));
const deployed_contracts_json_1 = __importDefault(require("./deployed-contracts.json"));
exports.deployments = deployed_contracts_json_1.default;
exports.MAX_UINT_AMOUNT = "115792089237316195423570985008687907853269984665640564039457584007913129639935";
exports.ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
const formatNetworkMappings = (marketAssets) => {
    const assetToAddress = new Map;
    const addressToAsset = new Map;
    Object.keys(marketAssets).forEach((asset) => {
        assetToAddress.set(asset.toUpperCase(), marketAssets[asset]);
        addressToAsset.set(marketAssets[asset].toLowerCase(), asset);
    });
    return [assetToAddress, addressToAsset];
};
_a = formatNetworkMappings(aave_1.default.reverseAssets['main']), exports.MAINNET_ASSET_MAPPINGS = _a[0], exports.REVERSE_MAINNET_ASSET_MAPPINGS = _a[1];
_b = formatNetworkMappings(optimism_1.default.reserveAssets['optimism']), exports.OPTIMISM_ASSET_MAPPINGS = _b[0], exports.REVERSE_OPTIMISM_ASSET_MAPPINGS = _b[1];
exports.flipAndLowerCase = (data) => new Map(Array.from(data, (entry) => [entry[1].toLowerCase(), entry[0]]));
exports.findCustomTokenAddresses = (symbols, network) => {
    const addressesMap = new Map();
    symbols.forEach((symbol) => {
        if (!exports.deployments[symbol] || !exports.deployments[symbol][network])
            return;
        addressesMap.set(symbol, exports.deployments[symbol][network].address);
    });
    return addressesMap;
};
// NOTE: we deploy common tokens on testnets
// Symbol => Address mapping of custom deployed tokens
exports.GOERLI_CUSTOM_ASSET_MAPPINGS = exports.findCustomTokenAddresses([...exports.MAINNET_ASSET_MAPPINGS.keys()], "goerli");
exports.REVERSE_GOERLI_CUSTOM_ASSET_MAPPINGS = exports.flipAndLowerCase(exports.GOERLI_CUSTOM_ASSET_MAPPINGS);
exports.SEPOLIA_CUSTOM_ASSET_MAPPINGS = exports.findCustomTokenAddresses([...exports.MAINNET_ASSET_MAPPINGS.keys()], "sepolia");
exports.REVERSE_SEPOLIA_CUSTOM_ASSET_MAPPINGS = exports.flipAndLowerCase(exports.SEPOLIA_CUSTOM_ASSET_MAPPINGS);
//# sourceMappingURL=constants.js.map