{
  "version": 3,
  "sources": ["../../src/utils/transactions/getInterpretedTransaction/helpers/getReceiptMessage.ts"],
  "sourcesContent": ["import BigNumber from 'bignumber.js';\nimport { REFUNDED_GAS } from 'constants/mvx.constants';\nimport { DECIMALS, DIGITS, formatAmount } from 'lib/sdkDappUtils';\nimport { ServerTransactionType } from 'types/serverTransactions.types';\n\nconst getReceiptValue = (transaction: ServerTransactionType) => {\n  if (!transaction.receipt?.value) {\n    return '';\n  }\n\n  if (transaction.receipt?.data === REFUNDED_GAS) {\n    const formattedGas = formatAmount({\n      input: transaction.receipt.value,\n      decimals: DECIMALS,\n      digits: DIGITS,\n      showLastNonZeroDecimal: true\n    });\n\n    const gasRefunded = new BigNumber(formattedGas)\n      .times(transaction.gasPrice)\n      .times(100);\n\n    return gasRefunded.toFixed();\n  }\n\n  return transaction.receipt.value;\n};\n\nexport function getReceiptMessage(transaction: ServerTransactionType) {\n  const message = transaction.receipt?.data;\n\n  if (!message) {\n    return '';\n  }\n\n  const receiptValue = getReceiptValue(transaction);\n  const value = receiptValue ? `: ${receiptValue}` : '';\n\n  return `${message}${value}`;\n}\n"],
  "mappings": "gGAAA,OAAOA,MAAe,eAKtB,IAAMC,EAAmBC,GAAuC,CAC9D,GAAI,CAACA,EAAY,SAAS,MACxB,MAAO,GAGT,GAAIA,EAAY,SAAS,OAASC,EAAc,CAC9C,IAAMC,EAAeC,EAAa,CAChC,MAAOH,EAAY,QAAQ,MAC3B,SAAUI,EACV,OAAQC,EACR,uBAAwB,EAC1B,CAAC,EAMD,OAJoB,IAAIC,EAAUJ,CAAY,EAC3C,MAAMF,EAAY,QAAQ,EAC1B,MAAM,GAAG,EAEO,QAAQ,CAC7B,CAEA,OAAOA,EAAY,QAAQ,KAC7B,EAEO,SAASO,EAAkBP,EAAoC,CACpE,IAAMQ,EAAUR,EAAY,SAAS,KAErC,GAAI,CAACQ,EACH,MAAO,GAGT,IAAMC,EAAeV,EAAgBC,CAAW,EAC1CU,EAAQD,EAAe,KAAKA,CAAY,GAAK,GAEnD,MAAO,GAAGD,CAAO,GAAGE,CAAK,EAC3B",
  "names": ["BigNumber", "getReceiptValue", "transaction", "REFUNDED_GAS", "formattedGas", "formatAmount", "DECIMALS", "DIGITS", "BigNumber", "getReceiptMessage", "message", "receiptValue", "value"]
}
