@metamask/snaps-jest 8.3.0 → 8.3.1
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 +11 -2
- package/dist/environment.cjs +96 -0
- package/dist/environment.cjs.map +1 -0
- package/dist/{types/environment.d.ts → environment.d.cts} +5 -4
- package/dist/environment.d.cts.map +1 -0
- package/dist/environment.d.mts +53 -0
- package/dist/environment.d.mts.map +1 -0
- package/dist/environment.mjs +94 -44
- package/dist/environment.mjs.map +1 -1
- package/dist/global.cjs +4 -0
- package/dist/global.cjs.map +1 -0
- package/dist/{types/global.d.ts → global.d.cts} +2 -1
- package/dist/global.d.cts.map +1 -0
- package/dist/global.d.mts +70 -0
- package/dist/global.d.mts.map +1 -0
- package/dist/global.mjs +2 -1
- package/dist/global.mjs.map +1 -1
- package/dist/helpers.cjs +240 -0
- package/dist/helpers.cjs.map +1 -0
- package/dist/{types/helpers.d.ts → helpers.d.cts} +5 -4
- package/dist/helpers.d.cts.map +1 -0
- package/dist/helpers.d.mts +132 -0
- package/dist/helpers.d.mts.map +1 -0
- package/dist/helpers.mjs +228 -56
- package/dist/helpers.mjs.map +1 -1
- package/dist/index.cjs +29 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +6 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +6 -67
- package/dist/index.mjs.map +1 -1
- package/dist/internals/environment.cjs +18 -0
- package/dist/internals/environment.cjs.map +1 -0
- package/dist/{types/internals/environment.d.ts → internals/environment.d.cts} +1 -0
- package/dist/internals/environment.d.cts.map +1 -0
- package/dist/internals/environment.d.mts +8 -0
- package/dist/internals/environment.d.mts.map +1 -0
- package/dist/internals/environment.mjs +13 -7
- package/dist/internals/environment.mjs.map +1 -1
- package/dist/internals/index.cjs +23 -0
- package/dist/internals/index.cjs.map +1 -0
- package/dist/internals/index.d.cts +7 -0
- package/dist/internals/index.d.cts.map +1 -0
- package/dist/internals/index.d.mts +7 -0
- package/dist/internals/index.d.mts.map +1 -0
- package/dist/internals/index.mjs +6 -149
- package/dist/internals/index.mjs.map +1 -1
- package/dist/internals/logger.cjs +6 -0
- package/dist/internals/logger.cjs.map +1 -0
- package/dist/{types/internals/logger.d.ts → internals/logger.d.cts} +1 -0
- package/dist/internals/logger.d.cts.map +1 -0
- package/dist/internals/logger.d.mts +3 -0
- package/dist/internals/logger.d.mts.map +1 -0
- package/dist/internals/logger.mjs +2 -7
- package/dist/internals/logger.mjs.map +1 -1
- package/dist/internals/request.cjs +143 -0
- package/dist/internals/request.cjs.map +1 -0
- package/dist/{types/internals/request.d.ts → internals/request.d.cts} +7 -6
- package/dist/internals/request.d.cts.map +1 -0
- package/dist/internals/request.d.mts +56 -0
- package/dist/internals/request.d.mts.map +1 -0
- package/dist/internals/request.mjs +137 -41
- package/dist/internals/request.mjs.map +1 -1
- package/dist/internals/server.cjs +74 -0
- package/dist/internals/server.cjs.map +1 -0
- package/dist/{types/internals/server.d.ts → internals/server.d.cts} +3 -2
- package/dist/internals/server.d.cts.map +1 -0
- package/dist/internals/server.d.mts +15 -0
- package/dist/internals/server.d.mts.map +1 -0
- package/dist/internals/server.mjs +73 -8
- package/dist/internals/server.mjs.map +1 -1
- package/dist/internals/simulation/constants.cjs +21 -0
- package/dist/internals/simulation/constants.cjs.map +1 -0
- package/dist/{types/internals/simulation/constants.d.ts → internals/simulation/constants.d.cts} +1 -0
- package/dist/internals/simulation/constants.d.cts.map +1 -0
- package/dist/internals/simulation/constants.d.mts +18 -0
- package/dist/internals/simulation/constants.d.mts.map +1 -0
- package/dist/internals/simulation/constants.mjs +17 -13
- package/dist/internals/simulation/constants.mjs.map +1 -1
- package/dist/internals/simulation/controllers.cjs +101 -0
- package/dist/internals/simulation/controllers.cjs.map +1 -0
- package/dist/{types/internals/simulation/controllers.d.ts → internals/simulation/controllers.d.cts} +11 -10
- package/dist/internals/simulation/controllers.d.cts.map +1 -0
- package/dist/internals/simulation/controllers.d.mts +41 -0
- package/dist/internals/simulation/controllers.d.mts.map +1 -0
- package/dist/internals/simulation/controllers.mjs +95 -24
- package/dist/internals/simulation/controllers.mjs.map +1 -1
- package/dist/internals/simulation/files.cjs +94 -0
- package/dist/internals/simulation/files.cjs.map +1 -0
- package/dist/{types/internals/simulation/files.d.ts → internals/simulation/files.d.cts} +6 -4
- package/dist/internals/simulation/files.d.cts.map +1 -0
- package/dist/internals/simulation/files.d.mts +49 -0
- package/dist/internals/simulation/files.d.mts.map +1 -0
- package/dist/internals/simulation/files.mjs +90 -13
- package/dist/internals/simulation/files.mjs.map +1 -1
- package/dist/internals/simulation/index.cjs +22 -0
- package/dist/internals/simulation/index.cjs.map +1 -0
- package/dist/internals/simulation/index.d.cts +6 -0
- package/dist/internals/simulation/index.d.cts.map +1 -0
- package/dist/internals/simulation/index.d.mts +6 -0
- package/dist/internals/simulation/index.d.mts.map +1 -0
- package/dist/internals/simulation/index.mjs +5 -110
- package/dist/internals/simulation/index.mjs.map +1 -1
- package/dist/internals/simulation/interface.cjs +527 -0
- package/dist/internals/simulation/interface.cjs.map +1 -0
- package/dist/{types/internals/simulation/interface.d.ts → internals/simulation/interface.d.cts} +9 -8
- package/dist/internals/simulation/interface.d.cts.map +1 -0
- package/dist/internals/simulation/interface.d.mts +152 -0
- package/dist/internals/simulation/interface.d.mts.map +1 -0
- package/dist/internals/simulation/interface.mjs +512 -36
- package/dist/internals/simulation/interface.mjs.map +1 -1
- package/dist/internals/simulation/methods/constants.cjs +72 -0
- package/dist/internals/simulation/methods/constants.cjs.map +1 -0
- package/dist/{types/internals/simulation/methods/constants.d.ts → internals/simulation/methods/constants.d.cts} +1 -0
- package/dist/internals/simulation/methods/constants.d.cts.map +1 -0
- package/dist/internals/simulation/methods/constants.d.mts +11 -0
- package/dist/internals/simulation/methods/constants.d.mts.map +1 -0
- package/dist/internals/simulation/methods/constants.mjs +68 -11
- package/dist/internals/simulation/methods/constants.mjs.map +1 -1
- package/dist/internals/simulation/methods/hooks/get-preferences.cjs +18 -0
- package/dist/internals/simulation/methods/hooks/get-preferences.cjs.map +1 -0
- package/dist/{types/internals/simulation/methods/hooks/get-preferences.d.ts → internals/simulation/methods/hooks/get-preferences.d.cts} +2 -1
- package/dist/internals/simulation/methods/hooks/get-preferences.d.cts.map +1 -0
- package/dist/internals/simulation/methods/hooks/get-preferences.d.mts +14 -0
- package/dist/internals/simulation/methods/hooks/get-preferences.d.mts.map +1 -0
- package/dist/internals/simulation/methods/hooks/get-preferences.mjs +13 -7
- package/dist/internals/simulation/methods/hooks/get-preferences.mjs.map +1 -1
- package/dist/internals/simulation/methods/hooks/index.cjs +22 -0
- package/dist/internals/simulation/methods/hooks/index.cjs.map +1 -0
- package/dist/internals/simulation/methods/hooks/index.d.cts +6 -0
- package/dist/internals/simulation/methods/hooks/index.d.cts.map +1 -0
- package/dist/internals/simulation/methods/hooks/index.d.mts +6 -0
- package/dist/internals/simulation/methods/hooks/index.d.mts.map +1 -0
- package/dist/internals/simulation/methods/hooks/index.mjs +5 -38
- package/dist/internals/simulation/methods/hooks/index.mjs.map +1 -1
- package/dist/internals/simulation/methods/hooks/interface.cjs +24 -0
- package/dist/internals/simulation/methods/hooks/interface.cjs.map +1 -0
- package/dist/{types/internals/simulation/methods/hooks/interface.d.ts → internals/simulation/methods/hooks/interface.d.cts} +3 -2
- package/dist/internals/simulation/methods/hooks/interface.d.cts.map +1 -0
- package/dist/internals/simulation/methods/hooks/interface.d.mts +17 -0
- package/dist/internals/simulation/methods/hooks/interface.d.mts.map +1 -0
- package/dist/internals/simulation/methods/hooks/interface.mjs +18 -9
- package/dist/internals/simulation/methods/hooks/interface.mjs.map +1 -1
- package/dist/internals/simulation/methods/hooks/notifications.cjs +58 -0
- package/dist/internals/simulation/methods/hooks/notifications.cjs.map +1 -0
- package/dist/{types/internals/simulation/methods/hooks/notifications.d.ts → internals/simulation/methods/hooks/notifications.d.cts} +5 -4
- package/dist/internals/simulation/methods/hooks/notifications.d.cts.map +1 -0
- package/dist/internals/simulation/methods/hooks/notifications.d.mts +17 -0
- package/dist/internals/simulation/methods/hooks/notifications.d.mts.map +1 -0
- package/dist/internals/simulation/methods/hooks/notifications.mjs +54 -15
- package/dist/internals/simulation/methods/hooks/notifications.mjs.map +1 -1
- package/dist/internals/simulation/methods/hooks/request-user-approval.cjs +38 -0
- package/dist/internals/simulation/methods/hooks/request-user-approval.cjs.map +1 -0
- package/dist/{types/internals/simulation/methods/hooks/request-user-approval.d.ts → internals/simulation/methods/hooks/request-user-approval.d.cts} +2 -1
- package/dist/internals/simulation/methods/hooks/request-user-approval.d.cts.map +1 -0
- package/dist/internals/simulation/methods/hooks/request-user-approval.d.mts +16 -0
- package/dist/internals/simulation/methods/hooks/request-user-approval.d.mts.map +1 -0
- package/dist/internals/simulation/methods/hooks/request-user-approval.mjs +34 -13
- package/dist/internals/simulation/methods/hooks/request-user-approval.mjs.map +1 -1
- package/dist/internals/simulation/methods/hooks/state.cjs +84 -0
- package/dist/internals/simulation/methods/hooks/state.cjs.map +1 -0
- package/dist/{types/internals/simulation/methods/hooks/state.d.ts → internals/simulation/methods/hooks/state.d.cts} +3 -2
- package/dist/internals/simulation/methods/hooks/state.d.cts.map +1 -0
- package/dist/internals/simulation/methods/hooks/state.d.mts +24 -0
- package/dist/internals/simulation/methods/hooks/state.d.mts.map +1 -0
- package/dist/internals/simulation/methods/hooks/state.mjs +78 -17
- package/dist/internals/simulation/methods/hooks/state.mjs.map +1 -1
- package/dist/internals/simulation/methods/index.cjs +18 -0
- package/dist/internals/simulation/methods/index.cjs.map +1 -0
- package/dist/internals/simulation/methods/index.d.cts +2 -0
- package/dist/internals/simulation/methods/index.d.cts.map +1 -0
- package/dist/internals/simulation/methods/index.d.mts +2 -0
- package/dist/internals/simulation/methods/index.d.mts.map +1 -0
- package/dist/internals/simulation/methods/index.mjs +1 -27
- package/dist/internals/simulation/methods/index.mjs.map +1 -1
- package/dist/internals/simulation/methods/specifications.cjs +85 -0
- package/dist/internals/simulation/methods/specifications.cjs.map +1 -0
- package/dist/{types/internals/simulation/methods/specifications.d.ts → internals/simulation/methods/specifications.d.cts} +6 -5
- package/dist/internals/simulation/methods/specifications.d.cts.map +1 -0
- package/dist/internals/simulation/methods/specifications.d.mts +57 -0
- package/dist/internals/simulation/methods/specifications.d.mts.map +1 -0
- package/dist/internals/simulation/methods/specifications.mjs +77 -26
- package/dist/internals/simulation/methods/specifications.mjs.map +1 -1
- package/dist/internals/simulation/middleware/engine.cjs +37 -0
- package/dist/internals/simulation/middleware/engine.cjs.map +1 -0
- package/dist/{types/internals/simulation/middleware/engine.d.ts → internals/simulation/middleware/engine.d.cts} +7 -6
- package/dist/internals/simulation/middleware/engine.d.cts.map +1 -0
- package/dist/internals/simulation/middleware/engine.d.mts +27 -0
- package/dist/internals/simulation/middleware/engine.d.mts.map +1 -0
- package/dist/internals/simulation/middleware/engine.mjs +33 -14
- package/dist/internals/simulation/middleware/engine.mjs.map +1 -1
- package/dist/internals/simulation/middleware/index.cjs +18 -0
- package/dist/internals/simulation/middleware/index.cjs.map +1 -0
- package/dist/internals/simulation/middleware/index.d.cts +2 -0
- package/dist/internals/simulation/middleware/index.d.cts.map +1 -0
- package/dist/internals/simulation/middleware/index.d.mts +2 -0
- package/dist/internals/simulation/middleware/index.d.mts.map +1 -0
- package/dist/internals/simulation/middleware/index.mjs +1 -15
- package/dist/internals/simulation/middleware/index.mjs.map +1 -1
- package/dist/internals/simulation/middleware/internal-methods/accounts.cjs +34 -0
- package/dist/internals/simulation/middleware/internal-methods/accounts.cjs.map +1 -0
- package/dist/{types/internals/simulation/middleware/internal-methods/accounts.d.ts → internals/simulation/middleware/internal-methods/accounts.d.cts} +4 -2
- package/dist/internals/simulation/middleware/internal-methods/accounts.d.cts.map +1 -0
- package/dist/internals/simulation/middleware/internal-methods/accounts.d.mts +20 -0
- package/dist/internals/simulation/middleware/internal-methods/accounts.d.mts.map +1 -0
- package/dist/internals/simulation/middleware/internal-methods/accounts.mjs +29 -7
- package/dist/internals/simulation/middleware/internal-methods/accounts.mjs.map +1 -1
- package/dist/internals/simulation/middleware/internal-methods/index.cjs +18 -0
- package/dist/internals/simulation/middleware/internal-methods/index.cjs.map +1 -0
- package/dist/internals/simulation/middleware/internal-methods/index.d.cts +2 -0
- package/dist/internals/simulation/middleware/internal-methods/index.d.cts.map +1 -0
- package/dist/internals/simulation/middleware/internal-methods/index.d.mts +2 -0
- package/dist/internals/simulation/middleware/internal-methods/index.d.mts.map +1 -0
- package/dist/internals/simulation/middleware/internal-methods/index.mjs +1 -10
- package/dist/internals/simulation/middleware/internal-methods/index.mjs.map +1 -1
- package/dist/internals/simulation/middleware/internal-methods/middleware.cjs +44 -0
- package/dist/internals/simulation/middleware/internal-methods/middleware.cjs.map +1 -0
- package/dist/{types/internals/simulation/middleware/internal-methods/middleware.d.ts → internals/simulation/middleware/internal-methods/middleware.d.cts} +3 -2
- package/dist/internals/simulation/middleware/internal-methods/middleware.d.cts.map +1 -0
- package/dist/internals/simulation/middleware/internal-methods/middleware.d.mts +23 -0
- package/dist/internals/simulation/middleware/internal-methods/middleware.d.mts.map +1 -0
- package/dist/internals/simulation/middleware/internal-methods/middleware.mjs +38 -8
- package/dist/internals/simulation/middleware/internal-methods/middleware.mjs.map +1 -1
- package/dist/internals/simulation/middleware/internal-methods/provider-state.cjs +28 -0
- package/dist/internals/simulation/middleware/internal-methods/provider-state.cjs.map +1 -0
- package/dist/{types/internals/simulation/middleware/internal-methods/provider-state.d.ts → internals/simulation/middleware/internal-methods/provider-state.d.cts} +4 -2
- package/dist/internals/simulation/middleware/internal-methods/provider-state.d.cts.map +1 -0
- package/dist/internals/simulation/middleware/internal-methods/provider-state.d.mts +16 -0
- package/dist/internals/simulation/middleware/internal-methods/provider-state.d.mts.map +1 -0
- package/dist/internals/simulation/middleware/internal-methods/provider-state.mjs +23 -7
- package/dist/internals/simulation/middleware/internal-methods/provider-state.mjs.map +1 -1
- package/dist/internals/simulation/middleware/mock.cjs +22 -0
- package/dist/internals/simulation/middleware/mock.cjs.map +1 -0
- package/dist/{types/internals/simulation/middleware/mock.d.ts → internals/simulation/middleware/mock.d.cts} +4 -3
- package/dist/internals/simulation/middleware/mock.d.cts.map +1 -0
- package/dist/internals/simulation/middleware/mock.d.mts +11 -0
- package/dist/internals/simulation/middleware/mock.d.mts.map +1 -0
- package/dist/internals/simulation/middleware/mock.mjs +17 -8
- package/dist/internals/simulation/middleware/mock.mjs.map +1 -1
- package/dist/internals/simulation/options.cjs +25 -0
- package/dist/internals/simulation/options.cjs.map +1 -0
- package/dist/{types/internals/simulation/options.d.ts → internals/simulation/options.d.cts} +3 -2
- package/dist/internals/simulation/options.d.cts.map +1 -0
- package/dist/internals/simulation/options.d.mts +40 -0
- package/dist/internals/simulation/options.d.mts.map +1 -0
- package/dist/internals/simulation/options.mjs +20 -8
- package/dist/internals/simulation/options.mjs.map +1 -1
- package/dist/internals/simulation/simulation.cjs +155 -0
- package/dist/internals/simulation/simulation.cjs.map +1 -0
- package/dist/{types/internals/simulation/simulation.d.ts → internals/simulation/simulation.d.cts} +11 -9
- package/dist/internals/simulation/simulation.d.cts.map +1 -0
- package/dist/internals/simulation/simulation.d.mts +103 -0
- package/dist/internals/simulation/simulation.d.mts.map +1 -0
- package/dist/internals/simulation/simulation.mjs +149 -38
- package/dist/internals/simulation/simulation.mjs.map +1 -1
- package/dist/internals/simulation/store/index.cjs +21 -0
- package/dist/internals/simulation/store/index.cjs.map +1 -0
- package/dist/internals/simulation/store/index.d.cts +5 -0
- package/dist/internals/simulation/store/index.d.cts.map +1 -0
- package/dist/internals/simulation/store/index.d.mts +5 -0
- package/dist/internals/simulation/store/index.d.mts.map +1 -0
- package/dist/internals/simulation/store/index.mjs +4 -43
- package/dist/internals/simulation/store/index.mjs.map +1 -1
- package/dist/internals/simulation/store/mocks.cjs +39 -0
- package/dist/internals/simulation/store/mocks.cjs.map +1 -0
- package/dist/{types/internals/simulation/store/mocks.d.ts → internals/simulation/store/mocks.d.cts} +6 -5
- package/dist/internals/simulation/store/mocks.d.cts.map +1 -0
- package/dist/internals/simulation/store/mocks.d.mts +36 -0
- package/dist/internals/simulation/store/mocks.d.mts.map +1 -0
- package/dist/internals/simulation/store/mocks.mjs +33 -14
- package/dist/internals/simulation/store/mocks.mjs.map +1 -1
- package/dist/internals/simulation/store/notifications.cjs +35 -0
- package/dist/internals/simulation/store/notifications.cjs.map +1 -0
- package/dist/{types/internals/simulation/store/notifications.d.ts → internals/simulation/store/notifications.d.cts} +6 -5
- package/dist/internals/simulation/store/notifications.d.cts.map +1 -0
- package/dist/internals/simulation/store/notifications.d.mts +45 -0
- package/dist/internals/simulation/store/notifications.d.mts.map +1 -0
- package/dist/internals/simulation/store/notifications.mjs +30 -14
- package/dist/internals/simulation/store/notifications.mjs.map +1 -1
- package/dist/internals/simulation/store/state.cjs +54 -0
- package/dist/internals/simulation/store/state.cjs.map +1 -0
- package/dist/{types/internals/simulation/store/state.d.ts → internals/simulation/store/state.d.cts} +6 -5
- package/dist/internals/simulation/store/state.d.cts.map +1 -0
- package/dist/internals/simulation/store/state.d.mts +56 -0
- package/dist/internals/simulation/store/state.d.mts.map +1 -0
- package/dist/internals/simulation/store/state.mjs +48 -12
- package/dist/internals/simulation/store/state.mjs.map +1 -1
- package/dist/internals/simulation/store/store.cjs +51 -0
- package/dist/internals/simulation/store/store.cjs.map +1 -0
- package/dist/{types/internals/simulation/store/store.d.ts → internals/simulation/store/store.d.cts} +2 -1
- package/dist/internals/simulation/store/store.d.cts.map +1 -0
- package/dist/internals/simulation/store/store.d.mts +22 -0
- package/dist/internals/simulation/store/store.d.mts.map +1 -0
- package/dist/internals/simulation/store/store.mjs +44 -11
- package/dist/internals/simulation/store/store.mjs.map +1 -1
- package/dist/internals/simulation/store/ui.cjs +24 -0
- package/dist/internals/simulation/store/ui.cjs.map +1 -0
- package/dist/{types/internals/simulation/store/ui.d.ts → internals/simulation/store/ui.d.cts} +6 -5
- package/dist/internals/simulation/store/ui.d.cts.map +1 -0
- package/dist/internals/simulation/store/ui.d.mts +27 -0
- package/dist/internals/simulation/store/ui.d.mts.map +1 -0
- package/dist/internals/simulation/store/ui.mjs +19 -14
- package/dist/internals/simulation/store/ui.mjs.map +1 -1
- package/dist/internals/structs.cjs +157 -0
- package/dist/internals/structs.cjs.map +1 -0
- package/dist/{types/internals/structs.d.ts → internals/structs.d.cts} +28 -27
- package/dist/internals/structs.d.cts.map +1 -0
- package/dist/internals/structs.d.mts +205 -0
- package/dist/internals/structs.d.mts.map +1 -0
- package/dist/internals/structs.mjs +153 -21
- package/dist/internals/structs.mjs.map +1 -1
- package/dist/matchers.cjs +160 -0
- package/dist/matchers.cjs.map +1 -0
- package/dist/{types/matchers.d.ts → matchers.d.cts} +4 -3
- package/dist/matchers.d.cts.map +1 -0
- package/dist/matchers.d.mts +28 -0
- package/dist/matchers.d.mts.map +1 -0
- package/dist/matchers.mjs +152 -47
- package/dist/matchers.mjs.map +1 -1
- package/dist/options.cjs +24 -0
- package/dist/options.cjs.map +1 -0
- package/dist/{types/options.d.ts → options.d.cts} +2 -1
- package/dist/options.d.cts.map +1 -0
- package/dist/options.d.mts +61 -0
- package/dist/options.d.mts.map +1 -0
- package/dist/options.mjs +19 -7
- package/dist/options.mjs.map +1 -1
- package/dist/setup.cjs +7 -0
- package/dist/setup.cjs.map +1 -0
- package/dist/setup.d.cts +2 -0
- package/dist/setup.d.cts.map +1 -0
- package/dist/setup.d.mts +2 -0
- package/dist/setup.d.mts.map +1 -0
- package/dist/setup.mjs +4 -37
- package/dist/setup.mjs.map +1 -1
- package/dist/types/index.cjs +18 -0
- package/dist/types/index.cjs.map +1 -0
- package/dist/types/index.d.cts +2 -0
- package/dist/types/index.d.cts.map +1 -0
- package/dist/types/index.d.mts +2 -0
- package/dist/types/index.d.mts.map +1 -0
- package/dist/types/index.mjs +2 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/types/types.cjs +3 -0
- package/dist/types/types.cjs.map +1 -0
- package/dist/types/{types.d.ts → types.d.cts} +7 -6
- package/dist/types/types.d.cts.map +1 -0
- package/dist/types/types.d.mts +386 -0
- package/dist/types/types.d.mts.map +1 -0
- package/dist/types/types.mjs +2 -0
- package/dist/types/types.mjs.map +1 -0
- package/jest-preset.js +1 -1
- package/package.json +25 -23
- package/dist/chunk-24CGIQLL.mjs +0 -30
- package/dist/chunk-24CGIQLL.mjs.map +0 -1
- package/dist/chunk-2JTGBHPR.js +0 -14
- package/dist/chunk-2JTGBHPR.js.map +0 -1
- package/dist/chunk-2RJYSYUB.js +0 -28
- package/dist/chunk-2RJYSYUB.js.map +0 -1
- package/dist/chunk-2YE2P5BZ.js +0 -36
- package/dist/chunk-2YE2P5BZ.js.map +0 -1
- package/dist/chunk-3FNLFVV2.js +0 -15
- package/dist/chunk-3FNLFVV2.js.map +0 -1
- package/dist/chunk-3J2IBWXV.mjs +0 -39
- package/dist/chunk-3J2IBWXV.mjs.map +0 -1
- package/dist/chunk-3NP6BDGK.js +0 -167
- package/dist/chunk-3NP6BDGK.js.map +0 -1
- package/dist/chunk-55J6XMHW.js +0 -1
- package/dist/chunk-55J6XMHW.js.map +0 -1
- package/dist/chunk-57SGDM5B.mjs +0 -69
- package/dist/chunk-57SGDM5B.mjs.map +0 -1
- package/dist/chunk-5U5WB3SM.mjs +0 -41
- package/dist/chunk-5U5WB3SM.mjs.map +0 -1
- package/dist/chunk-5ZFHFICZ.mjs +0 -1
- package/dist/chunk-5ZFHFICZ.mjs.map +0 -1
- package/dist/chunk-6HHV6YFQ.mjs +0 -1
- package/dist/chunk-6HHV6YFQ.mjs.map +0 -1
- package/dist/chunk-6JPBXAHM.mjs +0 -509
- package/dist/chunk-6JPBXAHM.mjs.map +0 -1
- package/dist/chunk-6V6MFT67.js +0 -38
- package/dist/chunk-6V6MFT67.js.map +0 -1
- package/dist/chunk-7PCHIR6O.mjs +0 -181
- package/dist/chunk-7PCHIR6O.mjs.map +0 -1
- package/dist/chunk-ALRZENWP.mjs +0 -42
- package/dist/chunk-ALRZENWP.mjs.map +0 -1
- package/dist/chunk-AMAL4SJH.js +0 -153
- package/dist/chunk-AMAL4SJH.js.map +0 -1
- package/dist/chunk-C26TYXXD.mjs +0 -240
- package/dist/chunk-C26TYXXD.mjs.map +0 -1
- package/dist/chunk-CACRY3TX.mjs +0 -104
- package/dist/chunk-CACRY3TX.mjs.map +0 -1
- package/dist/chunk-CKRORVDW.js +0 -1
- package/dist/chunk-CKRORVDW.js.map +0 -1
- package/dist/chunk-D653LBAY.js +0 -34
- package/dist/chunk-D653LBAY.js.map +0 -1
- package/dist/chunk-DR6Y7IVX.js +0 -1
- package/dist/chunk-DR6Y7IVX.js.map +0 -1
- package/dist/chunk-DUVKGPX5.js +0 -509
- package/dist/chunk-DUVKGPX5.js.map +0 -1
- package/dist/chunk-EMTW3H54.js +0 -20
- package/dist/chunk-EMTW3H54.js.map +0 -1
- package/dist/chunk-FP4H3ADT.mjs +0 -20
- package/dist/chunk-FP4H3ADT.mjs.map +0 -1
- package/dist/chunk-FQWOVTBB.mjs +0 -22
- package/dist/chunk-FQWOVTBB.mjs.map +0 -1
- package/dist/chunk-G333FBBL.mjs +0 -38
- package/dist/chunk-G333FBBL.mjs.map +0 -1
- package/dist/chunk-GECE47HW.js +0 -1
- package/dist/chunk-GECE47HW.js.map +0 -1
- package/dist/chunk-GLPGOEVE.js +0 -240
- package/dist/chunk-GLPGOEVE.js.map +0 -1
- package/dist/chunk-GMTKFAWO.js +0 -42
- package/dist/chunk-GMTKFAWO.js.map +0 -1
- package/dist/chunk-H2464AXT.mjs +0 -33
- package/dist/chunk-H2464AXT.mjs.map +0 -1
- package/dist/chunk-HROOL3VI.js +0 -1
- package/dist/chunk-HROOL3VI.js.map +0 -1
- package/dist/chunk-IWJ4HKDR.mjs +0 -50
- package/dist/chunk-IWJ4HKDR.mjs.map +0 -1
- package/dist/chunk-IXKO6X55.mjs +0 -15
- package/dist/chunk-IXKO6X55.mjs.map +0 -1
- package/dist/chunk-J3I5KZIF.js +0 -22
- package/dist/chunk-J3I5KZIF.js.map +0 -1
- package/dist/chunk-J4ZPUCLX.mjs +0 -8
- package/dist/chunk-J4ZPUCLX.mjs.map +0 -1
- package/dist/chunk-JMDSN227.mjs +0 -25
- package/dist/chunk-JMDSN227.mjs.map +0 -1
- package/dist/chunk-K7MK6LQU.js +0 -54
- package/dist/chunk-K7MK6LQU.js.map +0 -1
- package/dist/chunk-KIQOUUEZ.mjs +0 -1
- package/dist/chunk-KIQOUUEZ.mjs.map +0 -1
- package/dist/chunk-KOPPL55J.mjs +0 -28
- package/dist/chunk-KOPPL55J.mjs.map +0 -1
- package/dist/chunk-KPRLFCKD.js +0 -13
- package/dist/chunk-KPRLFCKD.js.map +0 -1
- package/dist/chunk-LACTK6EO.js +0 -33
- package/dist/chunk-LACTK6EO.js.map +0 -1
- package/dist/chunk-LB4R3BUA.mjs +0 -36
- package/dist/chunk-LB4R3BUA.mjs.map +0 -1
- package/dist/chunk-LBC2OGSN.js +0 -48
- package/dist/chunk-LBC2OGSN.js.map +0 -1
- package/dist/chunk-LPMHPAZK.js +0 -203
- package/dist/chunk-LPMHPAZK.js.map +0 -1
- package/dist/chunk-LSKT2AUS.mjs +0 -97
- package/dist/chunk-LSKT2AUS.mjs.map +0 -1
- package/dist/chunk-LVNNGMJ2.mjs +0 -13
- package/dist/chunk-LVNNGMJ2.mjs.map +0 -1
- package/dist/chunk-MF43OG3Z.mjs +0 -1
- package/dist/chunk-MF43OG3Z.mjs.map +0 -1
- package/dist/chunk-MPZOXW6I.mjs +0 -48
- package/dist/chunk-MPZOXW6I.mjs.map +0 -1
- package/dist/chunk-N6MAO223.js +0 -60
- package/dist/chunk-N6MAO223.js.map +0 -1
- package/dist/chunk-NTOY6Y4Q.mjs +0 -1
- package/dist/chunk-NTOY6Y4Q.mjs.map +0 -1
- package/dist/chunk-OHRFO2BL.mjs +0 -89
- package/dist/chunk-OHRFO2BL.mjs.map +0 -1
- package/dist/chunk-OO6IVUCV.js +0 -104
- package/dist/chunk-OO6IVUCV.js.map +0 -1
- package/dist/chunk-ORR7AE5X.mjs +0 -54
- package/dist/chunk-ORR7AE5X.mjs.map +0 -1
- package/dist/chunk-PDOVVC74.mjs +0 -153
- package/dist/chunk-PDOVVC74.mjs.map +0 -1
- package/dist/chunk-PHUTP7NB.js +0 -25
- package/dist/chunk-PHUTP7NB.js.map +0 -1
- package/dist/chunk-Q2OQXAUM.mjs +0 -35
- package/dist/chunk-Q2OQXAUM.mjs.map +0 -1
- package/dist/chunk-Q3I6P2ZF.mjs +0 -167
- package/dist/chunk-Q3I6P2ZF.mjs.map +0 -1
- package/dist/chunk-QRVFWATH.mjs +0 -14
- package/dist/chunk-QRVFWATH.mjs.map +0 -1
- package/dist/chunk-QYHQ2WWX.js +0 -89
- package/dist/chunk-QYHQ2WWX.js.map +0 -1
- package/dist/chunk-RJNNNCZJ.js +0 -39
- package/dist/chunk-RJNNNCZJ.js.map +0 -1
- package/dist/chunk-ROCGQYSK.mjs +0 -203
- package/dist/chunk-ROCGQYSK.mjs.map +0 -1
- package/dist/chunk-RQKT6BQ2.mjs +0 -1
- package/dist/chunk-RQKT6BQ2.mjs.map +0 -1
- package/dist/chunk-S2HLITUN.js +0 -1
- package/dist/chunk-S2HLITUN.js.map +0 -1
- package/dist/chunk-SB5EPHE3.js +0 -41
- package/dist/chunk-SB5EPHE3.js.map +0 -1
- package/dist/chunk-SLU4FNKX.mjs +0 -60
- package/dist/chunk-SLU4FNKX.mjs.map +0 -1
- package/dist/chunk-SNXRXX2O.js +0 -30
- package/dist/chunk-SNXRXX2O.js.map +0 -1
- package/dist/chunk-SW65QYFV.js +0 -50
- package/dist/chunk-SW65QYFV.js.map +0 -1
- package/dist/chunk-TGZ7WOTJ.mjs +0 -1
- package/dist/chunk-TGZ7WOTJ.mjs.map +0 -1
- package/dist/chunk-TZB4LBT7.js +0 -8
- package/dist/chunk-TZB4LBT7.js.map +0 -1
- package/dist/chunk-UDOXICJK.mjs +0 -1
- package/dist/chunk-UDOXICJK.mjs.map +0 -1
- package/dist/chunk-VHJZERIC.js +0 -1
- package/dist/chunk-VHJZERIC.js.map +0 -1
- package/dist/chunk-VOYBI6T4.mjs +0 -22
- package/dist/chunk-VOYBI6T4.mjs.map +0 -1
- package/dist/chunk-WDYPMEZB.js +0 -22
- package/dist/chunk-WDYPMEZB.js.map +0 -1
- package/dist/chunk-WHGYMK5B.js +0 -1
- package/dist/chunk-WHGYMK5B.js.map +0 -1
- package/dist/chunk-WZ57PU2K.js +0 -97
- package/dist/chunk-WZ57PU2K.js.map +0 -1
- package/dist/chunk-XAOCS6ZD.js +0 -69
- package/dist/chunk-XAOCS6ZD.js.map +0 -1
- package/dist/chunk-XK5HPZZC.mjs +0 -14
- package/dist/chunk-XK5HPZZC.mjs.map +0 -1
- package/dist/chunk-XP4YGQJA.js +0 -14
- package/dist/chunk-XP4YGQJA.js.map +0 -1
- package/dist/chunk-Y2U3ZPCK.js +0 -181
- package/dist/chunk-Y2U3ZPCK.js.map +0 -1
- package/dist/chunk-Y3JC4WGW.js +0 -35
- package/dist/chunk-Y3JC4WGW.js.map +0 -1
- package/dist/chunk-ZG33OGC3.mjs +0 -1
- package/dist/chunk-ZG33OGC3.mjs.map +0 -1
- package/dist/chunk-ZJQSGRNK.mjs +0 -34
- package/dist/chunk-ZJQSGRNK.mjs.map +0 -1
- package/dist/chunk-ZTX624YO.js +0 -1
- package/dist/chunk-ZTX624YO.js.map +0 -1
- package/dist/environment.js +0 -46
- package/dist/environment.js.map +0 -1
- package/dist/global.js +0 -2
- package/dist/global.js.map +0 -1
- package/dist/helpers.js +0 -57
- package/dist/helpers.js.map +0 -1
- package/dist/index.js +0 -68
- package/dist/index.js.map +0 -1
- package/dist/internals/environment.js +0 -8
- package/dist/internals/environment.js.map +0 -1
- package/dist/internals/index.js +0 -150
- package/dist/internals/index.js.map +0 -1
- package/dist/internals/logger.js +0 -8
- package/dist/internals/logger.js.map +0 -1
- package/dist/internals/request.js +0 -42
- package/dist/internals/request.js.map +0 -1
- package/dist/internals/server.js +0 -9
- package/dist/internals/server.js.map +0 -1
- package/dist/internals/simulation/constants.js +0 -14
- package/dist/internals/simulation/constants.js.map +0 -1
- package/dist/internals/simulation/controllers.js +0 -25
- package/dist/internals/simulation/controllers.js.map +0 -1
- package/dist/internals/simulation/files.js +0 -14
- package/dist/internals/simulation/files.js.map +0 -1
- package/dist/internals/simulation/index.js +0 -111
- package/dist/internals/simulation/index.js.map +0 -1
- package/dist/internals/simulation/interface.js +0 -37
- package/dist/internals/simulation/interface.js.map +0 -1
- package/dist/internals/simulation/methods/constants.js +0 -12
- package/dist/internals/simulation/methods/constants.js.map +0 -1
- package/dist/internals/simulation/methods/hooks/get-preferences.js +0 -8
- package/dist/internals/simulation/methods/hooks/get-preferences.js.map +0 -1
- package/dist/internals/simulation/methods/hooks/index.js +0 -39
- package/dist/internals/simulation/methods/hooks/index.js.map +0 -1
- package/dist/internals/simulation/methods/hooks/interface.js +0 -10
- package/dist/internals/simulation/methods/hooks/interface.js.map +0 -1
- package/dist/internals/simulation/methods/hooks/notifications.js +0 -16
- package/dist/internals/simulation/methods/hooks/notifications.js.map +0 -1
- package/dist/internals/simulation/methods/hooks/request-user-approval.js +0 -14
- package/dist/internals/simulation/methods/hooks/request-user-approval.js.map +0 -1
- package/dist/internals/simulation/methods/hooks/state.js +0 -18
- package/dist/internals/simulation/methods/hooks/state.js.map +0 -1
- package/dist/internals/simulation/methods/index.js +0 -28
- package/dist/internals/simulation/methods/index.js.map +0 -1
- package/dist/internals/simulation/methods/specifications.js +0 -27
- package/dist/internals/simulation/methods/specifications.js.map +0 -1
- package/dist/internals/simulation/middleware/engine.js +0 -15
- package/dist/internals/simulation/middleware/engine.js.map +0 -1
- package/dist/internals/simulation/middleware/index.js +0 -16
- package/dist/internals/simulation/middleware/index.js.map +0 -1
- package/dist/internals/simulation/middleware/internal-methods/accounts.js +0 -8
- package/dist/internals/simulation/middleware/internal-methods/accounts.js.map +0 -1
- package/dist/internals/simulation/middleware/internal-methods/index.js +0 -11
- package/dist/internals/simulation/middleware/internal-methods/index.js.map +0 -1
- package/dist/internals/simulation/middleware/internal-methods/middleware.js +0 -10
- package/dist/internals/simulation/middleware/internal-methods/middleware.js.map +0 -1
- package/dist/internals/simulation/middleware/internal-methods/provider-state.js +0 -8
- package/dist/internals/simulation/middleware/internal-methods/provider-state.js.map +0 -1
- package/dist/internals/simulation/middleware/mock.js +0 -9
- package/dist/internals/simulation/middleware/mock.js.map +0 -1
- package/dist/internals/simulation/options.js +0 -9
- package/dist/internals/simulation/options.js.map +0 -1
- package/dist/internals/simulation/simulation.js +0 -39
- package/dist/internals/simulation/simulation.js.map +0 -1
- package/dist/internals/simulation/store/index.js +0 -44
- package/dist/internals/simulation/store/index.js.map +0 -1
- package/dist/internals/simulation/store/mocks.js +0 -16
- package/dist/internals/simulation/store/mocks.js.map +0 -1
- package/dist/internals/simulation/store/notifications.js +0 -16
- package/dist/internals/simulation/store/notifications.js.map +0 -1
- package/dist/internals/simulation/store/state.js +0 -14
- package/dist/internals/simulation/store/state.js.map +0 -1
- package/dist/internals/simulation/store/store.js +0 -12
- package/dist/internals/simulation/store/store.js.map +0 -1
- package/dist/internals/simulation/store/ui.js +0 -16
- package/dist/internals/simulation/store/ui.js.map +0 -1
- package/dist/internals/structs.js +0 -22
- package/dist/internals/structs.js.map +0 -1
- package/dist/matchers.js +0 -49
- package/dist/matchers.js.map +0 -1
- package/dist/options.js +0 -8
- package/dist/options.js.map +0 -1
- package/dist/setup.js +0 -38
- package/dist/setup.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/dist/types/index.d.ts +0 -5
- package/dist/types/internals/index.d.ts +0 -6
- package/dist/types/internals/simulation/index.d.ts +0 -5
- package/dist/types/internals/simulation/methods/hooks/index.d.ts +0 -5
- package/dist/types/internals/simulation/methods/index.d.ts +0 -1
- package/dist/types/internals/simulation/middleware/index.d.ts +0 -1
- package/dist/types/internals/simulation/middleware/internal-methods/index.d.ts +0 -1
- package/dist/types/internals/simulation/store/index.d.ts +0 -4
- package/dist/types/setup.d.ts +0 -1
- package/dist/types/vendor/readable-stream.d.js +0 -1
- package/dist/types/vendor/readable-stream.d.js.map +0 -1
- package/dist/types/vendor/readable-stream.d.mjs +0 -1
- package/dist/types/vendor/readable-stream.d.mjs.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/types.mjs +0 -2
- package/dist/types.mjs.map +0 -1
|
@@ -1,25 +1,96 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "
|
|
5
|
-
import "
|
|
6
|
-
import "
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { PermissionController, SubjectMetadataController, SubjectType } from "@metamask/permission-controller";
|
|
2
|
+
import { SnapInterfaceController } from "@metamask/snaps-controllers";
|
|
3
|
+
import { caveatSpecifications as snapsCaveatsSpecifications, endowmentCaveatSpecifications as snapsEndowmentCaveatSpecifications, processSnapPermissions } from "@metamask/snaps-rpc-methods";
|
|
4
|
+
import { getSafeJson } from "@metamask/utils";
|
|
5
|
+
import { getPermissionSpecifications } from "./methods/index.mjs";
|
|
6
|
+
import { UNRESTRICTED_METHODS } from "./methods/constants.mjs";
|
|
7
|
+
/**
|
|
8
|
+
* Get the controllers for the Snap.
|
|
9
|
+
*
|
|
10
|
+
* @param options - The options.
|
|
11
|
+
* @returns The controllers for the Snap.
|
|
12
|
+
*/
|
|
13
|
+
export function getControllers(options) {
|
|
14
|
+
const { controllerMessenger } = options;
|
|
15
|
+
const subjectMetadataController = new SubjectMetadataController({
|
|
16
|
+
messenger: controllerMessenger.getRestricted({
|
|
17
|
+
name: 'SubjectMetadataController',
|
|
18
|
+
allowedActions: [],
|
|
19
|
+
allowedEvents: [],
|
|
20
|
+
}),
|
|
21
|
+
subjectCacheLimit: 100,
|
|
22
|
+
});
|
|
23
|
+
const interfaceController = new SnapInterfaceController({
|
|
24
|
+
messenger: controllerMessenger.getRestricted({
|
|
25
|
+
name: 'SnapInterfaceController',
|
|
26
|
+
allowedActions: [
|
|
27
|
+
'PhishingController:maybeUpdateState',
|
|
28
|
+
'PhishingController:testOrigin',
|
|
29
|
+
'ApprovalController:hasRequest',
|
|
30
|
+
'ApprovalController:acceptRequest',
|
|
31
|
+
],
|
|
32
|
+
allowedEvents: [],
|
|
33
|
+
}),
|
|
34
|
+
});
|
|
35
|
+
const permissionController = getPermissionController(options);
|
|
36
|
+
return {
|
|
37
|
+
permissionController,
|
|
38
|
+
subjectMetadataController,
|
|
39
|
+
interfaceController,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get the permission controller for the Snap.
|
|
44
|
+
*
|
|
45
|
+
* @param options - The options.
|
|
46
|
+
* @param options.controllerMessenger - The controller messenger.
|
|
47
|
+
* @param options.options - Miscellaneous options.
|
|
48
|
+
* @returns The permission controller for the Snap.
|
|
49
|
+
*/
|
|
50
|
+
function getPermissionController(options) {
|
|
51
|
+
const { controllerMessenger } = options;
|
|
52
|
+
const permissionSpecifications = getPermissionSpecifications(options);
|
|
53
|
+
return new PermissionController({
|
|
54
|
+
messenger: controllerMessenger.getRestricted({
|
|
55
|
+
name: 'PermissionController',
|
|
56
|
+
allowedActions: [
|
|
57
|
+
`ApprovalController:addRequest`,
|
|
58
|
+
`ApprovalController:hasRequest`,
|
|
59
|
+
`ApprovalController:acceptRequest`,
|
|
60
|
+
`ApprovalController:rejectRequest`,
|
|
61
|
+
`SnapController:getPermitted`,
|
|
62
|
+
`SnapController:install`,
|
|
63
|
+
`SubjectMetadataController:getSubjectMetadata`,
|
|
64
|
+
],
|
|
65
|
+
allowedEvents: [],
|
|
66
|
+
}),
|
|
67
|
+
caveatSpecifications: {
|
|
68
|
+
...snapsCaveatsSpecifications,
|
|
69
|
+
...snapsEndowmentCaveatSpecifications,
|
|
70
|
+
},
|
|
71
|
+
permissionSpecifications,
|
|
72
|
+
unrestrictedMethods: UNRESTRICTED_METHODS,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Register the Snap. This sets up the Snap's permissions and subject metadata.
|
|
77
|
+
*
|
|
78
|
+
* @param snapId - The ID of the Snap to install.
|
|
79
|
+
* @param manifest - The parsed manifest.
|
|
80
|
+
* @param controllers - The controllers for the Snap.
|
|
81
|
+
* @param controllers.permissionController - The permission controller.
|
|
82
|
+
* @param controllers.subjectMetadataController - The subject metadata controller.
|
|
83
|
+
*/
|
|
84
|
+
export async function registerSnap(snapId, manifest, { permissionController, subjectMetadataController, }) {
|
|
85
|
+
subjectMetadataController.addSubjectMetadata({
|
|
86
|
+
origin: snapId,
|
|
87
|
+
subjectType: SubjectType.Snap,
|
|
88
|
+
});
|
|
89
|
+
const approvedPermissions = processSnapPermissions(getSafeJson(manifest.initialPermissions));
|
|
90
|
+
permissionController.grantPermissions({
|
|
91
|
+
approvedPermissions,
|
|
92
|
+
subject: { origin: snapId },
|
|
93
|
+
preserveExistingPermissions: false,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
25
96
|
//# sourceMappingURL=controllers.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"file":"controllers.mjs","sourceRoot":"","sources":["../../../src/internals/simulation/controllers.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,WAAW,EACZ,wCAAwC;AACzC,OAAO,EAAE,uBAAuB,EAAE,oCAAoC;AAMtE,OAAO,EACL,oBAAoB,IAAI,0BAA0B,EAClD,6BAA6B,IAAI,kCAAkC,EACnE,sBAAsB,EACvB,oCAAoC;AAGrC,OAAO,EAAE,WAAW,EAAE,wBAAwB;AAE9C,OAAO,EAAE,2BAA2B,EAAE,4BAAkB;AACxD,OAAO,EAAE,oBAAoB,EAAE,gCAA4B;AAiC3D;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,OAA8B;IAC3D,MAAM,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC;IACxC,MAAM,yBAAyB,GAAG,IAAI,yBAAyB,CAAC;QAC9D,SAAS,EAAE,mBAAmB,CAAC,aAAa,CAAC;YAC3C,IAAI,EAAE,2BAA2B;YACjC,cAAc,EAAE,EAAE;YAClB,aAAa,EAAE,EAAE;SAClB,CAAC;QACF,iBAAiB,EAAE,GAAG;KACvB,CAAC,CAAC;IAEH,MAAM,mBAAmB,GAAG,IAAI,uBAAuB,CAAC;QACtD,SAAS,EAAE,mBAAmB,CAAC,aAAa,CAAC;YAC3C,IAAI,EAAE,yBAAyB;YAC/B,cAAc,EAAE;gBACd,qCAAqC;gBACrC,+BAA+B;gBAC/B,+BAA+B;gBAC/B,kCAAkC;aACnC;YACD,aAAa,EAAE,EAAE;SAClB,CAAC;KACH,CAAC,CAAC;IAEH,MAAM,oBAAoB,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAE9D,OAAO;QACL,oBAAoB;QACpB,yBAAyB;QACzB,mBAAmB;KACpB,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,uBAAuB,CAAC,OAA8B;IAC7D,MAAM,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC;IACxC,MAAM,wBAAwB,GAAG,2BAA2B,CAAC,OAAO,CAAC,CAAC;IACtE,OAAO,IAAI,oBAAoB,CAAC;QAC9B,SAAS,EAAE,mBAAmB,CAAC,aAAa,CAAC;YAC3C,IAAI,EAAE,sBAAsB;YAC5B,cAAc,EAAE;gBACd,+BAA+B;gBAC/B,+BAA+B;gBAC/B,kCAAkC;gBAClC,kCAAkC;gBAClC,6BAA6B;gBAC7B,wBAAwB;gBACxB,8CAA8C;aAC/C;YACD,aAAa,EAAE,EAAE;SAClB,CAAC;QACF,oBAAoB,EAAE;YACpB,GAAG,0BAA0B;YAC7B,GAAG,kCAAkC;SACtC;QACD,wBAAwB;QACxB,mBAAmB,EAAE,oBAAoB;KAC1C,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,MAAc,EACd,QAAsB,EACtB,EACE,oBAAoB,EACpB,yBAAyB,GACgB;IAE3C,yBAAyB,CAAC,kBAAkB,CAAC;QAC3C,MAAM,EAAE,MAAM;QACd,WAAW,EAAE,WAAW,CAAC,IAAI;KAC9B,CAAC,CAAC;IAEH,MAAM,mBAAmB,GAAG,sBAAsB,CAChD,WAAW,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CACzC,CAAC;IAEF,oBAAoB,CAAC,gBAAgB,CAAC;QACpC,mBAAmB;QACnB,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;QAC3B,2BAA2B,EAAE,KAAK;KACnC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { ControllerMessenger } from '@metamask/base-controller';\nimport type {\n CaveatSpecificationConstraint,\n PermissionSpecificationConstraint,\n PermissionControllerActions,\n SubjectMetadataControllerActions,\n} from '@metamask/permission-controller';\nimport {\n PermissionController,\n SubjectMetadataController,\n SubjectType,\n} from '@metamask/permission-controller';\nimport { SnapInterfaceController } from '@metamask/snaps-controllers';\nimport type {\n ExecutionServiceActions,\n SnapInterfaceControllerActions,\n SnapInterfaceControllerAllowedActions,\n} from '@metamask/snaps-controllers';\nimport {\n caveatSpecifications as snapsCaveatsSpecifications,\n endowmentCaveatSpecifications as snapsEndowmentCaveatSpecifications,\n processSnapPermissions,\n} from '@metamask/snaps-rpc-methods';\nimport type { SnapId } from '@metamask/snaps-sdk';\nimport type { SnapManifest } from '@metamask/snaps-utils';\nimport { getSafeJson } from '@metamask/utils';\n\nimport { getPermissionSpecifications } from './methods';\nimport { UNRESTRICTED_METHODS } from './methods/constants';\nimport type { SimulationOptions } from './options';\nimport type { MiddlewareHooks } from './simulation';\nimport type { RunSagaFunction } from './store';\n\nexport type RootControllerAllowedActions =\n | SnapInterfaceControllerActions\n | SnapInterfaceControllerAllowedActions\n | PermissionControllerActions\n | ExecutionServiceActions\n | SubjectMetadataControllerActions;\n\nexport type RootControllerMessenger = ControllerMessenger<\n RootControllerAllowedActions,\n any\n>;\n\nexport type GetControllersOptions = {\n controllerMessenger: ControllerMessenger<any, any>;\n hooks: MiddlewareHooks;\n runSaga: RunSagaFunction;\n options: SimulationOptions;\n};\n\nexport type Controllers = {\n permissionController: PermissionController<\n PermissionSpecificationConstraint,\n CaveatSpecificationConstraint\n >;\n subjectMetadataController: SubjectMetadataController;\n interfaceController: SnapInterfaceController;\n};\n\n/**\n * Get the controllers for the Snap.\n *\n * @param options - The options.\n * @returns The controllers for the Snap.\n */\nexport function getControllers(options: GetControllersOptions): Controllers {\n const { controllerMessenger } = options;\n const subjectMetadataController = new SubjectMetadataController({\n messenger: controllerMessenger.getRestricted({\n name: 'SubjectMetadataController',\n allowedActions: [],\n allowedEvents: [],\n }),\n subjectCacheLimit: 100,\n });\n\n const interfaceController = new SnapInterfaceController({\n messenger: controllerMessenger.getRestricted({\n name: 'SnapInterfaceController',\n allowedActions: [\n 'PhishingController:maybeUpdateState',\n 'PhishingController:testOrigin',\n 'ApprovalController:hasRequest',\n 'ApprovalController:acceptRequest',\n ],\n allowedEvents: [],\n }),\n });\n\n const permissionController = getPermissionController(options);\n\n return {\n permissionController,\n subjectMetadataController,\n interfaceController,\n };\n}\n\n/**\n * Get the permission controller for the Snap.\n *\n * @param options - The options.\n * @param options.controllerMessenger - The controller messenger.\n * @param options.options - Miscellaneous options.\n * @returns The permission controller for the Snap.\n */\nfunction getPermissionController(options: GetControllersOptions) {\n const { controllerMessenger } = options;\n const permissionSpecifications = getPermissionSpecifications(options);\n return new PermissionController({\n messenger: controllerMessenger.getRestricted({\n name: 'PermissionController',\n allowedActions: [\n `ApprovalController:addRequest`,\n `ApprovalController:hasRequest`,\n `ApprovalController:acceptRequest`,\n `ApprovalController:rejectRequest`,\n `SnapController:getPermitted`,\n `SnapController:install`,\n `SubjectMetadataController:getSubjectMetadata`,\n ],\n allowedEvents: [],\n }),\n caveatSpecifications: {\n ...snapsCaveatsSpecifications,\n ...snapsEndowmentCaveatSpecifications,\n },\n permissionSpecifications,\n unrestrictedMethods: UNRESTRICTED_METHODS,\n });\n}\n\n/**\n * Register the Snap. This sets up the Snap's permissions and subject metadata.\n *\n * @param snapId - The ID of the Snap to install.\n * @param manifest - The parsed manifest.\n * @param controllers - The controllers for the Snap.\n * @param controllers.permissionController - The permission controller.\n * @param controllers.subjectMetadataController - The subject metadata controller.\n */\nexport async function registerSnap(\n snapId: SnapId,\n manifest: SnapManifest,\n {\n permissionController,\n subjectMetadataController,\n }: Omit<Controllers, 'interfaceController'>,\n) {\n subjectMetadataController.addSubjectMetadata({\n origin: snapId,\n subjectType: SubjectType.Snap,\n });\n\n const approvedPermissions = processSnapPermissions(\n getSafeJson(manifest.initialPermissions),\n );\n\n permissionController.grantPermissions({\n approvedPermissions,\n subject: { origin: snapId },\n preserveExistingPermissions: false,\n });\n}\n"]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getFileToUpload = exports.getFileSize = exports.getContentType = exports.getSnapFile = void 0;
|
|
7
|
+
const snaps_sdk_1 = require("@metamask/snaps-sdk");
|
|
8
|
+
const snaps_utils_1 = require("@metamask/snaps-utils");
|
|
9
|
+
const utils_1 = require("@metamask/utils");
|
|
10
|
+
const promises_1 = require("fs/promises");
|
|
11
|
+
const mime_1 = __importDefault(require("mime/index.js"));
|
|
12
|
+
const path_1 = require("path");
|
|
13
|
+
/**
|
|
14
|
+
* Get a statically defined Snap file from an array of files.
|
|
15
|
+
*
|
|
16
|
+
* @param files - The Snap files.
|
|
17
|
+
* @param path - The file path.
|
|
18
|
+
* @param encoding - The requested file encoding.
|
|
19
|
+
* @returns The file in the requested encoding if found, otherwise null.
|
|
20
|
+
*/
|
|
21
|
+
async function getSnapFile(files, path, encoding = snaps_sdk_1.AuxiliaryFileEncoding.Base64) {
|
|
22
|
+
const normalizedPath = (0, snaps_utils_1.normalizeRelative)(path);
|
|
23
|
+
const base64 = files
|
|
24
|
+
.find((file) => file.path === normalizedPath)
|
|
25
|
+
?.toString('base64');
|
|
26
|
+
if (!base64) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
return await (0, snaps_utils_1.encodeAuxiliaryFile)(base64, encoding);
|
|
30
|
+
}
|
|
31
|
+
exports.getSnapFile = getSnapFile;
|
|
32
|
+
/**
|
|
33
|
+
* Get the content type of a file based on its extension.
|
|
34
|
+
*
|
|
35
|
+
* @param extension - The file extension.
|
|
36
|
+
* @returns The content type of the file. If the content type cannot be inferred
|
|
37
|
+
* from the extension, `application/octet-stream` is returned.
|
|
38
|
+
*/
|
|
39
|
+
function getContentType(extension) {
|
|
40
|
+
return mime_1.default.getType(extension) ?? 'application/octet-stream';
|
|
41
|
+
}
|
|
42
|
+
exports.getContentType = getContentType;
|
|
43
|
+
/**
|
|
44
|
+
* Get the size of a file, from a file path or a `Uint8Array`.
|
|
45
|
+
*
|
|
46
|
+
* @param file - The file to get the size of. This can be a path to a file or a
|
|
47
|
+
* `Uint8Array` containing the file contents. If this is a path, the file is
|
|
48
|
+
* resolved relative to the current working directory.
|
|
49
|
+
* @returns The size of the file in bytes.
|
|
50
|
+
*/
|
|
51
|
+
async function getFileSize(file) {
|
|
52
|
+
if (typeof file === 'string') {
|
|
53
|
+
const { size } = await (0, promises_1.stat)((0, path_1.resolve)(process.cwd(), file));
|
|
54
|
+
return size;
|
|
55
|
+
}
|
|
56
|
+
return file.length;
|
|
57
|
+
}
|
|
58
|
+
exports.getFileSize = getFileSize;
|
|
59
|
+
/**
|
|
60
|
+
* Get a file object to upload, from a file path or a `Uint8Array`, with an
|
|
61
|
+
* optional file name and content type.
|
|
62
|
+
*
|
|
63
|
+
* @param file - The file to upload. This can be a path to a file or a
|
|
64
|
+
* `Uint8Array` containing the file contents. If this is a path, the file is
|
|
65
|
+
* resolved relative to the current working directory.
|
|
66
|
+
* @param options - The file options.
|
|
67
|
+
* @param options.fileName - The name of the file. By default, this is
|
|
68
|
+
* inferred from the file path if it's a path, and defaults to an empty string
|
|
69
|
+
* if it's a `Uint8Array`.
|
|
70
|
+
* @param options.contentType - The content type of the file. By default, this
|
|
71
|
+
* is inferred from the file name if it's a path, and defaults to
|
|
72
|
+
* `application/octet-stream` if it's a `Uint8Array` or the content type
|
|
73
|
+
* cannot be inferred from the file name.
|
|
74
|
+
* @returns The file object to upload.
|
|
75
|
+
*/
|
|
76
|
+
async function getFileToUpload(file, { fileName, contentType } = {}) {
|
|
77
|
+
if (typeof file === 'string') {
|
|
78
|
+
const buffer = await (0, promises_1.readFile)((0, path_1.resolve)(process.cwd(), file));
|
|
79
|
+
return {
|
|
80
|
+
name: fileName ?? (0, path_1.basename)(file),
|
|
81
|
+
size: buffer.byteLength,
|
|
82
|
+
contentType: contentType ?? getContentType((0, path_1.extname)(file)),
|
|
83
|
+
contents: (0, utils_1.bytesToBase64)(buffer),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
name: fileName ?? '',
|
|
88
|
+
size: file.length,
|
|
89
|
+
contentType: contentType ?? 'application/octet-stream',
|
|
90
|
+
contents: (0, utils_1.bytesToBase64)(file),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
exports.getFileToUpload = getFileToUpload;
|
|
94
|
+
//# sourceMappingURL=files.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.cjs","sourceRoot":"","sources":["../../../src/internals/simulation/files.ts"],"names":[],"mappings":";;;;;;AACA,mDAA4D;AAE5D,uDAA+E;AAC/E,2CAAgD;AAChD,0CAA6C;AAC7C,yDAAwB;AACxB,+BAAkD;AAIlD;;;;;;;GAOG;AACI,KAAK,UAAU,WAAW,CAC/B,KAAoB,EACpB,IAAY,EACZ,WAAkC,iCAAqB,CAAC,MAAM;IAE9D,MAAM,cAAc,GAAG,IAAA,+BAAiB,EAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,KAAK;SACjB,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC;QAC7C,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAEvB,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,MAAM,IAAA,iCAAmB,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AACrD,CAAC;AAfD,kCAeC;AAED;;;;;;GAMG;AACH,SAAgB,cAAc,CAAC,SAAiB;IAC9C,OAAO,cAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,0BAA0B,CAAC;AAC/D,CAAC;AAFD,wCAEC;AAED;;;;;;;GAOG;AACI,KAAK,UAAU,WAAW,CAAC,IAAyB;IACzD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,eAAI,EAAC,IAAA,cAAO,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,IAAI,CAAC,MAAM,CAAC;AACrB,CAAC;AAPD,kCAOC;AAED;;;;;;;;;;;;;;;;GAgBG;AACI,KAAK,UAAU,eAAe,CACnC,IAAyB,EACzB,EAAE,QAAQ,EAAE,WAAW,KAAkB,EAAE;IAE3C,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,MAAM,IAAA,mBAAQ,EAAC,IAAA,cAAO,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;QAE5D,OAAO;YACL,IAAI,EAAE,QAAQ,IAAI,IAAA,eAAQ,EAAC,IAAI,CAAC;YAChC,IAAI,EAAE,MAAM,CAAC,UAAU;YACvB,WAAW,EAAE,WAAW,IAAI,cAAc,CAAC,IAAA,cAAO,EAAC,IAAI,CAAC,CAAC;YACzD,QAAQ,EAAE,IAAA,qBAAa,EAAC,MAAM,CAAC;SAChC,CAAC;IACJ,CAAC;IAED,OAAO;QACL,IAAI,EAAE,QAAQ,IAAI,EAAE;QACpB,IAAI,EAAE,IAAI,CAAC,MAAM;QACjB,WAAW,EAAE,WAAW,IAAI,0BAA0B;QACtD,QAAQ,EAAE,IAAA,qBAAa,EAAC,IAAI,CAAC;KAC9B,CAAC;AACJ,CAAC;AArBD,0CAqBC","sourcesContent":["import type { File } from '@metamask/snaps-sdk';\nimport { AuxiliaryFileEncoding } from '@metamask/snaps-sdk';\nimport type { VirtualFile } from '@metamask/snaps-utils';\nimport { encodeAuxiliaryFile, normalizeRelative } from '@metamask/snaps-utils';\nimport { bytesToBase64 } from '@metamask/utils';\nimport { readFile, stat } from 'fs/promises';\nimport mime from 'mime';\nimport { basename, extname, resolve } from 'path';\n\nimport type { FileOptions } from '../../types';\n\n/**\n * Get a statically defined Snap file from an array of files.\n *\n * @param files - The Snap files.\n * @param path - The file path.\n * @param encoding - The requested file encoding.\n * @returns The file in the requested encoding if found, otherwise null.\n */\nexport async function getSnapFile(\n files: VirtualFile[],\n path: string,\n encoding: AuxiliaryFileEncoding = AuxiliaryFileEncoding.Base64,\n) {\n const normalizedPath = normalizeRelative(path);\n const base64 = files\n .find((file) => file.path === normalizedPath)\n ?.toString('base64');\n\n if (!base64) {\n return null;\n }\n\n return await encodeAuxiliaryFile(base64, encoding);\n}\n\n/**\n * Get the content type of a file based on its extension.\n *\n * @param extension - The file extension.\n * @returns The content type of the file. If the content type cannot be inferred\n * from the extension, `application/octet-stream` is returned.\n */\nexport function getContentType(extension: string) {\n return mime.getType(extension) ?? 'application/octet-stream';\n}\n\n/**\n * Get the size of a file, from a file path or a `Uint8Array`.\n *\n * @param file - The file to get the size of. This can be a path to a file or a\n * `Uint8Array` containing the file contents. If this is a path, the file is\n * resolved relative to the current working directory.\n * @returns The size of the file in bytes.\n */\nexport async function getFileSize(file: string | Uint8Array) {\n if (typeof file === 'string') {\n const { size } = await stat(resolve(process.cwd(), file));\n return size;\n }\n\n return file.length;\n}\n\n/**\n * Get a file object to upload, from a file path or a `Uint8Array`, with an\n * optional file name and content type.\n *\n * @param file - The file to upload. This can be a path to a file or a\n * `Uint8Array` containing the file contents. If this is a path, the file is\n * resolved relative to the current working directory.\n * @param options - The file options.\n * @param options.fileName - The name of the file. By default, this is\n * inferred from the file path if it's a path, and defaults to an empty string\n * if it's a `Uint8Array`.\n * @param options.contentType - The content type of the file. By default, this\n * is inferred from the file name if it's a path, and defaults to\n * `application/octet-stream` if it's a `Uint8Array` or the content type\n * cannot be inferred from the file name.\n * @returns The file object to upload.\n */\nexport async function getFileToUpload(\n file: string | Uint8Array,\n { fileName, contentType }: FileOptions = {},\n): Promise<File> {\n if (typeof file === 'string') {\n const buffer = await readFile(resolve(process.cwd(), file));\n\n return {\n name: fileName ?? basename(file),\n size: buffer.byteLength,\n contentType: contentType ?? getContentType(extname(file)),\n contents: bytesToBase64(buffer),\n };\n }\n\n return {\n name: fileName ?? '',\n size: file.length,\n contentType: contentType ?? 'application/octet-stream',\n contents: bytesToBase64(file),\n };\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { File } from
|
|
2
|
-
import { AuxiliaryFileEncoding } from
|
|
3
|
-
import type { VirtualFile } from
|
|
4
|
-
import type { FileOptions } from
|
|
1
|
+
import type { File } from "@metamask/snaps-sdk";
|
|
2
|
+
import { AuxiliaryFileEncoding } from "@metamask/snaps-sdk";
|
|
3
|
+
import type { VirtualFile } from "@metamask/snaps-utils";
|
|
4
|
+
import type { FileOptions } from "../../types/index.cjs";
|
|
5
5
|
/**
|
|
6
6
|
* Get a statically defined Snap file from an array of files.
|
|
7
7
|
*
|
|
@@ -43,5 +43,7 @@ export declare function getFileSize(file: string | Uint8Array): Promise<number>;
|
|
|
43
43
|
* is inferred from the file name if it's a path, and defaults to
|
|
44
44
|
* `application/octet-stream` if it's a `Uint8Array` or the content type
|
|
45
45
|
* cannot be inferred from the file name.
|
|
46
|
+
* @returns The file object to upload.
|
|
46
47
|
*/
|
|
47
48
|
export declare function getFileToUpload(file: string | Uint8Array, { fileName, contentType }?: FileOptions): Promise<File>;
|
|
49
|
+
//# sourceMappingURL=files.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.cts","sourceRoot":"","sources":["../../../src/internals/simulation/files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,4BAA4B;AAChD,OAAO,EAAE,qBAAqB,EAAE,4BAA4B;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,8BAA8B;AAOzD,OAAO,KAAK,EAAE,WAAW,EAAE,8BAAoB;AAE/C;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAC/B,KAAK,EAAE,WAAW,EAAE,EACpB,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,qBAAoD,0BAY/D;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,UAE/C;AAED;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,mBAO1D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,GAAG,UAAU,EACzB,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAE,WAAgB,GAC1C,OAAO,CAAC,IAAI,CAAC,CAkBf"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { File } from "@metamask/snaps-sdk";
|
|
2
|
+
import { AuxiliaryFileEncoding } from "@metamask/snaps-sdk";
|
|
3
|
+
import type { VirtualFile } from "@metamask/snaps-utils";
|
|
4
|
+
import type { FileOptions } from "../../types/index.mjs";
|
|
5
|
+
/**
|
|
6
|
+
* Get a statically defined Snap file from an array of files.
|
|
7
|
+
*
|
|
8
|
+
* @param files - The Snap files.
|
|
9
|
+
* @param path - The file path.
|
|
10
|
+
* @param encoding - The requested file encoding.
|
|
11
|
+
* @returns The file in the requested encoding if found, otherwise null.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getSnapFile(files: VirtualFile[], path: string, encoding?: AuxiliaryFileEncoding): Promise<string | null>;
|
|
14
|
+
/**
|
|
15
|
+
* Get the content type of a file based on its extension.
|
|
16
|
+
*
|
|
17
|
+
* @param extension - The file extension.
|
|
18
|
+
* @returns The content type of the file. If the content type cannot be inferred
|
|
19
|
+
* from the extension, `application/octet-stream` is returned.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getContentType(extension: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Get the size of a file, from a file path or a `Uint8Array`.
|
|
24
|
+
*
|
|
25
|
+
* @param file - The file to get the size of. This can be a path to a file or a
|
|
26
|
+
* `Uint8Array` containing the file contents. If this is a path, the file is
|
|
27
|
+
* resolved relative to the current working directory.
|
|
28
|
+
* @returns The size of the file in bytes.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getFileSize(file: string | Uint8Array): Promise<number>;
|
|
31
|
+
/**
|
|
32
|
+
* Get a file object to upload, from a file path or a `Uint8Array`, with an
|
|
33
|
+
* optional file name and content type.
|
|
34
|
+
*
|
|
35
|
+
* @param file - The file to upload. This can be a path to a file or a
|
|
36
|
+
* `Uint8Array` containing the file contents. If this is a path, the file is
|
|
37
|
+
* resolved relative to the current working directory.
|
|
38
|
+
* @param options - The file options.
|
|
39
|
+
* @param options.fileName - The name of the file. By default, this is
|
|
40
|
+
* inferred from the file path if it's a path, and defaults to an empty string
|
|
41
|
+
* if it's a `Uint8Array`.
|
|
42
|
+
* @param options.contentType - The content type of the file. By default, this
|
|
43
|
+
* is inferred from the file name if it's a path, and defaults to
|
|
44
|
+
* `application/octet-stream` if it's a `Uint8Array` or the content type
|
|
45
|
+
* cannot be inferred from the file name.
|
|
46
|
+
* @returns The file object to upload.
|
|
47
|
+
*/
|
|
48
|
+
export declare function getFileToUpload(file: string | Uint8Array, { fileName, contentType }?: FileOptions): Promise<File>;
|
|
49
|
+
//# sourceMappingURL=files.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.mts","sourceRoot":"","sources":["../../../src/internals/simulation/files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,4BAA4B;AAChD,OAAO,EAAE,qBAAqB,EAAE,4BAA4B;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,8BAA8B;AAOzD,OAAO,KAAK,EAAE,WAAW,EAAE,8BAAoB;AAE/C;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAC/B,KAAK,EAAE,WAAW,EAAE,EACpB,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,qBAAoD,0BAY/D;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,UAE/C;AAED;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,mBAO1D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,GAAG,UAAU,EACzB,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAE,WAAgB,GAC1C,OAAO,CAAC,IAAI,CAAC,CAkBf"}
|
|
@@ -1,14 +1,91 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
import "
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
import { AuxiliaryFileEncoding } from "@metamask/snaps-sdk";
|
|
8
|
+
import { encodeAuxiliaryFile, normalizeRelative } from "@metamask/snaps-utils";
|
|
9
|
+
import { bytesToBase64 } from "@metamask/utils";
|
|
10
|
+
import { readFile, stat } from "fs/promises";
|
|
11
|
+
import $mime from "mime/index.js";
|
|
12
|
+
const mime = $importDefault($mime);
|
|
13
|
+
import { basename, extname, resolve } from "path";
|
|
14
|
+
/**
|
|
15
|
+
* Get a statically defined Snap file from an array of files.
|
|
16
|
+
*
|
|
17
|
+
* @param files - The Snap files.
|
|
18
|
+
* @param path - The file path.
|
|
19
|
+
* @param encoding - The requested file encoding.
|
|
20
|
+
* @returns The file in the requested encoding if found, otherwise null.
|
|
21
|
+
*/
|
|
22
|
+
export async function getSnapFile(files, path, encoding = AuxiliaryFileEncoding.Base64) {
|
|
23
|
+
const normalizedPath = normalizeRelative(path);
|
|
24
|
+
const base64 = files
|
|
25
|
+
.find((file) => file.path === normalizedPath)
|
|
26
|
+
?.toString('base64');
|
|
27
|
+
if (!base64) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
return await encodeAuxiliaryFile(base64, encoding);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get the content type of a file based on its extension.
|
|
34
|
+
*
|
|
35
|
+
* @param extension - The file extension.
|
|
36
|
+
* @returns The content type of the file. If the content type cannot be inferred
|
|
37
|
+
* from the extension, `application/octet-stream` is returned.
|
|
38
|
+
*/
|
|
39
|
+
export function getContentType(extension) {
|
|
40
|
+
return mime.getType(extension) ?? 'application/octet-stream';
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get the size of a file, from a file path or a `Uint8Array`.
|
|
44
|
+
*
|
|
45
|
+
* @param file - The file to get the size of. This can be a path to a file or a
|
|
46
|
+
* `Uint8Array` containing the file contents. If this is a path, the file is
|
|
47
|
+
* resolved relative to the current working directory.
|
|
48
|
+
* @returns The size of the file in bytes.
|
|
49
|
+
*/
|
|
50
|
+
export async function getFileSize(file) {
|
|
51
|
+
if (typeof file === 'string') {
|
|
52
|
+
const { size } = await stat(resolve(process.cwd(), file));
|
|
53
|
+
return size;
|
|
54
|
+
}
|
|
55
|
+
return file.length;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Get a file object to upload, from a file path or a `Uint8Array`, with an
|
|
59
|
+
* optional file name and content type.
|
|
60
|
+
*
|
|
61
|
+
* @param file - The file to upload. This can be a path to a file or a
|
|
62
|
+
* `Uint8Array` containing the file contents. If this is a path, the file is
|
|
63
|
+
* resolved relative to the current working directory.
|
|
64
|
+
* @param options - The file options.
|
|
65
|
+
* @param options.fileName - The name of the file. By default, this is
|
|
66
|
+
* inferred from the file path if it's a path, and defaults to an empty string
|
|
67
|
+
* if it's a `Uint8Array`.
|
|
68
|
+
* @param options.contentType - The content type of the file. By default, this
|
|
69
|
+
* is inferred from the file name if it's a path, and defaults to
|
|
70
|
+
* `application/octet-stream` if it's a `Uint8Array` or the content type
|
|
71
|
+
* cannot be inferred from the file name.
|
|
72
|
+
* @returns The file object to upload.
|
|
73
|
+
*/
|
|
74
|
+
export async function getFileToUpload(file, { fileName, contentType } = {}) {
|
|
75
|
+
if (typeof file === 'string') {
|
|
76
|
+
const buffer = await readFile(resolve(process.cwd(), file));
|
|
77
|
+
return {
|
|
78
|
+
name: fileName ?? basename(file),
|
|
79
|
+
size: buffer.byteLength,
|
|
80
|
+
contentType: contentType ?? getContentType(extname(file)),
|
|
81
|
+
contents: bytesToBase64(buffer),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
name: fileName ?? '',
|
|
86
|
+
size: file.length,
|
|
87
|
+
contentType: contentType ?? 'application/octet-stream',
|
|
88
|
+
contents: bytesToBase64(file),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
14
91
|
//# sourceMappingURL=files.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"file":"files.mjs","sourceRoot":"","sources":["../../../src/internals/simulation/files.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,qBAAqB,EAAE,4BAA4B;AAE5D,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,8BAA8B;AAC/E,OAAO,EAAE,aAAa,EAAE,wBAAwB;AAChD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,oBAAoB;AAC7C,OAAO,KAAI,sBAAa;;AACxB,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa;AAIlD;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,KAAoB,EACpB,IAAY,EACZ,WAAkC,qBAAqB,CAAC,MAAM;IAE9D,MAAM,cAAc,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC/C,MAAM,MAAM,GAAG,KAAK;SACjB,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC;QAC7C,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAEvB,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,MAAM,mBAAmB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AACrD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,SAAiB;IAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,0BAA0B,CAAC;AAC/D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,IAAyB;IACzD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,IAAI,CAAC,MAAM,CAAC;AACrB,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,IAAyB,EACzB,EAAE,QAAQ,EAAE,WAAW,KAAkB,EAAE;IAE3C,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;QAE5D,OAAO;YACL,IAAI,EAAE,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC;YAChC,IAAI,EAAE,MAAM,CAAC,UAAU;YACvB,WAAW,EAAE,WAAW,IAAI,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACzD,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC;SAChC,CAAC;IACJ,CAAC;IAED,OAAO;QACL,IAAI,EAAE,QAAQ,IAAI,EAAE;QACpB,IAAI,EAAE,IAAI,CAAC,MAAM;QACjB,WAAW,EAAE,WAAW,IAAI,0BAA0B;QACtD,QAAQ,EAAE,aAAa,CAAC,IAAI,CAAC;KAC9B,CAAC;AACJ,CAAC","sourcesContent":["import type { File } from '@metamask/snaps-sdk';\nimport { AuxiliaryFileEncoding } from '@metamask/snaps-sdk';\nimport type { VirtualFile } from '@metamask/snaps-utils';\nimport { encodeAuxiliaryFile, normalizeRelative } from '@metamask/snaps-utils';\nimport { bytesToBase64 } from '@metamask/utils';\nimport { readFile, stat } from 'fs/promises';\nimport mime from 'mime';\nimport { basename, extname, resolve } from 'path';\n\nimport type { FileOptions } from '../../types';\n\n/**\n * Get a statically defined Snap file from an array of files.\n *\n * @param files - The Snap files.\n * @param path - The file path.\n * @param encoding - The requested file encoding.\n * @returns The file in the requested encoding if found, otherwise null.\n */\nexport async function getSnapFile(\n files: VirtualFile[],\n path: string,\n encoding: AuxiliaryFileEncoding = AuxiliaryFileEncoding.Base64,\n) {\n const normalizedPath = normalizeRelative(path);\n const base64 = files\n .find((file) => file.path === normalizedPath)\n ?.toString('base64');\n\n if (!base64) {\n return null;\n }\n\n return await encodeAuxiliaryFile(base64, encoding);\n}\n\n/**\n * Get the content type of a file based on its extension.\n *\n * @param extension - The file extension.\n * @returns The content type of the file. If the content type cannot be inferred\n * from the extension, `application/octet-stream` is returned.\n */\nexport function getContentType(extension: string) {\n return mime.getType(extension) ?? 'application/octet-stream';\n}\n\n/**\n * Get the size of a file, from a file path or a `Uint8Array`.\n *\n * @param file - The file to get the size of. This can be a path to a file or a\n * `Uint8Array` containing the file contents. If this is a path, the file is\n * resolved relative to the current working directory.\n * @returns The size of the file in bytes.\n */\nexport async function getFileSize(file: string | Uint8Array) {\n if (typeof file === 'string') {\n const { size } = await stat(resolve(process.cwd(), file));\n return size;\n }\n\n return file.length;\n}\n\n/**\n * Get a file object to upload, from a file path or a `Uint8Array`, with an\n * optional file name and content type.\n *\n * @param file - The file to upload. This can be a path to a file or a\n * `Uint8Array` containing the file contents. If this is a path, the file is\n * resolved relative to the current working directory.\n * @param options - The file options.\n * @param options.fileName - The name of the file. By default, this is\n * inferred from the file path if it's a path, and defaults to an empty string\n * if it's a `Uint8Array`.\n * @param options.contentType - The content type of the file. By default, this\n * is inferred from the file name if it's a path, and defaults to\n * `application/octet-stream` if it's a `Uint8Array` or the content type\n * cannot be inferred from the file name.\n * @returns The file object to upload.\n */\nexport async function getFileToUpload(\n file: string | Uint8Array,\n { fileName, contentType }: FileOptions = {},\n): Promise<File> {\n if (typeof file === 'string') {\n const buffer = await readFile(resolve(process.cwd(), file));\n\n return {\n name: fileName ?? basename(file),\n size: buffer.byteLength,\n contentType: contentType ?? getContentType(extname(file)),\n contents: bytesToBase64(buffer),\n };\n }\n\n return {\n name: fileName ?? '',\n size: file.length,\n contentType: contentType ?? 'application/octet-stream',\n contents: bytesToBase64(file),\n };\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./constants.cjs"), exports);
|
|
18
|
+
__exportStar(require("./interface.cjs"), exports);
|
|
19
|
+
__exportStar(require("./simulation.cjs"), exports);
|
|
20
|
+
__exportStar(require("./options.cjs"), exports);
|
|
21
|
+
__exportStar(require("./store/index.cjs"), exports);
|
|
22
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/internals/simulation/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA4B;AAC5B,kDAA4B;AAC5B,mDAA6B;AAC7B,gDAA0B;AAC1B,oDAAwB","sourcesContent":["export * from './constants';\nexport * from './interface';\nexport * from './simulation';\nexport * from './options';\nexport * from './store';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/internals/simulation/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,gCAA4B;AAC5B,iCAA6B;AAC7B,8BAA0B;AAC1B,kCAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/internals/simulation/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,gCAA4B;AAC5B,iCAA6B;AAC7B,8BAA0B;AAC1B,kCAAwB"}
|
|
@@ -1,111 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from "../../chunk-Q3I6P2ZF.mjs";
|
|
7
|
-
import "../../chunk-ZG33OGC3.mjs";
|
|
8
|
-
import "../../chunk-3J2IBWXV.mjs";
|
|
9
|
-
import "../../chunk-6HHV6YFQ.mjs";
|
|
10
|
-
import "../../chunk-Q2OQXAUM.mjs";
|
|
11
|
-
import "../../chunk-VOYBI6T4.mjs";
|
|
12
|
-
import "../../chunk-IXKO6X55.mjs";
|
|
13
|
-
import "../../chunk-FP4H3ADT.mjs";
|
|
14
|
-
import {
|
|
15
|
-
clickElement,
|
|
16
|
-
getElement,
|
|
17
|
-
getElementByType,
|
|
18
|
-
getInterface,
|
|
19
|
-
getInterfaceActions,
|
|
20
|
-
getInterfaceResponse,
|
|
21
|
-
mergeValue,
|
|
22
|
-
resolveWithSaga,
|
|
23
|
-
selectFromRadioGroup,
|
|
24
|
-
selectInDropdown,
|
|
25
|
-
typeInField,
|
|
26
|
-
uploadFile
|
|
27
|
-
} from "../../chunk-6JPBXAHM.mjs";
|
|
28
|
-
import "../../chunk-IWJ4HKDR.mjs";
|
|
29
|
-
import {
|
|
30
|
-
getOptions
|
|
31
|
-
} from "../../chunk-G333FBBL.mjs";
|
|
32
|
-
import {
|
|
33
|
-
DEFAULT_CURRENCY,
|
|
34
|
-
DEFAULT_JSON_RPC_ENDPOINT,
|
|
35
|
-
DEFAULT_LOCALE,
|
|
36
|
-
DEFAULT_SRP
|
|
37
|
-
} from "../../chunk-LVNNGMJ2.mjs";
|
|
38
|
-
import "../../chunk-LSKT2AUS.mjs";
|
|
39
|
-
import "../../chunk-NTOY6Y4Q.mjs";
|
|
40
|
-
import "../../chunk-OHRFO2BL.mjs";
|
|
41
|
-
import "../../chunk-UDOXICJK.mjs";
|
|
42
|
-
import "../../chunk-QRVFWATH.mjs";
|
|
43
|
-
import "../../chunk-FQWOVTBB.mjs";
|
|
44
|
-
import "../../chunk-ALRZENWP.mjs";
|
|
45
|
-
import "../../chunk-24CGIQLL.mjs";
|
|
46
|
-
import "../../chunk-5U5WB3SM.mjs";
|
|
47
|
-
import "../../chunk-RQKT6BQ2.mjs";
|
|
48
|
-
import {
|
|
49
|
-
createStore
|
|
50
|
-
} from "../../chunk-ORR7AE5X.mjs";
|
|
51
|
-
import {
|
|
52
|
-
closeInterface,
|
|
53
|
-
getCurrentInterface,
|
|
54
|
-
resolveInterface,
|
|
55
|
-
setInterface,
|
|
56
|
-
uiSlice
|
|
57
|
-
} from "../../chunk-ZJQSGRNK.mjs";
|
|
58
|
-
import "../../chunk-H2464AXT.mjs";
|
|
59
|
-
import {
|
|
60
|
-
addNotification,
|
|
61
|
-
clearNotifications,
|
|
62
|
-
getNotifications,
|
|
63
|
-
notificationsSlice,
|
|
64
|
-
removeNotification
|
|
65
|
-
} from "../../chunk-LB4R3BUA.mjs";
|
|
66
|
-
import {
|
|
67
|
-
clearState,
|
|
68
|
-
getState,
|
|
69
|
-
setState,
|
|
70
|
-
stateSlice
|
|
71
|
-
} from "../../chunk-MPZOXW6I.mjs";
|
|
72
|
-
import "../../chunk-57SGDM5B.mjs";
|
|
73
|
-
import "../../chunk-JMDSN227.mjs";
|
|
74
|
-
export {
|
|
75
|
-
DEFAULT_CURRENCY,
|
|
76
|
-
DEFAULT_JSON_RPC_ENDPOINT,
|
|
77
|
-
DEFAULT_LOCALE,
|
|
78
|
-
DEFAULT_SRP,
|
|
79
|
-
addNotification,
|
|
80
|
-
clearNotifications,
|
|
81
|
-
clearState,
|
|
82
|
-
clickElement,
|
|
83
|
-
closeInterface,
|
|
84
|
-
createStore,
|
|
85
|
-
getCurrentInterface,
|
|
86
|
-
getElement,
|
|
87
|
-
getElementByType,
|
|
88
|
-
getHooks,
|
|
89
|
-
getInterface,
|
|
90
|
-
getInterfaceActions,
|
|
91
|
-
getInterfaceResponse,
|
|
92
|
-
getNotifications,
|
|
93
|
-
getOptions,
|
|
94
|
-
getState,
|
|
95
|
-
handleInstallSnap,
|
|
96
|
-
mergeValue,
|
|
97
|
-
notificationsSlice,
|
|
98
|
-
registerActions,
|
|
99
|
-
removeNotification,
|
|
100
|
-
resolveInterface,
|
|
101
|
-
resolveWithSaga,
|
|
102
|
-
selectFromRadioGroup,
|
|
103
|
-
selectInDropdown,
|
|
104
|
-
setInterface,
|
|
105
|
-
setState,
|
|
106
|
-
stateSlice,
|
|
107
|
-
typeInField,
|
|
108
|
-
uiSlice,
|
|
109
|
-
uploadFile
|
|
110
|
-
};
|
|
1
|
+
export * from "./constants.mjs";
|
|
2
|
+
export * from "./interface.mjs";
|
|
3
|
+
export * from "./simulation.mjs";
|
|
4
|
+
export * from "./options.mjs";
|
|
5
|
+
export * from "./store/index.mjs";
|
|
111
6
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/internals/simulation/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,gCAA4B;AAC5B,iCAA6B;AAC7B,8BAA0B;AAC1B,kCAAwB","sourcesContent":["export * from './constants';\nexport * from './interface';\nexport * from './simulation';\nexport * from './options';\nexport * from './store';\n"]}
|