{
  "version": 3,
  "sources": ["../../../../../src/utils/transactions/getTransactionsHistory/helpers/getTransactionActionDirectionLabel.ts"],
  "sourcesContent": ["import { ServerTransactionType } from 'types/serverTransactions.types';\nimport { NftEnumType } from 'types/tokens.types';\nimport { getReceiverData } from './getReceiverData';\n\ninterface IGetTransactionActionDirectionLabelParams {\n  transaction: ServerTransactionType;\n  currentUserAddress: string;\n  transferType?: string;\n}\n\nexport const getTransactionActionDirectionLabel = ({\n  transaction,\n  transferType,\n  currentUserAddress\n}: IGetTransactionActionDirectionLabelParams) => {\n  const { receiver } = getReceiverData(transaction);\n\n  const isSelfTransaction = receiver === transaction.sender;\n  const isReceiverTransaction = receiver === currentUserAddress;\n  const isSenderTransaction = !isSelfTransaction && !isReceiverTransaction;\n  const processedTransferType = transferType as NftEnumType;\n\n  const selfTransactionTransferTypes = [\n    NftEnumType.SemiFungibleESDT,\n    NftEnumType.NonFungibleESDT,\n    NftEnumType.MetaESDT\n  ];\n\n  const isSelfSentTransactionTransfer = selfTransactionTransferTypes.includes(\n    processedTransferType\n  );\n\n  if (\n    (isSelfTransaction && isSelfSentTransactionTransfer) ||\n    isReceiverTransaction\n  ) {\n    return 'Received';\n  }\n\n  if (isSelfTransaction && !isSelfSentTransactionTransfer) {\n    return 'Self Sent';\n  }\n\n  if (isSenderTransaction) {\n    return 'Sent';\n  }\n\n  return 'Self';\n};\n"],
  "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wCAAAE,IAAA,eAAAC,EAAAH,GACA,IAAAI,EAA4B,8BAC5BC,EAAgC,6BAQzB,MAAMH,EAAqC,CAAC,CACjD,YAAAI,EACA,aAAAC,EACA,mBAAAC,CACF,IAAiD,CAC/C,KAAM,CAAE,SAAAC,CAAS,KAAI,mBAAgBH,CAAW,EAE1CI,EAAoBD,IAAaH,EAAY,OAC7CK,EAAwBF,IAAaD,EACrCI,EAAsB,CAACF,GAAqB,CAACC,EAC7CE,EAAwBN,EAQxBO,EAN+B,CACnC,cAAY,iBACZ,cAAY,gBACZ,cAAY,QACd,EAEmE,SACjED,CACF,EAEA,OACGH,GAAqBI,GACtBH,EAEO,WAGLD,GAAqB,CAACI,EACjB,YAGLF,EACK,OAGF,MACT",
  "names": ["getTransactionActionDirectionLabel_exports", "__export", "getTransactionActionDirectionLabel", "__toCommonJS", "import_tokens", "import_getReceiverData", "transaction", "transferType", "currentUserAddress", "receiver", "isSelfTransaction", "isReceiverTransaction", "isSenderTransaction", "processedTransferType", "isSelfSentTransactionTransfer"]
}
