{
  "version": 3,
  "sources": ["../../../src/apiCalls/configuration/getServerConfiguration.ts"],
  "sourcesContent": ["import axios from 'axios';\nimport { NetworkType } from 'types/network.types';\nimport { CONFIG_ENDPOINT } from '../endpoints';\n\nexport async function getServerConfiguration(apiAddress: string) {\n  const configUrl = `${apiAddress}/${CONFIG_ENDPOINT}`;\n\n  try {\n    const { data } = await axios.get<NetworkType>(configUrl);\n    if (data != null) {\n      // egldDenomination will be removed from API when dapp-core v1 will be discontinued\n      const egldDenomination = 'egldDenomination';\n      if (egldDenomination in data) {\n        const {\n          [egldDenomination]: decimals,\n          decimals: digits,\n          ...rest\n        } = data as NetworkType & {\n          [egldDenomination]: string;\n        };\n        const networkConfig: NetworkType = {\n          ...rest,\n          decimals,\n          digits\n        };\n        return networkConfig;\n      }\n      return data;\n    }\n  } catch (_err) {\n    console.error('error fetching configuration for ', configUrl);\n  }\n  return null;\n}\n"],
  "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAkB,oBAElBC,EAAgC,wBAEhC,eAAsBH,EAAuBI,EAAoB,CAC/D,MAAMC,EAAY,GAAGD,CAAU,IAAI,iBAAe,GAElD,GAAI,CACF,KAAM,CAAE,KAAAE,CAAK,EAAI,MAAM,EAAAC,QAAM,IAAiBF,CAAS,EACvD,GAAIC,GAAQ,KAAM,CAEhB,MAAME,EAAmB,mBACzB,GAAIA,KAAoBF,EAAM,CAC5B,KAAM,CACJ,CAACE,CAAgB,EAAGC,EACpB,SAAUC,EACV,GAAGC,CACL,EAAIL,EAQJ,MALmC,CACjC,GAAGK,EACH,SAAAF,EACA,OAAAC,CACF,CAEF,CACA,OAAOJ,CACT,CACF,MAAe,CACb,QAAQ,MAAM,oCAAqCD,CAAS,CAC9D,CACA,OAAO,IACT",
  "names": ["getServerConfiguration_exports", "__export", "getServerConfiguration", "__toCommonJS", "import_axios", "import_endpoints", "apiAddress", "configUrl", "data", "axios", "egldDenomination", "decimals", "digits", "rest"]
}
