{
  "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": "kFAAA,OAAOA,MAAW,QAWlB,eAAsBC,EACpBC,EACAC,EACmD,CAEnD,IAAMC,EAAgB,GADHC,EAAmBF,CAAgB,CACnB,IAAIG,CAAoB,IAAIJ,CAAK,GAEpE,GAAI,CACF,GAAM,CAAE,KAAAK,CAAK,EAAI,MAAMC,EAAM,IAA4BJ,CAAa,EAEtE,OAAIG,EACK,CACL,CAACL,CAAK,EAAG,CACP,UAAWK,EAAK,UAChB,KAAMA,EAAK,KACX,OAAQA,EAAK,MACf,CACF,EAEK,IACT,OAASE,EAAK,CACZ,eAAQ,MACN,4CACAL,EACAK,CACF,EACO,IACT,CACF",
  "names": ["axios", "getGasStationMetadataFromApi", "shard", "customApiAddress", "gasStationUrl", "getCleanApiAddress", "GAS_STATION_ENDPOINT", "data", "axios", "err"]
}
