{"version":3,"file":"is-onchain-notification.cjs","sourceRoot":"","sources":["../../src/shared/is-onchain-notification.ts"],"names":[],"mappings":";;;AAEA;;;;;GAKG;AACH,SAAgB,wBAAwB,CACtC,YAAqB;IAErB,MAAM,OAAO,GAAG,YAAsC,CAAC;IAEvD,qGAAqG;IACrG,yGAAyG;IACzG,MAAM,oCAAoC,GAAG;QAC3C,OAAO,EAAE,EAAE;QACX,OAAO,EAAE,OAAO,EAAE,IAAI;KACvB,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;IACxC,OAAO,oCAAoC,CAAC;AAC9C,CAAC;AAZD,4DAYC","sourcesContent":["import type { OnChainRawNotification } from '../NotificationServicesController';\n\n/**\n * Checks if the given value is an OnChainRawNotification object.\n *\n * @param notification - The value to check.\n * @returns True if the value is an OnChainRawNotification object, false otherwise.\n */\nexport function isOnChainRawNotification(\n  notification: unknown,\n): notification is OnChainRawNotification {\n  const assumed = notification as OnChainRawNotification;\n\n  // We don't have a validation/parsing library to check all possible types of an on chain notification\n  // It is safe enough just to check \"some\" fields, and catch any errors down the line if the shape is bad.\n  const isValidEnoughToBeOnChainNotification = [\n    assumed?.id,\n    assumed?.payload?.data,\n  ].every((field) => field !== undefined);\n  return isValidEnoughToBeOnChainNotification;\n}\n"]}