UNPKG

@cryptoalgebra/alm-sdk

Version:

Algebra ALM SDK

26 lines 1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getChainsForDex = exports.getSupportedDexes = void 0; // eslint-disable-next-line import/no-cycle var addresses_1 = require("../config/addresses"); function getSupportedDexes(chainId) { var chainConfig = addresses_1.addressConfig[chainId]; if (!chainConfig) { throw new Error("Unsupported chainId: ".concat(chainId)); } return Object.keys(chainConfig); } exports.getSupportedDexes = getSupportedDexes; function getChainsForDex(dex) { var chainsWithDex = []; Object.keys(addresses_1.addressConfig).forEach(function (chainId) { var chainConfig = addresses_1.addressConfig[Number(chainId)]; // Check if the DEX exists in the current chain configuration if (chainConfig && dex in chainConfig) { chainsWithDex.push(Number(chainId)); } }); return chainsWithDex; } exports.getChainsForDex = getChainsForDex; //# sourceMappingURL=chains.js.map