{
  "version": 3,
  "sources": ["../../../src/apiCalls/account/getAccountFromApi.ts"],
  "sourcesContent": ["import { getCleanApiAddress } from 'apiCalls/configuration/getCleanApiAddress';\nimport { ACCOUNTS_ENDPOINT } from 'apiCalls/endpoints';\nimport { axiosInstance } from 'apiCalls/utils/axiosInstance';\nimport { TIMEOUT } from 'constants/network.constants';\nimport { AccountType } from 'types/account.types';\n\nexport const accountFetcher = ({\n  address,\n  baseURL\n}: {\n  address: string | null;\n  baseURL: string;\n}) => {\n  const apiAddress = getCleanApiAddress(baseURL);\n  const url = `${apiAddress}/${ACCOUNTS_ENDPOINT}/${address}?withGuardianInfo=true`;\n  // we need to get it with an axios instance because of cross-window user interaction issues\n  return axiosInstance.get(url, {\n    baseURL: apiAddress,\n    timeout: TIMEOUT\n  });\n};\n\nexport const getAccountFromApi = async ({\n  address,\n  baseURL\n}: {\n  address?: string;\n  baseURL: string;\n}) => {\n  if (!address) {\n    return null;\n  }\n\n  try {\n    const { data } = await accountFetcher({ address, baseURL });\n    return data as AccountType;\n  } catch (_err) {\n    console.error('error fetching configuration for ', address);\n  }\n\n  return null;\n};\n"],
  "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,EAAA,sBAAAC,IAAA,eAAAC,EAAAJ,GAAA,IAAAK,EAAmC,qDACnCC,EAAkC,8BAClCC,EAA8B,wCAC9BC,EAAwB,uCAGjB,MAAMN,EAAiB,CAAC,CAC7B,QAAAO,EACA,QAAAC,CACF,IAGM,CACJ,MAAMC,KAAa,sBAAmBD,CAAO,EACvCE,EAAM,GAAGD,CAAU,IAAI,mBAAiB,IAAIF,CAAO,yBAEzD,OAAO,gBAAc,IAAIG,EAAK,CAC5B,QAASD,EACT,QAAS,SACX,CAAC,CACH,EAEaR,EAAoB,MAAO,CACtC,QAAAM,EACA,QAAAC,CACF,IAGM,CACJ,GAAI,CAACD,EACH,OAAO,KAGT,GAAI,CACF,KAAM,CAAE,KAAAI,CAAK,EAAI,MAAMX,EAAe,CAAE,QAAAO,EAAS,QAAAC,CAAQ,CAAC,EAC1D,OAAOG,CACT,MAAe,CACb,QAAQ,MAAM,oCAAqCJ,CAAO,CAC5D,CAEA,OAAO,IACT",
  "names": ["getAccountFromApi_exports", "__export", "accountFetcher", "getAccountFromApi", "__toCommonJS", "import_getCleanApiAddress", "import_endpoints", "import_axiosInstance", "import_network", "address", "baseURL", "apiAddress", "url", "data"]
}
