{
  "version": 3,
  "sources": ["../../../../../../src/utils/transactions/getInterpretedTransaction/getTransactionValue/helpers/getValueFromOperations.ts"],
  "sourcesContent": ["import { InterpretedTransactionType } from 'types/serverTransactions.types';\nimport { getEgldValueData } from './getEgldValueData';\nimport { getVisibleOperations } from './getVisibleOperations';\n\nlet warningLogged = false;\n\nconst logError = (hash: string) => {\n  if (!warningLogged) {\n    console.error(\n      `Operations field missing for txHash: ${hash}.\n        Unable to compute value field.`\n    );\n    warningLogged = true;\n  }\n};\n\nexport function getValueFromOperations(\n  transaction: InterpretedTransactionType\n) {\n  try {\n    if (transaction.operations) {\n      const [operation] = getVisibleOperations(transaction);\n      return getEgldValueData(operation?.value);\n    } else {\n      logError(transaction.txHash);\n    }\n  } catch {\n    logError(transaction.txHash);\n  }\n  return getEgldValueData(transaction.value);\n}\n"],
  "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,4BAAAE,IAAA,eAAAC,EAAAH,GACA,IAAAI,EAAiC,8BACjCC,EAAqC,kCAErC,IAAIC,EAAgB,GAEpB,MAAMC,EAAYC,GAAiB,CAC5BF,IACH,QAAQ,MACN,wCAAwCE,CAAI;AAAA,uCAE9C,EACAF,EAAgB,GAEpB,EAEO,SAASJ,EACdO,EACA,CACA,GAAI,CACF,GAAIA,EAAY,WAAY,CAC1B,KAAM,CAACC,CAAS,KAAI,wBAAqBD,CAAW,EACpD,SAAO,oBAAiBC,GAAW,KAAK,CAC1C,MACEH,EAASE,EAAY,MAAM,CAE/B,MAAQ,CACNF,EAASE,EAAY,MAAM,CAC7B,CACA,SAAO,oBAAiBA,EAAY,KAAK,CAC3C",
  "names": ["getValueFromOperations_exports", "__export", "getValueFromOperations", "__toCommonJS", "import_getEgldValueData", "import_getVisibleOperations", "warningLogged", "logError", "hash", "transaction", "operation"]
}
