@metamask/snaps-jest 8.2.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 +20 -1
- package/README.md +2 -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} +47 -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 -42
- 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 -53
- 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 -141
- 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} +8 -7
- 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} +4 -3
- 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} +5 -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 -11
- 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} +15 -14
- 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 -102
- 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} +38 -10
- 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 -30
- 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/internals/simulation/methods/hooks/get-preferences.d.cts +14 -0
- 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 +14 -0
- package/dist/internals/simulation/methods/hooks/get-preferences.mjs.map +1 -0
- 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/internals/simulation/methods/hooks/request-user-approval.d.cts +16 -0
- 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 +35 -0
- package/dist/internals/simulation/methods/hooks/request-user-approval.mjs.map +1 -0
- 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} +8 -7
- 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} +8 -7
- 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} +5 -3
- 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} +4 -3
- 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} +11 -8
- 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} +18 -13
- 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 -37
- 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} +8 -7
- 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} +8 -7
- 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} +7 -6
- 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} +6 -5
- 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} +9 -7
- 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} +67 -66
- 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 -13
- 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 -49
- 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} +8 -7
- 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} +66 -26
- 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 +32 -30
- package/dist/chunk-265BMFM5.js +0 -13
- package/dist/chunk-265BMFM5.js.map +0 -1
- package/dist/chunk-2JTGBHPR.js +0 -14
- package/dist/chunk-2JTGBHPR.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-3M4GRUMH.mjs +0 -54
- package/dist/chunk-3M4GRUMH.mjs.map +0 -1
- package/dist/chunk-43HRTFLS.mjs +0 -421
- package/dist/chunk-43HRTFLS.mjs.map +0 -1
- package/dist/chunk-44ARQBXS.js +0 -95
- package/dist/chunk-44ARQBXS.js.map +0 -1
- package/dist/chunk-4MAA7WGJ.js +0 -153
- package/dist/chunk-4MAA7WGJ.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-5SGLRSWR.mjs +0 -153
- package/dist/chunk-5SGLRSWR.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-6KXCBUNZ.mjs +0 -11
- package/dist/chunk-6KXCBUNZ.mjs.map +0 -1
- package/dist/chunk-74TIKA2T.mjs +0 -34
- package/dist/chunk-74TIKA2T.mjs.map +0 -1
- package/dist/chunk-7Y27L2EV.js +0 -211
- package/dist/chunk-7Y27L2EV.js.map +0 -1
- package/dist/chunk-ALRZENWP.mjs +0 -42
- package/dist/chunk-ALRZENWP.mjs.map +0 -1
- package/dist/chunk-B73P64TE.mjs +0 -28
- package/dist/chunk-B73P64TE.mjs.map +0 -1
- package/dist/chunk-CKRORVDW.js +0 -1
- package/dist/chunk-CKRORVDW.js.map +0 -1
- package/dist/chunk-CYPP66I7.mjs +0 -163
- package/dist/chunk-CYPP66I7.mjs.map +0 -1
- package/dist/chunk-DR6Y7IVX.js +0 -1
- package/dist/chunk-DR6Y7IVX.js.map +0 -1
- package/dist/chunk-DVDAOXO7.js +0 -134
- package/dist/chunk-DVDAOXO7.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-GECE47HW.js +0 -1
- package/dist/chunk-GECE47HW.js.map +0 -1
- package/dist/chunk-GG2BCPQH.mjs +0 -95
- package/dist/chunk-GG2BCPQH.mjs.map +0 -1
- package/dist/chunk-GMTKFAWO.js +0 -42
- package/dist/chunk-GMTKFAWO.js.map +0 -1
- package/dist/chunk-GVTDUKXK.js +0 -421
- package/dist/chunk-GVTDUKXK.js.map +0 -1
- package/dist/chunk-H2464AXT.mjs +0 -33
- package/dist/chunk-H2464AXT.mjs.map +0 -1
- package/dist/chunk-HOI6FPLR.mjs +0 -240
- package/dist/chunk-HOI6FPLR.mjs.map +0 -1
- package/dist/chunk-HROOL3VI.js +0 -1
- package/dist/chunk-HROOL3VI.js.map +0 -1
- package/dist/chunk-IH7UNS5A.mjs +0 -36
- package/dist/chunk-IH7UNS5A.mjs.map +0 -1
- package/dist/chunk-IVFVB4VR.js +0 -163
- package/dist/chunk-IVFVB4VR.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-KIQOUUEZ.mjs +0 -1
- package/dist/chunk-KIQOUUEZ.mjs.map +0 -1
- package/dist/chunk-KNJNL723.mjs +0 -39
- package/dist/chunk-KNJNL723.mjs.map +0 -1
- package/dist/chunk-KSIBNOB2.mjs +0 -13
- package/dist/chunk-KSIBNOB2.mjs.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-MAT5SBM7.mjs +0 -211
- package/dist/chunk-MAT5SBM7.mjs.map +0 -1
- package/dist/chunk-MBQHVBLA.js +0 -89
- package/dist/chunk-MBQHVBLA.js.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-NSMTFK33.mjs +0 -104
- package/dist/chunk-NSMTFK33.mjs.map +0 -1
- package/dist/chunk-NTOY6Y4Q.mjs +0 -1
- package/dist/chunk-NTOY6Y4Q.mjs.map +0 -1
- package/dist/chunk-O24GTINW.mjs +0 -134
- package/dist/chunk-O24GTINW.mjs.map +0 -1
- package/dist/chunk-ORO3T6BU.mjs +0 -24
- package/dist/chunk-ORO3T6BU.mjs.map +0 -1
- package/dist/chunk-PHUTP7NB.js +0 -25
- package/dist/chunk-PHUTP7NB.js.map +0 -1
- package/dist/chunk-PZDTZGSI.js +0 -34
- package/dist/chunk-PZDTZGSI.js.map +0 -1
- package/dist/chunk-Q2OQXAUM.mjs +0 -35
- package/dist/chunk-Q2OQXAUM.mjs.map +0 -1
- package/dist/chunk-RAMAN5RM.js +0 -24
- package/dist/chunk-RAMAN5RM.js.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-SW65QYFV.js +0 -50
- package/dist/chunk-SW65QYFV.js.map +0 -1
- package/dist/chunk-T2PHS5FY.js +0 -28
- package/dist/chunk-T2PHS5FY.js.map +0 -1
- package/dist/chunk-TGZ7WOTJ.mjs +0 -1
- package/dist/chunk-TGZ7WOTJ.mjs.map +0 -1
- package/dist/chunk-TMAWGVZP.mjs +0 -89
- package/dist/chunk-TMAWGVZP.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-VXPCUDBI.js +0 -36
- package/dist/chunk-VXPCUDBI.js.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-WMLSD6B5.js +0 -54
- package/dist/chunk-WMLSD6B5.js.map +0 -1
- package/dist/chunk-WRKY2DLV.js +0 -104
- package/dist/chunk-WRKY2DLV.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-XKJHFUHE.js +0 -11
- package/dist/chunk-XKJHFUHE.js.map +0 -1
- package/dist/chunk-XWGECIXI.js +0 -39
- package/dist/chunk-XWGECIXI.js.map +0 -1
- package/dist/chunk-Y3JC4WGW.js +0 -35
- package/dist/chunk-Y3JC4WGW.js.map +0 -1
- package/dist/chunk-YNUVT3HC.js +0 -240
- package/dist/chunk-YNUVT3HC.js.map +0 -1
- package/dist/chunk-ZG33OGC3.mjs +0 -1
- package/dist/chunk-ZG33OGC3.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 -43
- package/dist/helpers.js.map +0 -1
- package/dist/index.js +0 -54
- 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 -142
- 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 -12
- 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 -103
- package/dist/internals/simulation/index.js.map +0 -1
- package/dist/internals/simulation/interface.js +0 -31
- 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-locale.js +0 -8
- package/dist/internals/simulation/methods/hooks/get-locale.js.map +0 -1
- package/dist/internals/simulation/methods/hooks/get-locale.mjs +0 -8
- package/dist/internals/simulation/methods/hooks/get-locale.mjs.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/show-dialog.js +0 -14
- package/dist/internals/simulation/methods/hooks/show-dialog.js.map +0 -1
- package/dist/internals/simulation/methods/hooks/show-dialog.mjs +0 -14
- package/dist/internals/simulation/methods/hooks/show-dialog.mjs.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 -38
- 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 -51
- 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/get-locale.d.ts +0 -9
- package/dist/types/internals/simulation/methods/hooks/index.d.ts +0 -5
- package/dist/types/internals/simulation/methods/hooks/show-dialog.d.ts +0 -9
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../../src/internals/simulation/store/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAgC;AAChC,8CAAwB;AACxB,8CAAwB;AACxB,2CAAqB","sourcesContent":["export * from './notifications';\nexport * from './state';\nexport * from './store';\nexport * from './ui';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../../src/internals/simulation/store/index.ts"],"names":[],"mappings":"AAAA,oCAAgC;AAChC,4BAAwB;AACxB,4BAAwB;AACxB,yBAAqB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/internals/simulation/store/index.ts"],"names":[],"mappings":"AAAA,oCAAgC;AAChC,4BAAwB;AACxB,4BAAwB;AACxB,yBAAqB"}
|
|
@@ -1,44 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
closeInterface,
|
|
7
|
-
getCurrentInterface,
|
|
8
|
-
resolveInterface,
|
|
9
|
-
setInterface,
|
|
10
|
-
uiSlice
|
|
11
|
-
} from "../../../chunk-74TIKA2T.mjs";
|
|
12
|
-
import "../../../chunk-H2464AXT.mjs";
|
|
13
|
-
import {
|
|
14
|
-
addNotification,
|
|
15
|
-
clearNotifications,
|
|
16
|
-
getNotifications,
|
|
17
|
-
notificationsSlice,
|
|
18
|
-
removeNotification
|
|
19
|
-
} from "../../../chunk-LB4R3BUA.mjs";
|
|
20
|
-
import {
|
|
21
|
-
clearState,
|
|
22
|
-
getState,
|
|
23
|
-
setState,
|
|
24
|
-
stateSlice
|
|
25
|
-
} from "../../../chunk-MPZOXW6I.mjs";
|
|
26
|
-
import "../../../chunk-JMDSN227.mjs";
|
|
27
|
-
export {
|
|
28
|
-
addNotification,
|
|
29
|
-
clearNotifications,
|
|
30
|
-
clearState,
|
|
31
|
-
closeInterface,
|
|
32
|
-
createStore,
|
|
33
|
-
getCurrentInterface,
|
|
34
|
-
getNotifications,
|
|
35
|
-
getState,
|
|
36
|
-
notificationsSlice,
|
|
37
|
-
removeNotification,
|
|
38
|
-
resolveInterface,
|
|
39
|
-
setInterface,
|
|
40
|
-
setState,
|
|
41
|
-
stateSlice,
|
|
42
|
-
uiSlice
|
|
43
|
-
};
|
|
1
|
+
export * from "./notifications.mjs";
|
|
2
|
+
export * from "./state.mjs";
|
|
3
|
+
export * from "./store.mjs";
|
|
4
|
+
export * from "./ui.mjs";
|
|
44
5
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../src/internals/simulation/store/index.ts"],"names":[],"mappings":"AAAA,oCAAgC;AAChC,4BAAwB;AACxB,4BAAwB;AACxB,yBAAqB","sourcesContent":["export * from './notifications';\nexport * from './state';\nexport * from './store';\nexport * from './ui';\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.getJsonRpcMock = exports.getJsonRpcMocks = exports.removeJsonRpcMock = exports.addJsonRpcMock = exports.mocksSlice = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
/**
|
|
7
|
+
* The initial notifications state.
|
|
8
|
+
*/
|
|
9
|
+
const INITIAL_STATE = {
|
|
10
|
+
jsonRpc: {},
|
|
11
|
+
};
|
|
12
|
+
exports.mocksSlice = (0, toolkit_1.createSlice)({
|
|
13
|
+
name: 'mocks',
|
|
14
|
+
initialState: INITIAL_STATE,
|
|
15
|
+
reducers: {
|
|
16
|
+
addJsonRpcMock: (state, action) => {
|
|
17
|
+
// @ts-expect-error - TS2589: Type instantiation is excessively deep and
|
|
18
|
+
// possibly infinite.
|
|
19
|
+
state.jsonRpc[action.payload.method] = action.payload.result;
|
|
20
|
+
},
|
|
21
|
+
removeJsonRpcMock: (state, action) => {
|
|
22
|
+
delete state.jsonRpc[action.payload];
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
_a = exports.mocksSlice.actions, exports.addJsonRpcMock = _a.addJsonRpcMock, exports.removeJsonRpcMock = _a.removeJsonRpcMock;
|
|
27
|
+
/**
|
|
28
|
+
* Get the JSON-RPC mocks from the state.
|
|
29
|
+
*
|
|
30
|
+
* @param state - The application state.
|
|
31
|
+
* @returns The JSON-RPC mocks.
|
|
32
|
+
*/
|
|
33
|
+
const getJsonRpcMocks = (state) => state.mocks.jsonRpc;
|
|
34
|
+
exports.getJsonRpcMocks = getJsonRpcMocks;
|
|
35
|
+
/**
|
|
36
|
+
* Get the JSON-RPC mock for a given method from the state.
|
|
37
|
+
*/
|
|
38
|
+
exports.getJsonRpcMock = (0, toolkit_1.createSelector)(exports.getJsonRpcMocks, (_, method) => method, (jsonRpcMocks, method) => jsonRpcMocks[method]);
|
|
39
|
+
//# sourceMappingURL=mocks.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mocks.cjs","sourceRoot":"","sources":["../../../../src/internals/simulation/store/mocks.ts"],"names":[],"mappings":";;;;AAEA,8CAA+D;AAa/D;;GAEG;AACH,MAAM,aAAa,GAAe;IAChC,OAAO,EAAE,EAAE;CACZ,CAAC;AAEW,QAAA,UAAU,GAAG,IAAA,qBAAW,EAAC;IACpC,IAAI,EAAE,OAAO;IACb,YAAY,EAAE,aAAa;IAC3B,QAAQ,EAAE;QACR,cAAc,EAAE,CAAC,KAAK,EAAE,MAAkC,EAAE,EAAE;YAC5D,wEAAwE;YACxE,qBAAqB;YACrB,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;QAC/D,CAAC;QACD,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAA6B,EAAE,EAAE;YAC1D,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC;KACF;CACF,CAAC,CAAC;AAEU,KAAwC,kBAAU,CAAC,OAAO,EAAxD,sBAAc,sBAAE,yBAAiB,wBAAwB;AAExE;;;;;GAKG;AACI,MAAM,eAAe,GAAG,CAAC,KAAuB,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC;AAAnE,QAAA,eAAe,mBAAoD;AAEhF;;GAEG;AACU,QAAA,cAAc,GAAG,IAAA,wBAAc,EAC1C,uBAAe,EACf,CAAC,CAAU,EAAE,MAAc,EAAE,EAAE,CAAC,MAAM,EACtC,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,CAC/C,CAAC","sourcesContent":["import type { Json } from '@metamask/utils';\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSelector, createSlice } from '@reduxjs/toolkit';\n\nimport type { ApplicationState } from './store';\n\nexport type JsonRpcMock = {\n method: string;\n result: Json;\n};\n\nexport type MocksState = {\n jsonRpc: Record<string, Json>;\n};\n\n/**\n * The initial notifications state.\n */\nconst INITIAL_STATE: MocksState = {\n jsonRpc: {},\n};\n\nexport const mocksSlice = createSlice({\n name: 'mocks',\n initialState: INITIAL_STATE,\n reducers: {\n addJsonRpcMock: (state, action: PayloadAction<JsonRpcMock>) => {\n // @ts-expect-error - TS2589: Type instantiation is excessively deep and\n // possibly infinite.\n state.jsonRpc[action.payload.method] = action.payload.result;\n },\n removeJsonRpcMock: (state, action: PayloadAction<string>) => {\n delete state.jsonRpc[action.payload];\n },\n },\n});\n\nexport const { addJsonRpcMock, removeJsonRpcMock } = mocksSlice.actions;\n\n/**\n * Get the JSON-RPC mocks from the state.\n *\n * @param state - The application state.\n * @returns The JSON-RPC mocks.\n */\nexport const getJsonRpcMocks = (state: ApplicationState) => state.mocks.jsonRpc;\n\n/**\n * Get the JSON-RPC mock for a given method from the state.\n */\nexport const getJsonRpcMock = createSelector(\n getJsonRpcMocks,\n (_: unknown, method: string) => method,\n (jsonRpcMocks, method) => jsonRpcMocks[method],\n);\n"]}
|
package/dist/{types/internals/simulation/store/mocks.d.ts → internals/simulation/store/mocks.d.cts}
RENAMED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type { Json } from
|
|
2
|
-
import type { PayloadAction } from
|
|
3
|
-
import type { ApplicationState } from
|
|
4
|
-
export
|
|
1
|
+
import type { Json } from "@metamask/utils";
|
|
2
|
+
import type { PayloadAction } from "@reduxjs/toolkit";
|
|
3
|
+
import type { ApplicationState } from "./store.cjs";
|
|
4
|
+
export type JsonRpcMock = {
|
|
5
5
|
method: string;
|
|
6
6
|
result: Json;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type MocksState = {
|
|
9
9
|
jsonRpc: Record<string, Json>;
|
|
10
10
|
};
|
|
11
11
|
export declare const mocksSlice: import("@reduxjs/toolkit").Slice<MocksState, {
|
|
12
|
-
addJsonRpcMock: (state: import("immer/dist/internal").WritableDraft<MocksState>, action: PayloadAction<JsonRpcMock>) => void;
|
|
13
|
-
removeJsonRpcMock: (state: import("immer/dist/internal").WritableDraft<MocksState>, action: PayloadAction<string>) => void;
|
|
12
|
+
addJsonRpcMock: (state: import("immer/dist/internal.js").WritableDraft<MocksState>, action: PayloadAction<JsonRpcMock>) => void;
|
|
13
|
+
removeJsonRpcMock: (state: import("immer/dist/internal.js").WritableDraft<MocksState>, action: PayloadAction<string>) => void;
|
|
14
14
|
}, "mocks">;
|
|
15
15
|
export declare const addJsonRpcMock: import("@reduxjs/toolkit").ActionCreatorWithPayload<JsonRpcMock, "mocks/addJsonRpcMock">, removeJsonRpcMock: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "mocks/removeJsonRpcMock">;
|
|
16
16
|
/**
|
|
@@ -33,3 +33,4 @@ export declare const getJsonRpcMock: ((state: {
|
|
|
33
33
|
}> & {
|
|
34
34
|
clearCache: () => void;
|
|
35
35
|
};
|
|
36
|
+
//# sourceMappingURL=mocks.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mocks.d.cts","sourceRoot":"","sources":["../../../../src/internals/simulation/store/mocks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAyB;AAGtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAgB;AAEhD,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,IAAI,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;CAC/B,CAAC;AASF,eAAO,MAAM,UAAU;gGAIa,cAAc,WAAW,CAAC;mGAKvB,cAAc,MAAM,CAAC;WAI1D,CAAC;AAEH,eAAO,MAAQ,cAAc,4FAAE,iBAAiB,wFAAuB,CAAC;AAExE;;;;;GAKG;AACH,eAAO,MAAM,eAAe,UAAW,gBAAgB,yBAAwB,CAAC;AAEhF;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;CAI1B,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Json } from "@metamask/utils";
|
|
2
|
+
import type { PayloadAction } from "@reduxjs/toolkit";
|
|
3
|
+
import type { ApplicationState } from "./store.mjs";
|
|
4
|
+
export type JsonRpcMock = {
|
|
5
|
+
method: string;
|
|
6
|
+
result: Json;
|
|
7
|
+
};
|
|
8
|
+
export type MocksState = {
|
|
9
|
+
jsonRpc: Record<string, Json>;
|
|
10
|
+
};
|
|
11
|
+
export declare const mocksSlice: import("@reduxjs/toolkit").Slice<MocksState, {
|
|
12
|
+
addJsonRpcMock: (state: import("immer/dist/internal.js").WritableDraft<MocksState>, action: PayloadAction<JsonRpcMock>) => void;
|
|
13
|
+
removeJsonRpcMock: (state: import("immer/dist/internal.js").WritableDraft<MocksState>, action: PayloadAction<string>) => void;
|
|
14
|
+
}, "mocks">;
|
|
15
|
+
export declare const addJsonRpcMock: import("@reduxjs/toolkit").ActionCreatorWithPayload<JsonRpcMock, "mocks/addJsonRpcMock">, removeJsonRpcMock: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "mocks/removeJsonRpcMock">;
|
|
16
|
+
/**
|
|
17
|
+
* Get the JSON-RPC mocks from the state.
|
|
18
|
+
*
|
|
19
|
+
* @param state - The application state.
|
|
20
|
+
* @returns The JSON-RPC mocks.
|
|
21
|
+
*/
|
|
22
|
+
export declare const getJsonRpcMocks: (state: ApplicationState) => Record<string, Json>;
|
|
23
|
+
/**
|
|
24
|
+
* Get the JSON-RPC mock for a given method from the state.
|
|
25
|
+
*/
|
|
26
|
+
export declare const getJsonRpcMock: ((state: {
|
|
27
|
+
mocks: MocksState;
|
|
28
|
+
notifications: import("./notifications").NotificationsState;
|
|
29
|
+
state: import("./state").State;
|
|
30
|
+
ui: import("./ui").UiState;
|
|
31
|
+
}, method: string) => Json) & import("reselect").OutputSelectorFields<(args_0: Record<string, Json>, args_1: string) => Json, {
|
|
32
|
+
clearCache: () => void;
|
|
33
|
+
}> & {
|
|
34
|
+
clearCache: () => void;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=mocks.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mocks.d.mts","sourceRoot":"","sources":["../../../../src/internals/simulation/store/mocks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAyB;AAGtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,oBAAgB;AAEhD,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,IAAI,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;CAC/B,CAAC;AASF,eAAO,MAAM,UAAU;gGAIa,cAAc,WAAW,CAAC;mGAKvB,cAAc,MAAM,CAAC;WAI1D,CAAC;AAEH,eAAO,MAAQ,cAAc,4FAAE,iBAAiB,wFAAuB,CAAC;AAExE;;;;;GAKG;AACH,eAAO,MAAM,eAAe,UAAW,gBAAgB,yBAAwB,CAAC;AAEhF;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;CAI1B,CAAC"}
|
|
@@ -1,16 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
import "../../../chunk-JMDSN227.mjs";
|
|
9
|
-
export {
|
|
10
|
-
addJsonRpcMock,
|
|
11
|
-
getJsonRpcMock,
|
|
12
|
-
getJsonRpcMocks,
|
|
13
|
-
mocksSlice,
|
|
14
|
-
removeJsonRpcMock
|
|
1
|
+
import $reduxjstoolkit from "@reduxjs/toolkit";
|
|
2
|
+
const { createSelector, createSlice } = $reduxjstoolkit;
|
|
3
|
+
/**
|
|
4
|
+
* The initial notifications state.
|
|
5
|
+
*/
|
|
6
|
+
const INITIAL_STATE = {
|
|
7
|
+
jsonRpc: {},
|
|
15
8
|
};
|
|
9
|
+
export const mocksSlice = createSlice({
|
|
10
|
+
name: 'mocks',
|
|
11
|
+
initialState: INITIAL_STATE,
|
|
12
|
+
reducers: {
|
|
13
|
+
addJsonRpcMock: (state, action) => {
|
|
14
|
+
// @ts-expect-error - TS2589: Type instantiation is excessively deep and
|
|
15
|
+
// possibly infinite.
|
|
16
|
+
state.jsonRpc[action.payload.method] = action.payload.result;
|
|
17
|
+
},
|
|
18
|
+
removeJsonRpcMock: (state, action) => {
|
|
19
|
+
delete state.jsonRpc[action.payload];
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
export const { addJsonRpcMock, removeJsonRpcMock } = mocksSlice.actions;
|
|
24
|
+
/**
|
|
25
|
+
* Get the JSON-RPC mocks from the state.
|
|
26
|
+
*
|
|
27
|
+
* @param state - The application state.
|
|
28
|
+
* @returns The JSON-RPC mocks.
|
|
29
|
+
*/
|
|
30
|
+
export const getJsonRpcMocks = (state) => state.mocks.jsonRpc;
|
|
31
|
+
/**
|
|
32
|
+
* Get the JSON-RPC mock for a given method from the state.
|
|
33
|
+
*/
|
|
34
|
+
export const getJsonRpcMock = createSelector(getJsonRpcMocks, (_, method) => method, (jsonRpcMocks, method) => jsonRpcMocks[method]);
|
|
16
35
|
//# sourceMappingURL=mocks.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"file":"mocks.mjs","sourceRoot":"","sources":["../../../../src/internals/simulation/store/mocks.ts"],"names":[],"mappings":";;AAeA;;GAEG;AACH,MAAM,aAAa,GAAe;IAChC,OAAO,EAAE,EAAE;CACZ,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,WAAW,CAAC;IACpC,IAAI,EAAE,OAAO;IACb,YAAY,EAAE,aAAa;IAC3B,QAAQ,EAAE;QACR,cAAc,EAAE,CAAC,KAAK,EAAE,MAAkC,EAAE,EAAE;YAC5D,wEAAwE;YACxE,qBAAqB;YACrB,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;QAC/D,CAAC;QACD,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAA6B,EAAE,EAAE;YAC1D,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC;KACF;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,EAAE,cAAc,EAAE,iBAAiB,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC;AAExE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAuB,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC;AAEhF;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAC1C,eAAe,EACf,CAAC,CAAU,EAAE,MAAc,EAAE,EAAE,CAAC,MAAM,EACtC,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,CAC/C,CAAC","sourcesContent":["import type { Json } from '@metamask/utils';\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSelector, createSlice } from '@reduxjs/toolkit';\n\nimport type { ApplicationState } from './store';\n\nexport type JsonRpcMock = {\n method: string;\n result: Json;\n};\n\nexport type MocksState = {\n jsonRpc: Record<string, Json>;\n};\n\n/**\n * The initial notifications state.\n */\nconst INITIAL_STATE: MocksState = {\n jsonRpc: {},\n};\n\nexport const mocksSlice = createSlice({\n name: 'mocks',\n initialState: INITIAL_STATE,\n reducers: {\n addJsonRpcMock: (state, action: PayloadAction<JsonRpcMock>) => {\n // @ts-expect-error - TS2589: Type instantiation is excessively deep and\n // possibly infinite.\n state.jsonRpc[action.payload.method] = action.payload.result;\n },\n removeJsonRpcMock: (state, action: PayloadAction<string>) => {\n delete state.jsonRpc[action.payload];\n },\n },\n});\n\nexport const { addJsonRpcMock, removeJsonRpcMock } = mocksSlice.actions;\n\n/**\n * Get the JSON-RPC mocks from the state.\n *\n * @param state - The application state.\n * @returns The JSON-RPC mocks.\n */\nexport const getJsonRpcMocks = (state: ApplicationState) => state.mocks.jsonRpc;\n\n/**\n * Get the JSON-RPC mock for a given method from the state.\n */\nexport const getJsonRpcMock = createSelector(\n getJsonRpcMocks,\n (_: unknown, method: string) => method,\n (jsonRpcMocks, method) => jsonRpcMocks[method],\n);\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.getNotifications = exports.clearNotifications = exports.removeNotification = exports.addNotification = exports.notificationsSlice = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
/**
|
|
7
|
+
* The initial notifications state.
|
|
8
|
+
*/
|
|
9
|
+
const INITIAL_STATE = {
|
|
10
|
+
notifications: [],
|
|
11
|
+
};
|
|
12
|
+
exports.notificationsSlice = (0, toolkit_1.createSlice)({
|
|
13
|
+
name: 'notifications',
|
|
14
|
+
initialState: INITIAL_STATE,
|
|
15
|
+
reducers: {
|
|
16
|
+
addNotification: (state, action) => {
|
|
17
|
+
state.notifications.push(action.payload);
|
|
18
|
+
},
|
|
19
|
+
removeNotification: (state, action) => {
|
|
20
|
+
state.notifications = state.notifications.filter((notification) => notification.id !== action.payload);
|
|
21
|
+
},
|
|
22
|
+
clearNotifications: (state) => {
|
|
23
|
+
state.notifications = [];
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
_a = exports.notificationsSlice.actions, exports.addNotification = _a.addNotification, exports.removeNotification = _a.removeNotification, exports.clearNotifications = _a.clearNotifications;
|
|
28
|
+
/**
|
|
29
|
+
* Get the notifications from the state.
|
|
30
|
+
*
|
|
31
|
+
* @param state - The application state.
|
|
32
|
+
* @returns An array of notifications.
|
|
33
|
+
*/
|
|
34
|
+
exports.getNotifications = (0, toolkit_1.createSelector)((state) => state.notifications, ({ notifications }) => notifications);
|
|
35
|
+
//# sourceMappingURL=notifications.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.cjs","sourceRoot":"","sources":["../../../../src/internals/simulation/store/notifications.ts"],"names":[],"mappings":";;;;AAEA,8CAA+D;AA0B/D;;GAEG;AACH,MAAM,aAAa,GAAuB;IACxC,aAAa,EAAE,EAAE;CAClB,CAAC;AAEW,QAAA,kBAAkB,GAAG,IAAA,qBAAW,EAAC;IAC5C,IAAI,EAAE,eAAe;IACrB,YAAY,EAAE,aAAa;IAC3B,QAAQ,EAAE;QACR,eAAe,EAAE,CAAC,KAAK,EAAE,MAAmC,EAAE,EAAE;YAC9D,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC3C,CAAC;QACD,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAA6B,EAAE,EAAE;YAC3D,KAAK,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,MAAM,CAC9C,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,KAAK,MAAM,CAAC,OAAO,CACrD,CAAC;QACJ,CAAC;QACD,kBAAkB,EAAE,CAAC,KAAK,EAAE,EAAE;YAC5B,KAAK,CAAC,aAAa,GAAG,EAAE,CAAC;QAC3B,CAAC;KACF;CACF,CAAC,CAAC;AAEU,KACX,0BAAkB,CAAC,OAAO,EADb,uBAAe,uBAAE,0BAAkB,0BAAE,0BAAkB,yBACzC;AAE7B;;;;;GAKG;AACU,QAAA,gBAAgB,GAAG,IAAA,wBAAc,EAC5C,CAAC,KAAuB,EAAE,EAAE,CAAC,KAAK,CAAC,aAAa,EAChD,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,aAAa,CACrC,CAAC","sourcesContent":["import type { NotificationType } from '@metamask/snaps-sdk';\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSelector, createSlice } from '@reduxjs/toolkit';\n\nimport type { ApplicationState } from './store';\n\n/**\n * A notification object.\n *\n * @property id - A unique ID for the notification.\n * @property message - The notification message.\n * @property type - The notification type.\n */\nexport type Notification = {\n id: string;\n message: string;\n type: NotificationType;\n};\n\n/**\n * The notifications state.\n *\n * @property notifications - An array of notifications.\n */\nexport type NotificationsState = {\n notifications: Notification[];\n};\n\n/**\n * The initial notifications state.\n */\nconst INITIAL_STATE: NotificationsState = {\n notifications: [],\n};\n\nexport const notificationsSlice = createSlice({\n name: 'notifications',\n initialState: INITIAL_STATE,\n reducers: {\n addNotification: (state, action: PayloadAction<Notification>) => {\n state.notifications.push(action.payload);\n },\n removeNotification: (state, action: PayloadAction<string>) => {\n state.notifications = state.notifications.filter(\n (notification) => notification.id !== action.payload,\n );\n },\n clearNotifications: (state) => {\n state.notifications = [];\n },\n },\n});\n\nexport const { addNotification, removeNotification, clearNotifications } =\n notificationsSlice.actions;\n\n/**\n * Get the notifications from the state.\n *\n * @param state - The application state.\n * @returns An array of notifications.\n */\nexport const getNotifications = createSelector(\n (state: ApplicationState) => state.notifications,\n ({ notifications }) => notifications,\n);\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { NotificationType } from
|
|
2
|
-
import type { PayloadAction } from
|
|
1
|
+
import type { NotificationType } from "@metamask/snaps-sdk";
|
|
2
|
+
import type { PayloadAction } from "@reduxjs/toolkit";
|
|
3
3
|
/**
|
|
4
4
|
* A notification object.
|
|
5
5
|
*
|
|
@@ -7,7 +7,7 @@ import type { PayloadAction } from '@reduxjs/toolkit';
|
|
|
7
7
|
* @property message - The notification message.
|
|
8
8
|
* @property type - The notification type.
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export type Notification = {
|
|
11
11
|
id: string;
|
|
12
12
|
message: string;
|
|
13
13
|
type: NotificationType;
|
|
@@ -17,13 +17,13 @@ export declare type Notification = {
|
|
|
17
17
|
*
|
|
18
18
|
* @property notifications - An array of notifications.
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export type NotificationsState = {
|
|
21
21
|
notifications: Notification[];
|
|
22
22
|
};
|
|
23
23
|
export declare const notificationsSlice: import("@reduxjs/toolkit").Slice<NotificationsState, {
|
|
24
|
-
addNotification: (state: import("immer/dist/internal").WritableDraft<NotificationsState>, action: PayloadAction<Notification>) => void;
|
|
25
|
-
removeNotification: (state: import("immer/dist/internal").WritableDraft<NotificationsState>, action: PayloadAction<string>) => void;
|
|
26
|
-
clearNotifications: (state: import("immer/dist/internal").WritableDraft<NotificationsState>) => void;
|
|
24
|
+
addNotification: (state: import("immer/dist/internal.js").WritableDraft<NotificationsState>, action: PayloadAction<Notification>) => void;
|
|
25
|
+
removeNotification: (state: import("immer/dist/internal.js").WritableDraft<NotificationsState>, action: PayloadAction<string>) => void;
|
|
26
|
+
clearNotifications: (state: import("immer/dist/internal.js").WritableDraft<NotificationsState>) => void;
|
|
27
27
|
}, "notifications">;
|
|
28
28
|
export declare const addNotification: import("@reduxjs/toolkit").ActionCreatorWithPayload<Notification, "notifications/addNotification">, removeNotification: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "notifications/removeNotification">, clearNotifications: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"notifications/clearNotifications">;
|
|
29
29
|
/**
|
|
@@ -42,3 +42,4 @@ export declare const getNotifications: ((state: {
|
|
|
42
42
|
}> & {
|
|
43
43
|
clearCache: () => void;
|
|
44
44
|
};
|
|
45
|
+
//# sourceMappingURL=notifications.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.d.cts","sourceRoot":"","sources":["../../../../src/internals/simulation/store/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,4BAA4B;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAyB;AAKtD;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,gBAAgB,CAAC;CACxB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,aAAa,EAAE,YAAY,EAAE,CAAC;CAC/B,CAAC;AASF,eAAO,MAAM,kBAAkB;yGAIM,cAAc,YAAY,CAAC;4GAGxB,cAAc,MAAM,CAAC;;mBAS3D,CAAC;AAEH,eAAO,MAAQ,eAAe,sGAAE,kBAAkB,mGAAE,kBAAkB,4FAC1C,CAAC;AAE7B;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;CAG5B,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { NotificationType } from "@metamask/snaps-sdk";
|
|
2
|
+
import type { PayloadAction } from "@reduxjs/toolkit";
|
|
3
|
+
/**
|
|
4
|
+
* A notification object.
|
|
5
|
+
*
|
|
6
|
+
* @property id - A unique ID for the notification.
|
|
7
|
+
* @property message - The notification message.
|
|
8
|
+
* @property type - The notification type.
|
|
9
|
+
*/
|
|
10
|
+
export type Notification = {
|
|
11
|
+
id: string;
|
|
12
|
+
message: string;
|
|
13
|
+
type: NotificationType;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* The notifications state.
|
|
17
|
+
*
|
|
18
|
+
* @property notifications - An array of notifications.
|
|
19
|
+
*/
|
|
20
|
+
export type NotificationsState = {
|
|
21
|
+
notifications: Notification[];
|
|
22
|
+
};
|
|
23
|
+
export declare const notificationsSlice: import("@reduxjs/toolkit").Slice<NotificationsState, {
|
|
24
|
+
addNotification: (state: import("immer/dist/internal.js").WritableDraft<NotificationsState>, action: PayloadAction<Notification>) => void;
|
|
25
|
+
removeNotification: (state: import("immer/dist/internal.js").WritableDraft<NotificationsState>, action: PayloadAction<string>) => void;
|
|
26
|
+
clearNotifications: (state: import("immer/dist/internal.js").WritableDraft<NotificationsState>) => void;
|
|
27
|
+
}, "notifications">;
|
|
28
|
+
export declare const addNotification: import("@reduxjs/toolkit").ActionCreatorWithPayload<Notification, "notifications/addNotification">, removeNotification: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "notifications/removeNotification">, clearNotifications: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"notifications/clearNotifications">;
|
|
29
|
+
/**
|
|
30
|
+
* Get the notifications from the state.
|
|
31
|
+
*
|
|
32
|
+
* @param state - The application state.
|
|
33
|
+
* @returns An array of notifications.
|
|
34
|
+
*/
|
|
35
|
+
export declare const getNotifications: ((state: {
|
|
36
|
+
mocks: import("./mocks").MocksState;
|
|
37
|
+
notifications: NotificationsState;
|
|
38
|
+
state: import("./state").State;
|
|
39
|
+
ui: import("./ui").UiState;
|
|
40
|
+
}) => Notification[]) & import("reselect").OutputSelectorFields<(args_0: NotificationsState) => Notification[], {
|
|
41
|
+
clearCache: () => void;
|
|
42
|
+
}> & {
|
|
43
|
+
clearCache: () => void;
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=notifications.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.d.mts","sourceRoot":"","sources":["../../../../src/internals/simulation/store/notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,4BAA4B;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAyB;AAKtD;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,gBAAgB,CAAC;CACxB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,aAAa,EAAE,YAAY,EAAE,CAAC;CAC/B,CAAC;AASF,eAAO,MAAM,kBAAkB;yGAIM,cAAc,YAAY,CAAC;4GAGxB,cAAc,MAAM,CAAC;;mBAS3D,CAAC;AAEH,eAAO,MAAQ,eAAe,sGAAE,kBAAkB,mGAAE,kBAAkB,4FAC1C,CAAC;AAE7B;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;CAG5B,CAAC"}
|
|
@@ -1,16 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import "../../../chunk-JMDSN227.mjs";
|
|
9
|
-
export {
|
|
10
|
-
addNotification,
|
|
11
|
-
clearNotifications,
|
|
12
|
-
getNotifications,
|
|
13
|
-
notificationsSlice,
|
|
14
|
-
removeNotification
|
|
1
|
+
import $reduxjstoolkit from "@reduxjs/toolkit";
|
|
2
|
+
const { createSelector, createSlice } = $reduxjstoolkit;
|
|
3
|
+
/**
|
|
4
|
+
* The initial notifications state.
|
|
5
|
+
*/
|
|
6
|
+
const INITIAL_STATE = {
|
|
7
|
+
notifications: [],
|
|
15
8
|
};
|
|
9
|
+
export const notificationsSlice = createSlice({
|
|
10
|
+
name: 'notifications',
|
|
11
|
+
initialState: INITIAL_STATE,
|
|
12
|
+
reducers: {
|
|
13
|
+
addNotification: (state, action) => {
|
|
14
|
+
state.notifications.push(action.payload);
|
|
15
|
+
},
|
|
16
|
+
removeNotification: (state, action) => {
|
|
17
|
+
state.notifications = state.notifications.filter((notification) => notification.id !== action.payload);
|
|
18
|
+
},
|
|
19
|
+
clearNotifications: (state) => {
|
|
20
|
+
state.notifications = [];
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
export const { addNotification, removeNotification, clearNotifications } = notificationsSlice.actions;
|
|
25
|
+
/**
|
|
26
|
+
* Get the notifications from the state.
|
|
27
|
+
*
|
|
28
|
+
* @param state - The application state.
|
|
29
|
+
* @returns An array of notifications.
|
|
30
|
+
*/
|
|
31
|
+
export const getNotifications = createSelector((state) => state.notifications, ({ notifications }) => notifications);
|
|
16
32
|
//# sourceMappingURL=notifications.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"file":"notifications.mjs","sourceRoot":"","sources":["../../../../src/internals/simulation/store/notifications.ts"],"names":[],"mappings":";;AA4BA;;GAEG;AACH,MAAM,aAAa,GAAuB;IACxC,aAAa,EAAE,EAAE;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,WAAW,CAAC;IAC5C,IAAI,EAAE,eAAe;IACrB,YAAY,EAAE,aAAa;IAC3B,QAAQ,EAAE;QACR,eAAe,EAAE,CAAC,KAAK,EAAE,MAAmC,EAAE,EAAE;YAC9D,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC3C,CAAC;QACD,kBAAkB,EAAE,CAAC,KAAK,EAAE,MAA6B,EAAE,EAAE;YAC3D,KAAK,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,MAAM,CAC9C,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,KAAK,MAAM,CAAC,OAAO,CACrD,CAAC;QACJ,CAAC;QACD,kBAAkB,EAAE,CAAC,KAAK,EAAE,EAAE;YAC5B,KAAK,CAAC,aAAa,GAAG,EAAE,CAAC;QAC3B,CAAC;KACF;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,EAAE,eAAe,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,GACtE,kBAAkB,CAAC,OAAO,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAC5C,CAAC,KAAuB,EAAE,EAAE,CAAC,KAAK,CAAC,aAAa,EAChD,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,aAAa,CACrC,CAAC","sourcesContent":["import type { NotificationType } from '@metamask/snaps-sdk';\nimport type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSelector, createSlice } from '@reduxjs/toolkit';\n\nimport type { ApplicationState } from './store';\n\n/**\n * A notification object.\n *\n * @property id - A unique ID for the notification.\n * @property message - The notification message.\n * @property type - The notification type.\n */\nexport type Notification = {\n id: string;\n message: string;\n type: NotificationType;\n};\n\n/**\n * The notifications state.\n *\n * @property notifications - An array of notifications.\n */\nexport type NotificationsState = {\n notifications: Notification[];\n};\n\n/**\n * The initial notifications state.\n */\nconst INITIAL_STATE: NotificationsState = {\n notifications: [],\n};\n\nexport const notificationsSlice = createSlice({\n name: 'notifications',\n initialState: INITIAL_STATE,\n reducers: {\n addNotification: (state, action: PayloadAction<Notification>) => {\n state.notifications.push(action.payload);\n },\n removeNotification: (state, action: PayloadAction<string>) => {\n state.notifications = state.notifications.filter(\n (notification) => notification.id !== action.payload,\n );\n },\n clearNotifications: (state) => {\n state.notifications = [];\n },\n },\n});\n\nexport const { addNotification, removeNotification, clearNotifications } =\n notificationsSlice.actions;\n\n/**\n * Get the notifications from the state.\n *\n * @param state - The application state.\n * @returns An array of notifications.\n */\nexport const getNotifications = createSelector(\n (state: ApplicationState) => state.notifications,\n ({ notifications }) => notifications,\n);\n"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.getState = exports.clearState = exports.setState = exports.stateSlice = void 0;
|
|
5
|
+
const toolkit_1 = require("@reduxjs/toolkit");
|
|
6
|
+
/**
|
|
7
|
+
* The initial state.
|
|
8
|
+
*/
|
|
9
|
+
const INITIAL_STATE = {
|
|
10
|
+
encrypted: null,
|
|
11
|
+
unencrypted: null,
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The state slice, which stores the state of the Snap.
|
|
15
|
+
*/
|
|
16
|
+
exports.stateSlice = (0, toolkit_1.createSlice)({
|
|
17
|
+
name: 'state',
|
|
18
|
+
initialState: INITIAL_STATE,
|
|
19
|
+
reducers: {
|
|
20
|
+
setState: (state, action) => {
|
|
21
|
+
if (action.payload.encrypted) {
|
|
22
|
+
state.encrypted = action.payload.state;
|
|
23
|
+
return state;
|
|
24
|
+
}
|
|
25
|
+
state.unencrypted = action.payload.state;
|
|
26
|
+
return state;
|
|
27
|
+
},
|
|
28
|
+
clearState: (state, action) => {
|
|
29
|
+
if (action.payload.encrypted) {
|
|
30
|
+
state.encrypted = null;
|
|
31
|
+
return state;
|
|
32
|
+
}
|
|
33
|
+
state.unencrypted = null;
|
|
34
|
+
return state;
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
_a = exports.stateSlice.actions, exports.setState = _a.setState, exports.clearState = _a.clearState;
|
|
39
|
+
/**
|
|
40
|
+
* Get the state from the store.
|
|
41
|
+
*
|
|
42
|
+
* @param encrypted - Whether to get the encrypted or unencrypted state.
|
|
43
|
+
* @returns A selector that returns the state.
|
|
44
|
+
*/
|
|
45
|
+
function getState(encrypted) {
|
|
46
|
+
return (0, toolkit_1.createSelector)((state) => state, ({ state }) => {
|
|
47
|
+
if (encrypted) {
|
|
48
|
+
return state.encrypted;
|
|
49
|
+
}
|
|
50
|
+
return state.unencrypted;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
exports.getState = getState;
|
|
54
|
+
//# sourceMappingURL=state.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.cjs","sourceRoot":"","sources":["../../../../src/internals/simulation/store/state.ts"],"names":[],"mappings":";;;;AACA,8CAA+D;AAiB/D;;GAEG;AACH,MAAM,aAAa,GAAU;IAC3B,SAAS,EAAE,IAAI;IACf,WAAW,EAAE,IAAI;CAClB,CAAC;AAEF;;GAEG;AACU,QAAA,UAAU,GAAG,IAAA,qBAAW,EAAC;IACpC,IAAI,EAAE,OAAO;IACb,YAAY,EAAE,aAAa;IAC3B,QAAQ,EAAE;QACR,QAAQ,EAAE,CACR,KAAK,EACL,MAAmE,EACnE,EAAE;YACF,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;gBAC7B,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;gBACvC,OAAO,KAAK,CAAC;YACf,CAAC;YAED,KAAK,CAAC,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;YACzC,OAAO,KAAK,CAAC;QACf,CAAC;QACD,UAAU,EAAE,CAAC,KAAK,EAAE,MAA6C,EAAE,EAAE;YACnE,IAAI,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;gBAC7B,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;gBACvB,OAAO,KAAK,CAAC;YACf,CAAC;YAED,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC;YACzB,OAAO,KAAK,CAAC;QACf,CAAC;KACF;CACF,CAAC,CAAC;AAEU,KAA2B,kBAAU,CAAC,OAAO,EAA3C,gBAAQ,gBAAE,kBAAU,iBAAwB;AAE3D;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,SAAkB;IACzC,OAAO,IAAA,wBAAc,EACnB,CAAC,KAAuB,EAAE,EAAE,CAAC,KAAK,EAClC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;QACZ,IAAI,SAAS,EAAE,CAAC;YACd,OAAO,KAAK,CAAC,SAAS,CAAC;QACzB,CAAC;QAED,OAAO,KAAK,CAAC,WAAW,CAAC;IAC3B,CAAC,CACF,CAAC;AACJ,CAAC;AAXD,4BAWC","sourcesContent":["import type { PayloadAction } from '@reduxjs/toolkit';\nimport { createSelector, createSlice } from '@reduxjs/toolkit';\n\nimport type { ApplicationState } from './store';\n\n/**\n * The Snap state object.\n *\n * @property encrypted - The encrypted state. Can be null if the Snap does not\n * have an encrypted state.\n * @property unencrypted - The unencrypted state. Can be null if the Snap does\n * not have an unencrypted state.\n */\nexport type State = {\n encrypted: string | null;\n unencrypted: string | null;\n};\n\n/**\n * The initial state.\n */\nconst INITIAL_STATE: State = {\n encrypted: null,\n unencrypted: null,\n};\n\n/**\n * The state slice, which stores the state of the Snap.\n */\nexport const stateSlice = createSlice({\n name: 'state',\n initialState: INITIAL_STATE,\n reducers: {\n setState: (\n state,\n action: PayloadAction<{ state: string | null; encrypted: boolean }>,\n ) => {\n if (action.payload.encrypted) {\n state.encrypted = action.payload.state;\n return state;\n }\n\n state.unencrypted = action.payload.state;\n return state;\n },\n clearState: (state, action: PayloadAction<{ encrypted: boolean }>) => {\n if (action.payload.encrypted) {\n state.encrypted = null;\n return state;\n }\n\n state.unencrypted = null;\n return state;\n },\n },\n});\n\nexport const { setState, clearState } = stateSlice.actions;\n\n/**\n * Get the state from the store.\n *\n * @param encrypted - Whether to get the encrypted or unencrypted state.\n * @returns A selector that returns the state.\n */\nexport function getState(encrypted: boolean) {\n return createSelector(\n (state: ApplicationState) => state,\n ({ state }) => {\n if (encrypted) {\n return state.encrypted;\n }\n\n return state.unencrypted;\n },\n );\n}\n"]}
|
package/dist/{types/internals/simulation/store/state.d.ts → internals/simulation/store/state.d.cts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PayloadAction } from
|
|
1
|
+
import type { PayloadAction } from "@reduxjs/toolkit";
|
|
2
2
|
/**
|
|
3
3
|
* The Snap state object.
|
|
4
4
|
*
|
|
@@ -7,7 +7,7 @@ import type { PayloadAction } from '@reduxjs/toolkit';
|
|
|
7
7
|
* @property unencrypted - The unencrypted state. Can be null if the Snap does
|
|
8
8
|
* not have an unencrypted state.
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export type State = {
|
|
11
11
|
encrypted: string | null;
|
|
12
12
|
unencrypted: string | null;
|
|
13
13
|
};
|
|
@@ -15,16 +15,16 @@ export declare type State = {
|
|
|
15
15
|
* The state slice, which stores the state of the Snap.
|
|
16
16
|
*/
|
|
17
17
|
export declare const stateSlice: import("@reduxjs/toolkit").Slice<State, {
|
|
18
|
-
setState: (state: import("immer/dist/internal").WritableDraft<State>, action: {
|
|
18
|
+
setState: (state: import("immer/dist/internal.js").WritableDraft<State>, action: {
|
|
19
19
|
payload: {
|
|
20
20
|
state: string | null;
|
|
21
21
|
encrypted: boolean;
|
|
22
22
|
};
|
|
23
23
|
type: string;
|
|
24
|
-
}) => import("immer/dist/internal").WritableDraft<State>;
|
|
25
|
-
clearState: (state: import("immer/dist/internal").WritableDraft<State>, action: PayloadAction<{
|
|
24
|
+
}) => import("immer/dist/internal.js").WritableDraft<State>;
|
|
25
|
+
clearState: (state: import("immer/dist/internal.js").WritableDraft<State>, action: PayloadAction<{
|
|
26
26
|
encrypted: boolean;
|
|
27
|
-
}>) => import("immer/dist/internal").WritableDraft<State>;
|
|
27
|
+
}>) => import("immer/dist/internal.js").WritableDraft<State>;
|
|
28
28
|
}, "state">;
|
|
29
29
|
export declare const setState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
30
30
|
state: string | null;
|
|
@@ -53,3 +53,4 @@ export declare function getState(encrypted: boolean): ((state: {
|
|
|
53
53
|
}> & {
|
|
54
54
|
clearCache: () => void;
|
|
55
55
|
};
|
|
56
|
+
//# sourceMappingURL=state.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.cts","sourceRoot":"","sources":["../../../../src/internals/simulation/store/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAyB;AAKtD;;;;;;;GAOG;AACH,MAAM,MAAM,KAAK,GAAG;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAUF;;GAEG;AACH,eAAO,MAAM,UAAU;;;mBAMc,MAAM,GAAG,IAAI;uBAAa,OAAO;;;;uFAUtC,cAAc;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC;WAUnE,CAAC;AAEH,eAAO,MAAQ,QAAQ;WAtBc,MAAM,GAAG,IAAI;eAAa,OAAO;sBAsB7C,UAAU;eAZwB,OAAO;sBAYR,CAAC;AAE3D;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,OAAO;;;;;;;;;;;;;;EAW1C"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { PayloadAction } from "@reduxjs/toolkit";
|
|
2
|
+
/**
|
|
3
|
+
* The Snap state object.
|
|
4
|
+
*
|
|
5
|
+
* @property encrypted - The encrypted state. Can be null if the Snap does not
|
|
6
|
+
* have an encrypted state.
|
|
7
|
+
* @property unencrypted - The unencrypted state. Can be null if the Snap does
|
|
8
|
+
* not have an unencrypted state.
|
|
9
|
+
*/
|
|
10
|
+
export type State = {
|
|
11
|
+
encrypted: string | null;
|
|
12
|
+
unencrypted: string | null;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The state slice, which stores the state of the Snap.
|
|
16
|
+
*/
|
|
17
|
+
export declare const stateSlice: import("@reduxjs/toolkit").Slice<State, {
|
|
18
|
+
setState: (state: import("immer/dist/internal.js").WritableDraft<State>, action: {
|
|
19
|
+
payload: {
|
|
20
|
+
state: string | null;
|
|
21
|
+
encrypted: boolean;
|
|
22
|
+
};
|
|
23
|
+
type: string;
|
|
24
|
+
}) => import("immer/dist/internal.js").WritableDraft<State>;
|
|
25
|
+
clearState: (state: import("immer/dist/internal.js").WritableDraft<State>, action: PayloadAction<{
|
|
26
|
+
encrypted: boolean;
|
|
27
|
+
}>) => import("immer/dist/internal.js").WritableDraft<State>;
|
|
28
|
+
}, "state">;
|
|
29
|
+
export declare const setState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
30
|
+
state: string | null;
|
|
31
|
+
encrypted: boolean;
|
|
32
|
+
}, "state/setState">, clearState: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
|
|
33
|
+
encrypted: boolean;
|
|
34
|
+
}, "state/clearState">;
|
|
35
|
+
/**
|
|
36
|
+
* Get the state from the store.
|
|
37
|
+
*
|
|
38
|
+
* @param encrypted - Whether to get the encrypted or unencrypted state.
|
|
39
|
+
* @returns A selector that returns the state.
|
|
40
|
+
*/
|
|
41
|
+
export declare function getState(encrypted: boolean): ((state: {
|
|
42
|
+
mocks: import("./mocks").MocksState;
|
|
43
|
+
notifications: import("./notifications").NotificationsState;
|
|
44
|
+
state: State;
|
|
45
|
+
ui: import("./ui").UiState;
|
|
46
|
+
}) => string | null) & import("reselect").OutputSelectorFields<(args_0: {
|
|
47
|
+
mocks: import("./mocks").MocksState;
|
|
48
|
+
notifications: import("./notifications").NotificationsState;
|
|
49
|
+
state: State;
|
|
50
|
+
ui: import("./ui").UiState;
|
|
51
|
+
}) => string | null, {
|
|
52
|
+
clearCache: () => void;
|
|
53
|
+
}> & {
|
|
54
|
+
clearCache: () => void;
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=state.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.mts","sourceRoot":"","sources":["../../../../src/internals/simulation/store/state.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAyB;AAKtD;;;;;;;GAOG;AACH,MAAM,MAAM,KAAK,GAAG;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAUF;;GAEG;AACH,eAAO,MAAM,UAAU;;;mBAMc,MAAM,GAAG,IAAI;uBAAa,OAAO;;;;uFAUtC,cAAc;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC;WAUnE,CAAC;AAEH,eAAO,MAAQ,QAAQ;WAtBc,MAAM,GAAG,IAAI;eAAa,OAAO;sBAsB7C,UAAU;eAZwB,OAAO;sBAYR,CAAC;AAE3D;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,OAAO;;;;;;;;;;;;;;EAW1C"}
|