{
  "version": 3,
  "sources": ["../../../src/apiCalls/configuration/getGasStationMetadata.ts"],
  "sourcesContent": ["import axios from 'axios';\nimport { getCleanApiAddress } from 'apiCalls/configuration/getCleanApiAddress';\nimport { GAS_STATION_ENDPOINT } from 'apiCalls/endpoints';\nimport { NetworkType } from 'types/network.types';\n\ninterface IGasStationApiResponse {\n  lastBlock: number;\n  fast: number;\n  faster: number;\n}\n\nexport async function getGasStationMetadataFromApi(\n  shard: number,\n  customApiAddress?: string\n): Promise<NetworkType['gasStationMetadata'] | null> {\n  const apiAddress = getCleanApiAddress(customApiAddress);\n  const gasStationUrl = `${apiAddress}/${GAS_STATION_ENDPOINT}/${shard}`;\n\n  try {\n    const { data } = await axios.get<IGasStationApiResponse>(gasStationUrl);\n\n    if (data) {\n      return {\n        [shard]: {\n          lastBlock: data.lastBlock,\n          fast: data.fast,\n          faster: data.faster\n        }\n      };\n    }\n    return null;\n  } catch (err) {\n    console.error(\n      'Error fetching gas station metadata from:',\n      gasStationUrl,\n      err\n    );\n    return null;\n  }\n}\n"],
  "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kCAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAkB,oBAClBC,EAAmC,qDACnCC,EAAqC,8BASrC,eAAsBJ,EACpBK,EACAC,EACmD,CAEnD,MAAMC,EAAgB,MADH,sBAAmBD,CAAgB,CACnB,IAAI,sBAAoB,IAAID,CAAK,GAEpE,GAAI,CACF,KAAM,CAAE,KAAAG,CAAK,EAAI,MAAM,EAAAC,QAAM,IAA4BF,CAAa,EAEtE,OAAIC,EACK,CACL,CAACH,CAAK,EAAG,CACP,UAAWG,EAAK,UAChB,KAAMA,EAAK,KACX,OAAQA,EAAK,MACf,CACF,EAEK,IACT,OAASE,EAAK,CACZ,eAAQ,MACN,4CACAH,EACAG,CACF,EACO,IACT,CACF",
  "names": ["getGasStationMetadata_exports", "__export", "getGasStationMetadataFromApi", "__toCommonJS", "import_axios", "import_getCleanApiAddress", "import_endpoints", "shard", "customApiAddress", "gasStationUrl", "data", "axios", "err"]
}
