{
  "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": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAsB,2BACtBC,EAA6B,mCAC7BC,EAA+C,4BAG/C,MAAMC,EAAmBC,GAAuC,CAC9D,GAAI,CAACA,EAAY,SAAS,MACxB,MAAO,GAGT,GAAIA,EAAY,SAAS,OAAS,eAAc,CAC9C,MAAMC,KAAe,gBAAa,CAChC,MAAOD,EAAY,QAAQ,MAC3B,SAAU,WACV,OAAQ,SACR,uBAAwB,EAC1B,CAAC,EAMD,OAJoB,IAAI,EAAAE,QAAUD,CAAY,EAC3C,MAAMD,EAAY,QAAQ,EAC1B,MAAM,GAAG,EAEO,QAAQ,CAC7B,CAEA,OAAOA,EAAY,QAAQ,KAC7B,EAEO,SAASN,EAAkBM,EAAoC,CACpE,MAAMG,EAAUH,EAAY,SAAS,KAErC,GAAI,CAACG,EACH,MAAO,GAGT,MAAMC,EAAeL,EAAgBC,CAAW,EAC1CK,EAAQD,EAAe,KAAKA,CAAY,GAAK,GAEnD,MAAO,GAAGD,CAAO,GAAGE,CAAK,EAC3B",
  "names": ["getReceiptMessage_exports", "__export", "getReceiptMessage", "__toCommonJS", "import_bignumber", "import_mvx", "import_sdkDappUtils", "getReceiptValue", "transaction", "formattedGas", "BigNumber", "message", "receiptValue", "value"]
}
