@metamask/snaps-utils 7.0.0 → 7.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -1
- package/dist/array.js +2 -2
- package/dist/array.mjs +2 -2
- package/dist/auxiliary-files.js +6 -6
- package/dist/auxiliary-files.mjs +6 -6
- package/dist/base64.js +5 -5
- package/dist/base64.mjs +5 -5
- package/dist/bytes.js +4 -4
- package/dist/bytes.mjs +4 -4
- package/dist/caveats.js +2 -2
- package/dist/caveats.mjs +2 -2
- package/dist/checksum.js +5 -5
- package/dist/checksum.mjs +5 -5
- package/dist/{chunk-FJH6DDEL.mjs → chunk-2IWSQJKQ.mjs} +3 -3
- package/dist/{chunk-2QS3W66J.js → chunk-2LBN5T56.js} +4 -4
- package/dist/{chunk-3TH3NLQL.js → chunk-2PCPD5XY.js} +6 -6
- package/dist/{chunk-KWQKGJSV.js → chunk-3SOYDY4W.js} +1 -1
- package/dist/{chunk-ZXCNX3ZB.mjs → chunk-44GPX66J.mjs} +1 -1
- package/dist/{chunk-WDGBH5CP.js → chunk-44VFHYJO.js} +9 -9
- package/dist/chunk-44VFHYJO.js.map +1 -0
- package/dist/{chunk-R4BBIGBN.js → chunk-473MIETW.js} +3 -3
- package/dist/chunk-4CMD46B2.js +1 -0
- package/dist/{chunk-TUAHXE75.mjs → chunk-5R7UF7KM.mjs} +1 -1
- package/dist/{chunk-P5V6S2PA.mjs → chunk-63OXILAY.mjs} +2 -2
- package/dist/{chunk-QWEXXUTO.mjs → chunk-6CHO3LOX.mjs} +1 -1
- package/dist/{chunk-B3YQVRPE.js → chunk-6LOYTBS3.js} +4 -4
- package/dist/{chunk-VGWELVCX.mjs → chunk-6YRUDGNL.mjs} +2 -2
- package/dist/{chunk-7H5TGXZ5.js → chunk-772OPTGX.js} +3 -3
- package/dist/{chunk-XC5E26VE.mjs → chunk-7LG4D4XA.mjs} +1 -1
- package/dist/chunk-7LOABHVW.js +1 -0
- package/dist/chunk-7MTAHOWC.mjs +1 -0
- package/dist/{chunk-F33RMB76.js → chunk-7P62OIGX.js} +7 -7
- package/dist/{chunk-32B4YQM7.mjs → chunk-7Y3WSN44.mjs} +3 -3
- package/dist/chunk-A3RRMELT.mjs +1 -0
- package/dist/{chunk-GMC2A3D7.js → chunk-A6E325SZ.js} +3 -3
- package/dist/{chunk-RS5HE55U.js → chunk-AFQY2CNY.js} +3 -3
- package/dist/{chunk-I3BUOULW.js → chunk-AOGVLPQZ.js} +1 -1
- package/dist/{chunk-QF3LHIJ5.mjs → chunk-AS5P6JRP.mjs} +1 -1
- package/dist/{chunk-MJABESWH.js → chunk-ASZWZ7JT.js} +1 -1
- package/dist/{chunk-GK4IJQVW.js → chunk-AWRMYDIN.js} +43 -43
- package/dist/{chunk-3ZSMMNQB.mjs → chunk-BGSO2GQC.mjs} +1 -1
- package/dist/{chunk-4UMDRHDR.js → chunk-CMOSYNZR.js} +2 -2
- package/dist/{chunk-ZRVOIW3H.js → chunk-CQRPSEH3.js} +3 -3
- package/dist/{chunk-DKSB4FMW.mjs → chunk-DKDGMZFU.mjs} +1 -1
- package/dist/{chunk-IWENO6LT.js → chunk-E3BDBG6T.js} +1 -1
- package/dist/{chunk-YLT6CNSL.mjs → chunk-EA2FOAEG.mjs} +1 -1
- package/dist/chunk-EFRPCO3C.js +1 -0
- package/dist/{chunk-OQSLMZJN.js → chunk-ENKAY3PI.js} +18 -18
- package/dist/{chunk-7T3N2ZGQ.mjs → chunk-EXUEHPZ4.mjs} +1 -1
- package/dist/{chunk-JGMGNLZW.mjs → chunk-FOWIC2SO.mjs} +2 -2
- package/dist/{chunk-2IVFF3AA.mjs → chunk-GTAYOKI4.mjs} +2 -2
- package/dist/{chunk-6H32HLTZ.js → chunk-HF7HUZ5Z.js} +1 -1
- package/dist/{chunk-LHIPBIPS.mjs → chunk-HJRCBSNA.mjs} +2 -2
- package/dist/chunk-HJYRGKCX.js +50 -0
- package/dist/chunk-HYF7Q6VY.mjs +1 -0
- package/dist/{chunk-Z4J4GUGG.mjs → chunk-I77AVJKV.mjs} +1 -1
- package/dist/{chunk-HOTDTMNP.mjs → chunk-IGMAXVPP.mjs} +2 -2
- package/dist/{chunk-7KKLGQNE.js → chunk-IHQPAJ2B.js} +3 -3
- package/dist/{chunk-6WBLB5BX.js → chunk-IJX3CXOY.js} +1 -1
- package/dist/{chunk-WJOAEPZ7.js → chunk-IPOE62V4.js} +1 -1
- package/dist/{chunk-7XA5VYYV.mjs → chunk-IV3FSWZ7.mjs} +1 -1
- package/dist/{chunk-7PNGOFLU.js → chunk-IXBJNVHK.js} +3 -3
- package/dist/chunk-JI5NQ2C3.mjs +1 -0
- package/dist/{chunk-4GBOSMF7.mjs → chunk-JMDSN227.mjs} +2 -10
- package/dist/{chunk-XRGYWWT7.js → chunk-K6BCBPXF.js} +1 -1
- package/dist/{chunk-2G4HD42C.mjs → chunk-KMLVVVK3.mjs} +2 -2
- package/dist/{chunk-ZLFA4R5X.js → chunk-LBRWAC27.js} +3 -3
- package/dist/{chunk-HWFLO7W5.mjs → chunk-LCWDLIK5.mjs} +8 -8
- package/dist/{chunk-XEY3KVEH.js → chunk-LEKZPKS2.js} +1 -1
- package/dist/{chunk-4IKNNAVC.mjs → chunk-LGT3PBPZ.mjs} +5 -5
- package/dist/{chunk-TURGGK5F.mjs → chunk-LSPOXPJJ.mjs} +9 -5
- package/dist/chunk-LSPOXPJJ.mjs.map +1 -0
- package/dist/{chunk-KEXZDQAN.js → chunk-M3KAAQFK.js} +4 -3
- package/dist/chunk-M3KAAQFK.js.map +1 -0
- package/dist/{chunk-224S5XKL.js → chunk-MLOQHUOY.js} +5 -5
- package/dist/{chunk-UGQQ5DJ4.mjs → chunk-MNCFAD4E.mjs} +4 -3
- package/dist/chunk-MNCFAD4E.mjs.map +1 -0
- package/dist/{chunk-QYFDFOWT.js → chunk-N722KRZW.js} +1 -1
- package/dist/{chunk-Q7FGULTV.js → chunk-NUCLSR2G.js} +1 -1
- package/dist/{chunk-XKXHM3PC.mjs → chunk-P252LKUT.mjs} +1 -1
- package/dist/{chunk-Y3F7VUZB.mjs → chunk-PIG67G67.mjs} +10 -10
- package/dist/{chunk-IUNNN6HN.mjs → chunk-PJMEJVOB.mjs} +1 -1
- package/dist/{chunk-RRPU7M4Y.js → chunk-PLBSSUVY.js} +1 -1
- package/dist/{chunk-R7UAMO2U.js → chunk-QSCKTRRU.js} +3 -3
- package/dist/{chunk-H34N3OWO.mjs → chunk-QX6MAFJU.mjs} +2 -2
- package/dist/{chunk-O3XKEEJV.mjs → chunk-QYPLUMB7.mjs} +2 -2
- package/dist/chunk-QYPLUMB7.mjs.map +1 -0
- package/dist/chunk-RAZ7XG4Z.mjs +1 -0
- package/dist/chunk-RAZ7XG4Z.mjs.map +1 -0
- package/dist/{chunk-6CTV7VW5.mjs → chunk-SRMDDOVO.mjs} +1 -1
- package/dist/chunk-T3VM5YXY.js +1 -0
- package/dist/{chunk-FTY3BOF7.js → chunk-T3YY4JIJ.js} +1 -1
- package/dist/{chunk-ZVXX2CTH.mjs → chunk-T6FWIDA6.mjs} +1 -1
- package/dist/chunk-TFP64TMV.js +1 -0
- package/dist/{chunk-H636DAOG.js → chunk-TG4BDSYJ.js} +12 -12
- package/dist/{chunk-43EBXDVP.mjs → chunk-UMZNVWEM.mjs} +1 -1
- package/dist/{chunk-3SARO5TJ.mjs → chunk-UW74NLTC.mjs} +1 -1
- package/dist/{chunk-GW5NQXN4.mjs → chunk-VWGXNUMD.mjs} +2 -2
- package/dist/{chunk-N52KMB25.mjs → chunk-WEOCOYES.mjs} +2 -2
- package/dist/{chunk-VMUXXXJC.js → chunk-X44Z53IG.js} +5 -5
- package/dist/chunk-YMUOYQFU.js +30 -0
- package/dist/{chunk-B2DMAQNK.mjs → chunk-Z2JQNSVL.mjs} +1 -1
- package/dist/{chunk-LOW2T4MV.mjs → chunk-ZJRWU4AJ.mjs} +2 -2
- package/dist/{chunk-MSUZTHYT.js → chunk-ZT3KKTS2.js} +1 -1
- package/dist/cronjob.js +2 -2
- package/dist/cronjob.mjs +2 -2
- package/dist/deep-clone.js +2 -2
- package/dist/deep-clone.mjs +2 -2
- package/dist/default-endowments.js +2 -2
- package/dist/default-endowments.mjs +2 -2
- package/dist/derivation-paths.js +3 -3
- package/dist/derivation-paths.mjs +3 -3
- package/dist/entropy.js +2 -2
- package/dist/entropy.mjs +2 -2
- package/dist/errors.js +2 -2
- package/dist/errors.mjs +2 -2
- package/dist/eval-worker.js +5 -5
- package/dist/eval-worker.mjs +4 -4
- package/dist/eval.js +9 -9
- package/dist/eval.mjs +9 -9
- package/dist/fs.js +8 -8
- package/dist/fs.mjs +8 -8
- package/dist/handler-types.js +2 -2
- package/dist/handler-types.mjs +2 -2
- package/dist/handlers.js +3 -3
- package/dist/handlers.mjs +3 -3
- package/dist/icon.js +2 -2
- package/dist/icon.mjs +2 -2
- package/dist/iframe.js +2 -2
- package/dist/iframe.mjs +2 -2
- package/dist/index.executionenv.js +8 -8
- package/dist/index.executionenv.mjs +8 -8
- package/dist/index.js +35 -35
- package/dist/index.mjs +35 -35
- package/dist/json-rpc.js +2 -2
- package/dist/json-rpc.mjs +2 -2
- package/dist/json.js +2 -2
- package/dist/json.mjs +2 -2
- package/dist/localization.js +3 -3
- package/dist/localization.mjs +3 -3
- package/dist/logging.js +2 -2
- package/dist/logging.mjs +2 -2
- package/dist/manifest/index.js +15 -15
- package/dist/manifest/index.mjs +15 -15
- package/dist/manifest/manifest.js +22 -22
- package/dist/manifest/manifest.mjs +22 -22
- package/dist/manifest/node.js +24 -24
- package/dist/manifest/node.mjs +24 -24
- package/dist/manifest/validation.js +14 -14
- package/dist/manifest/validation.mjs +14 -14
- package/dist/mock.js +3 -3
- package/dist/mock.mjs +3 -3
- package/dist/namespace.js +2 -2
- package/dist/namespace.mjs +2 -2
- package/dist/node.js +43 -43
- package/dist/node.mjs +43 -43
- package/dist/npm.js +22 -22
- package/dist/npm.mjs +22 -22
- package/dist/path.js +2 -2
- package/dist/path.mjs +2 -2
- package/dist/post-process.js +2 -2
- package/dist/post-process.mjs +2 -2
- package/dist/snaps.js +8 -8
- package/dist/snaps.mjs +8 -8
- package/dist/strings.js +2 -2
- package/dist/strings.mjs +2 -2
- package/dist/structs.js +3 -3
- package/dist/structs.mjs +3 -3
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/handlers.d.ts +14 -0
- package/dist/types.js +2 -2
- package/dist/types.mjs +2 -2
- package/dist/ui.js +2 -2
- package/dist/ui.mjs +2 -2
- package/dist/validation.js +18 -18
- package/dist/validation.mjs +18 -18
- package/dist/versions.js +2 -2
- package/dist/versions.mjs +2 -2
- package/dist/virtual-file/VirtualFile.js +3 -3
- package/dist/virtual-file/VirtualFile.mjs +3 -3
- package/dist/virtual-file/index.js +4 -4
- package/dist/virtual-file/index.mjs +4 -4
- package/dist/virtual-file/node.js +6 -6
- package/dist/virtual-file/node.mjs +6 -6
- package/dist/virtual-file/toVirtualFile.js +4 -4
- package/dist/virtual-file/toVirtualFile.mjs +4 -4
- package/package.json +3 -3
- package/dist/chunk-2XF32FCF.js +0 -1
- package/dist/chunk-4GBOSMF7.mjs.map +0 -1
- package/dist/chunk-DK3IYVMP.mjs +0 -1
- package/dist/chunk-IIDK6BRC.mjs +0 -1
- package/dist/chunk-JV7OA3FD.js +0 -1
- package/dist/chunk-KEXZDQAN.js.map +0 -1
- package/dist/chunk-LEFOMYX3.mjs +0 -1
- package/dist/chunk-MYSBDK36.mjs +0 -1
- package/dist/chunk-O3XKEEJV.mjs.map +0 -1
- package/dist/chunk-O4PW77JW.mjs +0 -1
- package/dist/chunk-Q5T57UNN.js +0 -1
- package/dist/chunk-QJTAFTW7.js +0 -30
- package/dist/chunk-TURGGK5F.mjs.map +0 -1
- package/dist/chunk-UGQQ5DJ4.mjs.map +0 -1
- package/dist/chunk-WDGBH5CP.js.map +0 -1
- package/dist/chunk-XDEHYKW2.js +0 -1
- package/dist/chunk-XWFKTDB3.js +0 -50
- package/dist/chunk-YF4PGFCO.js +0 -1
- /package/dist/{chunk-FJH6DDEL.mjs.map → chunk-2IWSQJKQ.mjs.map} +0 -0
- /package/dist/{chunk-2QS3W66J.js.map → chunk-2LBN5T56.js.map} +0 -0
- /package/dist/{chunk-3TH3NLQL.js.map → chunk-2PCPD5XY.js.map} +0 -0
- /package/dist/{chunk-KWQKGJSV.js.map → chunk-3SOYDY4W.js.map} +0 -0
- /package/dist/{chunk-ZXCNX3ZB.mjs.map → chunk-44GPX66J.mjs.map} +0 -0
- /package/dist/{chunk-R4BBIGBN.js.map → chunk-473MIETW.js.map} +0 -0
- /package/dist/{chunk-2XF32FCF.js.map → chunk-4CMD46B2.js.map} +0 -0
- /package/dist/{chunk-TUAHXE75.mjs.map → chunk-5R7UF7KM.mjs.map} +0 -0
- /package/dist/{chunk-P5V6S2PA.mjs.map → chunk-63OXILAY.mjs.map} +0 -0
- /package/dist/{chunk-QWEXXUTO.mjs.map → chunk-6CHO3LOX.mjs.map} +0 -0
- /package/dist/{chunk-B3YQVRPE.js.map → chunk-6LOYTBS3.js.map} +0 -0
- /package/dist/{chunk-VGWELVCX.mjs.map → chunk-6YRUDGNL.mjs.map} +0 -0
- /package/dist/{chunk-7H5TGXZ5.js.map → chunk-772OPTGX.js.map} +0 -0
- /package/dist/{chunk-XC5E26VE.mjs.map → chunk-7LG4D4XA.mjs.map} +0 -0
- /package/dist/{chunk-JV7OA3FD.js.map → chunk-7LOABHVW.js.map} +0 -0
- /package/dist/{chunk-DK3IYVMP.mjs.map → chunk-7MTAHOWC.mjs.map} +0 -0
- /package/dist/{chunk-F33RMB76.js.map → chunk-7P62OIGX.js.map} +0 -0
- /package/dist/{chunk-32B4YQM7.mjs.map → chunk-7Y3WSN44.mjs.map} +0 -0
- /package/dist/{chunk-IIDK6BRC.mjs.map → chunk-A3RRMELT.mjs.map} +0 -0
- /package/dist/{chunk-GMC2A3D7.js.map → chunk-A6E325SZ.js.map} +0 -0
- /package/dist/{chunk-RS5HE55U.js.map → chunk-AFQY2CNY.js.map} +0 -0
- /package/dist/{chunk-I3BUOULW.js.map → chunk-AOGVLPQZ.js.map} +0 -0
- /package/dist/{chunk-QF3LHIJ5.mjs.map → chunk-AS5P6JRP.mjs.map} +0 -0
- /package/dist/{chunk-MJABESWH.js.map → chunk-ASZWZ7JT.js.map} +0 -0
- /package/dist/{chunk-GK4IJQVW.js.map → chunk-AWRMYDIN.js.map} +0 -0
- /package/dist/{chunk-3ZSMMNQB.mjs.map → chunk-BGSO2GQC.mjs.map} +0 -0
- /package/dist/{chunk-4UMDRHDR.js.map → chunk-CMOSYNZR.js.map} +0 -0
- /package/dist/{chunk-ZRVOIW3H.js.map → chunk-CQRPSEH3.js.map} +0 -0
- /package/dist/{chunk-DKSB4FMW.mjs.map → chunk-DKDGMZFU.mjs.map} +0 -0
- /package/dist/{chunk-IWENO6LT.js.map → chunk-E3BDBG6T.js.map} +0 -0
- /package/dist/{chunk-YLT6CNSL.mjs.map → chunk-EA2FOAEG.mjs.map} +0 -0
- /package/dist/{chunk-Q5T57UNN.js.map → chunk-EFRPCO3C.js.map} +0 -0
- /package/dist/{chunk-OQSLMZJN.js.map → chunk-ENKAY3PI.js.map} +0 -0
- /package/dist/{chunk-7T3N2ZGQ.mjs.map → chunk-EXUEHPZ4.mjs.map} +0 -0
- /package/dist/{chunk-JGMGNLZW.mjs.map → chunk-FOWIC2SO.mjs.map} +0 -0
- /package/dist/{chunk-2IVFF3AA.mjs.map → chunk-GTAYOKI4.mjs.map} +0 -0
- /package/dist/{chunk-6H32HLTZ.js.map → chunk-HF7HUZ5Z.js.map} +0 -0
- /package/dist/{chunk-LHIPBIPS.mjs.map → chunk-HJRCBSNA.mjs.map} +0 -0
- /package/dist/{chunk-XWFKTDB3.js.map → chunk-HJYRGKCX.js.map} +0 -0
- /package/dist/{chunk-LEFOMYX3.mjs.map → chunk-HYF7Q6VY.mjs.map} +0 -0
- /package/dist/{chunk-Z4J4GUGG.mjs.map → chunk-I77AVJKV.mjs.map} +0 -0
- /package/dist/{chunk-HOTDTMNP.mjs.map → chunk-IGMAXVPP.mjs.map} +0 -0
- /package/dist/{chunk-7KKLGQNE.js.map → chunk-IHQPAJ2B.js.map} +0 -0
- /package/dist/{chunk-6WBLB5BX.js.map → chunk-IJX3CXOY.js.map} +0 -0
- /package/dist/{chunk-WJOAEPZ7.js.map → chunk-IPOE62V4.js.map} +0 -0
- /package/dist/{chunk-7XA5VYYV.mjs.map → chunk-IV3FSWZ7.mjs.map} +0 -0
- /package/dist/{chunk-7PNGOFLU.js.map → chunk-IXBJNVHK.js.map} +0 -0
- /package/dist/{chunk-MYSBDK36.mjs.map → chunk-JI5NQ2C3.mjs.map} +0 -0
- /package/dist/{chunk-O4PW77JW.mjs.map → chunk-JMDSN227.mjs.map} +0 -0
- /package/dist/{chunk-XRGYWWT7.js.map → chunk-K6BCBPXF.js.map} +0 -0
- /package/dist/{chunk-2G4HD42C.mjs.map → chunk-KMLVVVK3.mjs.map} +0 -0
- /package/dist/{chunk-ZLFA4R5X.js.map → chunk-LBRWAC27.js.map} +0 -0
- /package/dist/{chunk-HWFLO7W5.mjs.map → chunk-LCWDLIK5.mjs.map} +0 -0
- /package/dist/{chunk-XEY3KVEH.js.map → chunk-LEKZPKS2.js.map} +0 -0
- /package/dist/{chunk-4IKNNAVC.mjs.map → chunk-LGT3PBPZ.mjs.map} +0 -0
- /package/dist/{chunk-224S5XKL.js.map → chunk-MLOQHUOY.js.map} +0 -0
- /package/dist/{chunk-QYFDFOWT.js.map → chunk-N722KRZW.js.map} +0 -0
- /package/dist/{chunk-Q7FGULTV.js.map → chunk-NUCLSR2G.js.map} +0 -0
- /package/dist/{chunk-XKXHM3PC.mjs.map → chunk-P252LKUT.mjs.map} +0 -0
- /package/dist/{chunk-Y3F7VUZB.mjs.map → chunk-PIG67G67.mjs.map} +0 -0
- /package/dist/{chunk-IUNNN6HN.mjs.map → chunk-PJMEJVOB.mjs.map} +0 -0
- /package/dist/{chunk-RRPU7M4Y.js.map → chunk-PLBSSUVY.js.map} +0 -0
- /package/dist/{chunk-R7UAMO2U.js.map → chunk-QSCKTRRU.js.map} +0 -0
- /package/dist/{chunk-H34N3OWO.mjs.map → chunk-QX6MAFJU.mjs.map} +0 -0
- /package/dist/{chunk-6CTV7VW5.mjs.map → chunk-SRMDDOVO.mjs.map} +0 -0
- /package/dist/{chunk-XDEHYKW2.js.map → chunk-T3VM5YXY.js.map} +0 -0
- /package/dist/{chunk-FTY3BOF7.js.map → chunk-T3YY4JIJ.js.map} +0 -0
- /package/dist/{chunk-ZVXX2CTH.mjs.map → chunk-T6FWIDA6.mjs.map} +0 -0
- /package/dist/{chunk-YF4PGFCO.js.map → chunk-TFP64TMV.js.map} +0 -0
- /package/dist/{chunk-H636DAOG.js.map → chunk-TG4BDSYJ.js.map} +0 -0
- /package/dist/{chunk-43EBXDVP.mjs.map → chunk-UMZNVWEM.mjs.map} +0 -0
- /package/dist/{chunk-3SARO5TJ.mjs.map → chunk-UW74NLTC.mjs.map} +0 -0
- /package/dist/{chunk-GW5NQXN4.mjs.map → chunk-VWGXNUMD.mjs.map} +0 -0
- /package/dist/{chunk-N52KMB25.mjs.map → chunk-WEOCOYES.mjs.map} +0 -0
- /package/dist/{chunk-VMUXXXJC.js.map → chunk-X44Z53IG.js.map} +0 -0
- /package/dist/{chunk-QJTAFTW7.js.map → chunk-YMUOYQFU.js.map} +0 -0
- /package/dist/{chunk-B2DMAQNK.mjs.map → chunk-Z2JQNSVL.mjs.map} +0 -0
- /package/dist/{chunk-LOW2T4MV.mjs.map → chunk-ZJRWU4AJ.mjs.map} +0 -0
- /package/dist/{chunk-MSUZTHYT.js.map → chunk-ZT3KKTS2.js.map} +0 -0
package/dist/types/handlers.d.ts
CHANGED
|
@@ -112,6 +112,7 @@ export declare const OnTransactionResponseWithContentStruct: import("superstruct
|
|
|
112
112
|
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
113
113
|
name: string;
|
|
114
114
|
value?: string | undefined;
|
|
115
|
+
error?: string | undefined;
|
|
115
116
|
label?: string | undefined;
|
|
116
117
|
inputType?: "number" | "text" | "password" | undefined;
|
|
117
118
|
placeholder?: string | undefined;
|
|
@@ -128,6 +129,7 @@ export declare const OnTransactionResponseWithContentStruct: import("superstruct
|
|
|
128
129
|
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
129
130
|
name: string;
|
|
130
131
|
value?: string | undefined;
|
|
132
|
+
error?: string | undefined;
|
|
131
133
|
label?: string | undefined;
|
|
132
134
|
inputType?: "number" | "text" | "password" | undefined;
|
|
133
135
|
placeholder?: string | undefined;
|
|
@@ -181,6 +183,7 @@ export declare const OnTransactionResponseWithContentStruct: import("superstruct
|
|
|
181
183
|
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
182
184
|
name: string;
|
|
183
185
|
value?: string | undefined;
|
|
186
|
+
error?: string | undefined;
|
|
184
187
|
label?: string | undefined;
|
|
185
188
|
inputType?: "number" | "text" | "password" | undefined;
|
|
186
189
|
placeholder?: string | undefined;
|
|
@@ -197,6 +200,7 @@ export declare const OnTransactionResponseWithContentStruct: import("superstruct
|
|
|
197
200
|
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
198
201
|
name: string;
|
|
199
202
|
value?: string | undefined;
|
|
203
|
+
error?: string | undefined;
|
|
200
204
|
label?: string | undefined;
|
|
201
205
|
inputType?: "number" | "text" | "password" | undefined;
|
|
202
206
|
placeholder?: string | undefined;
|
|
@@ -254,6 +258,7 @@ export declare const OnTransactionResponseStruct: import("superstruct").Struct<{
|
|
|
254
258
|
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
255
259
|
name: string;
|
|
256
260
|
value?: string | undefined;
|
|
261
|
+
error?: string | undefined;
|
|
257
262
|
label?: string | undefined;
|
|
258
263
|
inputType?: "number" | "text" | "password" | undefined;
|
|
259
264
|
placeholder?: string | undefined;
|
|
@@ -270,6 +275,7 @@ export declare const OnTransactionResponseStruct: import("superstruct").Struct<{
|
|
|
270
275
|
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
271
276
|
name: string;
|
|
272
277
|
value?: string | undefined;
|
|
278
|
+
error?: string | undefined;
|
|
273
279
|
label?: string | undefined;
|
|
274
280
|
inputType?: "number" | "text" | "password" | undefined;
|
|
275
281
|
placeholder?: string | undefined;
|
|
@@ -327,6 +333,7 @@ export declare const OnSignatureResponseStruct: import("superstruct").Struct<{
|
|
|
327
333
|
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
328
334
|
name: string;
|
|
329
335
|
value?: string | undefined;
|
|
336
|
+
error?: string | undefined;
|
|
330
337
|
label?: string | undefined;
|
|
331
338
|
inputType?: "number" | "text" | "password" | undefined;
|
|
332
339
|
placeholder?: string | undefined;
|
|
@@ -343,6 +350,7 @@ export declare const OnSignatureResponseStruct: import("superstruct").Struct<{
|
|
|
343
350
|
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
344
351
|
name: string;
|
|
345
352
|
value?: string | undefined;
|
|
353
|
+
error?: string | undefined;
|
|
346
354
|
label?: string | undefined;
|
|
347
355
|
inputType?: "number" | "text" | "password" | undefined;
|
|
348
356
|
placeholder?: string | undefined;
|
|
@@ -397,6 +405,7 @@ export declare const OnHomePageResponseWithContentStruct: import("superstruct").
|
|
|
397
405
|
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
398
406
|
name: string;
|
|
399
407
|
value?: string | undefined;
|
|
408
|
+
error?: string | undefined;
|
|
400
409
|
label?: string | undefined;
|
|
401
410
|
inputType?: "number" | "text" | "password" | undefined;
|
|
402
411
|
placeholder?: string | undefined;
|
|
@@ -413,6 +422,7 @@ export declare const OnHomePageResponseWithContentStruct: import("superstruct").
|
|
|
413
422
|
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
414
423
|
name: string;
|
|
415
424
|
value?: string | undefined;
|
|
425
|
+
error?: string | undefined;
|
|
416
426
|
label?: string | undefined;
|
|
417
427
|
inputType?: "number" | "text" | "password" | undefined;
|
|
418
428
|
placeholder?: string | undefined;
|
|
@@ -465,6 +475,7 @@ export declare const OnHomePageResponseWithContentStruct: import("superstruct").
|
|
|
465
475
|
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
466
476
|
name: string;
|
|
467
477
|
value?: string | undefined;
|
|
478
|
+
error?: string | undefined;
|
|
468
479
|
label?: string | undefined;
|
|
469
480
|
inputType?: "number" | "text" | "password" | undefined;
|
|
470
481
|
placeholder?: string | undefined;
|
|
@@ -481,6 +492,7 @@ export declare const OnHomePageResponseWithContentStruct: import("superstruct").
|
|
|
481
492
|
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
482
493
|
name: string;
|
|
483
494
|
value?: string | undefined;
|
|
495
|
+
error?: string | undefined;
|
|
484
496
|
label?: string | undefined;
|
|
485
497
|
inputType?: "number" | "text" | "password" | undefined;
|
|
486
498
|
placeholder?: string | undefined;
|
|
@@ -539,6 +551,7 @@ export declare const OnHomePageResponseStruct: import("superstruct").Struct<{
|
|
|
539
551
|
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
540
552
|
name: string;
|
|
541
553
|
value?: string | undefined;
|
|
554
|
+
error?: string | undefined;
|
|
542
555
|
label?: string | undefined;
|
|
543
556
|
inputType?: "number" | "text" | "password" | undefined;
|
|
544
557
|
placeholder?: string | undefined;
|
|
@@ -555,6 +568,7 @@ export declare const OnHomePageResponseStruct: import("superstruct").Struct<{
|
|
|
555
568
|
type: import("@metamask/snaps-sdk").NodeType.Input;
|
|
556
569
|
name: string;
|
|
557
570
|
value?: string | undefined;
|
|
571
|
+
error?: string | undefined;
|
|
558
572
|
label?: string | undefined;
|
|
559
573
|
inputType?: "number" | "text" | "password" | undefined;
|
|
560
574
|
placeholder?: string | undefined;
|
package/dist/types.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkCMOSYNZRjs = require('./chunk-CMOSYNZR.js');
|
|
14
14
|
require('./chunk-PHUTP7NB.js');
|
|
15
15
|
|
|
16
16
|
|
|
@@ -24,5 +24,5 @@ require('./chunk-PHUTP7NB.js');
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
exports.NameStruct =
|
|
27
|
+
exports.NameStruct = _chunkCMOSYNZRjs.NameStruct; exports.NpmSnapFileNames = _chunkCMOSYNZRjs.NpmSnapFileNames; exports.NpmSnapPackageJsonStruct = _chunkCMOSYNZRjs.NpmSnapPackageJsonStruct; exports.SNAP_STREAM_NAMES = _chunkCMOSYNZRjs.SNAP_STREAM_NAMES; exports.SnapIdPrefixes = _chunkCMOSYNZRjs.SnapIdPrefixes; exports.SnapValidationFailureReason = _chunkCMOSYNZRjs.SnapValidationFailureReason; exports.WALLET_SNAP_PERMISSION_KEY = _chunkCMOSYNZRjs.WALLET_SNAP_PERMISSION_KEY; exports.assertIsNpmSnapPackageJson = _chunkCMOSYNZRjs.assertIsNpmSnapPackageJson; exports.isNpmSnapPackageJson = _chunkCMOSYNZRjs.isNpmSnapPackageJson; exports.isValidUrl = _chunkCMOSYNZRjs.isValidUrl; exports.uri = _chunkCMOSYNZRjs.uri;
|
|
28
28
|
//# sourceMappingURL=types.js.map
|
package/dist/types.mjs
CHANGED
package/dist/ui.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunk772OPTGXjs = require('./chunk-772OPTGX.js');
|
|
6
6
|
require('./chunk-PHUTP7NB.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.getTotalTextLength =
|
|
11
|
+
exports.getTotalTextLength = _chunk772OPTGXjs.getTotalTextLength; exports.validateComponentLinks = _chunk772OPTGXjs.validateComponentLinks; exports.validateTextLinks = _chunk772OPTGXjs.validateTextLinks;
|
|
12
12
|
//# sourceMappingURL=ui.js.map
|
package/dist/ui.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
getTotalTextLength,
|
|
3
3
|
validateComponentLinks,
|
|
4
4
|
validateTextLinks
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-44GPX66J.mjs";
|
|
6
|
+
import "./chunk-JMDSN227.mjs";
|
|
7
7
|
export {
|
|
8
8
|
getTotalTextLength,
|
|
9
9
|
validateComponentLinks,
|
package/dist/validation.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
10
|
-
require('./chunk-
|
|
11
|
-
require('./chunk-
|
|
12
|
-
require('./chunk-
|
|
13
|
-
require('./chunk-
|
|
14
|
-
require('./chunk-
|
|
15
|
-
require('./chunk-
|
|
16
|
-
require('./chunk-
|
|
17
|
-
require('./chunk-
|
|
18
|
-
require('./chunk-
|
|
19
|
-
require('./chunk-
|
|
3
|
+
var _chunkYMUOYQFUjs = require('./chunk-YMUOYQFU.js');
|
|
4
|
+
require('./chunk-ENKAY3PI.js');
|
|
5
|
+
require('./chunk-TG4BDSYJ.js');
|
|
6
|
+
require('./chunk-M3KAAQFK.js');
|
|
7
|
+
require('./chunk-6LOYTBS3.js');
|
|
8
|
+
require('./chunk-CMOSYNZR.js');
|
|
9
|
+
require('./chunk-CQRPSEH3.js');
|
|
10
|
+
require('./chunk-AFQY2CNY.js');
|
|
11
|
+
require('./chunk-ZT3KKTS2.js');
|
|
12
|
+
require('./chunk-HF7HUZ5Z.js');
|
|
13
|
+
require('./chunk-T3YY4JIJ.js');
|
|
14
|
+
require('./chunk-ASZWZ7JT.js');
|
|
15
|
+
require('./chunk-MLOQHUOY.js');
|
|
16
|
+
require('./chunk-473MIETW.js');
|
|
17
|
+
require('./chunk-HJYRGKCX.js');
|
|
18
|
+
require('./chunk-2LBN5T56.js');
|
|
19
|
+
require('./chunk-NUCLSR2G.js');
|
|
20
20
|
require('./chunk-PHUTP7NB.js');
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
exports.validateFetchedSnap =
|
|
23
|
+
exports.validateFetchedSnap = _chunkYMUOYQFUjs.validateFetchedSnap;
|
|
24
24
|
//# sourceMappingURL=validation.js.map
|
package/dist/validation.mjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
validateFetchedSnap
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-LGT3PBPZ.mjs";
|
|
4
|
+
import "./chunk-LCWDLIK5.mjs";
|
|
5
|
+
import "./chunk-2IWSQJKQ.mjs";
|
|
6
|
+
import "./chunk-MNCFAD4E.mjs";
|
|
7
|
+
import "./chunk-EXUEHPZ4.mjs";
|
|
8
|
+
import "./chunk-T6FWIDA6.mjs";
|
|
9
|
+
import "./chunk-DKDGMZFU.mjs";
|
|
10
|
+
import "./chunk-WEOCOYES.mjs";
|
|
11
|
+
import "./chunk-AS5P6JRP.mjs";
|
|
12
|
+
import "./chunk-6CHO3LOX.mjs";
|
|
13
|
+
import "./chunk-P252LKUT.mjs";
|
|
14
|
+
import "./chunk-7LG4D4XA.mjs";
|
|
15
|
+
import "./chunk-HJRCBSNA.mjs";
|
|
16
|
+
import "./chunk-6YRUDGNL.mjs";
|
|
17
|
+
import "./chunk-ZJRWU4AJ.mjs";
|
|
18
|
+
import "./chunk-EA2FOAEG.mjs";
|
|
19
|
+
import "./chunk-Z2JQNSVL.mjs";
|
|
20
|
+
import "./chunk-JMDSN227.mjs";
|
|
21
21
|
export {
|
|
22
22
|
validateFetchedSnap
|
|
23
23
|
};
|
package/dist/versions.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkIPOE62V4js = require('./chunk-IPOE62V4.js');
|
|
6
6
|
require('./chunk-PHUTP7NB.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.DEFAULT_REQUESTED_SNAP_VERSION =
|
|
11
|
+
exports.DEFAULT_REQUESTED_SNAP_VERSION = _chunkIPOE62V4js.DEFAULT_REQUESTED_SNAP_VERSION; exports.getTargetVersion = _chunkIPOE62V4js.getTargetVersion; exports.resolveVersionRange = _chunkIPOE62V4js.resolveVersionRange;
|
|
12
12
|
//# sourceMappingURL=versions.js.map
|
package/dist/versions.mjs
CHANGED
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
DEFAULT_REQUESTED_SNAP_VERSION,
|
|
3
3
|
getTargetVersion,
|
|
4
4
|
resolveVersionRange
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-UMZNVWEM.mjs";
|
|
6
|
+
import "./chunk-JMDSN227.mjs";
|
|
7
7
|
export {
|
|
8
8
|
DEFAULT_REQUESTED_SNAP_VERSION,
|
|
9
9
|
getTargetVersion,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var _chunkHJYRGKCXjs = require('../chunk-HJYRGKCX.js');
|
|
4
|
+
require('../chunk-NUCLSR2G.js');
|
|
5
5
|
require('../chunk-PHUTP7NB.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.VirtualFile =
|
|
8
|
+
exports.VirtualFile = _chunkHJYRGKCXjs.VirtualFile;
|
|
9
9
|
//# sourceMappingURL=VirtualFile.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-T3VM5YXY.js');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../chunk-
|
|
4
|
+
var _chunkHJYRGKCXjs = require('../chunk-HJYRGKCX.js');
|
|
5
|
+
require('../chunk-NUCLSR2G.js');
|
|
6
6
|
require('../chunk-PHUTP7NB.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
exports.VirtualFile =
|
|
9
|
+
exports.VirtualFile = _chunkHJYRGKCXjs.VirtualFile;
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-HYF7Q6VY.mjs";
|
|
2
2
|
import {
|
|
3
3
|
VirtualFile
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-ZJRWU4AJ.mjs";
|
|
5
|
+
import "../chunk-Z2JQNSVL.mjs";
|
|
6
|
+
import "../chunk-JMDSN227.mjs";
|
|
7
7
|
export {
|
|
8
8
|
VirtualFile
|
|
9
9
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-EFRPCO3C.js');
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('../chunk-
|
|
5
|
+
var _chunkQSCKTRRUjs = require('../chunk-QSCKTRRU.js');
|
|
6
|
+
require('../chunk-T3VM5YXY.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
10
|
-
require('../chunk-
|
|
9
|
+
var _chunkHJYRGKCXjs = require('../chunk-HJYRGKCX.js');
|
|
10
|
+
require('../chunk-NUCLSR2G.js');
|
|
11
11
|
require('../chunk-PHUTP7NB.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
exports.VirtualFile =
|
|
16
|
+
exports.VirtualFile = _chunkHJYRGKCXjs.VirtualFile; exports.readVirtualFile = _chunkQSCKTRRUjs.readVirtualFile; exports.writeVirtualFile = _chunkQSCKTRRUjs.writeVirtualFile;
|
|
17
17
|
//# sourceMappingURL=node.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-RAZ7XG4Z.mjs";
|
|
2
2
|
import {
|
|
3
3
|
readVirtualFile,
|
|
4
4
|
writeVirtualFile
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-IGMAXVPP.mjs";
|
|
6
|
+
import "../chunk-HYF7Q6VY.mjs";
|
|
7
7
|
import {
|
|
8
8
|
VirtualFile
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-ZJRWU4AJ.mjs";
|
|
10
|
+
import "../chunk-Z2JQNSVL.mjs";
|
|
11
|
+
import "../chunk-JMDSN227.mjs";
|
|
12
12
|
export {
|
|
13
13
|
VirtualFile,
|
|
14
14
|
readVirtualFile,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../chunk-
|
|
6
|
-
require('../chunk-
|
|
4
|
+
var _chunkQSCKTRRUjs = require('../chunk-QSCKTRRU.js');
|
|
5
|
+
require('../chunk-HJYRGKCX.js');
|
|
6
|
+
require('../chunk-NUCLSR2G.js');
|
|
7
7
|
require('../chunk-PHUTP7NB.js');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.readVirtualFile =
|
|
11
|
+
exports.readVirtualFile = _chunkQSCKTRRUjs.readVirtualFile; exports.writeVirtualFile = _chunkQSCKTRRUjs.writeVirtualFile;
|
|
12
12
|
//# sourceMappingURL=toVirtualFile.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readVirtualFile,
|
|
3
3
|
writeVirtualFile
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-IGMAXVPP.mjs";
|
|
5
|
+
import "../chunk-ZJRWU4AJ.mjs";
|
|
6
|
+
import "../chunk-Z2JQNSVL.mjs";
|
|
7
|
+
import "../chunk-JMDSN227.mjs";
|
|
8
8
|
export {
|
|
9
9
|
readVirtualFile,
|
|
10
10
|
writeVirtualFile
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask/snaps-utils",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/MetaMask/snaps.git"
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@metamask/rpc-errors": "^6.2.1",
|
|
59
59
|
"@metamask/slip44": "^3.1.0",
|
|
60
60
|
"@metamask/snaps-registry": "^3.0.0",
|
|
61
|
-
"@metamask/snaps-sdk": "^3.
|
|
61
|
+
"@metamask/snaps-sdk": "^3.1.0",
|
|
62
62
|
"@metamask/utils": "^8.3.0",
|
|
63
63
|
"@noble/hashes": "^1.3.1",
|
|
64
64
|
"@scure/base": "^1.1.1",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
|
|
77
77
|
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
|
|
78
|
-
"@lavamoat/allow-scripts": "^3.0.
|
|
78
|
+
"@lavamoat/allow-scripts": "^3.0.3",
|
|
79
79
|
"@metamask/auto-changelog": "^3.4.4",
|
|
80
80
|
"@metamask/eslint-config": "^12.1.0",
|
|
81
81
|
"@metamask/eslint-config-jest": "^12.1.0",
|
package/dist/chunk-2XF32FCF.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";//# sourceMappingURL=chunk-2XF32FCF.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../node_modules/tsup/assets/esm_shims.js"],"sourcesContent":["// Shim globals in esm bundle\nimport { fileURLToPath } from 'url'\nimport path from 'path'\n\nconst getFilename = () => fileURLToPath(import.meta.url)\nconst getDirname = () => path.dirname(getFilename())\n\nexport const __dirname = /* @__PURE__ */ getDirname()\nexport const __filename = /* @__PURE__ */ getFilename()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,SAAS,qBAAqB;AAC9B,OAAO,UAAU;AAEjB,IAAM,cAAc,MAAM,cAAc,YAAY,GAAG;AACvD,IAAM,aAAa,MAAM,KAAK,QAAQ,YAAY,CAAC;AAE5C,IAAM,YAA4B,2BAAW;","names":[]}
|
package/dist/chunk-DK3IYVMP.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-DK3IYVMP.mjs.map
|
package/dist/chunk-IIDK6BRC.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-IIDK6BRC.mjs.map
|
package/dist/chunk-JV7OA3FD.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";//# sourceMappingURL=chunk-JV7OA3FD.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/icon.ts"],"names":[],"mappings":";AAAA,SAAS,OAAO,gBAAgB;AAChC,SAAS,cAAc;AAIhB,IAAM,oBAAoB;AAC1B,IAAM,yBAAyB,GAAG,KAAK;AAAA,EAC5C,oBAAoB;AACtB,CAAC;AAOM,SAAS,iBAAiB,MAAmB;AAClD,SAAO,KAAK,KAAK,SAAS,MAAM,GAAG,sCAAsC;AAEzE;AAAA,IACE,OAAO,WAAW,KAAK,OAAO,MAAM,KAAK;AAAA,IACzC,sDAAsD,sBAAsB;AAAA,EAC9E;AAEA,SAAO,MAAM,KAAK,SAAS,CAAC,GAAG,gCAAgC;AACjE;AAQO,SAAS,iBAAiB,KAGxB;AACP,MAAI;AACF,UAAM,SAAS,SAAS,GAAG;AAE3B,UAAM,SAAS,OAAO,UAAU;AAChC,UAAM,QAAQ,OAAO,SAAS;AAE9B,QAAI,UAAU,OAAO;AACnB,aAAO,EAAE,QAAQ,MAAM;AAAA,IACzB;AAEA,UAAM,UAAU,OAAO,WAAW;AAClC,QAAI,SAAS;AAEX,YAAM,CAAC,OAAO,OAAO,cAAc,aAAa,IAAI,QAAQ,MAAM,GAAG;AAErE,UAAI,gBAAgB,eAAe;AACjC,cAAM,cAAc,SAAS,cAAc,EAAE;AAC7C,cAAM,eAAe,SAAS,eAAe,EAAE;AAE/C,eAAO,OAAO,UAAU,WAAW,KAAK,cAAc,CAAC;AACvD,eAAO,OAAO,UAAU,YAAY,KAAK,eAAe,CAAC;AAEzD,eAAO;AAAA,UACL,OAAO;AAAA,UACP,QAAQ;AAAA,QACV;AAAA,MACF;AAAA,IACF;AAAA,EACF,QAAQ;AACN,UAAM,IAAI,MAAM,gCAAgC;AAAA,EAClD;AAEA,SAAO;AACT","sourcesContent":["import { isSvg, parseSvg } from '@metamask/snaps-sdk';\nimport { assert } from '@metamask/utils';\n\nimport type { VirtualFile } from './virtual-file';\n\nexport const SVG_MAX_BYTE_SIZE = 100_000;\nexport const SVG_MAX_BYTE_SIZE_TEXT = `${Math.floor(\n SVG_MAX_BYTE_SIZE / 1000,\n)}kb`;\n\n/**\n * Assert that a virtual file containing a Snap icon is valid.\n *\n * @param icon - A virtual file containing a Snap icon.\n */\nexport function assertIsSnapIcon(icon: VirtualFile) {\n assert(icon.path.endsWith('.svg'), 'Expected snap icon to end in \".svg\".');\n\n assert(\n Buffer.byteLength(icon.value, 'utf8') <= SVG_MAX_BYTE_SIZE,\n `The specified SVG icon exceeds the maximum size of ${SVG_MAX_BYTE_SIZE_TEXT}.`,\n );\n\n assert(isSvg(icon.toString()), 'Snap icon must be a valid SVG.');\n}\n\n/**\n * Extract the dimensions of an image from an SVG string if possible.\n *\n * @param svg - An SVG string.\n * @returns The height and width of the SVG or null.\n */\nexport function getSvgDimensions(svg: string): {\n height: number;\n width: number;\n} | null {\n try {\n const parsed = parseSvg(svg);\n\n const height = parsed['@_height'];\n const width = parsed['@_width'];\n\n if (height && width) {\n return { height, width };\n }\n\n const viewBox = parsed['@_viewBox'];\n if (viewBox) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [_minX, _minY, viewBoxWidth, viewBoxHeight] = viewBox.split(' ');\n\n if (viewBoxWidth && viewBoxHeight) {\n const parsedWidth = parseInt(viewBoxWidth, 10);\n const parsedHeight = parseInt(viewBoxHeight, 10);\n\n assert(Number.isInteger(parsedWidth) && parsedWidth > 0);\n assert(Number.isInteger(parsedHeight) && parsedHeight > 0);\n\n return {\n width: parsedWidth,\n height: parsedHeight,\n };\n }\n }\n } catch {\n throw new Error('Snap icon must be a valid SVG.');\n }\n\n return null;\n}\n"]}
|
package/dist/chunk-LEFOMYX3.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-LEFOMYX3.mjs.map
|
package/dist/chunk-MYSBDK36.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-MYSBDK36.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/post-process.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-shadow\nimport type { Node, Visitor, PluginObj } from '@babel/core';\nimport { transformSync, template } from '@babel/core';\nimport type { Expression, Identifier, TemplateElement } from '@babel/types';\nimport {\n binaryExpression,\n isUnaryExpression,\n isUpdateExpression,\n stringLiteral,\n templateElement,\n templateLiteral,\n} from '@babel/types';\n\n/**\n * Source map declaration taken from `@babel/core`. Babel doesn't export the\n * type for this, so it's copied from the source code instead here.\n */\nexport type SourceMap = {\n version: number;\n sources: string[];\n names: string[];\n sourceRoot?: string | undefined;\n sourcesContent?: string[] | undefined;\n mappings: string;\n file: string;\n};\n\n/**\n * The post process options.\n *\n * @property stripComments - Whether to strip comments. Defaults to `true`.\n * @property sourceMap - Whether to generate a source map for the modified code.\n * See also `inputSourceMap`.\n * @property inputSourceMap - The source map for the input code. When provided,\n * the source map will be used to generate a source map for the modified code.\n * This ensures that the source map is correct for the modified code, and still\n * points to the original source. If not provided, a new source map will be\n * generated instead.\n */\nexport type PostProcessOptions = {\n stripComments?: boolean;\n sourceMap?: boolean | 'inline';\n inputSourceMap?: SourceMap;\n};\n\n/**\n * The post processed bundle output.\n *\n * @property code - The modified code.\n * @property sourceMap - The source map for the modified code, if the source map\n * option was enabled.\n * @property warnings - Any warnings that occurred during the post-processing.\n */\nexport type PostProcessedBundle = {\n code: string;\n sourceMap?: SourceMap | null;\n warnings: PostProcessWarning[];\n};\n\nexport enum PostProcessWarning {\n UnsafeMathRandom = '`Math.random` was detected in the Snap bundle. This is not a secure source of randomness, and should not be used in a secure context. Use `crypto.getRandomValues` instead.',\n}\n\n// The RegEx below consists of multiple groups joined by a boolean OR.\n// Each part consists of two groups which capture a part of each string\n// which needs to be split up, e.g., `<!--` is split into `<!` and `--`.\nconst TOKEN_REGEX = /(<!)(--)|(--)(>)|(import)(\\(.*?\\))/gu;\n\n// An empty template element, i.e., a part of a template literal without any\n// value (\"\").\nconst EMPTY_TEMPLATE_ELEMENT = templateElement({ raw: '', cooked: '' });\n\nconst evalWrapper = template.statement(`\n (1, REF)(ARGS)\n`);\n\nconst objectEvalWrapper = template.statement(`\n (1, OBJECT.REF)\n`);\n\nconst regeneratorRuntimeWrapper = template.statement(`\n var regeneratorRuntime;\n`);\n\n/**\n * Breaks up tokens that would otherwise result in SES errors. The tokens are\n * broken up in a non-destructive way where possible. Currently works with:\n * - HTML comment tags `<!--` and `-->`, broken up into `<!`, `--`, and `--`,\n * `>`.\n * - `import(n)` statements, broken up into `import`, `(n)`.\n *\n * @param value - The string value to break up.\n * @returns The string split into an array, in a way that it can be joined\n * together to form the same string, but with the tokens separated into single\n * array elements.\n */\nfunction breakTokens(value: string): string[] {\n const tokens = value.split(TOKEN_REGEX);\n return (\n tokens\n // TODO: The `split` above results in some values being `undefined`.\n // There may be a better solution to avoid having to filter those out.\n .filter((token) => token !== '' && token !== undefined)\n );\n}\n\n/**\n * Breaks up tokens that would otherwise result in SES errors. The tokens are\n * broken up in a non-destructive way where possible. Currently works with:\n * - HTML comment tags `<!--` and `-->`, broken up into `<!`, `--`, and `--`,\n * `>`.\n * - `import(n)` statements, broken up into `import`, `(n)`.\n *\n * @param value - The string value to break up.\n * @returns The string split into a tuple consisting of the new template\n * elements and string literal expressions.\n */\nfunction breakTokensTemplateLiteral(\n value: string,\n): [TemplateElement[], Expression[]] {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore `matchAll` is not available in ES2017, but this code\n // should only be used in environments where the function is supported.\n const matches: RegExpMatchArray[] = Array.from(value.matchAll(TOKEN_REGEX));\n\n if (matches.length > 0) {\n const output = matches.reduce<[TemplateElement[], Expression[]]>(\n ([elements, expressions], rawMatch, index, values) => {\n const [, first, last] = rawMatch.filter((raw) => raw !== undefined);\n\n // Slice the text in front of the match, which does not need to be\n // broken up.\n const prefix = value.slice(\n index === 0\n ? 0\n : (values[index - 1].index as number) + values[index - 1][0].length,\n rawMatch.index,\n );\n\n return [\n [\n ...elements,\n templateElement({\n raw: getRawTemplateValue(prefix),\n cooked: prefix,\n }),\n EMPTY_TEMPLATE_ELEMENT,\n ],\n [...expressions, stringLiteral(first), stringLiteral(last)],\n ];\n },\n [[], []],\n );\n\n // Add the text after the last match to the output.\n const lastMatch = matches[matches.length - 1];\n const suffix = value.slice(\n (lastMatch.index as number) + lastMatch[0].length,\n );\n\n return [\n [\n ...output[0],\n templateElement({ raw: getRawTemplateValue(suffix), cooked: suffix }),\n ],\n output[1],\n ];\n }\n\n // If there are no matches, simply return the original value.\n return [\n [templateElement({ raw: getRawTemplateValue(value), cooked: value })],\n [],\n ];\n}\n\n/**\n * Get a raw template literal value from a cooked value. This adds a backslash\n * before every '`', '\\' and '${' characters.\n *\n * @see https://github.com/babel/babel/issues/9242#issuecomment-532529613\n * @param value - The cooked string to get the raw string for.\n * @returns The value as raw value.\n */\nfunction getRawTemplateValue(value: string) {\n return value.replace(/\\\\|`|\\$\\{/gu, '\\\\$&');\n}\n\n/**\n * Post process code with AST such that it can be evaluated in SES.\n *\n * Currently:\n * - Makes all direct calls to eval indirect.\n * - Handles certain Babel-related edge cases.\n * - Removes the `Buffer` provided by Browserify.\n * - Optionally removes comments.\n * - Breaks up tokens that would otherwise result in SES errors, such as HTML\n * comment tags `<!--` and `-->` and `import(n)` statements.\n *\n * @param code - The code to post process.\n * @param options - The post-process options.\n * @param options.stripComments - Whether to strip comments. Defaults to `true`.\n * @param options.sourceMap - Whether to generate a source map for the modified\n * code. See also `inputSourceMap`.\n * @param options.inputSourceMap - The source map for the input code. When\n * provided, the source map will be used to generate a source map for the\n * modified code. This ensures that the source map is correct for the modified\n * code, and still points to the original source. If not provided, a new source\n * map will be generated instead.\n * @returns An object containing the modified code, and source map, or null if\n * the provided code is null.\n */\nexport function postProcessBundle(\n code: string,\n {\n stripComments = true,\n sourceMap: sourceMaps,\n inputSourceMap,\n }: Partial<PostProcessOptions> = {},\n): PostProcessedBundle {\n const warnings = new Set<PostProcessWarning>();\n\n const pre: PluginObj['pre'] = ({ ast }) => {\n ast.comments?.forEach((comment) => {\n // Break up tokens that could be parsed as HTML comment terminators. The\n // regular expressions below are written strangely so as to avoid the\n // appearance of such tokens in our source code. For reference:\n // https://github.com/endojs/endo/blob/70cc86eb400655e922413b99c38818d7b2e79da0/packages/ses/error-codes/SES_HTML_COMMENT_REJECTED.md\n comment.value = comment.value\n .replace(new RegExp(`<!${'--'}`, 'gu'), '< !--')\n .replace(new RegExp(`${'--'}>`, 'gu'), '-- >')\n .replace(/import(\\(.*\\))/gu, 'import\\\\$1');\n });\n };\n\n const visitor: Visitor<Node> = {\n FunctionExpression(path) {\n const { node } = path;\n\n // Browserify provides the `Buffer` global as an argument to modules that\n // use it, but this does not work in SES. Since we pass in `Buffer` as an\n // endowment, we can simply remove the argument.\n //\n // Note that this only removes `Buffer` from a wrapped function\n // expression, e.g., `(function (Buffer) { ... })`. Regular functions\n // are not affected.\n //\n // TODO: Since we're working on the AST level, we could check the scope\n // of the function expression, and possibly prevent false positives?\n if (node.type === 'FunctionExpression' && node.extra?.parenthesized) {\n node.params = node.params.filter(\n (param) => !(param.type === 'Identifier' && param.name === 'Buffer'),\n );\n }\n },\n\n CallExpression(path) {\n const { node } = path;\n\n // Replace `eval(foo)` with `(1, eval)(foo)`.\n if (node.callee.type === 'Identifier' && node.callee.name === 'eval') {\n path.replaceWith(\n evalWrapper({\n REF: node.callee,\n ARGS: node.arguments,\n }),\n );\n }\n\n // Detect the use of `Math.random()` and add a warning.\n if (\n node.callee.type === 'MemberExpression' &&\n node.callee.object.type === 'Identifier' &&\n node.callee.object.name === 'Math' &&\n node.callee.property.type === 'Identifier' &&\n node.callee.property.name === 'random'\n ) {\n warnings.add(PostProcessWarning.UnsafeMathRandom);\n }\n },\n\n MemberExpression(path) {\n const { node } = path;\n\n // Replace `object.eval(foo)` with `(1, object.eval)(foo)`.\n if (\n node.property.type === 'Identifier' &&\n node.property.name === 'eval' &&\n // We only apply this to MemberExpressions that are the callee of CallExpression\n path.parent.type === 'CallExpression' &&\n path.parent.callee === node\n ) {\n path.replaceWith(\n objectEvalWrapper({\n OBJECT: node.object,\n REF: node.property,\n }),\n );\n }\n },\n\n Identifier(path) {\n const { node } = path;\n\n // Insert `regeneratorRuntime` global if it's used in the code.\n if (node.name === 'regeneratorRuntime') {\n const program = path.findParent(\n (parent) => parent.node.type === 'Program',\n );\n\n // We know that `program` is a Program node here, but this keeps\n // TypeScript happy.\n if (program?.node.type === 'Program') {\n const body = program.node.body[0];\n\n // This stops it from inserting `regeneratorRuntime` multiple times.\n if (\n body.type === 'VariableDeclaration' &&\n (body.declarations[0].id as Identifier).name ===\n 'regeneratorRuntime'\n ) {\n return;\n }\n\n program?.node.body.unshift(regeneratorRuntimeWrapper());\n }\n }\n },\n\n TemplateLiteral(path) {\n const { node } = path;\n\n // This checks if the template literal was visited before. Without this,\n // it would cause an infinite loop resulting in a stack overflow. We can't\n // skip the path here, because we need to visit the children of the node.\n if (path.getData('visited')) {\n return;\n }\n\n // Break up tokens that could be parsed as HTML comment terminators, or\n // `import()` statements.\n // For reference:\n // - https://github.com/endojs/endo/blob/70cc86eb400655e922413b99c38818d7b2e79da0/packages/ses/error-codes/SES_HTML_COMMENT_REJECTED.md\n // - https://github.com/MetaMask/snaps-monorepo/issues/505\n const [replacementQuasis, replacementExpressions] = node.quasis.reduce<\n [TemplateElement[], Expression[]]\n >(\n ([elements, expressions], quasi, index) => {\n // Note: Template literals have two variants, \"cooked\" and \"raw\". Here\n // we use the cooked version.\n // https://exploringjs.com/impatient-js/ch_template-literals.html#template-strings-cooked-vs-raw\n const tokens = breakTokensTemplateLiteral(\n quasi.value.cooked as string,\n );\n\n // Only update the node if something changed.\n if (tokens[0].length <= 1) {\n return [\n [...elements, quasi],\n [...expressions, node.expressions[index] as Expression],\n ];\n }\n\n return [\n [...elements, ...tokens[0]],\n [\n ...expressions,\n ...tokens[1],\n node.expressions[index] as Expression,\n ],\n ];\n },\n [[], []],\n );\n\n path.replaceWith(\n templateLiteral(\n replacementQuasis,\n replacementExpressions.filter(\n (expression) => expression !== undefined,\n ),\n ) as Node,\n );\n\n path.setData('visited', true);\n },\n\n StringLiteral(path) {\n const { node } = path;\n\n // Break up tokens that could be parsed as HTML comment terminators, or\n // `import()` statements.\n // For reference:\n // - https://github.com/endojs/endo/blob/70cc86eb400655e922413b99c38818d7b2e79da0/packages/ses/error-codes/SES_HTML_COMMENT_REJECTED.md\n // - https://github.com/MetaMask/snaps-monorepo/issues/505\n const tokens = breakTokens(node.value);\n\n // Only update the node if the string literal was broken up.\n if (tokens.length <= 1) {\n return;\n }\n\n const replacement = tokens\n .slice(1)\n .reduce<Expression>(\n (acc, value) => binaryExpression('+', acc, stringLiteral(value)),\n stringLiteral(tokens[0]),\n );\n\n path.replaceWith(replacement as Node);\n path.skip();\n },\n\n BinaryExpression(path) {\n const { node } = path;\n\n const errorMessage =\n 'Using HTML comments (`<!--` and `-->`) as operators is not allowed. The behaviour of ' +\n 'these comments is ambiguous, and differs per browser and environment. If you want ' +\n 'to use them as operators, break them up into separate characters, i.e., `a-- > b` ' +\n 'and `a < ! --b`.';\n\n if (\n node.operator === '<' &&\n isUnaryExpression(node.right) &&\n isUpdateExpression(node.right.argument) &&\n node.right.argument.operator === '--' &&\n node.left.end &&\n node.right.argument.argument.start\n ) {\n const expression = code.slice(\n node.left.end,\n node.right.argument.argument.start,\n );\n\n if (expression.includes('<!--')) {\n throw new Error(errorMessage);\n }\n }\n\n if (\n node.operator === '>' &&\n isUpdateExpression(node.left) &&\n node.left.operator === '--' &&\n node.left.argument.end &&\n node.right.start\n ) {\n const expression = code.slice(node.left.argument.end, node.right.start);\n\n if (expression.includes('-->')) {\n throw new Error(errorMessage);\n }\n }\n },\n };\n\n try {\n const file = transformSync(code, {\n // Prevent Babel from searching for a config file.\n configFile: false,\n\n parserOpts: {\n // Strict mode isn't enabled by default, so we need to enable it here.\n strictMode: true,\n\n // If this is disabled, the AST does not include any comments. This is\n // useful for performance reasons, and we use it for stripping comments.\n attachComment: !stripComments,\n },\n\n // By default, Babel optimises bundles that exceed 500 KB, but that\n // results in characters which look like HTML comments, which breaks SES.\n compact: false,\n\n // This configures Babel to generate a new source map from the existing\n // source map if specified. If `sourceMap` is `true` but an input source\n // map is not provided, a new source map will be generated instead.\n inputSourceMap,\n sourceMaps,\n\n plugins: [\n () => ({\n pre,\n visitor,\n }),\n ],\n });\n\n if (!file?.code) {\n throw new Error('Bundled code is empty.');\n }\n\n return {\n code: file.code,\n sourceMap: file.map,\n warnings: Array.from(warnings),\n };\n } catch (error) {\n throw new Error(`Failed to post process code:\\n${error.message}`);\n }\n}\n"],"mappings":";AAEA,SAAS,eAAe,gBAAgB;AAExC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAgDA,IAAK,qBAAL,kBAAKA,wBAAL;AACL,EAAAA,oBAAA,sBAAmB;AADT,SAAAA;AAAA,GAAA;AAOZ,IAAM,cAAc;AAIpB,IAAM,yBAAyB,gBAAgB,EAAE,KAAK,IAAI,QAAQ,GAAG,CAAC;AAEtE,IAAM,cAAc,SAAS,UAAU;AAAA;AAAA,CAEtC;AAED,IAAM,oBAAoB,SAAS,UAAU;AAAA;AAAA,CAE5C;AAED,IAAM,4BAA4B,SAAS,UAAU;AAAA;AAAA,CAEpD;AAcD,SAAS,YAAY,OAAyB;AAC5C,QAAM,SAAS,MAAM,MAAM,WAAW;AACtC,SACE,OAGG,OAAO,CAAC,UAAU,UAAU,MAAM,UAAU,MAAS;AAE5D;AAaA,SAAS,2BACP,OACmC;AAInC,QAAM,UAA8B,MAAM,KAAK,MAAM,SAAS,WAAW,CAAC;AAE1E,MAAI,QAAQ,SAAS,GAAG;AACtB,UAAM,SAAS,QAAQ;AAAA,MACrB,CAAC,CAAC,UAAU,WAAW,GAAG,UAAU,OAAO,WAAW;AACpD,cAAM,C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eAAe,CAAC;AAAA,MAClB;AAAA;AAAA;AAAA,MAIA,SAAS;AAAA;AAAA;AAAA;AAAA,MAKT;AAAA,MACA;AAAA,MAEA,SAAS;AAAA,QACP,OAAO;AAAA,UACL;AAAA,UACA;AAAA,QACF;AAAA,MACF;AAAA,IACF,CAAC;AAED,QAAI,CAAC,MAAM,MAAM;AACf,YAAM,IAAI,MAAM,wBAAwB;AAAA,IAC1C;AAEA,WAAO;AAAA,MACL,MAAM,KAAK;AAAA,MACX,WAAW,KAAK;AAAA,MAChB,UAAU,MAAM,KAAK,QAAQ;AAAA,IAC/B;AAAA,EACF,SAAS,OAAO;AACd,UAAM,IAAI,MAAM;AAAA,EAAiC,MAAM,OAAO,EAAE;AAAA,EAClE;AACF;","names":["PostProcessWarning"]}
|
package/dist/chunk-O4PW77JW.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
//# sourceMappingURL=chunk-O4PW77JW.mjs.map
|
package/dist/chunk-Q5T57UNN.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";//# sourceMappingURL=chunk-Q5T57UNN.js.map
|
package/dist/chunk-QJTAFTW7.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunkOQSLMZJNjs = require('./chunk-OQSLMZJN.js');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunkH636DAOGjs = require('./chunk-H636DAOG.js');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _chunkKEXZDQANjs = require('./chunk-KEXZDQAN.js');
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _chunkRS5HE55Ujs = require('./chunk-RS5HE55U.js');
|
|
13
|
-
|
|
14
|
-
// src/validation.ts
|
|
15
|
-
async function validateFetchedSnap(files) {
|
|
16
|
-
_chunkOQSLMZJNjs.assertIsSnapManifest.call(void 0, files.manifest.result);
|
|
17
|
-
await _chunkH636DAOGjs.validateSnapShasum.call(void 0, files);
|
|
18
|
-
_chunkRS5HE55Ujs.validateSnapManifestLocalizations.call(void 0,
|
|
19
|
-
files.manifest.result,
|
|
20
|
-
files.localizationFiles.map((file) => file.result)
|
|
21
|
-
);
|
|
22
|
-
if (files.svgIcon) {
|
|
23
|
-
_chunkKEXZDQANjs.assertIsSnapIcon.call(void 0, files.svgIcon);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
exports.validateFetchedSnap = validateFetchedSnap;
|
|
30
|
-
//# sourceMappingURL=chunk-QJTAFTW7.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/eval.ts"],"sourcesContent":["import { assert } from '@metamask/utils';\nimport { fork } from 'child_process';\nimport { join } from 'path';\n\nimport { validateFilePath } from './fs';\n\nexport type EvalOutput = {\n stdout: string;\n stderr: string;\n};\n\nexport class SnapEvalError extends Error {\n readonly output: EvalOutput;\n\n constructor(message: string, output: EvalOutput) {\n super(message);\n\n this.name = 'SnapEvalError';\n this.output = output;\n }\n}\n\n/**\n * Spawn a new process to run the provided bundle in.\n *\n * @param bundlePath - The path to the bundle to run.\n * @returns `null` if the worker ran successfully.\n * @throws If the worker failed to run successfully.\n */\nexport async function evalBundle(bundlePath: string): Promise<EvalOutput> {\n await validateFilePath(bundlePath);\n\n return new Promise((resolve, reject) => {\n const worker = fork(join(__dirname, 'eval-worker.js'), [bundlePath], {\n // To avoid printing the output of the worker to the console, we set\n // `stdio` to `pipe` and handle the output ourselves.\n stdio: 'pipe',\n });\n\n let stdout = '';\n let stderr = '';\n\n assert(worker.stdout, '`stdout` should be defined.');\n assert(worker.stderr, '`stderr` should be defined.');\n\n worker.stdout.on('data', (data: Buffer) => {\n stdout += data.toString();\n });\n\n worker.stderr.on('data', (data: Buffer) => {\n stderr += data.toString();\n });\n\n worker.on('exit', (exitCode: number) => {\n const output = {\n stdout,\n stderr,\n };\n\n if (exitCode === 0) {\n return resolve(output);\n }\n\n return reject(\n new SnapEvalError(\n `Process exited with non-zero exit code: ${exitCode}.`,\n output,\n ),\n );\n });\n });\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,cAAc;AACvB,SAAS,YAAY;AACrB,SAAS,YAAY;AASd,IAAM,gBAAN,cAA4B,MAAM;AAAA,EAGvC,YAAY,SAAiB,QAAoB;AAC/C,UAAM,OAAO;AAEb,SAAK,OAAO;AACZ,SAAK,SAAS;AAAA,EAChB;AACF;AASA,eAAsB,WAAW,YAAyC;AACxE,QAAM,iBAAiB,UAAU;AAEjC,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,UAAM,SAAS,KAAK,KAAK,WAAW,gBAAgB,GAAG,CAAC,UAAU,GAAG;AAAA;AAAA;AAAA,MAGnE,OAAO;AAAA,IACT,CAAC;AAED,QAAI,SAAS;AACb,QAAI,SAAS;AAEb,WAAO,OAAO,QAAQ,6BAA6B;AACnD,WAAO,OAAO,QAAQ,6BAA6B;AAEnD,WAAO,OAAO,GAAG,QAAQ,CAAC,SAAiB;AACzC,gBAAU,KAAK,SAAS;AAAA,IAC1B,CAAC;AAED,WAAO,OAAO,GAAG,QAAQ,CAAC,SAAiB;AACzC,gBAAU,KAAK,SAAS;AAAA,IAC1B,CAAC;AAED,WAAO,GAAG,QAAQ,CAAC,aAAqB;AACtC,YAAM,SAAS;AAAA,QACb;AAAA,QACA;AAAA,MACF;AAEA,UAAI,aAAa,GAAG;AAClB,eAAO,QAAQ,MAAM;AAAA,MACvB;AAEA,aAAO;AAAA,QACL,IAAI;AAAA,UACF,2CAA2C,QAAQ;AAAA,UACnD;AAAA,QACF;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/icon.ts"],"sourcesContent":["import { isSvg, parseSvg } from '@metamask/snaps-sdk';\nimport { assert } from '@metamask/utils';\n\nimport type { VirtualFile } from './virtual-file';\n\nexport const SVG_MAX_BYTE_SIZE = 100_000;\nexport const SVG_MAX_BYTE_SIZE_TEXT = `${Math.floor(\n SVG_MAX_BYTE_SIZE / 1000,\n)}kb`;\n\n/**\n * Assert that a virtual file containing a Snap icon is valid.\n *\n * @param icon - A virtual file containing a Snap icon.\n */\nexport function assertIsSnapIcon(icon: VirtualFile) {\n assert(icon.path.endsWith('.svg'), 'Expected snap icon to end in \".svg\".');\n\n assert(\n Buffer.byteLength(icon.value, 'utf8') <= SVG_MAX_BYTE_SIZE,\n `The specified SVG icon exceeds the maximum size of ${SVG_MAX_BYTE_SIZE_TEXT}.`,\n );\n\n assert(isSvg(icon.toString()), 'Snap icon must be a valid SVG.');\n}\n\n/**\n * Extract the dimensions of an image from an SVG string if possible.\n *\n * @param svg - An SVG string.\n * @returns The height and width of the SVG or null.\n */\nexport function getSvgDimensions(svg: string): {\n height: number;\n width: number;\n} | null {\n try {\n const parsed = parseSvg(svg);\n\n const height = parsed['@_height'];\n const width = parsed['@_width'];\n\n if (height && width) {\n return { height, width };\n }\n\n const viewBox = parsed['@_viewBox'];\n if (viewBox) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [_minX, _minY, viewBoxWidth, viewBoxHeight] = viewBox.split(' ');\n\n if (viewBoxWidth && viewBoxHeight) {\n const parsedWidth = parseInt(viewBoxWidth, 10);\n const parsedHeight = parseInt(viewBoxHeight, 10);\n\n assert(Number.isInteger(parsedWidth) && parsedWidth > 0);\n assert(Number.isInteger(parsedHeight) && parsedHeight > 0);\n\n return {\n width: parsedWidth,\n height: parsedHeight,\n };\n }\n }\n } catch {\n throw new Error('Snap icon must be a valid SVG.');\n }\n\n return null;\n}\n"],"mappings":";AAAA,SAAS,OAAO,gBAAgB;AAChC,SAAS,cAAc;AAIhB,IAAM,oBAAoB;AAC1B,IAAM,yBAAyB,GAAG,KAAK;AAAA,EAC5C,oBAAoB;AACtB,CAAC;AAOM,SAAS,iBAAiB,MAAmB;AAClD,SAAO,KAAK,KAAK,SAAS,MAAM,GAAG,sCAAsC;AAEzE;AAAA,IACE,OAAO,WAAW,KAAK,OAAO,MAAM,KAAK;AAAA,IACzC,sDAAsD,sBAAsB;AAAA,EAC9E;AAEA,SAAO,MAAM,KAAK,SAAS,CAAC,GAAG,gCAAgC;AACjE;AAQO,SAAS,iBAAiB,KAGxB;AACP,MAAI;AACF,UAAM,SAAS,SAAS,GAAG;AAE3B,UAAM,SAAS,OAAO,UAAU;AAChC,UAAM,QAAQ,OAAO,SAAS;AAE9B,QAAI,UAAU,OAAO;AACnB,aAAO,EAAE,QAAQ,MAAM;AAAA,IACzB;AAEA,UAAM,UAAU,OAAO,WAAW;AAClC,QAAI,SAAS;AAEX,YAAM,CAAC,OAAO,OAAO,cAAc,aAAa,IAAI,QAAQ,MAAM,GAAG;AAErE,UAAI,gBAAgB,eAAe;AACjC,cAAM,cAAc,SAAS,cAAc,EAAE;AAC7C,cAAM,eAAe,SAAS,eAAe,EAAE;AAE/C,eAAO,OAAO,UAAU,WAAW,KAAK,cAAc,CAAC;AACvD,eAAO,OAAO,UAAU,YAAY,KAAK,eAAe,CAAC;AAEzD,eAAO;AAAA,UACL,OAAO;AAAA,UACP,QAAQ;AAAA,QACV;AAAA,MACF;AAAA,IACF;AAAA,EACF,QAAQ;AACN,UAAM,IAAI,MAAM,gCAAgC;AAAA,EAClD;AAEA,SAAO;AACT;","names":[]}
|