{
  "version": 3,
  "sources": ["../../../../../src/utils/transactions/getTransactionsHistory/helpers/getAssetAmount.ts"],
  "sourcesContent": ["import BigNumber from 'bignumber.js';\nimport trimEnd from 'lodash.trimend';\nimport { formatAmount, DECIMALS, DIGITS, ZERO } from 'lib/sdkDappUtils';\n\nimport { trimAmountDecimals } from 'utils/operations/trimAmountDecimals';\nimport { isTransferNftOrSft } from './isTransferNftOrSft';\n\nexport const getAssetAmount = (transactionTransfer: Record<string, string>) => {\n  if (isTransferNftOrSft(transactionTransfer)) {\n    return parseFloat(transactionTransfer.value).toLocaleString();\n  }\n\n  const formattedAmount = formatAmount({\n    input: String(transactionTransfer.value ?? ZERO),\n    decimals: Number(transactionTransfer.decimals ?? DECIMALS),\n    showLastNonZeroDecimal: true,\n    addCommas: true\n  });\n\n  const trimmedAmount = trimAmountDecimals({\n    minimumPositiveDecimals: DIGITS,\n    amount: formattedAmount\n  });\n\n  const [price, decimals] = trimmedAmount.split('.');\n  const trimmedDecimals = trimEnd(decimals, ZERO);\n\n  if (decimals && new BigNumber(decimals).isGreaterThan(ZERO)) {\n    return `${price}.${trimmedDecimals}`;\n  }\n\n  return trimmedAmount;\n};\n"],
  "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAsB,2BACtBC,EAAoB,6BACpBC,EAAqD,4BAErDC,EAAmC,+CACnCC,EAAmC,gCAE5B,MAAMN,EAAkBO,GAAgD,CAC7E,MAAI,sBAAmBA,CAAmB,EACxC,OAAO,WAAWA,EAAoB,KAAK,EAAE,eAAe,EAG9D,MAAMC,KAAkB,gBAAa,CACnC,MAAO,OAAOD,EAAoB,OAAS,MAAI,EAC/C,SAAU,OAAOA,EAAoB,UAAY,UAAQ,EACzD,uBAAwB,GACxB,UAAW,EACb,CAAC,EAEKE,KAAgB,sBAAmB,CACvC,wBAAyB,SACzB,OAAQD,CACV,CAAC,EAEK,CAACE,EAAOC,CAAQ,EAAIF,EAAc,MAAM,GAAG,EAC3CG,KAAkB,EAAAC,SAAQF,EAAU,MAAI,EAE9C,OAAIA,GAAY,IAAI,EAAAG,QAAUH,CAAQ,EAAE,cAAc,MAAI,EACjD,GAAGD,CAAK,IAAIE,CAAe,GAG7BH,CACT",
  "names": ["getAssetAmount_exports", "__export", "getAssetAmount", "__toCommonJS", "import_bignumber", "import_lodash", "import_sdkDappUtils", "import_trimAmountDecimals", "import_isTransferNftOrSft", "transactionTransfer", "formattedAmount", "trimmedAmount", "price", "decimals", "trimmedDecimals", "trimEnd", "BigNumber"]
}
