{
  "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": "yCAAA,OAAOA,MAAW,QAIlB,eAAsBC,EAAuBC,EAAoB,CAC/D,IAAMC,EAAY,GAAGD,CAAU,IAAIE,CAAe,GAElD,GAAI,CACF,GAAM,CAAE,KAAAC,CAAK,EAAI,MAAMC,EAAM,IAAiBH,CAAS,EACvD,GAAIE,GAAQ,KAAM,CAEhB,IAAME,EAAmB,mBACzB,GAAIA,KAAoBF,EAAM,CAC5B,GAAM,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,oCAAqCF,CAAS,CAC9D,CACA,OAAO,IACT",
  "names": ["axios", "getServerConfiguration", "apiAddress", "configUrl", "CONFIG_ENDPOINT", "data", "axios", "egldDenomination", "decimals", "digits", "rest"]
}
