@metamask/snaps-jest 5.0.0 → 6.0.0
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 +10 -1
- package/dist/chunk-2KLZ7GOW.js +15 -0
- package/dist/chunk-2KLZ7GOW.js.map +1 -0
- package/dist/chunk-2M7WQ26F.js +28 -0
- package/dist/chunk-2M7WQ26F.js.map +1 -0
- package/dist/chunk-34GS3AHA.js +33 -0
- package/dist/chunk-34GS3AHA.js.map +1 -0
- package/dist/chunk-3CC2NI7R.js +80 -0
- package/dist/chunk-3CC2NI7R.js.map +1 -0
- package/dist/chunk-3IUQA6YL.mjs +1 -0
- package/dist/chunk-3IUQA6YL.mjs.map +1 -0
- package/dist/chunk-3KCEPGJA.js +39 -0
- package/dist/chunk-3KCEPGJA.js.map +1 -0
- package/dist/chunk-3KQYPQZY.js +20 -0
- package/dist/chunk-3KQYPQZY.js.map +1 -0
- package/dist/chunk-3O5OISLU.js +16 -0
- package/dist/chunk-3O5OISLU.js.map +1 -0
- package/dist/chunk-3ZW2EE3B.js +1 -0
- package/dist/chunk-3ZW2EE3B.js.map +1 -0
- package/dist/chunk-4FCRZDOX.js +134 -0
- package/dist/chunk-4FCRZDOX.js.map +1 -0
- package/dist/chunk-4HY4SM3A.js +1 -0
- package/dist/chunk-4HY4SM3A.js.map +1 -0
- package/dist/chunk-4JUUFDTC.js +104 -0
- package/dist/chunk-4JUUFDTC.js.map +1 -0
- package/dist/chunk-4VCE3DRR.mjs +34 -0
- package/dist/chunk-4VCE3DRR.mjs.map +1 -0
- package/dist/chunk-4WCFXE73.js +48 -0
- package/dist/chunk-4WCFXE73.js.map +1 -0
- package/dist/chunk-5IUHGC5S.js +153 -0
- package/dist/chunk-5IUHGC5S.js.map +1 -0
- package/dist/chunk-5O6VBW42.js +42 -0
- package/dist/chunk-5O6VBW42.js.map +1 -0
- package/dist/chunk-6IMEYERE.js +137 -0
- package/dist/chunk-6IMEYERE.js.map +1 -0
- package/dist/chunk-6KNT4UMX.mjs +35 -0
- package/dist/chunk-6KNT4UMX.mjs.map +1 -0
- package/dist/chunk-6RDNSELT.mjs +39 -0
- package/dist/chunk-6RDNSELT.mjs.map +1 -0
- package/dist/chunk-72YN2D26.mjs +60 -0
- package/dist/chunk-72YN2D26.mjs.map +1 -0
- package/dist/chunk-7JLVQJK7.js +14 -0
- package/dist/chunk-7JLVQJK7.js.map +1 -0
- package/dist/chunk-AH7YNG6N.js +22 -0
- package/dist/chunk-AH7YNG6N.js.map +1 -0
- package/dist/chunk-AIZADBRK.mjs +36 -0
- package/dist/chunk-AIZADBRK.mjs.map +1 -0
- package/dist/chunk-AKFRQ5EJ.mjs +42 -0
- package/dist/chunk-AKFRQ5EJ.mjs.map +1 -0
- package/dist/chunk-AUB7XPDH.mjs +28 -0
- package/dist/chunk-AUB7XPDH.mjs.map +1 -0
- package/dist/chunk-BJMTD7H2.mjs +20 -0
- package/dist/chunk-BJMTD7H2.mjs.map +1 -0
- package/dist/chunk-BN5VBVT3.mjs +233 -0
- package/dist/chunk-BN5VBVT3.mjs.map +1 -0
- package/dist/chunk-CKOGTHM4.mjs +22 -0
- package/dist/chunk-CKOGTHM4.mjs.map +1 -0
- package/dist/chunk-CZQKOZLR.js +11 -0
- package/dist/chunk-CZQKOZLR.js.map +1 -0
- package/dist/chunk-D36QBJ35.js +24 -0
- package/dist/{cjs/internals/simulation/methods/hooks/show-dialog.js.map → chunk-D36QBJ35.js.map} +1 -1
- package/dist/chunk-DEFFA5IJ.mjs +24 -0
- package/dist/chunk-DEFFA5IJ.mjs.map +1 -0
- package/dist/chunk-EFB6AQPB.js +36 -0
- package/dist/chunk-EFB6AQPB.js.map +1 -0
- package/dist/chunk-EOCDSPT7.mjs +97 -0
- package/dist/chunk-EOCDSPT7.mjs.map +1 -0
- package/dist/chunk-FPFX5AKR.mjs +36 -0
- package/dist/chunk-FPFX5AKR.mjs.map +1 -0
- package/dist/chunk-HBT34TJ2.mjs +1 -0
- package/dist/chunk-HBT34TJ2.mjs.map +1 -0
- package/dist/chunk-HBVDXIVN.mjs +80 -0
- package/dist/chunk-HBVDXIVN.mjs.map +1 -0
- package/dist/chunk-HMF2CKYT.mjs +39 -0
- package/dist/chunk-HMF2CKYT.mjs.map +1 -0
- package/dist/chunk-HP56MLQ3.js +1 -0
- package/dist/chunk-HP56MLQ3.js.map +1 -0
- package/dist/chunk-I5LVU57H.mjs +69 -0
- package/dist/chunk-I5LVU57H.mjs.map +1 -0
- package/dist/chunk-I7FLOZU7.mjs +1 -0
- package/dist/chunk-I7FLOZU7.mjs.map +1 -0
- package/dist/chunk-J2ID3DS7.mjs +33 -0
- package/dist/chunk-J2ID3DS7.mjs.map +1 -0
- package/dist/chunk-JA7RJLI7.js +34 -0
- package/dist/chunk-JA7RJLI7.js.map +1 -0
- package/dist/chunk-JB2H2XEL.mjs +1 -0
- package/dist/chunk-JB2H2XEL.mjs.map +1 -0
- package/dist/chunk-JDN3VGMO.js +21 -0
- package/dist/chunk-JDN3VGMO.js.map +1 -0
- package/dist/chunk-JGQJFYU4.js +57 -0
- package/dist/chunk-JGQJFYU4.js.map +1 -0
- package/dist/chunk-JJCX335U.mjs +91 -0
- package/dist/chunk-JJCX335U.mjs.map +1 -0
- package/dist/chunk-JMDSN227.mjs +25 -0
- package/dist/chunk-JMDSN227.mjs.map +1 -0
- package/dist/chunk-JXOKRTEH.mjs +11 -0
- package/dist/chunk-JXOKRTEH.mjs.map +1 -0
- package/dist/chunk-JZJWUVD7.mjs +1 -0
- package/dist/chunk-JZJWUVD7.mjs.map +1 -0
- package/dist/chunk-K2KTKFLP.js +76 -0
- package/dist/chunk-K2KTKFLP.js.map +1 -0
- package/dist/chunk-KGIWSGTT.js +91 -0
- package/dist/chunk-KGIWSGTT.js.map +1 -0
- package/dist/chunk-KPXLJ6RH.js +60 -0
- package/dist/chunk-KPXLJ6RH.js.map +1 -0
- package/dist/chunk-LD5PSHHT.mjs +57 -0
- package/dist/chunk-LD5PSHHT.mjs.map +1 -0
- package/dist/chunk-LNNKGOHQ.mjs +16 -0
- package/dist/chunk-LNNKGOHQ.mjs.map +1 -0
- package/dist/chunk-MNDF32ZV.js +8 -0
- package/dist/chunk-MNDF32ZV.js.map +1 -0
- package/dist/chunk-MSQ7Q2VJ.mjs +13 -0
- package/dist/chunk-MSQ7Q2VJ.mjs.map +1 -0
- package/dist/chunk-O3VJYBFN.mjs +15 -0
- package/dist/chunk-O3VJYBFN.mjs.map +1 -0
- package/dist/chunk-O4MJRHZD.js +69 -0
- package/dist/chunk-O4MJRHZD.js.map +1 -0
- package/dist/chunk-OC64PNDU.mjs +21 -0
- package/dist/chunk-OC64PNDU.mjs.map +1 -0
- package/dist/chunk-ON6M4WG5.js +36 -0
- package/dist/chunk-ON6M4WG5.js.map +1 -0
- package/dist/chunk-P7JA42ZC.mjs +153 -0
- package/dist/chunk-P7JA42ZC.mjs.map +1 -0
- package/dist/chunk-PHUTP7NB.js +25 -0
- package/dist/chunk-PHUTP7NB.js.map +1 -0
- package/dist/chunk-QFPRGU5L.mjs +104 -0
- package/dist/chunk-QFPRGU5L.mjs.map +1 -0
- package/dist/chunk-QMHWGASM.js +1 -0
- package/dist/chunk-QMHWGASM.js.map +1 -0
- package/dist/chunk-QNDLJ2W7.js +1 -0
- package/dist/chunk-QNDLJ2W7.js.map +1 -0
- package/dist/chunk-QUUILTDY.mjs +137 -0
- package/dist/chunk-QUUILTDY.mjs.map +1 -0
- package/dist/chunk-R7ORBTUD.js +1 -0
- package/dist/chunk-R7ORBTUD.js.map +1 -0
- package/dist/chunk-RQBZLDXL.js +233 -0
- package/dist/chunk-RQBZLDXL.js.map +1 -0
- package/dist/chunk-S3DHQTXB.js +1 -0
- package/dist/chunk-S3DHQTXB.js.map +1 -0
- package/dist/chunk-SWSSV3LK.js +35 -0
- package/dist/chunk-SWSSV3LK.js.map +1 -0
- package/dist/chunk-T4TRX3ZR.js +22 -0
- package/dist/chunk-T4TRX3ZR.js.map +1 -0
- package/dist/chunk-UXHKMILA.mjs +1 -0
- package/dist/chunk-UXHKMILA.mjs.map +1 -0
- package/dist/chunk-VCXM6FKU.mjs +1 -0
- package/dist/chunk-VCXM6FKU.mjs.map +1 -0
- package/dist/chunk-VHTVUQWR.mjs +14 -0
- package/dist/chunk-VHTVUQWR.mjs.map +1 -0
- package/dist/chunk-VNQIROKZ.js +97 -0
- package/dist/chunk-VNQIROKZ.js.map +1 -0
- package/dist/chunk-VXQOXWRO.mjs +48 -0
- package/dist/chunk-VXQOXWRO.mjs.map +1 -0
- package/dist/chunk-VYKYQSUI.mjs +22 -0
- package/dist/chunk-VYKYQSUI.mjs.map +1 -0
- package/dist/chunk-WEI35OIM.mjs +8 -0
- package/dist/chunk-WEI35OIM.mjs.map +1 -0
- package/dist/chunk-WL2GRM5E.mjs +76 -0
- package/dist/chunk-WL2GRM5E.mjs.map +1 -0
- package/dist/chunk-XDZPH5WD.js +39 -0
- package/dist/chunk-XDZPH5WD.js.map +1 -0
- package/dist/chunk-Y5NWZU43.js +13 -0
- package/dist/chunk-Y5NWZU43.js.map +1 -0
- package/dist/chunk-YZFWCFMG.js +1 -0
- package/dist/chunk-YZFWCFMG.js.map +1 -0
- package/dist/chunk-ZCE26WZM.mjs +1 -0
- package/dist/chunk-ZCE26WZM.mjs.map +1 -0
- package/dist/chunk-ZZPKZRJQ.mjs +134 -0
- package/dist/chunk-ZZPKZRJQ.mjs.map +1 -0
- package/dist/environment.js +47 -0
- package/dist/environment.js.map +1 -0
- package/dist/environment.mjs +47 -0
- package/dist/environment.mjs.map +1 -0
- package/dist/helpers.js +44 -0
- package/dist/helpers.js.map +1 -0
- package/dist/helpers.mjs +44 -0
- package/dist/helpers.mjs.map +1 -0
- package/dist/index.js +54 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +54 -0
- package/dist/index.mjs.map +1 -0
- package/dist/internals/environment.js +8 -0
- package/dist/internals/environment.js.map +1 -0
- package/dist/internals/environment.mjs +8 -0
- package/dist/internals/environment.mjs.map +1 -0
- package/dist/internals/index.js +123 -0
- package/dist/internals/index.js.map +1 -0
- package/dist/internals/index.mjs +123 -0
- package/dist/internals/index.mjs.map +1 -0
- package/dist/internals/logger.js +8 -0
- package/dist/internals/logger.js.map +1 -0
- package/dist/internals/logger.mjs +8 -0
- package/dist/internals/logger.mjs.map +1 -0
- package/dist/internals/request.js +40 -0
- package/dist/internals/request.js.map +1 -0
- package/dist/internals/request.mjs +40 -0
- package/dist/internals/request.mjs.map +1 -0
- package/dist/internals/server.js +9 -0
- package/dist/internals/server.js.map +1 -0
- package/dist/internals/server.mjs +9 -0
- package/dist/internals/server.mjs.map +1 -0
- package/dist/internals/simulation/constants.js +12 -0
- package/dist/internals/simulation/constants.js.map +1 -0
- package/dist/internals/simulation/constants.mjs +12 -0
- package/dist/internals/simulation/constants.mjs.map +1 -0
- package/dist/internals/simulation/controllers.js +26 -0
- package/dist/internals/simulation/controllers.js.map +1 -0
- package/dist/internals/simulation/controllers.mjs +26 -0
- package/dist/internals/simulation/controllers.mjs.map +1 -0
- package/dist/internals/simulation/files.js +8 -0
- package/dist/internals/simulation/files.js.map +1 -0
- package/dist/internals/simulation/files.mjs +8 -0
- package/dist/internals/simulation/files.mjs.map +1 -0
- package/dist/internals/simulation/index.js +90 -0
- package/dist/internals/simulation/index.js.map +1 -0
- package/dist/internals/simulation/index.mjs +90 -0
- package/dist/internals/simulation/index.mjs.map +1 -0
- package/dist/internals/simulation/interface.js +16 -0
- package/dist/internals/simulation/interface.js.map +1 -0
- package/dist/internals/simulation/interface.mjs +16 -0
- package/dist/internals/simulation/interface.mjs.map +1 -0
- package/dist/internals/simulation/methods/constants.js +12 -0
- package/dist/internals/simulation/methods/constants.js.map +1 -0
- package/dist/internals/simulation/methods/constants.mjs +12 -0
- package/dist/internals/simulation/methods/constants.mjs.map +1 -0
- package/dist/internals/simulation/methods/hooks/encryption.js +10 -0
- package/dist/internals/simulation/methods/hooks/encryption.js.map +1 -0
- package/dist/internals/simulation/methods/hooks/encryption.mjs +10 -0
- package/dist/internals/simulation/methods/hooks/encryption.mjs.map +1 -0
- package/dist/internals/simulation/methods/hooks/get-locale.js +8 -0
- package/dist/internals/simulation/methods/hooks/get-locale.js.map +1 -0
- package/dist/internals/simulation/methods/hooks/get-locale.mjs +8 -0
- package/dist/internals/simulation/methods/hooks/get-locale.mjs.map +1 -0
- package/dist/internals/simulation/methods/hooks/index.js +45 -0
- package/dist/internals/simulation/methods/hooks/index.js.map +1 -0
- package/dist/internals/simulation/methods/hooks/index.mjs +45 -0
- package/dist/internals/simulation/methods/hooks/index.mjs.map +1 -0
- package/dist/internals/simulation/methods/hooks/interface.js +10 -0
- package/dist/internals/simulation/methods/hooks/interface.js.map +1 -0
- package/dist/internals/simulation/methods/hooks/interface.mjs +10 -0
- package/dist/internals/simulation/methods/hooks/interface.mjs.map +1 -0
- package/dist/internals/simulation/methods/hooks/notifications.js +16 -0
- package/dist/internals/simulation/methods/hooks/notifications.js.map +1 -0
- package/dist/internals/simulation/methods/hooks/notifications.mjs +16 -0
- package/dist/internals/simulation/methods/hooks/notifications.mjs.map +1 -0
- package/dist/internals/simulation/methods/hooks/show-dialog.js +14 -0
- package/dist/internals/simulation/methods/hooks/show-dialog.js.map +1 -0
- package/dist/internals/simulation/methods/hooks/show-dialog.mjs +14 -0
- package/dist/internals/simulation/methods/hooks/show-dialog.mjs.map +1 -0
- package/dist/internals/simulation/methods/hooks/state.js +18 -0
- package/dist/internals/simulation/methods/hooks/state.js.map +1 -0
- package/dist/internals/simulation/methods/hooks/state.mjs +18 -0
- package/dist/internals/simulation/methods/hooks/state.mjs.map +1 -0
- package/dist/internals/simulation/methods/index.js +29 -0
- package/dist/internals/simulation/methods/index.js.map +1 -0
- package/dist/internals/simulation/methods/index.mjs +29 -0
- package/dist/internals/simulation/methods/index.mjs.map +1 -0
- package/dist/internals/simulation/methods/specifications.js +28 -0
- package/dist/internals/simulation/methods/specifications.js.map +1 -0
- package/dist/internals/simulation/methods/specifications.mjs +28 -0
- package/dist/internals/simulation/methods/specifications.mjs.map +1 -0
- package/dist/internals/simulation/middleware/engine.js +15 -0
- package/dist/internals/simulation/middleware/engine.js.map +1 -0
- package/dist/internals/simulation/middleware/engine.mjs +15 -0
- package/dist/internals/simulation/middleware/engine.mjs.map +1 -0
- package/dist/internals/simulation/middleware/index.js +16 -0
- package/dist/internals/simulation/middleware/index.js.map +1 -0
- package/dist/internals/simulation/middleware/index.mjs +16 -0
- package/dist/internals/simulation/middleware/index.mjs.map +1 -0
- package/dist/internals/simulation/middleware/internal-methods/accounts.js +8 -0
- package/dist/internals/simulation/middleware/internal-methods/accounts.js.map +1 -0
- package/dist/internals/simulation/middleware/internal-methods/accounts.mjs +8 -0
- package/dist/internals/simulation/middleware/internal-methods/accounts.mjs.map +1 -0
- package/dist/internals/simulation/middleware/internal-methods/index.js +11 -0
- package/dist/internals/simulation/middleware/internal-methods/index.js.map +1 -0
- package/dist/internals/simulation/middleware/internal-methods/index.mjs +11 -0
- package/dist/internals/simulation/middleware/internal-methods/index.mjs.map +1 -0
- package/dist/internals/simulation/middleware/internal-methods/middleware.js +10 -0
- package/dist/internals/simulation/middleware/internal-methods/middleware.js.map +1 -0
- package/dist/internals/simulation/middleware/internal-methods/middleware.mjs +10 -0
- package/dist/internals/simulation/middleware/internal-methods/middleware.mjs.map +1 -0
- package/dist/internals/simulation/middleware/internal-methods/provider-state.js +8 -0
- package/dist/internals/simulation/middleware/internal-methods/provider-state.js.map +1 -0
- package/dist/internals/simulation/middleware/internal-methods/provider-state.mjs +8 -0
- package/dist/internals/simulation/middleware/internal-methods/provider-state.mjs.map +1 -0
- package/dist/internals/simulation/middleware/mock.js +9 -0
- package/dist/internals/simulation/middleware/mock.js.map +1 -0
- package/dist/internals/simulation/middleware/mock.mjs +9 -0
- package/dist/internals/simulation/middleware/mock.mjs.map +1 -0
- package/dist/internals/simulation/options.js +9 -0
- package/dist/internals/simulation/options.js.map +1 -0
- package/dist/internals/simulation/options.mjs +9 -0
- package/dist/internals/simulation/options.mjs.map +1 -0
- package/dist/internals/simulation/simulation.js +39 -0
- package/dist/internals/simulation/simulation.js.map +1 -0
- package/dist/internals/simulation/simulation.mjs +39 -0
- package/dist/internals/simulation/simulation.mjs.map +1 -0
- package/dist/internals/simulation/store/index.js +44 -0
- package/dist/internals/simulation/store/index.js.map +1 -0
- package/dist/internals/simulation/store/index.mjs +44 -0
- package/dist/internals/simulation/store/index.mjs.map +1 -0
- package/dist/internals/simulation/store/mocks.js +16 -0
- package/dist/internals/simulation/store/mocks.js.map +1 -0
- package/dist/internals/simulation/store/mocks.mjs +16 -0
- package/dist/internals/simulation/store/mocks.mjs.map +1 -0
- package/dist/internals/simulation/store/notifications.js +16 -0
- package/dist/internals/simulation/store/notifications.js.map +1 -0
- package/dist/internals/simulation/store/notifications.mjs +16 -0
- package/dist/internals/simulation/store/notifications.mjs.map +1 -0
- package/dist/internals/simulation/store/state.js +14 -0
- package/dist/internals/simulation/store/state.js.map +1 -0
- package/dist/internals/simulation/store/state.mjs +14 -0
- package/dist/internals/simulation/store/state.mjs.map +1 -0
- package/dist/internals/simulation/store/store.js +12 -0
- package/dist/internals/simulation/store/store.js.map +1 -0
- package/dist/internals/simulation/store/store.mjs +12 -0
- package/dist/internals/simulation/store/store.mjs.map +1 -0
- package/dist/internals/simulation/store/ui.js +16 -0
- package/dist/internals/simulation/store/ui.js.map +1 -0
- package/dist/internals/simulation/store/ui.mjs +16 -0
- package/dist/internals/simulation/store/ui.mjs.map +1 -0
- package/dist/internals/structs.js +18 -0
- package/dist/internals/structs.js.map +1 -0
- package/dist/internals/structs.mjs +18 -0
- package/dist/internals/structs.mjs.map +1 -0
- package/dist/matchers.js +50 -0
- package/dist/matchers.js.map +1 -0
- package/dist/matchers.mjs +50 -0
- package/dist/matchers.mjs.map +1 -0
- package/dist/options.js +8 -0
- package/dist/options.js.map +1 -0
- package/dist/options.mjs +8 -0
- package/dist/options.mjs.map +1 -0
- package/dist/setup.js +39 -0
- package/dist/setup.js.map +1 -0
- package/dist/setup.mjs +39 -0
- package/dist/setup.mjs.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/types/vendor/readable-stream.d.js +1 -0
- package/dist/types/vendor/readable-stream.d.js.map +1 -0
- package/dist/types/vendor/readable-stream.d.mjs +1 -0
- package/dist/types/vendor/readable-stream.d.mjs.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/types.mjs +2 -0
- package/dist/types.mjs.map +1 -0
- package/jest-preset.js +1 -1
- package/package.json +24 -20
- package/dist/cjs/environment.js +0 -144
- package/dist/cjs/environment.js.map +0 -1
- package/dist/cjs/helpers.js +0 -142
- package/dist/cjs/helpers.js.map +0 -1
- package/dist/cjs/index.js +0 -42
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/internals/environment.js +0 -19
- package/dist/cjs/internals/environment.js.map +0 -1
- package/dist/cjs/internals/index.js +0 -25
- package/dist/cjs/internals/index.js.map +0 -1
- package/dist/cjs/internals/logger.js +0 -14
- package/dist/cjs/internals/logger.js.map +0 -1
- package/dist/cjs/internals/request.js +0 -69
- package/dist/cjs/internals/request.js.map +0 -1
- package/dist/cjs/internals/server.js +0 -71
- package/dist/cjs/internals/server.js.map +0 -1
- package/dist/cjs/internals/simulation/constants.js +0 -29
- package/dist/cjs/internals/simulation/constants.js.map +0 -1
- package/dist/cjs/internals/simulation/controllers.js +0 -95
- package/dist/cjs/internals/simulation/controllers.js.map +0 -1
- package/dist/cjs/internals/simulation/files.js +0 -22
- package/dist/cjs/internals/simulation/files.js.map +0 -1
- package/dist/cjs/internals/simulation/index.js +0 -24
- package/dist/cjs/internals/simulation/index.js.map +0 -1
- package/dist/cjs/internals/simulation/interface.js +0 -98
- package/dist/cjs/internals/simulation/interface.js.map +0 -1
- package/dist/cjs/internals/simulation/methods/constants.js +0 -84
- package/dist/cjs/internals/simulation/methods/constants.js.map +0 -1
- package/dist/cjs/internals/simulation/methods/hooks/encryption.js +0 -33
- package/dist/cjs/internals/simulation/methods/hooks/encryption.js.map +0 -1
- package/dist/cjs/internals/simulation/methods/hooks/get-locale.js +0 -17
- package/dist/cjs/internals/simulation/methods/hooks/get-locale.js.map +0 -1
- package/dist/cjs/internals/simulation/methods/hooks/index.js +0 -25
- package/dist/cjs/internals/simulation/methods/hooks/index.js.map +0 -1
- package/dist/cjs/internals/simulation/methods/hooks/interface.js +0 -26
- package/dist/cjs/internals/simulation/methods/hooks/interface.js.map +0 -1
- package/dist/cjs/internals/simulation/methods/hooks/notifications.js +0 -66
- package/dist/cjs/internals/simulation/methods/hooks/notifications.js.map +0 -1
- package/dist/cjs/internals/simulation/methods/hooks/show-dialog.js +0 -43
- package/dist/cjs/internals/simulation/methods/hooks/state.js +0 -80
- package/dist/cjs/internals/simulation/methods/hooks/state.js.map +0 -1
- package/dist/cjs/internals/simulation/methods/index.js +0 -20
- package/dist/cjs/internals/simulation/methods/index.js.map +0 -1
- package/dist/cjs/internals/simulation/methods/specifications.js +0 -81
- package/dist/cjs/internals/simulation/methods/specifications.js.map +0 -1
- package/dist/cjs/internals/simulation/middleware/engine.js +0 -31
- package/dist/cjs/internals/simulation/middleware/engine.js.map +0 -1
- package/dist/cjs/internals/simulation/middleware/index.js +0 -20
- package/dist/cjs/internals/simulation/middleware/index.js.map +0 -1
- package/dist/cjs/internals/simulation/middleware/internal-methods/accounts.js +0 -30
- package/dist/cjs/internals/simulation/middleware/internal-methods/accounts.js.map +0 -1
- package/dist/cjs/internals/simulation/middleware/internal-methods/index.js +0 -20
- package/dist/cjs/internals/simulation/middleware/internal-methods/index.js.map +0 -1
- package/dist/cjs/internals/simulation/middleware/internal-methods/middleware.js +0 -37
- package/dist/cjs/internals/simulation/middleware/internal-methods/middleware.js.map +0 -1
- package/dist/cjs/internals/simulation/middleware/internal-methods/provider-state.js +0 -23
- package/dist/cjs/internals/simulation/middleware/internal-methods/provider-state.js.map +0 -1
- package/dist/cjs/internals/simulation/middleware/mock.js +0 -23
- package/dist/cjs/internals/simulation/middleware/mock.js.map +0 -1
- package/dist/cjs/internals/simulation/options.js +0 -24
- package/dist/cjs/internals/simulation/options.js.map +0 -1
- package/dist/cjs/internals/simulation/simulation.js +0 -124
- package/dist/cjs/internals/simulation/simulation.js.map +0 -1
- package/dist/cjs/internals/simulation/store/index.js +0 -23
- package/dist/cjs/internals/simulation/store/index.js.map +0 -1
- package/dist/cjs/internals/simulation/store/mocks.js +0 -52
- package/dist/cjs/internals/simulation/store/mocks.js.map +0 -1
- package/dist/cjs/internals/simulation/store/notifications.js +0 -52
- package/dist/cjs/internals/simulation/store/notifications.js.map +0 -1
- package/dist/cjs/internals/simulation/store/state.js +0 -64
- package/dist/cjs/internals/simulation/store/state.js.map +0 -1
- package/dist/cjs/internals/simulation/store/store.js +0 -57
- package/dist/cjs/internals/simulation/store/store.js.map +0 -1
- package/dist/cjs/internals/simulation/store/ui.js +0 -48
- package/dist/cjs/internals/simulation/store/ui.js.map +0 -1
- package/dist/cjs/internals/structs.js +0 -165
- package/dist/cjs/internals/structs.js.map +0 -1
- package/dist/cjs/matchers.js +0 -120
- package/dist/cjs/matchers.js.map +0 -1
- package/dist/cjs/options.js +0 -23
- package/dist/cjs/options.js.map +0 -1
- package/dist/cjs/setup.js +0 -10
- package/dist/cjs/setup.js.map +0 -1
- package/dist/cjs/types.js +0 -6
- package/dist/cjs/types.js.map +0 -1
- package/dist/esm/environment.js +0 -121
- package/dist/esm/environment.js.map +0 -1
- package/dist/esm/helpers.js +0 -163
- package/dist/esm/helpers.js.map +0 -1
- package/dist/esm/index.js +0 -6
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/internals/environment.js +0 -14
- package/dist/esm/internals/environment.js.map +0 -1
- package/dist/esm/internals/index.js +0 -8
- package/dist/esm/internals/index.js.map +0 -1
- package/dist/esm/internals/logger.js +0 -4
- package/dist/esm/internals/logger.js.map +0 -1
- package/dist/esm/internals/request.js +0 -77
- package/dist/esm/internals/request.js.map +0 -1
- package/dist/esm/internals/server.js +0 -64
- package/dist/esm/internals/server.js.map +0 -1
- package/dist/esm/internals/simulation/constants.js +0 -12
- package/dist/esm/internals/simulation/constants.js.map +0 -1
- package/dist/esm/internals/simulation/controllers.js +0 -90
- package/dist/esm/internals/simulation/controllers.js.map +0 -1
- package/dist/esm/internals/simulation/files.js +0 -19
- package/dist/esm/internals/simulation/files.js.map +0 -1
- package/dist/esm/internals/simulation/index.js +0 -7
- package/dist/esm/internals/simulation/index.js.map +0 -1
- package/dist/esm/internals/simulation/interface.js +0 -95
- package/dist/esm/internals/simulation/interface.js.map +0 -1
- package/dist/esm/internals/simulation/methods/constants.js +0 -69
- package/dist/esm/internals/simulation/methods/constants.js.map +0 -1
- package/dist/esm/internals/simulation/methods/hooks/encryption.js +0 -39
- package/dist/esm/internals/simulation/methods/hooks/encryption.js.map +0 -1
- package/dist/esm/internals/simulation/methods/hooks/get-locale.js +0 -13
- package/dist/esm/internals/simulation/methods/hooks/get-locale.js.map +0 -1
- package/dist/esm/internals/simulation/methods/hooks/index.js +0 -8
- package/dist/esm/internals/simulation/methods/hooks/index.js.map +0 -1
- package/dist/esm/internals/simulation/methods/hooks/interface.js +0 -18
- package/dist/esm/internals/simulation/methods/hooks/interface.js.map +0 -1
- package/dist/esm/internals/simulation/methods/hooks/notifications.js +0 -58
- package/dist/esm/internals/simulation/methods/hooks/notifications.js.map +0 -1
- package/dist/esm/internals/simulation/methods/hooks/show-dialog.js +0 -38
- package/dist/esm/internals/simulation/methods/hooks/show-dialog.js.map +0 -1
- package/dist/esm/internals/simulation/methods/hooks/state.js +0 -74
- package/dist/esm/internals/simulation/methods/hooks/state.js.map +0 -1
- package/dist/esm/internals/simulation/methods/index.js +0 -3
- package/dist/esm/internals/simulation/methods/index.js.map +0 -1
- package/dist/esm/internals/simulation/methods/specifications.js +0 -84
- package/dist/esm/internals/simulation/methods/specifications.js.map +0 -1
- package/dist/esm/internals/simulation/middleware/engine.js +0 -33
- package/dist/esm/internals/simulation/middleware/engine.js.map +0 -1
- package/dist/esm/internals/simulation/middleware/index.js +0 -3
- package/dist/esm/internals/simulation/middleware/index.js.map +0 -1
- package/dist/esm/internals/simulation/middleware/internal-methods/accounts.js +0 -31
- package/dist/esm/internals/simulation/middleware/internal-methods/accounts.js.map +0 -1
- package/dist/esm/internals/simulation/middleware/internal-methods/index.js +0 -3
- package/dist/esm/internals/simulation/middleware/internal-methods/index.js.map +0 -1
- package/dist/esm/internals/simulation/middleware/internal-methods/middleware.js +0 -37
- package/dist/esm/internals/simulation/middleware/internal-methods/middleware.js.map +0 -1
- package/dist/esm/internals/simulation/middleware/internal-methods/provider-state.js +0 -23
- package/dist/esm/internals/simulation/middleware/internal-methods/provider-state.js.map +0 -1
- package/dist/esm/internals/simulation/middleware/mock.js +0 -18
- package/dist/esm/internals/simulation/middleware/mock.js.map +0 -1
- package/dist/esm/internals/simulation/options.js +0 -20
- package/dist/esm/internals/simulation/options.js.map +0 -1
- package/dist/esm/internals/simulation/simulation.js +0 -128
- package/dist/esm/internals/simulation/simulation.js.map +0 -1
- package/dist/esm/internals/simulation/store/index.js +0 -6
- package/dist/esm/internals/simulation/store/index.js.map +0 -1
- package/dist/esm/internals/simulation/store/mocks.js +0 -32
- package/dist/esm/internals/simulation/store/mocks.js.map +0 -1
- package/dist/esm/internals/simulation/store/notifications.js +0 -30
- package/dist/esm/internals/simulation/store/notifications.js.map +0 -1
- package/dist/esm/internals/simulation/store/state.js +0 -47
- package/dist/esm/internals/simulation/store/state.js.map +0 -1
- package/dist/esm/internals/simulation/store/store.js +0 -50
- package/dist/esm/internals/simulation/store/store.js.map +0 -1
- package/dist/esm/internals/simulation/store/ui.js +0 -21
- package/dist/esm/internals/simulation/store/ui.js.map +0 -1
- package/dist/esm/internals/structs.js +0 -135
- package/dist/esm/internals/structs.js.map +0 -1
- package/dist/esm/matchers.js +0 -111
- package/dist/esm/matchers.js.map +0 -1
- package/dist/esm/options.js +0 -20
- package/dist/esm/options.js.map +0 -1
- package/dist/esm/setup.js +0 -6
- package/dist/esm/setup.js.map +0 -1
- package/dist/esm/types.js +0 -3
- package/dist/esm/types.js.map +0 -1
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { NotificationType } from '@metamask/snaps-sdk';
|
|
2
|
-
import { nanoid } from '@reduxjs/toolkit';
|
|
3
|
-
import { put } from 'redux-saga/effects';
|
|
4
|
-
import { addNotification } from '../../store';
|
|
5
|
-
/**
|
|
6
|
-
* Show a native notification to the user.
|
|
7
|
-
*
|
|
8
|
-
* @param _snapId - The ID of the Snap that created the notification.
|
|
9
|
-
* @param options - The notification options.
|
|
10
|
-
* @param options.message - The message to show in the notification.
|
|
11
|
-
* @yields Adds the notification to the store.
|
|
12
|
-
* @returns `null`.
|
|
13
|
-
*/ function* showNativeNotificationImplementation(_snapId, { message }) {
|
|
14
|
-
yield put(addNotification({
|
|
15
|
-
id: nanoid(),
|
|
16
|
-
type: NotificationType.Native,
|
|
17
|
-
message
|
|
18
|
-
}));
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Get a method that can be used to show a native notification.
|
|
23
|
-
*
|
|
24
|
-
* @param runSaga - A function to run a saga outside the usual Redux flow.
|
|
25
|
-
* @returns A method that can be used to show a native notification.
|
|
26
|
-
*/ export function getShowNativeNotificationImplementation(runSaga) {
|
|
27
|
-
return async (...args)=>{
|
|
28
|
-
return await runSaga(showNativeNotificationImplementation, ...args).toPromise();
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Show an in-app notification to the user.
|
|
33
|
-
*
|
|
34
|
-
* @param _snapId - The ID of the Snap that created the notification.
|
|
35
|
-
* @param options - The notification options.
|
|
36
|
-
* @param options.message - The message to show in the notification.
|
|
37
|
-
* @yields Adds the notification to the store.
|
|
38
|
-
* @returns `null`.
|
|
39
|
-
*/ function* showInAppNotificationImplementation(_snapId, { message }) {
|
|
40
|
-
yield put(addNotification({
|
|
41
|
-
id: nanoid(),
|
|
42
|
-
type: NotificationType.InApp,
|
|
43
|
-
message
|
|
44
|
-
}));
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Get a method that can be used to show an in-app notification.
|
|
49
|
-
*
|
|
50
|
-
* @param runSaga - A function to run a saga outside the usual Redux flow.
|
|
51
|
-
* @returns A method that can be used to show an in-app notification.
|
|
52
|
-
*/ export function getShowInAppNotificationImplementation(runSaga) {
|
|
53
|
-
return async (...args)=>{
|
|
54
|
-
return await runSaga(showInAppNotificationImplementation, ...args).toPromise();
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
//# sourceMappingURL=notifications.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/internals/simulation/methods/hooks/notifications.ts"],"sourcesContent":["import type { NotifyParams } from '@metamask/snaps-sdk';\nimport { NotificationType } from '@metamask/snaps-sdk';\nimport { nanoid } from '@reduxjs/toolkit';\nimport type { SagaIterator } from 'redux-saga';\nimport { put } from 'redux-saga/effects';\n\nimport type { RunSagaFunction } from '../../store';\nimport { addNotification } from '../../store';\n\n/**\n * Show a native notification to the user.\n *\n * @param _snapId - The ID of the Snap that created the notification.\n * @param options - The notification options.\n * @param options.message - The message to show in the notification.\n * @yields Adds the notification to the store.\n * @returns `null`.\n */\nfunction* showNativeNotificationImplementation(\n _snapId: string,\n { message }: NotifyParams,\n): SagaIterator {\n yield put(\n addNotification({ id: nanoid(), type: NotificationType.Native, message }),\n );\n\n return null;\n}\n\n/**\n * Get a method that can be used to show a native notification.\n *\n * @param runSaga - A function to run a saga outside the usual Redux flow.\n * @returns A method that can be used to show a native notification.\n */\nexport function getShowNativeNotificationImplementation(\n runSaga: RunSagaFunction,\n) {\n return async (\n ...args: Parameters<typeof showNativeNotificationImplementation>\n ) => {\n return await runSaga(\n showNativeNotificationImplementation,\n ...args,\n ).toPromise();\n };\n}\n\n/**\n * Show an in-app notification to the user.\n *\n * @param _snapId - The ID of the Snap that created the notification.\n * @param options - The notification options.\n * @param options.message - The message to show in the notification.\n * @yields Adds the notification to the store.\n * @returns `null`.\n */\nfunction* showInAppNotificationImplementation(\n _snapId: string,\n { message }: NotifyParams,\n): SagaIterator<null> {\n yield put(\n addNotification({ id: nanoid(), type: NotificationType.InApp, message }),\n );\n\n return null;\n}\n\n/**\n * Get a method that can be used to show an in-app notification.\n *\n * @param runSaga - A function to run a saga outside the usual Redux flow.\n * @returns A method that can be used to show an in-app notification.\n */\nexport function getShowInAppNotificationImplementation(\n runSaga: RunSagaFunction,\n) {\n return async (\n ...args: Parameters<typeof showInAppNotificationImplementation>\n ) => {\n return await runSaga(\n showInAppNotificationImplementation,\n ...args,\n ).toPromise();\n };\n}\n"],"names":["NotificationType","nanoid","put","addNotification","showNativeNotificationImplementation","_snapId","message","id","type","Native","getShowNativeNotificationImplementation","runSaga","args","toPromise","showInAppNotificationImplementation","InApp","getShowInAppNotificationImplementation"],"mappings":"AACA,SAASA,gBAAgB,QAAQ,sBAAsB;AACvD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,SAASC,GAAG,QAAQ,qBAAqB;AAGzC,SAASC,eAAe,QAAQ,cAAc;AAE9C;;;;;;;;CAQC,GACD,UAAUC,qCACRC,OAAe,EACf,EAAEC,OAAO,EAAgB;IAEzB,MAAMJ,IACJC,gBAAgB;QAAEI,IAAIN;QAAUO,MAAMR,iBAAiBS,MAAM;QAAEH;IAAQ;IAGzE,OAAO;AACT;AAEA;;;;;CAKC,GACD,OAAO,SAASI,wCACdC,OAAwB;IAExB,OAAO,OACL,GAAGC;QAEH,OAAO,MAAMD,QACXP,yCACGQ,MACHC,SAAS;IACb;AACF;AAEA;;;;;;;;CAQC,GACD,UAAUC,oCACRT,OAAe,EACf,EAAEC,OAAO,EAAgB;IAEzB,MAAMJ,IACJC,gBAAgB;QAAEI,IAAIN;QAAUO,MAAMR,iBAAiBe,KAAK;QAAET;IAAQ;IAGxE,OAAO;AACT;AAEA;;;;;CAKC,GACD,OAAO,SAASU,uCACdL,OAAwB;IAExB,OAAO,OACL,GAAGC;QAEH,OAAO,MAAMD,QACXG,wCACGF,MACHC,SAAS;IACb;AACF"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { put, take } from 'redux-saga/effects';
|
|
2
|
-
import { resolveInterface, setInterface, closeInterface } from '../../store';
|
|
3
|
-
/**
|
|
4
|
-
* Show a dialog to the user. This will wait for `resolveUserInterface` to be
|
|
5
|
-
* dispatched before returning.
|
|
6
|
-
*
|
|
7
|
-
* @param _snapId - The ID of the Snap that created the dialog. This is ignored
|
|
8
|
-
* because the simulator only supports one Snap.
|
|
9
|
-
* @param type - The type of dialog to show.
|
|
10
|
-
* @param id - The interface ID.
|
|
11
|
-
* @param _placeholder - The placeholder text to show in the dialog. This is
|
|
12
|
-
* not implemented yet.
|
|
13
|
-
* @yields Sets the dialog in the store, waits for the user to resolve the
|
|
14
|
-
* dialog, and closes the dialog.
|
|
15
|
-
* @returns The result of the dialog.
|
|
16
|
-
*/ function* showDialogImplementation(_snapId, type, id, _placeholder) {
|
|
17
|
-
yield put(setInterface({
|
|
18
|
-
type,
|
|
19
|
-
id
|
|
20
|
-
}));
|
|
21
|
-
// We use `take` to wait for `resolveUserInterface` to be dispatched, which
|
|
22
|
-
// indicates that the user has resolved the dialog.
|
|
23
|
-
const { payload } = yield take(resolveInterface.type);
|
|
24
|
-
yield put(closeInterface());
|
|
25
|
-
return payload;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Get the implementation of the `showDialog` hook.
|
|
29
|
-
*
|
|
30
|
-
* @param runSaga - The function to run a saga outside the usual Redux flow.
|
|
31
|
-
* @returns The implementation of the `showDialog` hook.
|
|
32
|
-
*/ export function getShowDialogImplementation(runSaga) {
|
|
33
|
-
return async (...args)=>{
|
|
34
|
-
return await runSaga(showDialogImplementation, ...args).toPromise();
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
//# sourceMappingURL=show-dialog.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/internals/simulation/methods/hooks/show-dialog.ts"],"sourcesContent":["import type { DialogType } from '@metamask/snaps-sdk';\nimport type { SagaIterator } from 'redux-saga';\nimport { put, take } from 'redux-saga/effects';\n\nimport type { RunSagaFunction } from '../../store';\nimport { resolveInterface, setInterface, closeInterface } from '../../store';\n\n/**\n * Show a dialog to the user. This will wait for `resolveUserInterface` to be\n * dispatched before returning.\n *\n * @param _snapId - The ID of the Snap that created the dialog. This is ignored\n * because the simulator only supports one Snap.\n * @param type - The type of dialog to show.\n * @param id - The interface ID.\n * @param _placeholder - The placeholder text to show in the dialog. This is\n * not implemented yet.\n * @yields Sets the dialog in the store, waits for the user to resolve the\n * dialog, and closes the dialog.\n * @returns The result of the dialog.\n */\nfunction* showDialogImplementation(\n _snapId: string,\n type: DialogType,\n id: string,\n _placeholder?: string,\n): SagaIterator<unknown> {\n yield put(setInterface({ type, id }));\n\n // We use `take` to wait for `resolveUserInterface` to be dispatched, which\n // indicates that the user has resolved the dialog.\n const { payload } = yield take(resolveInterface.type);\n yield put(closeInterface());\n\n return payload;\n}\n\n/**\n * Get the implementation of the `showDialog` hook.\n *\n * @param runSaga - The function to run a saga outside the usual Redux flow.\n * @returns The implementation of the `showDialog` hook.\n */\nexport function getShowDialogImplementation(runSaga: RunSagaFunction) {\n return async (...args: Parameters<typeof showDialogImplementation>) => {\n return await runSaga(showDialogImplementation, ...args).toPromise();\n };\n}\n"],"names":["put","take","resolveInterface","setInterface","closeInterface","showDialogImplementation","_snapId","type","id","_placeholder","payload","getShowDialogImplementation","runSaga","args","toPromise"],"mappings":"AAEA,SAASA,GAAG,EAAEC,IAAI,QAAQ,qBAAqB;AAG/C,SAASC,gBAAgB,EAAEC,YAAY,EAAEC,cAAc,QAAQ,cAAc;AAE7E;;;;;;;;;;;;;CAaC,GACD,UAAUC,yBACRC,OAAe,EACfC,IAAgB,EAChBC,EAAU,EACVC,YAAqB;IAErB,MAAMT,IAAIG,aAAa;QAAEI;QAAMC;IAAG;IAElC,2EAA2E;IAC3E,mDAAmD;IACnD,MAAM,EAAEE,OAAO,EAAE,GAAG,MAAMT,KAAKC,iBAAiBK,IAAI;IACpD,MAAMP,IAAII;IAEV,OAAOM;AACT;AAEA;;;;;CAKC,GACD,OAAO,SAASC,4BAA4BC,OAAwB;IAClE,OAAO,OAAO,GAAGC;QACf,OAAO,MAAMD,QAAQP,6BAA6BQ,MAAMC,SAAS;IACnE;AACF"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { put, select } from 'redux-saga/effects';
|
|
2
|
-
import { clearState, getState, setState } from '../../store';
|
|
3
|
-
/**
|
|
4
|
-
* Get the Snap state from the store.
|
|
5
|
-
*
|
|
6
|
-
* @param _snapId - The ID of the Snap to get the state for. This is ignored
|
|
7
|
-
* because the simulator only supports one Snap.
|
|
8
|
-
* @param encrypted - Whether to get the encrypted or unencrypted state.
|
|
9
|
-
* Defaults to encrypted state.
|
|
10
|
-
* @returns The state of the Snap.
|
|
11
|
-
* @yields Selects the state from the store.
|
|
12
|
-
*/ function* getSnapStateImplementation(_snapId, encrypted = true) {
|
|
13
|
-
return yield select(getState(encrypted));
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Get the implementation of the `getSnapState` hook.
|
|
17
|
-
*
|
|
18
|
-
* @param runSaga - The function to run a saga outside the usual Redux flow.
|
|
19
|
-
* @returns The implementation of the `getSnapState` hook.
|
|
20
|
-
*/ export function getGetSnapStateMethodImplementation(runSaga) {
|
|
21
|
-
return (...args)=>{
|
|
22
|
-
return runSaga(getSnapStateImplementation, ...args).result();
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Update the Snap state in the store.
|
|
27
|
-
*
|
|
28
|
-
* @param _snapId - The ID of the Snap to update the state for. This is ignored
|
|
29
|
-
* because the simulator only supports one Snap.
|
|
30
|
-
* @param newState - The new state.
|
|
31
|
-
* @param encrypted - Whether to update the encrypted or unencrypted state.
|
|
32
|
-
* Defaults to encrypted state.
|
|
33
|
-
* @yields Puts the new state in the store.
|
|
34
|
-
*/ function* updateSnapStateImplementation(_snapId, newState, encrypted = true) {
|
|
35
|
-
yield put(setState({
|
|
36
|
-
state: newState,
|
|
37
|
-
encrypted
|
|
38
|
-
}));
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Get the implementation of the `updateSnapState` hook.
|
|
42
|
-
*
|
|
43
|
-
* @param runSaga - The function to run a saga outside the usual Redux flow.
|
|
44
|
-
* @returns The implementation of the `updateSnapState` hook.
|
|
45
|
-
*/ export function getUpdateSnapStateMethodImplementation(runSaga) {
|
|
46
|
-
return (...args)=>{
|
|
47
|
-
runSaga(updateSnapStateImplementation, ...args).result();
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Clear the Snap state in the store.
|
|
52
|
-
*
|
|
53
|
-
* @param _snapId - The ID of the Snap to clear the state for. This is ignored
|
|
54
|
-
* because the simulator only supports one Snap.
|
|
55
|
-
* @param encrypted - Whether to clear the encrypted or unencrypted state.
|
|
56
|
-
* Defaults to encrypted state.
|
|
57
|
-
* @yields Puts the new state in the store.
|
|
58
|
-
*/ function* clearSnapStateImplementation(_snapId, encrypted = true) {
|
|
59
|
-
yield put(clearState({
|
|
60
|
-
encrypted
|
|
61
|
-
}));
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Get the implementation of the `clearSnapState` hook.
|
|
65
|
-
*
|
|
66
|
-
* @param runSaga - The function to run a saga outside the usual Redux flow.
|
|
67
|
-
* @returns The implementation of the `clearSnapState` hook.
|
|
68
|
-
*/ export function getClearSnapStateMethodImplementation(runSaga) {
|
|
69
|
-
return async (...args)=>{
|
|
70
|
-
runSaga(clearSnapStateImplementation, ...args).result();
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
//# sourceMappingURL=state.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/internals/simulation/methods/hooks/state.ts"],"sourcesContent":["import type { SagaIterator } from 'redux-saga';\nimport { put, select } from 'redux-saga/effects';\n\nimport type { RunSagaFunction } from '../../store';\nimport { clearState, getState, setState } from '../../store';\n\n/**\n * Get the Snap state from the store.\n *\n * @param _snapId - The ID of the Snap to get the state for. This is ignored\n * because the simulator only supports one Snap.\n * @param encrypted - Whether to get the encrypted or unencrypted state.\n * Defaults to encrypted state.\n * @returns The state of the Snap.\n * @yields Selects the state from the store.\n */\nfunction* getSnapStateImplementation(\n _snapId: string,\n encrypted = true,\n): SagaIterator<string> {\n return yield select(getState(encrypted));\n}\n\n/**\n * Get the implementation of the `getSnapState` hook.\n *\n * @param runSaga - The function to run a saga outside the usual Redux flow.\n * @returns The implementation of the `getSnapState` hook.\n */\nexport function getGetSnapStateMethodImplementation(runSaga: RunSagaFunction) {\n return (...args: Parameters<typeof getSnapStateImplementation>) => {\n return runSaga(getSnapStateImplementation, ...args).result();\n };\n}\n\n/**\n * Update the Snap state in the store.\n *\n * @param _snapId - The ID of the Snap to update the state for. This is ignored\n * because the simulator only supports one Snap.\n * @param newState - The new state.\n * @param encrypted - Whether to update the encrypted or unencrypted state.\n * Defaults to encrypted state.\n * @yields Puts the new state in the store.\n */\nfunction* updateSnapStateImplementation(\n _snapId: string,\n newState: string,\n encrypted = true,\n): SagaIterator<void> {\n yield put(setState({ state: newState, encrypted }));\n}\n\n/**\n * Get the implementation of the `updateSnapState` hook.\n *\n * @param runSaga - The function to run a saga outside the usual Redux flow.\n * @returns The implementation of the `updateSnapState` hook.\n */\nexport function getUpdateSnapStateMethodImplementation(\n runSaga: RunSagaFunction,\n) {\n return (...args: Parameters<typeof updateSnapStateImplementation>) => {\n runSaga(updateSnapStateImplementation, ...args).result();\n };\n}\n\n/**\n * Clear the Snap state in the store.\n *\n * @param _snapId - The ID of the Snap to clear the state for. This is ignored\n * because the simulator only supports one Snap.\n * @param encrypted - Whether to clear the encrypted or unencrypted state.\n * Defaults to encrypted state.\n * @yields Puts the new state in the store.\n */\nfunction* clearSnapStateImplementation(\n _snapId: string,\n encrypted = true,\n): SagaIterator<void> {\n yield put(clearState({ encrypted }));\n}\n\n/**\n * Get the implementation of the `clearSnapState` hook.\n *\n * @param runSaga - The function to run a saga outside the usual Redux flow.\n * @returns The implementation of the `clearSnapState` hook.\n */\nexport function getClearSnapStateMethodImplementation(\n runSaga: RunSagaFunction,\n) {\n return async (...args: Parameters<typeof clearSnapStateImplementation>) => {\n runSaga(clearSnapStateImplementation, ...args).result();\n };\n}\n"],"names":["put","select","clearState","getState","setState","getSnapStateImplementation","_snapId","encrypted","getGetSnapStateMethodImplementation","runSaga","args","result","updateSnapStateImplementation","newState","state","getUpdateSnapStateMethodImplementation","clearSnapStateImplementation","getClearSnapStateMethodImplementation"],"mappings":"AACA,SAASA,GAAG,EAAEC,MAAM,QAAQ,qBAAqB;AAGjD,SAASC,UAAU,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,cAAc;AAE7D;;;;;;;;;CASC,GACD,UAAUC,2BACRC,OAAe,EACfC,YAAY,IAAI;IAEhB,OAAO,MAAMN,OAAOE,SAASI;AAC/B;AAEA;;;;;CAKC,GACD,OAAO,SAASC,oCAAoCC,OAAwB;IAC1E,OAAO,CAAC,GAAGC;QACT,OAAOD,QAAQJ,+BAA+BK,MAAMC,MAAM;IAC5D;AACF;AAEA;;;;;;;;;CASC,GACD,UAAUC,8BACRN,OAAe,EACfO,QAAgB,EAChBN,YAAY,IAAI;IAEhB,MAAMP,IAAII,SAAS;QAAEU,OAAOD;QAAUN;IAAU;AAClD;AAEA;;;;;CAKC,GACD,OAAO,SAASQ,uCACdN,OAAwB;IAExB,OAAO,CAAC,GAAGC;QACTD,QAAQG,kCAAkCF,MAAMC,MAAM;IACxD;AACF;AAEA;;;;;;;;CAQC,GACD,UAAUK,6BACRV,OAAe,EACfC,YAAY,IAAI;IAEhB,MAAMP,IAAIE,WAAW;QAAEK;IAAU;AACnC;AAEA;;;;;CAKC,GACD,OAAO,SAASU,sCACdR,OAAwB;IAExB,OAAO,OAAO,GAAGC;QACfD,QAAQO,iCAAiCN,MAAMC,MAAM;IACvD;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/internals/simulation/methods/index.ts"],"sourcesContent":["export * from './specifications';\n"],"names":[],"mappings":"AAAA,cAAc,mBAAmB"}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { endowmentPermissionBuilders, buildSnapEndowmentSpecifications, buildSnapRestrictedMethodSpecifications } from '@metamask/snaps-rpc-methods';
|
|
2
|
-
import { DEFAULT_ENDOWMENTS } from '@metamask/snaps-utils';
|
|
3
|
-
import { EXCLUDED_SNAP_ENDOWMENTS, EXCLUDED_SNAP_PERMISSIONS } from './constants';
|
|
4
|
-
import { getGetLocaleMethodImplementation, getClearSnapStateMethodImplementation, getGetSnapStateMethodImplementation, getUpdateSnapStateMethodImplementation, getShowDialogImplementation, getShowInAppNotificationImplementation, getShowNativeNotificationImplementation, encryptImplementation, decryptImplementation, getCreateInterfaceImplementation, getGetInterfaceImplementation } from './hooks';
|
|
5
|
-
/**
|
|
6
|
-
* Get a function which resolves with the specified result.
|
|
7
|
-
*
|
|
8
|
-
* @param result - The result to return.
|
|
9
|
-
* @returns The function implementation.
|
|
10
|
-
*/ export function resolve(result) {
|
|
11
|
-
return ()=>result;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Get a function which resolves with the specified result.
|
|
15
|
-
*
|
|
16
|
-
* @param result - The result to return. If not specified, the function will
|
|
17
|
-
* resolve with `undefined`.
|
|
18
|
-
* @returns The function implementation.
|
|
19
|
-
*/ export function asyncResolve(result) {
|
|
20
|
-
return async ()=>result;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Get the permission specifications for the Snap.
|
|
24
|
-
*
|
|
25
|
-
* @param options - The options.
|
|
26
|
-
* @param options.controllerMessenger - The controller messenger.
|
|
27
|
-
* @param options.hooks - The hooks.
|
|
28
|
-
* @param options.runSaga - The function to run a saga outside the usual Redux
|
|
29
|
-
* flow.
|
|
30
|
-
* @param options.options - The simulation options.
|
|
31
|
-
* @returns The permission specifications for the Snap.
|
|
32
|
-
*/ export function getPermissionSpecifications({ controllerMessenger, hooks, runSaga, options }) {
|
|
33
|
-
return {
|
|
34
|
-
...buildSnapEndowmentSpecifications(EXCLUDED_SNAP_ENDOWMENTS),
|
|
35
|
-
...buildSnapRestrictedMethodSpecifications(EXCLUDED_SNAP_PERMISSIONS, {
|
|
36
|
-
// Shared hooks.
|
|
37
|
-
...hooks,
|
|
38
|
-
// Encryption and decryption hooks.
|
|
39
|
-
// TODO: Swap these out for the real implementations.
|
|
40
|
-
encrypt: encryptImplementation,
|
|
41
|
-
decrypt: decryptImplementation,
|
|
42
|
-
// Snaps-specific hooks.
|
|
43
|
-
clearSnapState: getClearSnapStateMethodImplementation(runSaga),
|
|
44
|
-
getLocale: getGetLocaleMethodImplementation(options),
|
|
45
|
-
getSnapState: getGetSnapStateMethodImplementation(runSaga),
|
|
46
|
-
getUnlockPromise: asyncResolve(true),
|
|
47
|
-
// TODO: Allow the user to specify the result of this function.
|
|
48
|
-
isOnPhishingList: resolve(false),
|
|
49
|
-
maybeUpdatePhishingList: asyncResolve(),
|
|
50
|
-
showDialog: getShowDialogImplementation(runSaga),
|
|
51
|
-
showInAppNotification: getShowInAppNotificationImplementation(runSaga),
|
|
52
|
-
showNativeNotification: getShowNativeNotificationImplementation(runSaga),
|
|
53
|
-
updateSnapState: getUpdateSnapStateMethodImplementation(runSaga),
|
|
54
|
-
createInterface: getCreateInterfaceImplementation(controllerMessenger),
|
|
55
|
-
getInterface: getGetInterfaceImplementation(controllerMessenger)
|
|
56
|
-
})
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Get the endowments for the Snap.
|
|
61
|
-
*
|
|
62
|
-
* @param permissionController - The permission controller.
|
|
63
|
-
* @param snapId - The ID of the Snap.
|
|
64
|
-
* @returns The endowments for the Snap.
|
|
65
|
-
*/ export async function getEndowments(permissionController, snapId) {
|
|
66
|
-
const allEndowments = await Object.keys(endowmentPermissionBuilders).reduce(async (promise, permissionName)=>{
|
|
67
|
-
const accumulator = await promise;
|
|
68
|
-
if (permissionController.hasPermission(snapId, permissionName)) {
|
|
69
|
-
const endowments = await permissionController.getEndowments(snapId, permissionName);
|
|
70
|
-
if (endowments) {
|
|
71
|
-
return accumulator.concat(endowments);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return accumulator;
|
|
75
|
-
}, Promise.resolve([]));
|
|
76
|
-
return [
|
|
77
|
-
...new Set([
|
|
78
|
-
...DEFAULT_ENDOWMENTS,
|
|
79
|
-
...allEndowments
|
|
80
|
-
])
|
|
81
|
-
];
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
//# sourceMappingURL=specifications.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/internals/simulation/methods/specifications.ts"],"sourcesContent":["import type { GenericPermissionController } from '@metamask/permission-controller';\nimport {\n endowmentPermissionBuilders,\n buildSnapEndowmentSpecifications,\n buildSnapRestrictedMethodSpecifications,\n} from '@metamask/snaps-rpc-methods';\nimport type { SnapId } from '@metamask/snaps-sdk';\nimport { DEFAULT_ENDOWMENTS } from '@metamask/snaps-utils';\n\nimport type { RootControllerMessenger } from '../controllers';\nimport type { SimulationOptions } from '../options';\nimport type { RunSagaFunction } from '../store';\nimport {\n EXCLUDED_SNAP_ENDOWMENTS,\n EXCLUDED_SNAP_PERMISSIONS,\n} from './constants';\nimport {\n getGetLocaleMethodImplementation,\n getClearSnapStateMethodImplementation,\n getGetSnapStateMethodImplementation,\n getUpdateSnapStateMethodImplementation,\n getShowDialogImplementation,\n getShowInAppNotificationImplementation,\n getShowNativeNotificationImplementation,\n encryptImplementation,\n decryptImplementation,\n getCreateInterfaceImplementation,\n getGetInterfaceImplementation,\n} from './hooks';\n\nexport type PermissionSpecificationsHooks = {\n /**\n * A hook that returns the user's secret recovery phrase.\n *\n * @returns The user's secret recovery phrase.\n */\n getMnemonic: () => Promise<Uint8Array>;\n};\n\nexport type GetPermissionSpecificationsOptions = {\n controllerMessenger: RootControllerMessenger;\n hooks: PermissionSpecificationsHooks;\n runSaga: RunSagaFunction;\n options: SimulationOptions;\n};\n\n/**\n * Get a function which resolves with the specified result.\n *\n * @param result - The result to return.\n * @returns The function implementation.\n */\nexport function resolve(result: unknown) {\n return () => result;\n}\n\n/**\n * Get a function which resolves with the specified result.\n *\n * @param result - The result to return. If not specified, the function will\n * resolve with `undefined`.\n * @returns The function implementation.\n */\nexport function asyncResolve(result?: unknown) {\n return async () => result;\n}\n\n/**\n * Get the permission specifications for the Snap.\n *\n * @param options - The options.\n * @param options.controllerMessenger - The controller messenger.\n * @param options.hooks - The hooks.\n * @param options.runSaga - The function to run a saga outside the usual Redux\n * flow.\n * @param options.options - The simulation options.\n * @returns The permission specifications for the Snap.\n */\nexport function getPermissionSpecifications({\n controllerMessenger,\n hooks,\n runSaga,\n options,\n}: GetPermissionSpecificationsOptions) {\n return {\n ...buildSnapEndowmentSpecifications(EXCLUDED_SNAP_ENDOWMENTS),\n ...buildSnapRestrictedMethodSpecifications(EXCLUDED_SNAP_PERMISSIONS, {\n // Shared hooks.\n ...hooks,\n\n // Encryption and decryption hooks.\n // TODO: Swap these out for the real implementations.\n encrypt: encryptImplementation,\n decrypt: decryptImplementation,\n\n // Snaps-specific hooks.\n clearSnapState: getClearSnapStateMethodImplementation(runSaga),\n getLocale: getGetLocaleMethodImplementation(options),\n getSnapState: getGetSnapStateMethodImplementation(runSaga),\n getUnlockPromise: asyncResolve(true),\n\n // TODO: Allow the user to specify the result of this function.\n isOnPhishingList: resolve(false),\n\n maybeUpdatePhishingList: asyncResolve(),\n showDialog: getShowDialogImplementation(runSaga),\n showInAppNotification: getShowInAppNotificationImplementation(runSaga),\n showNativeNotification: getShowNativeNotificationImplementation(runSaga),\n updateSnapState: getUpdateSnapStateMethodImplementation(runSaga),\n createInterface: getCreateInterfaceImplementation(controllerMessenger),\n getInterface: getGetInterfaceImplementation(controllerMessenger),\n }),\n };\n}\n\n/**\n * Get the endowments for the Snap.\n *\n * @param permissionController - The permission controller.\n * @param snapId - The ID of the Snap.\n * @returns The endowments for the Snap.\n */\nexport async function getEndowments(\n permissionController: GenericPermissionController,\n snapId: SnapId,\n) {\n const allEndowments = await Object.keys(endowmentPermissionBuilders).reduce<\n Promise<string[]>\n >(async (promise, permissionName) => {\n const accumulator = await promise;\n if (permissionController.hasPermission(snapId, permissionName)) {\n const endowments = await permissionController.getEndowments(\n snapId,\n permissionName,\n );\n\n if (endowments) {\n return accumulator.concat(endowments as string[]);\n }\n }\n\n return accumulator;\n }, Promise.resolve([]));\n\n return [...new Set([...DEFAULT_ENDOWMENTS, ...allEndowments])];\n}\n"],"names":["endowmentPermissionBuilders","buildSnapEndowmentSpecifications","buildSnapRestrictedMethodSpecifications","DEFAULT_ENDOWMENTS","EXCLUDED_SNAP_ENDOWMENTS","EXCLUDED_SNAP_PERMISSIONS","getGetLocaleMethodImplementation","getClearSnapStateMethodImplementation","getGetSnapStateMethodImplementation","getUpdateSnapStateMethodImplementation","getShowDialogImplementation","getShowInAppNotificationImplementation","getShowNativeNotificationImplementation","encryptImplementation","decryptImplementation","getCreateInterfaceImplementation","getGetInterfaceImplementation","resolve","result","asyncResolve","getPermissionSpecifications","controllerMessenger","hooks","runSaga","options","encrypt","decrypt","clearSnapState","getLocale","getSnapState","getUnlockPromise","isOnPhishingList","maybeUpdatePhishingList","showDialog","showInAppNotification","showNativeNotification","updateSnapState","createInterface","getInterface","getEndowments","permissionController","snapId","allEndowments","Object","keys","reduce","promise","permissionName","accumulator","hasPermission","endowments","concat","Promise","Set"],"mappings":"AACA,SACEA,2BAA2B,EAC3BC,gCAAgC,EAChCC,uCAAuC,QAClC,8BAA8B;AAErC,SAASC,kBAAkB,QAAQ,wBAAwB;AAK3D,SACEC,wBAAwB,EACxBC,yBAAyB,QACpB,cAAc;AACrB,SACEC,gCAAgC,EAChCC,qCAAqC,EACrCC,mCAAmC,EACnCC,sCAAsC,EACtCC,2BAA2B,EAC3BC,sCAAsC,EACtCC,uCAAuC,EACvCC,qBAAqB,EACrBC,qBAAqB,EACrBC,gCAAgC,EAChCC,6BAA6B,QACxB,UAAU;AAkBjB;;;;;CAKC,GACD,OAAO,SAASC,QAAQC,MAAe;IACrC,OAAO,IAAMA;AACf;AAEA;;;;;;CAMC,GACD,OAAO,SAASC,aAAaD,MAAgB;IAC3C,OAAO,UAAYA;AACrB;AAEA;;;;;;;;;;CAUC,GACD,OAAO,SAASE,4BAA4B,EAC1CC,mBAAmB,EACnBC,KAAK,EACLC,OAAO,EACPC,OAAO,EAC4B;IACnC,OAAO;QACL,GAAGvB,iCAAiCG,yBAAyB;QAC7D,GAAGF,wCAAwCG,2BAA2B;YACpE,gBAAgB;YAChB,GAAGiB,KAAK;YAER,mCAAmC;YACnC,qDAAqD;YACrDG,SAASZ;YACTa,SAASZ;YAET,wBAAwB;YACxBa,gBAAgBpB,sCAAsCgB;YACtDK,WAAWtB,iCAAiCkB;YAC5CK,cAAcrB,oCAAoCe;YAClDO,kBAAkBX,aAAa;YAE/B,+DAA+D;YAC/DY,kBAAkBd,QAAQ;YAE1Be,yBAAyBb;YACzBc,YAAYvB,4BAA4Ba;YACxCW,uBAAuBvB,uCAAuCY;YAC9DY,wBAAwBvB,wCAAwCW;YAChEa,iBAAiB3B,uCAAuCc;YACxDc,iBAAiBtB,iCAAiCM;YAClDiB,cAActB,8BAA8BK;QAC9C,EAAE;IACJ;AACF;AAEA;;;;;;CAMC,GACD,OAAO,eAAekB,cACpBC,oBAAiD,EACjDC,MAAc;IAEd,MAAMC,gBAAgB,MAAMC,OAAOC,IAAI,CAAC5C,6BAA6B6C,MAAM,CAEzE,OAAOC,SAASC;QAChB,MAAMC,cAAc,MAAMF;QAC1B,IAAIN,qBAAqBS,aAAa,CAACR,QAAQM,iBAAiB;YAC9D,MAAMG,aAAa,MAAMV,qBAAqBD,aAAa,CACzDE,QACAM;YAGF,IAAIG,YAAY;gBACd,OAAOF,YAAYG,MAAM,CAACD;YAC5B;QACF;QAEA,OAAOF;IACT,GAAGI,QAAQnC,OAAO,CAAC,EAAE;IAErB,OAAO;WAAI,IAAIoC,IAAI;eAAIlD;eAAuBuC;SAAc;KAAE;AAChE"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { createFetchMiddleware } from '@metamask/eth-json-rpc-middleware';
|
|
2
|
-
import { JsonRpcEngine } from '@metamask/json-rpc-engine';
|
|
3
|
-
import { createSnapsMethodMiddleware } from '@metamask/snaps-rpc-methods';
|
|
4
|
-
import { DEFAULT_JSON_RPC_ENDPOINT } from '../constants';
|
|
5
|
-
import { createInternalMethodsMiddleware } from './internal-methods';
|
|
6
|
-
import { createMockMiddleware } from './mock';
|
|
7
|
-
/**
|
|
8
|
-
* Create a JSON-RPC engine for use in a simulated environment. This engine
|
|
9
|
-
* should be used to handle all JSON-RPC requests. It is set up to handle
|
|
10
|
-
* requests that would normally be handled internally by the MetaMask client, as
|
|
11
|
-
* well as Snap-specific requests.
|
|
12
|
-
*
|
|
13
|
-
* @param options - The options to use when creating the engine.
|
|
14
|
-
* @param options.store - The Redux store to use.
|
|
15
|
-
* @param options.hooks - Any hooks used by the middleware handlers.
|
|
16
|
-
* @param options.permissionMiddleware - The permission middleware to use.
|
|
17
|
-
* @param options.endpoint - The JSON-RPC endpoint to use for Ethereum requests.
|
|
18
|
-
* @returns A JSON-RPC engine.
|
|
19
|
-
*/ export function createJsonRpcEngine({ store, hooks, permissionMiddleware, endpoint = DEFAULT_JSON_RPC_ENDPOINT }) {
|
|
20
|
-
const engine = new JsonRpcEngine();
|
|
21
|
-
engine.push(createMockMiddleware(store));
|
|
22
|
-
engine.push(createInternalMethodsMiddleware(hooks));
|
|
23
|
-
engine.push(createSnapsMethodMiddleware(true, hooks));
|
|
24
|
-
engine.push(permissionMiddleware);
|
|
25
|
-
engine.push(createFetchMiddleware({
|
|
26
|
-
btoa: globalThis.btoa,
|
|
27
|
-
fetch: globalThis.fetch,
|
|
28
|
-
rpcUrl: endpoint
|
|
29
|
-
}));
|
|
30
|
-
return engine;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
//# sourceMappingURL=engine.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/internals/simulation/middleware/engine.ts"],"sourcesContent":["import { createFetchMiddleware } from '@metamask/eth-json-rpc-middleware';\nimport type { JsonRpcMiddleware } from '@metamask/json-rpc-engine';\nimport { JsonRpcEngine } from '@metamask/json-rpc-engine';\nimport type { RestrictedMethodParameters } from '@metamask/permission-controller';\nimport { createSnapsMethodMiddleware } from '@metamask/snaps-rpc-methods';\nimport type { Json } from '@metamask/utils';\n\nimport { DEFAULT_JSON_RPC_ENDPOINT } from '../constants';\nimport type { MiddlewareHooks } from '../simulation';\nimport type { Store } from '../store';\nimport { createInternalMethodsMiddleware } from './internal-methods';\nimport { createMockMiddleware } from './mock';\n\nexport type CreateJsonRpcEngineOptions = {\n store: Store;\n hooks: MiddlewareHooks;\n permissionMiddleware: JsonRpcMiddleware<RestrictedMethodParameters, Json>;\n endpoint?: string;\n};\n\n/**\n * Create a JSON-RPC engine for use in a simulated environment. This engine\n * should be used to handle all JSON-RPC requests. It is set up to handle\n * requests that would normally be handled internally by the MetaMask client, as\n * well as Snap-specific requests.\n *\n * @param options - The options to use when creating the engine.\n * @param options.store - The Redux store to use.\n * @param options.hooks - Any hooks used by the middleware handlers.\n * @param options.permissionMiddleware - The permission middleware to use.\n * @param options.endpoint - The JSON-RPC endpoint to use for Ethereum requests.\n * @returns A JSON-RPC engine.\n */\nexport function createJsonRpcEngine({\n store,\n hooks,\n permissionMiddleware,\n endpoint = DEFAULT_JSON_RPC_ENDPOINT,\n}: CreateJsonRpcEngineOptions) {\n const engine = new JsonRpcEngine();\n engine.push(createMockMiddleware(store));\n engine.push(createInternalMethodsMiddleware(hooks));\n engine.push(createSnapsMethodMiddleware(true, hooks));\n engine.push(permissionMiddleware);\n engine.push(\n createFetchMiddleware({\n btoa: globalThis.btoa,\n fetch: globalThis.fetch,\n rpcUrl: endpoint,\n }),\n );\n\n return engine;\n}\n"],"names":["createFetchMiddleware","JsonRpcEngine","createSnapsMethodMiddleware","DEFAULT_JSON_RPC_ENDPOINT","createInternalMethodsMiddleware","createMockMiddleware","createJsonRpcEngine","store","hooks","permissionMiddleware","endpoint","engine","push","btoa","globalThis","fetch","rpcUrl"],"mappings":"AAAA,SAASA,qBAAqB,QAAQ,oCAAoC;AAE1E,SAASC,aAAa,QAAQ,4BAA4B;AAE1D,SAASC,2BAA2B,QAAQ,8BAA8B;AAG1E,SAASC,yBAAyB,QAAQ,eAAe;AAGzD,SAASC,+BAA+B,QAAQ,qBAAqB;AACrE,SAASC,oBAAoB,QAAQ,SAAS;AAS9C;;;;;;;;;;;;CAYC,GACD,OAAO,SAASC,oBAAoB,EAClCC,KAAK,EACLC,KAAK,EACLC,oBAAoB,EACpBC,WAAWP,yBAAyB,EACT;IAC3B,MAAMQ,SAAS,IAAIV;IACnBU,OAAOC,IAAI,CAACP,qBAAqBE;IACjCI,OAAOC,IAAI,CAACR,gCAAgCI;IAC5CG,OAAOC,IAAI,CAACV,4BAA4B,MAAMM;IAC9CG,OAAOC,IAAI,CAACH;IACZE,OAAOC,IAAI,CACTZ,sBAAsB;QACpBa,MAAMC,WAAWD,IAAI;QACrBE,OAAOD,WAAWC,KAAK;QACvBC,QAAQN;IACV;IAGF,OAAOC;AACT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/internals/simulation/middleware/index.ts"],"sourcesContent":["export * from './engine';\n"],"names":[],"mappings":"AAAA,cAAc,WAAW"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { BIP44Node } from '@metamask/key-tree';
|
|
2
|
-
/**
|
|
3
|
-
* A mock handler for account related methods that always returns the first
|
|
4
|
-
* address for the selected secret recovery phrase.
|
|
5
|
-
*
|
|
6
|
-
* @param _request - Incoming JSON-RPC request. This is ignored for this
|
|
7
|
-
* specific handler.
|
|
8
|
-
* @param response - The outgoing JSON-RPC response, modified to return the
|
|
9
|
-
* result.
|
|
10
|
-
* @param _next - The `json-rpc-engine` middleware next handler.
|
|
11
|
-
* @param end - The `json-rpc-engine` middleware end handler.
|
|
12
|
-
* @param hooks - Any hooks required by this handler.
|
|
13
|
-
*/ export async function getAccountsHandler(_request, response, _next, end, hooks) {
|
|
14
|
-
const { getMnemonic } = hooks;
|
|
15
|
-
const node = await BIP44Node.fromDerivationPath({
|
|
16
|
-
derivationPath: [
|
|
17
|
-
await getMnemonic(),
|
|
18
|
-
`bip32:44'`,
|
|
19
|
-
`bip32:60'`,
|
|
20
|
-
`bip32:0'`,
|
|
21
|
-
`bip32:0`,
|
|
22
|
-
`bip32:0`
|
|
23
|
-
]
|
|
24
|
-
});
|
|
25
|
-
response.result = [
|
|
26
|
-
node.address
|
|
27
|
-
];
|
|
28
|
-
return end();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
//# sourceMappingURL=accounts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/internals/simulation/middleware/internal-methods/accounts.ts"],"sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport { BIP44Node } from '@metamask/key-tree';\nimport type {\n Json,\n JsonRpcRequest,\n PendingJsonRpcResponse,\n} from '@metamask/utils';\n\nexport type GetAccountsHandlerHooks = {\n getMnemonic: () => Promise<Uint8Array>;\n};\n\n/**\n * A mock handler for account related methods that always returns the first\n * address for the selected secret recovery phrase.\n *\n * @param _request - Incoming JSON-RPC request. This is ignored for this\n * specific handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @param hooks - Any hooks required by this handler.\n */\nexport async function getAccountsHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse<Json>,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n hooks: GetAccountsHandlerHooks,\n) {\n const { getMnemonic } = hooks;\n\n const node = await BIP44Node.fromDerivationPath({\n derivationPath: [\n await getMnemonic(),\n `bip32:44'`,\n `bip32:60'`,\n `bip32:0'`,\n `bip32:0`,\n `bip32:0`,\n ],\n });\n\n response.result = [node.address];\n return end();\n}\n"],"names":["BIP44Node","getAccountsHandler","_request","response","_next","end","hooks","getMnemonic","node","fromDerivationPath","derivationPath","result","address"],"mappings":"AAIA,SAASA,SAAS,QAAQ,qBAAqB;AAW/C;;;;;;;;;;;CAWC,GACD,OAAO,eAAeC,mBACpBC,QAAwB,EACxBC,QAAsC,EACtCC,KAAgC,EAChCC,GAA6B,EAC7BC,KAA8B;IAE9B,MAAM,EAAEC,WAAW,EAAE,GAAGD;IAExB,MAAME,OAAO,MAAMR,UAAUS,kBAAkB,CAAC;QAC9CC,gBAAgB;YACd,MAAMH;YACN,CAAC,SAAS,CAAC;YACX,CAAC,SAAS,CAAC;YACX,CAAC,QAAQ,CAAC;YACV,CAAC,OAAO,CAAC;YACT,CAAC,OAAO,CAAC;SACV;IACH;IAEAJ,SAASQ,MAAM,GAAG;QAACH,KAAKI,OAAO;KAAC;IAChC,OAAOP;AACT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/internals/simulation/middleware/internal-methods/index.ts"],"sourcesContent":["export * from './middleware';\n"],"names":[],"mappings":"AAAA,cAAc,eAAe"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { logError } from '@metamask/snaps-utils';
|
|
2
|
-
import { getAccountsHandler } from './accounts';
|
|
3
|
-
import { getProviderStateHandler } from './provider-state';
|
|
4
|
-
const methodHandlers = {
|
|
5
|
-
/* eslint-disable @typescript-eslint/naming-convention */ metamask_getProviderState: getProviderStateHandler,
|
|
6
|
-
eth_requestAccounts: getAccountsHandler,
|
|
7
|
-
eth_accounts: getAccountsHandler
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Create a middleware for handling JSON-RPC methods normally handled internally
|
|
11
|
-
* by the MetaMask client.
|
|
12
|
-
*
|
|
13
|
-
* NOTE: This middleware provides all `hooks` to all handlers and should
|
|
14
|
-
* therefore NOT be used outside of the simulation environment. It is intended
|
|
15
|
-
* for testing purposes only.
|
|
16
|
-
*
|
|
17
|
-
* @param hooks - Any hooks used by the middleware handlers.
|
|
18
|
-
* @returns A middleware function.
|
|
19
|
-
*/ export function createInternalMethodsMiddleware(hooks) {
|
|
20
|
-
// This should probably use createAsyncMiddleware.
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
22
|
-
return async function methodMiddleware(request, response, next, end) {
|
|
23
|
-
const handler = methodHandlers[request.method];
|
|
24
|
-
if (handler) {
|
|
25
|
-
try {
|
|
26
|
-
// Implementations may or may not be async, so we must await them.
|
|
27
|
-
return await handler(request, response, next, end, hooks);
|
|
28
|
-
} catch (error) {
|
|
29
|
-
logError(error);
|
|
30
|
-
return end(error);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return next();
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
//# sourceMappingURL=middleware.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/internals/simulation/middleware/internal-methods/middleware.ts"],"sourcesContent":["import type { JsonRpcMiddleware } from '@metamask/json-rpc-engine';\nimport { logError } from '@metamask/snaps-utils';\nimport type { Json, JsonRpcParams } from '@metamask/utils';\n\nimport { getAccountsHandler } from './accounts';\nimport { getProviderStateHandler } from './provider-state';\n\nexport type InternalMethodsMiddlewareHooks = {\n /**\n * A hook that returns the user's secret recovery phrase.\n *\n * @returns The user's secret recovery phrase.\n */\n getMnemonic: () => Promise<Uint8Array>;\n};\n\nconst methodHandlers = {\n /* eslint-disable @typescript-eslint/naming-convention */\n metamask_getProviderState: getProviderStateHandler,\n eth_requestAccounts: getAccountsHandler,\n eth_accounts: getAccountsHandler,\n /* eslint-enable @typescript-eslint/naming-convention */\n};\n\n/**\n * Create a middleware for handling JSON-RPC methods normally handled internally\n * by the MetaMask client.\n *\n * NOTE: This middleware provides all `hooks` to all handlers and should\n * therefore NOT be used outside of the simulation environment. It is intended\n * for testing purposes only.\n *\n * @param hooks - Any hooks used by the middleware handlers.\n * @returns A middleware function.\n */\nexport function createInternalMethodsMiddleware(\n hooks: InternalMethodsMiddlewareHooks,\n): JsonRpcMiddleware<JsonRpcParams, Json> {\n // This should probably use createAsyncMiddleware.\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n return async function methodMiddleware(request, response, next, end) {\n const handler =\n methodHandlers[request.method as keyof typeof methodHandlers];\n if (handler) {\n try {\n // Implementations may or may not be async, so we must await them.\n return await handler(request, response, next, end, hooks);\n } catch (error: any) {\n logError(error);\n return end(error);\n }\n }\n\n return next();\n };\n}\n"],"names":["logError","getAccountsHandler","getProviderStateHandler","methodHandlers","metamask_getProviderState","eth_requestAccounts","eth_accounts","createInternalMethodsMiddleware","hooks","methodMiddleware","request","response","next","end","handler","method","error"],"mappings":"AACA,SAASA,QAAQ,QAAQ,wBAAwB;AAGjD,SAASC,kBAAkB,QAAQ,aAAa;AAChD,SAASC,uBAAuB,QAAQ,mBAAmB;AAW3D,MAAMC,iBAAiB;IACrB,uDAAuD,GACvDC,2BAA2BF;IAC3BG,qBAAqBJ;IACrBK,cAAcL;AAEhB;AAEA;;;;;;;;;;CAUC,GACD,OAAO,SAASM,gCACdC,KAAqC;IAErC,kDAAkD;IAClD,kEAAkE;IAClE,OAAO,eAAeC,iBAAiBC,OAAO,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,GAAG;QACjE,MAAMC,UACJX,cAAc,CAACO,QAAQK,MAAM,CAAgC;QAC/D,IAAID,SAAS;YACX,IAAI;gBACF,kEAAkE;gBAClE,OAAO,MAAMA,QAAQJ,SAASC,UAAUC,MAAMC,KAAKL;YACrD,EAAE,OAAOQ,OAAY;gBACnBhB,SAASgB;gBACT,OAAOH,IAAIG;YACb;QACF;QAEA,OAAOJ;IACT;AACF"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A mock handler for metamask_getProviderState that always returns a specific
|
|
3
|
-
* hardcoded result.
|
|
4
|
-
*
|
|
5
|
-
* @param _request - Incoming JSON-RPC request. Ignored for this specific
|
|
6
|
-
* handler.
|
|
7
|
-
* @param response - The outgoing JSON-RPC response, modified to return the
|
|
8
|
-
* result.
|
|
9
|
-
* @param _next - The `json-rpc-engine` middleware next handler.
|
|
10
|
-
* @param end - The `json-rpc-engine` middleware end handler.
|
|
11
|
-
*/ export async function getProviderStateHandler(_request, response, _next, end) {
|
|
12
|
-
// For now this will return a mocked result, this should probably match
|
|
13
|
-
// whatever network the simulation is using.
|
|
14
|
-
response.result = {
|
|
15
|
-
isUnlocked: true,
|
|
16
|
-
chainId: '0x01',
|
|
17
|
-
networkVersion: '0x01',
|
|
18
|
-
accounts: []
|
|
19
|
-
};
|
|
20
|
-
return end();
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=provider-state.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/internals/simulation/middleware/internal-methods/provider-state.ts"],"sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport type {\n Json,\n JsonRpcRequest,\n PendingJsonRpcResponse,\n} from '@metamask/utils';\n\n/**\n * A mock handler for metamask_getProviderState that always returns a specific\n * hardcoded result.\n *\n * @param _request - Incoming JSON-RPC request. Ignored for this specific\n * handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n */\nexport async function getProviderStateHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse<Json>,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n) {\n // For now this will return a mocked result, this should probably match\n // whatever network the simulation is using.\n response.result = {\n isUnlocked: true,\n chainId: '0x01',\n networkVersion: '0x01',\n accounts: [],\n };\n\n return end();\n}\n"],"names":["getProviderStateHandler","_request","response","_next","end","result","isUnlocked","chainId","networkVersion","accounts"],"mappings":"AAUA;;;;;;;;;;CAUC,GACD,OAAO,eAAeA,wBACpBC,QAAwB,EACxBC,QAAsC,EACtCC,KAAgC,EAChCC,GAA6B;IAE7B,uEAAuE;IACvE,4CAA4C;IAC5CF,SAASG,MAAM,GAAG;QAChBC,YAAY;QACZC,SAAS;QACTC,gBAAgB;QAChBC,UAAU,EAAE;IACd;IAEA,OAAOL;AACT"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { getJsonRpcMock } from '../store/mocks';
|
|
2
|
-
/**
|
|
3
|
-
* Create a middleware for handling JSON-RPC methods that have been mocked.
|
|
4
|
-
*
|
|
5
|
-
* @param store - The Redux store to use.
|
|
6
|
-
* @returns A middleware function.
|
|
7
|
-
*/ export function createMockMiddleware(store) {
|
|
8
|
-
return function mockMiddleware(request, response, next, end) {
|
|
9
|
-
const result = getJsonRpcMock(store.getState(), request.method);
|
|
10
|
-
if (result) {
|
|
11
|
-
response.result = result;
|
|
12
|
-
return end();
|
|
13
|
-
}
|
|
14
|
-
return next();
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=mock.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/internals/simulation/middleware/mock.ts"],"sourcesContent":["import type { JsonRpcMiddleware } from '@metamask/json-rpc-engine';\nimport type { Json, JsonRpcParams } from '@metamask/utils';\n\nimport type { Store } from '../store';\nimport { getJsonRpcMock } from '../store/mocks';\n\n/**\n * Create a middleware for handling JSON-RPC methods that have been mocked.\n *\n * @param store - The Redux store to use.\n * @returns A middleware function.\n */\nexport function createMockMiddleware(\n store: Store,\n): JsonRpcMiddleware<JsonRpcParams, Json> {\n return function mockMiddleware(request, response, next, end) {\n const result = getJsonRpcMock(store.getState(), request.method);\n if (result) {\n response.result = result;\n return end();\n }\n\n return next();\n };\n}\n"],"names":["getJsonRpcMock","createMockMiddleware","store","mockMiddleware","request","response","next","end","result","getState","method"],"mappings":"AAIA,SAASA,cAAc,QAAQ,iBAAiB;AAEhD;;;;;CAKC,GACD,OAAO,SAASC,qBACdC,KAAY;IAEZ,OAAO,SAASC,eAAeC,OAAO,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,GAAG;QACzD,MAAMC,SAASR,eAAeE,MAAMO,QAAQ,IAAIL,QAAQM,MAAM;QAC9D,IAAIF,QAAQ;YACVH,SAASG,MAAM,GAAGA;YAClB,OAAOD;QACT;QAEA,OAAOD;IACT;AACF"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { JsonStruct } from '@metamask/utils';
|
|
2
|
-
import { create, defaulted, nullable, object, optional, record, string } from 'superstruct';
|
|
3
|
-
import { DEFAULT_LOCALE, DEFAULT_SRP } from './constants';
|
|
4
|
-
const SimulationOptionsStruct = object({
|
|
5
|
-
secretRecoveryPhrase: defaulted(optional(string()), DEFAULT_SRP),
|
|
6
|
-
locale: defaulted(optional(string()), DEFAULT_LOCALE),
|
|
7
|
-
state: defaulted(optional(nullable(record(string(), JsonStruct))), null),
|
|
8
|
-
unencryptedState: defaulted(optional(nullable(record(string(), JsonStruct))), null)
|
|
9
|
-
});
|
|
10
|
-
/**
|
|
11
|
-
* Get the options for the simulation.
|
|
12
|
-
*
|
|
13
|
-
* @param options - The user options. Any options not specified will be filled
|
|
14
|
-
* in with default values.
|
|
15
|
-
* @returns The simulation options.
|
|
16
|
-
*/ export function getOptions(options) {
|
|
17
|
-
return create(options, SimulationOptionsStruct);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
//# sourceMappingURL=options.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/internals/simulation/options.ts"],"sourcesContent":["import { JsonStruct } from '@metamask/utils';\nimport type { Infer } from 'superstruct';\nimport {\n create,\n defaulted,\n nullable,\n object,\n optional,\n record,\n string,\n} from 'superstruct';\n\nimport { DEFAULT_LOCALE, DEFAULT_SRP } from './constants';\n\nconst SimulationOptionsStruct = object({\n secretRecoveryPhrase: defaulted(optional(string()), DEFAULT_SRP),\n locale: defaulted(optional(string()), DEFAULT_LOCALE),\n state: defaulted(optional(nullable(record(string(), JsonStruct))), null),\n unencryptedState: defaulted(\n optional(nullable(record(string(), JsonStruct))),\n null,\n ),\n});\n\n/**\n * Options for the simulation.\n *\n * @property secretRecoveryPhrase - The secret recovery phrase to use. This is\n * used to derive addresses and private keys. Defaults to a test recovery\n * phrase.\n * @property locale - The locale to use. Defaults to `en`.\n * @property state - The initial state of the Snap, if any. Defaults to `null`.\n */\nexport type SimulationUserOptions = Infer<typeof SimulationOptionsStruct>;\n\n/**\n * Options for the simulation, with defaults filled in.\n *\n * See {@link SimulationUserOptions} for documentation.\n */\nexport type SimulationOptions = Required<SimulationUserOptions>;\n\n/**\n * Get the options for the simulation.\n *\n * @param options - The user options. Any options not specified will be filled\n * in with default values.\n * @returns The simulation options.\n */\nexport function getOptions(options: SimulationUserOptions): SimulationOptions {\n return create(\n options,\n SimulationOptionsStruct,\n ) as Required<SimulationUserOptions>;\n}\n"],"names":["JsonStruct","create","defaulted","nullable","object","optional","record","string","DEFAULT_LOCALE","DEFAULT_SRP","SimulationOptionsStruct","secretRecoveryPhrase","locale","state","unencryptedState","getOptions","options"],"mappings":"AAAA,SAASA,UAAU,QAAQ,kBAAkB;AAE7C,SACEC,MAAM,EACNC,SAAS,EACTC,QAAQ,EACRC,MAAM,EACNC,QAAQ,EACRC,MAAM,EACNC,MAAM,QACD,cAAc;AAErB,SAASC,cAAc,EAAEC,WAAW,QAAQ,cAAc;AAE1D,MAAMC,0BAA0BN,OAAO;IACrCO,sBAAsBT,UAAUG,SAASE,WAAWE;IACpDG,QAAQV,UAAUG,SAASE,WAAWC;IACtCK,OAAOX,UAAUG,SAASF,SAASG,OAAOC,UAAUP,eAAe;IACnEc,kBAAkBZ,UAChBG,SAASF,SAASG,OAAOC,UAAUP,eACnC;AAEJ;AAoBA;;;;;;CAMC,GACD,OAAO,SAASe,WAAWC,OAA8B;IACvD,OAAOf,OACLe,SACAN;AAEJ"}
|