{
  "version": 3,
  "sources": ["../../src/providers/strategies/helpers/signTransactions/helpers/getCommonData/helpers/checkIsValidSender.ts"],
  "sourcesContent": ["import { MULTIVERSX_WALLET_ORIGIN } from 'constants/mvx.constants';\nimport { AccountType } from 'types/account.types';\nimport { isContract } from 'utils/validation/isContract';\nimport { getWindowLocation } from 'utils/window/getWindowLocation';\n\n// Don't allow signing if the logged in account's address\n// is neither the sender or the sender account's active guardian\nexport const checkIsValidSender = (\n  senderAccount: Partial<AccountType> | null,\n  address: string | string[]\n) => {\n  if (!senderAccount || !senderAccount.address) {\n    return true;\n  }\n\n  // Allow sender to be different than the logged in address if the origin is multiversx.com\n  const isMultiversxWallet = getWindowLocation()?.origin?.endsWith(\n    MULTIVERSX_WALLET_ORIGIN\n  );\n\n  // Allow multisig contracts to be the sender\n  const isSenderContract = isContract(senderAccount.address);\n\n  if (isMultiversxWallet || isSenderContract) {\n    return true;\n  }\n\n  if (Array.isArray(address)) {\n    return address.some(\n      (addr) =>\n        senderAccount.address === addr ||\n        senderAccount.activeGuardianAddress === addr\n    );\n  }\n\n  return (\n    senderAccount.address === address ||\n    senderAccount.activeGuardianAddress === address\n  );\n};\n"],
  "mappings": "sHAOO,IAAMA,EAAqB,CAChCC,EACAC,IACG,CACH,GAAI,CAACD,GAAiB,CAACA,EAAc,QACnC,MAAO,GAIT,IAAME,EAAqBC,EAAkB,GAAG,QAAQ,SACtDC,CACF,EAGMC,EAAmBC,EAAWN,EAAc,OAAO,EAEzD,OAAIE,GAAsBG,EACjB,GAGL,MAAM,QAAQJ,CAAO,EAChBA,EAAQ,KACZM,GACCP,EAAc,UAAYO,GAC1BP,EAAc,wBAA0BO,CAC5C,EAIAP,EAAc,UAAYC,GAC1BD,EAAc,wBAA0BC,CAE5C",
  "names": ["checkIsValidSender", "senderAccount", "address", "isMultiversxWallet", "getWindowLocation", "MULTIVERSX_WALLET_ORIGIN", "isSenderContract", "isContract", "addr"]
}
