@metamask/snaps-execution-environments 6.6.2 → 6.7.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 +18 -1
- package/dist/common/BaseSnapExecutor.cjs +436 -0
- package/dist/common/BaseSnapExecutor.cjs.map +1 -0
- package/dist/{types/common/BaseSnapExecutor.d.ts → common/BaseSnapExecutor.d.cts} +8 -6
- package/dist/common/BaseSnapExecutor.d.cts.map +1 -0
- package/dist/common/BaseSnapExecutor.d.mts +70 -0
- package/dist/common/BaseSnapExecutor.d.mts.map +1 -0
- package/dist/common/BaseSnapExecutor.mjs +430 -24
- package/dist/common/BaseSnapExecutor.mjs.map +1 -1
- package/dist/common/commands.cjs +95 -0
- package/dist/common/commands.cjs.map +1 -0
- package/dist/{types/common/commands.d.ts → common/commands.d.cts} +5 -4
- package/dist/common/commands.d.cts.map +1 -0
- package/dist/common/commands.d.mts +31 -0
- package/dist/common/commands.d.mts.map +1 -0
- package/dist/common/commands.mjs +89 -10
- package/dist/common/commands.mjs.map +1 -1
- package/dist/common/endowments/commonEndowmentFactory.cjs +76 -0
- package/dist/common/endowments/commonEndowmentFactory.cjs.map +1 -0
- package/dist/{types/common/endowments/commonEndowmentFactory.d.ts → common/endowments/commonEndowmentFactory.d.cts} +5 -4
- package/dist/common/endowments/commonEndowmentFactory.d.cts.map +1 -0
- package/dist/common/endowments/commonEndowmentFactory.d.mts +26 -0
- package/dist/common/endowments/commonEndowmentFactory.d.mts.map +1 -0
- package/dist/common/endowments/commonEndowmentFactory.mjs +69 -18
- package/dist/common/endowments/commonEndowmentFactory.mjs.map +1 -1
- package/dist/common/endowments/console.cjs +103 -0
- package/dist/common/endowments/console.cjs.map +1 -0
- package/dist/{types/common/endowments/console.d.ts → common/endowments/console.d.cts} +2 -1
- package/dist/common/endowments/console.d.cts.map +1 -0
- package/dist/common/endowments/console.d.mts +46 -0
- package/dist/common/endowments/console.d.mts.map +1 -0
- package/dist/common/endowments/console.mjs +98 -11
- package/dist/common/endowments/console.mjs.map +1 -1
- package/dist/common/endowments/crypto.cjs +30 -0
- package/dist/common/endowments/crypto.cjs.map +1 -0
- package/dist/{types/common/endowments/crypto.d.ts → common/endowments/crypto.d.cts} +1 -0
- package/dist/common/endowments/crypto.d.cts.map +1 -0
- package/dist/common/endowments/crypto.d.mts +13 -0
- package/dist/common/endowments/crypto.d.mts.map +1 -0
- package/dist/common/endowments/crypto.mjs +26 -9
- package/dist/common/endowments/crypto.mjs.map +1 -1
- package/dist/common/endowments/date.cjs +39 -0
- package/dist/common/endowments/date.cjs.map +1 -0
- package/dist/{types/common/endowments/date.d.ts → common/endowments/date.d.cts} +1 -0
- package/dist/common/endowments/date.d.cts.map +1 -0
- package/dist/common/endowments/date.d.mts +16 -0
- package/dist/common/endowments/date.d.mts.map +1 -0
- package/dist/common/endowments/date.mjs +35 -7
- package/dist/common/endowments/date.mjs.map +1 -1
- package/dist/common/endowments/index.cjs +93 -0
- package/dist/common/endowments/index.cjs.map +1 -0
- package/dist/{types/common/endowments/index.d.ts → common/endowments/index.d.cts} +4 -3
- package/dist/common/endowments/index.d.cts.map +1 -0
- package/dist/common/endowments/index.d.mts +29 -0
- package/dist/common/endowments/index.d.mts.map +1 -0
- package/dist/common/endowments/index.mjs +85 -20
- package/dist/common/endowments/index.mjs.map +1 -1
- package/dist/common/endowments/interval.cjs +51 -0
- package/dist/common/endowments/interval.cjs.map +1 -0
- package/dist/{types/common/endowments/interval.d.ts → common/endowments/interval.d.cts} +1 -0
- package/dist/common/endowments/interval.d.cts.map +1 -0
- package/dist/common/endowments/interval.d.mts +10 -0
- package/dist/common/endowments/interval.d.mts.map +1 -0
- package/dist/common/endowments/interval.mjs +47 -6
- package/dist/common/endowments/interval.mjs.map +1 -1
- package/dist/common/endowments/math.cjs +54 -0
- package/dist/common/endowments/math.cjs.map +1 -0
- package/dist/{types/common/endowments/math.d.ts → common/endowments/math.d.cts} +1 -0
- package/dist/common/endowments/math.d.cts.map +1 -0
- package/dist/common/endowments/math.d.mts +61 -0
- package/dist/common/endowments/math.d.mts.map +1 -0
- package/dist/common/endowments/math.mjs +50 -8
- package/dist/common/endowments/math.mjs.map +1 -1
- package/dist/common/endowments/network.cjs +255 -0
- package/dist/common/endowments/network.cjs.map +1 -0
- package/dist/{types/common/endowments/network.d.ts → common/endowments/network.d.cts} +4 -2
- package/dist/common/endowments/network.d.cts.map +1 -0
- package/dist/common/endowments/network.d.mts +25 -0
- package/dist/common/endowments/network.d.mts.map +1 -0
- package/dist/common/endowments/network.mjs +251 -8
- package/dist/common/endowments/network.mjs.map +1 -1
- package/dist/common/endowments/textDecoder.cjs +18 -0
- package/dist/common/endowments/textDecoder.cjs.map +1 -0
- package/dist/{types/common/endowments/textDecoder.d.ts → common/endowments/textDecoder.d.cts} +1 -0
- package/dist/common/endowments/textDecoder.d.cts.map +1 -0
- package/dist/common/endowments/textDecoder.d.mts +11 -0
- package/dist/common/endowments/textDecoder.d.mts.map +1 -0
- package/dist/common/endowments/textDecoder.mjs +14 -6
- package/dist/common/endowments/textDecoder.mjs.map +1 -1
- package/dist/common/endowments/textEncoder.cjs +18 -0
- package/dist/common/endowments/textEncoder.cjs.map +1 -0
- package/dist/{types/common/endowments/textEncoder.d.ts → common/endowments/textEncoder.d.cts} +1 -0
- package/dist/common/endowments/textEncoder.d.cts.map +1 -0
- package/dist/common/endowments/textEncoder.d.mts +11 -0
- package/dist/common/endowments/textEncoder.d.mts.map +1 -0
- package/dist/common/endowments/textEncoder.mjs +14 -6
- package/dist/common/endowments/textEncoder.mjs.map +1 -1
- package/dist/common/endowments/timeout.cjs +53 -0
- package/dist/common/endowments/timeout.cjs.map +1 -0
- package/dist/{types/common/endowments/timeout.d.ts → common/endowments/timeout.d.cts} +1 -0
- package/dist/common/endowments/timeout.d.cts.map +1 -0
- package/dist/common/endowments/timeout.d.mts +10 -0
- package/dist/common/endowments/timeout.d.mts.map +1 -0
- package/dist/common/endowments/timeout.mjs +49 -6
- package/dist/common/endowments/timeout.mjs.map +1 -1
- package/dist/common/globalEvents.cjs +48 -0
- package/dist/common/globalEvents.cjs.map +1 -0
- package/dist/{types/common/globalEvents.d.ts → common/globalEvents.d.cts} +1 -0
- package/dist/common/globalEvents.d.cts.map +1 -0
- package/dist/common/globalEvents.d.mts +21 -0
- package/dist/common/globalEvents.d.mts.map +1 -0
- package/dist/common/globalEvents.mjs +42 -10
- package/dist/common/globalEvents.mjs.map +1 -1
- package/dist/common/globalObject.cjs +50 -0
- package/dist/common/globalObject.cjs.map +1 -0
- package/dist/{types/common/globalObject.d.ts → common/globalObject.d.cts} +1 -0
- package/dist/common/globalObject.d.cts.map +1 -0
- package/dist/common/globalObject.d.mts +10 -0
- package/dist/common/globalObject.d.mts.map +1 -0
- package/dist/common/globalObject.mjs +45 -9
- package/dist/common/globalObject.mjs.map +1 -1
- package/dist/common/lockdown/lockdown-events.cjs +60 -0
- package/dist/common/lockdown/lockdown-events.cjs.map +1 -0
- package/dist/{types/common/lockdown/lockdown-events.d.ts → common/lockdown/lockdown-events.d.cts} +1 -0
- package/dist/common/lockdown/lockdown-events.d.cts.map +1 -0
- package/dist/common/lockdown/lockdown-events.d.mts +5 -0
- package/dist/common/lockdown/lockdown-events.d.mts.map +1 -0
- package/dist/common/lockdown/lockdown-events.mjs +55 -7
- package/dist/common/lockdown/lockdown-events.mjs.map +1 -1
- package/dist/common/lockdown/lockdown-more.cjs +89 -0
- package/dist/common/lockdown/lockdown-more.cjs.map +1 -0
- package/dist/{types/common/lockdown/lockdown-more.d.ts → common/lockdown/lockdown-more.d.cts} +1 -0
- package/dist/common/lockdown/lockdown-more.d.cts.map +1 -0
- package/dist/common/lockdown/lockdown-more.d.mts +23 -0
- package/dist/common/lockdown/lockdown-more.d.mts.map +1 -0
- package/dist/common/lockdown/lockdown-more.mjs +84 -7
- package/dist/common/lockdown/lockdown-more.mjs.map +1 -1
- package/dist/common/lockdown/lockdown.cjs +29 -0
- package/dist/common/lockdown/lockdown.cjs.map +1 -0
- package/dist/{types/common/lockdown/lockdown.d.ts → common/lockdown/lockdown.d.cts} +1 -0
- package/dist/common/lockdown/lockdown.d.cts.map +1 -0
- package/dist/common/lockdown/lockdown.d.mts +8 -0
- package/dist/common/lockdown/lockdown.d.mts.map +1 -0
- package/dist/common/lockdown/lockdown.mjs +22 -19
- package/dist/common/lockdown/lockdown.mjs.map +1 -1
- package/dist/common/sortParams.cjs +35 -0
- package/dist/common/sortParams.cjs.map +1 -0
- package/dist/{types/common/sortParams.d.ts → common/sortParams.d.cts} +2 -1
- package/dist/common/sortParams.d.cts.map +1 -0
- package/dist/common/sortParams.d.mts +17 -0
- package/dist/common/sortParams.d.mts.map +1 -0
- package/dist/common/sortParams.mjs +29 -6
- package/dist/common/sortParams.mjs.map +1 -1
- package/dist/common/utils.cjs +156 -0
- package/dist/common/utils.cjs.map +1 -0
- package/dist/{types/common/utils.d.ts → common/utils.d.cts} +2 -1
- package/dist/common/utils.d.cts.map +1 -0
- package/dist/common/utils.d.mts +50 -0
- package/dist/common/utils.d.mts.map +1 -0
- package/dist/common/utils.mjs +146 -20
- package/dist/common/utils.mjs.map +1 -1
- package/dist/common/validation.cjs +137 -0
- package/dist/common/validation.cjs.map +1 -0
- package/dist/{types/common/validation.d.ts → common/validation.d.cts} +37 -36
- package/dist/common/validation.d.cts.map +1 -0
- package/dist/common/validation.d.mts +199 -0
- package/dist/common/validation.d.mts.map +1 -0
- package/dist/common/validation.mjs +127 -37
- package/dist/common/validation.mjs.map +1 -1
- package/dist/iframe/IFrameSnapExecutor.cjs +42 -0
- package/dist/iframe/IFrameSnapExecutor.cjs.map +1 -0
- package/dist/{types/iframe/IFrameSnapExecutor.d.ts → iframe/IFrameSnapExecutor.d.cts} +3 -2
- package/dist/iframe/IFrameSnapExecutor.d.cts.map +1 -0
- package/dist/iframe/IFrameSnapExecutor.d.mts +14 -0
- package/dist/iframe/IFrameSnapExecutor.d.mts.map +1 -0
- package/dist/iframe/IFrameSnapExecutor.mjs +42 -26
- package/dist/iframe/IFrameSnapExecutor.mjs.map +1 -1
- package/dist/iframe/index.cjs +10 -0
- package/dist/iframe/index.cjs.map +1 -0
- package/dist/iframe/index.d.cts +2 -0
- package/dist/iframe/index.d.cts.map +1 -0
- package/dist/iframe/index.d.mts +2 -0
- package/dist/iframe/index.d.mts.map +1 -0
- package/dist/iframe/index.mjs +4 -31
- package/dist/iframe/index.mjs.map +1 -1
- package/dist/index.cjs +18 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +1 -8
- package/dist/index.mjs.map +1 -1
- package/dist/logging.cjs +13 -0
- package/dist/logging.cjs.map +1 -0
- package/dist/{types/logging.d.ts → logging.d.cts} +1 -0
- package/dist/logging.d.cts.map +1 -0
- package/dist/logging.d.mts +9 -0
- package/dist/logging.d.mts.map +1 -0
- package/dist/logging.mjs +9 -7
- package/dist/logging.mjs.map +1 -1
- package/dist/node-process/ChildProcessSnapExecutor.cjs +30 -0
- package/dist/node-process/ChildProcessSnapExecutor.cjs.map +1 -0
- package/dist/{types/node-process/ChildProcessSnapExecutor.d.ts → node-process/ChildProcessSnapExecutor.d.cts} +2 -1
- package/dist/node-process/ChildProcessSnapExecutor.d.cts.map +1 -0
- package/dist/node-process/ChildProcessSnapExecutor.d.mts +5 -0
- package/dist/node-process/ChildProcessSnapExecutor.d.mts.map +1 -0
- package/dist/node-process/ChildProcessSnapExecutor.mjs +30 -26
- package/dist/node-process/ChildProcessSnapExecutor.mjs.map +1 -1
- package/dist/node-process/index.cjs +8 -0
- package/dist/node-process/index.cjs.map +1 -0
- package/dist/node-process/index.d.cts +2 -0
- package/dist/node-process/index.d.cts.map +1 -0
- package/dist/node-process/index.d.mts +2 -0
- package/dist/node-process/index.d.mts.map +1 -0
- package/dist/node-process/index.mjs +3 -28
- package/dist/node-process/index.mjs.map +1 -1
- package/dist/node-thread/ThreadSnapExecutor.cjs +30 -0
- package/dist/node-thread/ThreadSnapExecutor.cjs.map +1 -0
- package/dist/node-thread/ThreadSnapExecutor.d.cts +5 -0
- package/dist/node-thread/ThreadSnapExecutor.d.cts.map +1 -0
- package/dist/node-thread/ThreadSnapExecutor.d.mts +5 -0
- package/dist/node-thread/ThreadSnapExecutor.d.mts.map +1 -0
- package/dist/node-thread/ThreadSnapExecutor.mjs +30 -26
- package/dist/node-thread/ThreadSnapExecutor.mjs.map +1 -1
- package/dist/node-thread/index.cjs +8 -0
- package/dist/node-thread/index.cjs.map +1 -0
- package/dist/node-thread/index.d.cts +2 -0
- package/dist/node-thread/index.d.cts.map +1 -0
- package/dist/node-thread/index.d.mts +2 -0
- package/dist/node-thread/index.d.mts.map +1 -0
- package/dist/node-thread/index.mjs +3 -28
- package/dist/node-thread/index.mjs.map +1 -1
- package/dist/proxy/ProxySnapExecutor.cjs +112 -0
- package/dist/proxy/ProxySnapExecutor.cjs.map +1 -0
- package/dist/{types/proxy/ProxySnapExecutor.d.ts → proxy/ProxySnapExecutor.d.cts} +4 -3
- package/dist/proxy/ProxySnapExecutor.d.cts.map +1 -0
- package/dist/proxy/ProxySnapExecutor.d.mts +36 -0
- package/dist/proxy/ProxySnapExecutor.d.mts.map +1 -0
- package/dist/proxy/ProxySnapExecutor.mjs +104 -6
- package/dist/proxy/ProxySnapExecutor.mjs.map +1 -1
- package/dist/proxy/index.cjs +18 -0
- package/dist/proxy/index.cjs.map +1 -0
- package/dist/proxy/index.d.cts +2 -0
- package/dist/proxy/index.d.cts.map +1 -0
- package/dist/proxy/index.d.mts +2 -0
- package/dist/proxy/index.d.mts.map +1 -0
- package/dist/proxy/index.mjs +1 -8
- package/dist/proxy/index.mjs.map +1 -1
- package/dist/webview/WebViewExecutorStream.cjs +79 -0
- package/dist/webview/WebViewExecutorStream.cjs.map +1 -0
- package/dist/{types/webview/WebViewExecutorStream.d.ts → webview/WebViewExecutorStream.d.cts} +3 -2
- package/dist/webview/WebViewExecutorStream.d.cts.map +1 -0
- package/dist/webview/WebViewExecutorStream.d.mts +33 -0
- package/dist/webview/WebViewExecutorStream.d.mts.map +1 -0
- package/dist/webview/WebViewExecutorStream.mjs +74 -6
- package/dist/webview/WebViewExecutorStream.mjs.map +1 -1
- package/dist/webview/index.cjs +16 -0
- package/dist/webview/index.cjs.map +1 -0
- package/dist/webview/index.d.cts +2 -0
- package/dist/webview/index.d.cts.map +1 -0
- package/dist/webview/index.d.mts +2 -0
- package/dist/webview/index.d.mts.map +1 -0
- package/dist/webview/index.mjs +9 -21
- package/dist/webview/index.mjs.map +1 -1
- package/dist/webworker/executor/WebWorkerSnapExecutor.cjs +37 -0
- package/dist/webworker/executor/WebWorkerSnapExecutor.cjs.map +1 -0
- package/dist/{types/webworker/executor/WebWorkerSnapExecutor.d.ts → webworker/executor/WebWorkerSnapExecutor.d.cts} +3 -2
- package/dist/webworker/executor/WebWorkerSnapExecutor.d.cts.map +1 -0
- package/dist/webworker/executor/WebWorkerSnapExecutor.d.mts +14 -0
- package/dist/webworker/executor/WebWorkerSnapExecutor.d.mts.map +1 -0
- package/dist/webworker/executor/WebWorkerSnapExecutor.mjs +37 -26
- package/dist/webworker/executor/WebWorkerSnapExecutor.mjs.map +1 -1
- package/dist/webworker/executor/index.cjs +10 -0
- package/dist/webworker/executor/index.cjs.map +1 -0
- package/dist/webworker/executor/index.d.cts +2 -0
- package/dist/webworker/executor/index.d.cts.map +1 -0
- package/dist/webworker/executor/index.d.mts +2 -0
- package/dist/webworker/executor/index.d.mts.map +1 -0
- package/dist/webworker/executor/index.mjs +4 -31
- package/dist/webworker/executor/index.mjs.map +1 -1
- package/dist/webworker/pool/WebWorkerPool.cjs +168 -0
- package/dist/webworker/pool/WebWorkerPool.cjs.map +1 -0
- package/dist/{types/webworker/pool/WebWorkerPool.d.ts → webworker/pool/WebWorkerPool.d.cts} +4 -3
- package/dist/webworker/pool/WebWorkerPool.d.cts.map +1 -0
- package/dist/webworker/pool/WebWorkerPool.d.mts +24 -0
- package/dist/webworker/pool/WebWorkerPool.d.mts.map +1 -0
- package/dist/webworker/pool/WebWorkerPool.mjs +163 -6
- package/dist/webworker/pool/WebWorkerPool.mjs.map +1 -1
- package/dist/webworker/pool/index.cjs +10 -0
- package/dist/webworker/pool/index.cjs.map +1 -0
- package/dist/webworker/pool/index.d.cts +2 -0
- package/dist/webworker/pool/index.d.cts.map +1 -0
- package/dist/webworker/pool/index.d.mts +2 -0
- package/dist/webworker/pool/index.d.mts.map +1 -0
- package/dist/webworker/pool/index.mjs +4 -12
- package/dist/webworker/pool/index.mjs.map +1 -1
- package/package.json +21 -18
- package/dist/browserify/iframe/bundle.js +0 -9
- package/dist/browserify/iframe/index.html +0 -13394
- package/dist/browserify/node-process/bundle.js +0 -13390
- package/dist/browserify/node-thread/bundle.js +0 -13390
- package/dist/browserify/webview/index.html +0 -13402
- package/dist/browserify/worker-executor/bundle.js +0 -13392
- package/dist/browserify/worker-pool/bundle.js +0 -9
- package/dist/browserify/worker-pool/index.html +0 -13394
- package/dist/chunk-2VA6RAEE.js +0 -30
- package/dist/chunk-2VA6RAEE.js.map +0 -1
- package/dist/chunk-3JCT4MWT.js +0 -108
- package/dist/chunk-3JCT4MWT.js.map +0 -1
- package/dist/chunk-46LW37FK.js +0 -144
- package/dist/chunk-46LW37FK.js.map +0 -1
- package/dist/chunk-4COIRXF5.js +0 -86
- package/dist/chunk-4COIRXF5.js.map +0 -1
- package/dist/chunk-4XRZLEKU.js +0 -49
- package/dist/chunk-4XRZLEKU.js.map +0 -1
- package/dist/chunk-53ZULHPK.mjs +0 -16
- package/dist/chunk-53ZULHPK.mjs.map +0 -1
- package/dist/chunk-5DEV3QQU.mjs +0 -12
- package/dist/chunk-5DEV3QQU.mjs.map +0 -1
- package/dist/chunk-5LGIS4VY.js +0 -33
- package/dist/chunk-5LGIS4VY.js.map +0 -1
- package/dist/chunk-5STN3QCA.js +0 -183
- package/dist/chunk-5STN3QCA.js.map +0 -1
- package/dist/chunk-75RCH4ZX.mjs +0 -151
- package/dist/chunk-75RCH4ZX.mjs.map +0 -1
- package/dist/chunk-7AJWXSDQ.mjs +0 -73
- package/dist/chunk-7AJWXSDQ.mjs.map +0 -1
- package/dist/chunk-7MMUJJQ2.js +0 -151
- package/dist/chunk-7MMUJJQ2.js.map +0 -1
- package/dist/chunk-BCBKEUCG.mjs +0 -38
- package/dist/chunk-BCBKEUCG.mjs.map +0 -1
- package/dist/chunk-BTEAZZKP.mjs +0 -24
- package/dist/chunk-BTEAZZKP.mjs.map +0 -1
- package/dist/chunk-BVRVUIJB.mjs +0 -67
- package/dist/chunk-BVRVUIJB.mjs.map +0 -1
- package/dist/chunk-CV5LC4PP.js +0 -24
- package/dist/chunk-CV5LC4PP.js.map +0 -1
- package/dist/chunk-DAG7NWEU.mjs +0 -33
- package/dist/chunk-DAG7NWEU.mjs.map +0 -1
- package/dist/chunk-DKDTGAFK.js +0 -67
- package/dist/chunk-DKDTGAFK.js.map +0 -1
- package/dist/chunk-DLLLH5HN.js +0 -26
- package/dist/chunk-DLLLH5HN.js.map +0 -1
- package/dist/chunk-EXN2TFDJ.js +0 -38
- package/dist/chunk-EXN2TFDJ.js.map +0 -1
- package/dist/chunk-FJT65CXB.js +0 -472
- package/dist/chunk-FJT65CXB.js.map +0 -1
- package/dist/chunk-FOEAIF5U.js +0 -16
- package/dist/chunk-FOEAIF5U.js.map +0 -1
- package/dist/chunk-FUPEJT7B.js +0 -82
- package/dist/chunk-FUPEJT7B.js.map +0 -1
- package/dist/chunk-HCJZG6W7.mjs +0 -45
- package/dist/chunk-HCJZG6W7.mjs.map +0 -1
- package/dist/chunk-HGLRZZ56.js +0 -32
- package/dist/chunk-HGLRZZ56.js.map +0 -1
- package/dist/chunk-HL2TTKF3.mjs +0 -144
- package/dist/chunk-HL2TTKF3.mjs.map +0 -1
- package/dist/chunk-HWS4QSOC.mjs +0 -16
- package/dist/chunk-HWS4QSOC.mjs.map +0 -1
- package/dist/chunk-HXKBUIYS.js +0 -262
- package/dist/chunk-HXKBUIYS.js.map +0 -1
- package/dist/chunk-I5G4YFHM.js +0 -73
- package/dist/chunk-I5G4YFHM.js.map +0 -1
- package/dist/chunk-IX5S3V47.mjs +0 -26
- package/dist/chunk-IX5S3V47.mjs.map +0 -1
- package/dist/chunk-JOT5JH42.js +0 -52
- package/dist/chunk-JOT5JH42.js.map +0 -1
- package/dist/chunk-KEAB7ZVV.js +0 -50
- package/dist/chunk-KEAB7ZVV.js.map +0 -1
- package/dist/chunk-LAKWJYBO.js +0 -33
- package/dist/chunk-LAKWJYBO.js.map +0 -1
- package/dist/chunk-LO5ORVRC.js +0 -16
- package/dist/chunk-LO5ORVRC.js.map +0 -1
- package/dist/chunk-MCXWFCGV.js +0 -1
- package/dist/chunk-MCXWFCGV.js.map +0 -1
- package/dist/chunk-MIWGLICQ.mjs +0 -108
- package/dist/chunk-MIWGLICQ.mjs.map +0 -1
- package/dist/chunk-MMYM63NH.mjs +0 -82
- package/dist/chunk-MMYM63NH.mjs.map +0 -1
- package/dist/chunk-MS2LQQYH.js +0 -38
- package/dist/chunk-MS2LQQYH.js.map +0 -1
- package/dist/chunk-MXNMMTJW.mjs +0 -51
- package/dist/chunk-MXNMMTJW.mjs.map +0 -1
- package/dist/chunk-OBT45IWW.js +0 -92
- package/dist/chunk-OBT45IWW.js.map +0 -1
- package/dist/chunk-OCNPLHS2.js +0 -51
- package/dist/chunk-OCNPLHS2.js.map +0 -1
- package/dist/chunk-ODICKSGZ.mjs +0 -86
- package/dist/chunk-ODICKSGZ.mjs.map +0 -1
- package/dist/chunk-OIN7VU4G.mjs +0 -33
- package/dist/chunk-OIN7VU4G.mjs.map +0 -1
- package/dist/chunk-Q42NNJFY.mjs +0 -32
- package/dist/chunk-Q42NNJFY.mjs.map +0 -1
- package/dist/chunk-Q42WB3ZO.js +0 -40
- package/dist/chunk-Q42WB3ZO.js.map +0 -1
- package/dist/chunk-QZC2X6NG.js +0 -44
- package/dist/chunk-QZC2X6NG.js.map +0 -1
- package/dist/chunk-S5NWI5Z7.mjs +0 -50
- package/dist/chunk-S5NWI5Z7.mjs.map +0 -1
- package/dist/chunk-S7257EN3.mjs +0 -49
- package/dist/chunk-S7257EN3.mjs.map +0 -1
- package/dist/chunk-TSEAPB7L.mjs +0 -1
- package/dist/chunk-TSEAPB7L.mjs.map +0 -1
- package/dist/chunk-TZAPZE45.mjs +0 -472
- package/dist/chunk-TZAPZE45.mjs.map +0 -1
- package/dist/chunk-UOPIRTJX.mjs +0 -44
- package/dist/chunk-UOPIRTJX.mjs.map +0 -1
- package/dist/chunk-V76DI2XM.mjs +0 -183
- package/dist/chunk-V76DI2XM.mjs.map +0 -1
- package/dist/chunk-VFQ5CRZS.mjs +0 -40
- package/dist/chunk-VFQ5CRZS.mjs.map +0 -1
- package/dist/chunk-W7EDURT5.mjs +0 -92
- package/dist/chunk-W7EDURT5.mjs.map +0 -1
- package/dist/chunk-WZDVTU5C.js +0 -45
- package/dist/chunk-WZDVTU5C.js.map +0 -1
- package/dist/chunk-XPCW7TKM.mjs +0 -262
- package/dist/chunk-XPCW7TKM.mjs.map +0 -1
- package/dist/chunk-Y7AK2VVC.mjs +0 -52
- package/dist/chunk-Y7AK2VVC.mjs.map +0 -1
- package/dist/chunk-YRZVIDCF.mjs +0 -38
- package/dist/chunk-YRZVIDCF.mjs.map +0 -1
- package/dist/chunk-Z7BOREC4.js +0 -12
- package/dist/chunk-Z7BOREC4.js.map +0 -1
- package/dist/chunk-ZNTCZK7J.mjs +0 -30
- package/dist/chunk-ZNTCZK7J.mjs.map +0 -1
- package/dist/common/BaseSnapExecutor.js +0 -26
- package/dist/common/BaseSnapExecutor.js.map +0 -1
- package/dist/common/commands.js +0 -11
- package/dist/common/commands.js.map +0 -1
- package/dist/common/endowments/commonEndowmentFactory.js +0 -20
- package/dist/common/endowments/commonEndowmentFactory.js.map +0 -1
- package/dist/common/endowments/console.js +0 -13
- package/dist/common/endowments/console.js.map +0 -1
- package/dist/common/endowments/crypto.js +0 -11
- package/dist/common/endowments/crypto.js.map +0 -1
- package/dist/common/endowments/date.js +0 -9
- package/dist/common/endowments/date.js.map +0 -1
- package/dist/common/endowments/index.js +0 -21
- package/dist/common/endowments/index.js.map +0 -1
- package/dist/common/endowments/interval.js +0 -8
- package/dist/common/endowments/interval.js.map +0 -1
- package/dist/common/endowments/math.js +0 -10
- package/dist/common/endowments/math.js.map +0 -1
- package/dist/common/endowments/network.js +0 -10
- package/dist/common/endowments/network.js.map +0 -1
- package/dist/common/endowments/textDecoder.js +0 -8
- package/dist/common/endowments/textDecoder.js.map +0 -1
- package/dist/common/endowments/textEncoder.js +0 -8
- package/dist/common/endowments/textEncoder.js.map +0 -1
- package/dist/common/endowments/timeout.js +0 -8
- package/dist/common/endowments/timeout.js.map +0 -1
- package/dist/common/globalEvents.js +0 -11
- package/dist/common/globalEvents.js.map +0 -1
- package/dist/common/globalObject.js +0 -10
- package/dist/common/globalObject.js.map +0 -1
- package/dist/common/lockdown/lockdown-events.js +0 -8
- package/dist/common/lockdown/lockdown-events.js.map +0 -1
- package/dist/common/lockdown/lockdown-more.js +0 -8
- package/dist/common/lockdown/lockdown-more.js.map +0 -1
- package/dist/common/lockdown/lockdown.js +0 -22
- package/dist/common/lockdown/lockdown.js.map +0 -1
- package/dist/common/sortParams.js +0 -8
- package/dist/common/sortParams.js.map +0 -1
- package/dist/common/utils.js +0 -21
- package/dist/common/utils.js.map +0 -1
- package/dist/common/validation.js +0 -38
- package/dist/common/validation.js.map +0 -1
- package/dist/globals.d.js +0 -1
- package/dist/globals.d.js.map +0 -1
- package/dist/globals.d.mjs +0 -1
- package/dist/globals.d.mjs.map +0 -1
- package/dist/iframe/IFrameSnapExecutor.js +0 -27
- package/dist/iframe/IFrameSnapExecutor.js.map +0 -1
- package/dist/iframe/index.js +0 -35
- package/dist/iframe/index.js.map +0 -1
- package/dist/index.js +0 -9
- package/dist/index.js.map +0 -1
- package/dist/logging.js +0 -8
- package/dist/logging.js.map +0 -1
- package/dist/node-process/ChildProcessSnapExecutor.js +0 -27
- package/dist/node-process/ChildProcessSnapExecutor.js.map +0 -1
- package/dist/node-process/index.js +0 -31
- package/dist/node-process/index.js.map +0 -1
- package/dist/node-thread/ThreadSnapExecutor.js +0 -27
- package/dist/node-thread/ThreadSnapExecutor.js.map +0 -1
- package/dist/node-thread/index.js +0 -31
- package/dist/node-thread/index.js.map +0 -1
- package/dist/proxy/ProxySnapExecutor.js +0 -8
- package/dist/proxy/ProxySnapExecutor.js.map +0 -1
- package/dist/proxy/index.js +0 -9
- package/dist/proxy/index.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/dist/types/iframe/index.d.ts +0 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/node-process/index.d.ts +0 -1
- package/dist/types/node-thread/ThreadSnapExecutor.d.ts +0 -4
- package/dist/types/node-thread/index.d.ts +0 -1
- package/dist/types/proxy/index.d.ts +0 -1
- package/dist/types/vendor/global.d.js +0 -1
- package/dist/types/vendor/global.d.js.map +0 -1
- package/dist/types/vendor/global.d.mjs +0 -1
- package/dist/types/vendor/global.d.mjs.map +0 -1
- package/dist/types/vendor/providers.d.js +0 -1
- package/dist/types/vendor/providers.d.js.map +0 -1
- package/dist/types/vendor/providers.d.mjs +0 -1
- package/dist/types/vendor/providers.d.mjs.map +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/webview/index.d.ts +0 -1
- package/dist/types/webworker/executor/index.d.ts +0 -1
- package/dist/types/webworker/pool/index.d.ts +0 -1
- package/dist/webview/WebViewExecutorStream.js +0 -8
- package/dist/webview/WebViewExecutorStream.js.map +0 -1
- package/dist/webview/index.js +0 -26
- package/dist/webview/index.js.map +0 -1
- package/dist/webworker/executor/WebWorkerSnapExecutor.js +0 -27
- package/dist/webworker/executor/WebWorkerSnapExecutor.js.map +0 -1
- package/dist/webworker/executor/index.js +0 -35
- package/dist/webworker/executor/index.js.map +0 -1
- package/dist/webworker/pool/WebWorkerPool.js +0 -8
- package/dist/webworker/pool/WebWorkerPool.js.map +0 -1
- package/dist/webworker/pool/index.js +0 -16
- package/dist/webworker/pool/index.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/common/endowments/math.ts"],"sourcesContent":["import { rootRealmGlobal } from '../globalObject';\nimport { createCrypto } from './crypto';\n\n/**\n * Create a {@link Math} object, with the same properties as the global\n * {@link Math} object, but with the {@link Math.random} method replaced.\n *\n * @returns The {@link Math} object with the {@link Math.random} method\n * replaced.\n */\nfunction createMath() {\n // `Math` does not work with `Object.keys`, `Object.entries`, etc., so we\n // need to create a new object with the same properties.\n const keys = Object.getOwnPropertyNames(\n rootRealmGlobal.Math,\n ) as (keyof typeof Math)[];\n\n const math = keys.reduce<Partial<Math>>((target, key) => {\n if (key === 'random') {\n return target;\n }\n\n return { ...target, [key]: rootRealmGlobal.Math[key] };\n }, {});\n\n // Since the math endowment requires crypto, we can leverage the crypto endowment factory to get a hardened and platform agnostic instance of webcrypto\n const { crypto: hardenedCrypto } = createCrypto();\n\n return harden({\n Math: {\n ...math,\n random: () => {\n // NOTE: This is not intended to be a secure replacement for the weak\n // random number generator used by `Math.random`. It is only intended to\n // prevent side channel attacks of `Math.random` by replacing it with an\n // alternative implementation that is not vulnerable to the same\n // attacks.\n //\n // This does not mean that this implementation is secure. It is not\n // intended to be used in a security context, and this implementation\n // may change at any time.\n //\n // To securely generate random numbers, use a cryptographically secure\n // random number generator, such as the one provided by the Web Crypto\n // API:\n //\n // - https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/generateKey\n // - https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues\n return hardenedCrypto.getRandomValues(new Uint32Array(1))[0] / 2 ** 32;\n },\n },\n });\n}\n\nconst endowmentModule = {\n names: ['Math'] as const,\n factory: createMath,\n};\n\nexport default endowmentModule;\n"],"mappings":";;;;;;;;AAUA,SAAS,aAAa;AAGpB,QAAM,OAAO,OAAO;AAAA,IAClB,gBAAgB;AAAA,EAClB;AAEA,QAAM,OAAO,KAAK,OAAsB,CAAC,QAAQ,QAAQ;AACvD,QAAI,QAAQ,UAAU;AACpB,aAAO;AAAA,IACT;AAEA,WAAO,EAAE,GAAG,QAAQ,CAAC,GAAG,GAAG,gBAAgB,KAAK,GAAG,EAAE;AAAA,EACvD,GAAG,CAAC,CAAC;AAGL,QAAM,EAAE,QAAQ,eAAe,IAAI,aAAa;AAEhD,SAAO,OAAO;AAAA,IACZ,MAAM;AAAA,MACJ,GAAG;AAAA,MACH,QAAQ,MAAM;AAiBZ,eAAO,eAAe,gBAAgB,IAAI,YAAY,CAAC,CAAC,EAAE,CAAC,IAAI,KAAK;AAAA,MACtE;AAAA,IACF;AAAA,EACF,CAAC;AACH;AAEA,IAAM,kBAAkB;AAAA,EACtB,OAAO,CAAC,MAAM;AAAA,EACd,SAAS;AACX;AAEA,IAAO,eAAQ;","names":[]}
|
package/dist/chunk-BTEAZZKP.mjs
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// src/common/sortParams.ts
|
|
2
|
-
var sortParamKeys = (methodParams, params) => {
|
|
3
|
-
if (!params) {
|
|
4
|
-
return [];
|
|
5
|
-
}
|
|
6
|
-
if (params instanceof Array) {
|
|
7
|
-
return params;
|
|
8
|
-
}
|
|
9
|
-
const methodParamsOrder = methodParams.reduce(
|
|
10
|
-
(paramsOrderObj, paramsName, i) => ({
|
|
11
|
-
...paramsOrderObj,
|
|
12
|
-
[paramsName]: i
|
|
13
|
-
}),
|
|
14
|
-
{}
|
|
15
|
-
);
|
|
16
|
-
return Object.entries(params).sort(
|
|
17
|
-
([name1, _1], [name2, _2]) => methodParamsOrder[name1] - methodParamsOrder[name2]
|
|
18
|
-
).map(([_, val]) => val);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export {
|
|
22
|
-
sortParamKeys
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=chunk-BTEAZZKP.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/common/sortParams.ts"],"sourcesContent":["// original source sortParamKeys from: https://github.com/etclabscore/sig.tools/blob/master/src/postMessageServer/postMessageServer.ts#L75-L77\n\nimport type { JsonRpcParams } from '@metamask/utils';\n\n/**\n * Deterministically sort JSON-RPC parameter keys. This makes it possible to\n * support both arrays and objects as parameters. Objects are sorted and turned\n * into arrays, for easier consumption by the snap.\n *\n * The order is defined by the `method` parameter.\n *\n * @param methodParams - The parameters of the JSON-RPC method, which\n * determines the ordering for the parameters.\n * @param params - JSON-RPC parameters as object or array.\n * @returns The values for the sorted keys. If `params` is not provided, this\n * returns an empty array. If `params` is an array, this returns the same\n * `params`.\n */\nexport const sortParamKeys = (\n methodParams: string[],\n params?: JsonRpcParams,\n) => {\n if (!params) {\n return [];\n }\n\n if (params instanceof Array) {\n return params;\n }\n\n const methodParamsOrder: { [k: string]: number } = methodParams.reduce(\n (paramsOrderObj, paramsName, i) => ({\n ...paramsOrderObj,\n [paramsName]: i,\n }),\n {},\n );\n\n return Object.entries(params)\n .sort(\n ([name1, _1], [name2, _2]) =>\n methodParamsOrder[name1] - methodParamsOrder[name2],\n )\n .map(([_, val]) => val);\n};\n"],"mappings":";AAkBO,IAAM,gBAAgB,CAC3B,cACA,WACG;AACH,MAAI,CAAC,QAAQ;AACX,WAAO,CAAC;AAAA,EACV;AAEA,MAAI,kBAAkB,OAAO;AAC3B,WAAO;AAAA,EACT;AAEA,QAAM,oBAA6C,aAAa;AAAA,IAC9D,CAAC,gBAAgB,YAAY,OAAO;AAAA,MAClC,GAAG;AAAA,MACH,CAAC,UAAU,GAAG;AAAA,IAChB;AAAA,IACA,CAAC;AAAA,EACH;AAEA,SAAO,OAAO,QAAQ,MAAM,EACzB;AAAA,IACC,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,MACtB,kBAAkB,KAAK,IAAI,kBAAkB,KAAK;AAAA,EACtD,EACC,IAAI,CAAC,CAAC,GAAG,GAAG,MAAM,GAAG;AAC1B;","names":[]}
|
package/dist/chunk-BVRVUIJB.mjs
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
commonEndowmentFactory_default
|
|
3
|
-
} from "./chunk-ODICKSGZ.mjs";
|
|
4
|
-
import {
|
|
5
|
-
rootRealmGlobal
|
|
6
|
-
} from "./chunk-IX5S3V47.mjs";
|
|
7
|
-
|
|
8
|
-
// src/common/endowments/index.ts
|
|
9
|
-
import { rpcErrors } from "@metamask/rpc-errors";
|
|
10
|
-
import { logWarning } from "@metamask/snaps-utils";
|
|
11
|
-
import { hasProperty } from "@metamask/utils";
|
|
12
|
-
var registeredEndowments = commonEndowmentFactory_default();
|
|
13
|
-
var endowmentFactories = registeredEndowments.reduce((factories, builder) => {
|
|
14
|
-
builder.names.forEach((name) => {
|
|
15
|
-
factories.set(name, builder.factory);
|
|
16
|
-
});
|
|
17
|
-
return factories;
|
|
18
|
-
}, /* @__PURE__ */ new Map());
|
|
19
|
-
function createEndowments({
|
|
20
|
-
snap,
|
|
21
|
-
ethereum,
|
|
22
|
-
snapId,
|
|
23
|
-
endowments,
|
|
24
|
-
notify
|
|
25
|
-
}) {
|
|
26
|
-
const attenuatedEndowments = {};
|
|
27
|
-
const result = endowments.reduce(
|
|
28
|
-
({ allEndowments, teardowns }, endowmentName) => {
|
|
29
|
-
if (endowmentFactories.has(endowmentName)) {
|
|
30
|
-
if (!hasProperty(attenuatedEndowments, endowmentName)) {
|
|
31
|
-
const { teardownFunction, ...endowment } = endowmentFactories.get(
|
|
32
|
-
endowmentName
|
|
33
|
-
)({ snapId, notify });
|
|
34
|
-
Object.assign(attenuatedEndowments, endowment);
|
|
35
|
-
if (teardownFunction) {
|
|
36
|
-
teardowns.push(teardownFunction);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
allEndowments[endowmentName] = attenuatedEndowments[endowmentName];
|
|
40
|
-
} else if (endowmentName === "ethereum") {
|
|
41
|
-
allEndowments[endowmentName] = ethereum;
|
|
42
|
-
} else if (endowmentName in rootRealmGlobal) {
|
|
43
|
-
logWarning(`Access to unhardened global ${endowmentName}.`);
|
|
44
|
-
const globalValue = rootRealmGlobal[endowmentName];
|
|
45
|
-
allEndowments[endowmentName] = globalValue;
|
|
46
|
-
} else {
|
|
47
|
-
throw rpcErrors.internal(`Unknown endowment: "${endowmentName}".`);
|
|
48
|
-
}
|
|
49
|
-
return { allEndowments, teardowns };
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
allEndowments: { snap },
|
|
53
|
-
teardowns: []
|
|
54
|
-
}
|
|
55
|
-
);
|
|
56
|
-
const teardown = async () => {
|
|
57
|
-
await Promise.all(
|
|
58
|
-
result.teardowns.map((teardownFunction) => teardownFunction())
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
return { endowments: result.allEndowments, teardown };
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export {
|
|
65
|
-
createEndowments
|
|
66
|
-
};
|
|
67
|
-
//# sourceMappingURL=chunk-BVRVUIJB.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/common/endowments/index.ts"],"sourcesContent":["import type { StreamProvider } from '@metamask/providers';\nimport { rpcErrors } from '@metamask/rpc-errors';\nimport type { SnapsProvider } from '@metamask/snaps-sdk';\nimport { logWarning } from '@metamask/snaps-utils';\nimport { hasProperty } from '@metamask/utils';\n\nimport type { NotifyFunction } from '../BaseSnapExecutor';\nimport { rootRealmGlobal } from '../globalObject';\nimport type { EndowmentFactoryOptions } from './commonEndowmentFactory';\nimport buildCommonEndowments from './commonEndowmentFactory';\n\ntype EndowmentFactoryResult = {\n /**\n * A function that performs any necessary teardown when the snap becomes idle.\n *\n * NOTE:** The endowments are not reconstructed if the snap is re-invoked\n * before being terminated, so the teardown operation must not render the\n * endowments unusable; it should simply restore the endowments to their\n * original state.\n */\n teardownFunction?: () => Promise<void> | void;\n [key: string]: unknown;\n};\n\n/**\n * Retrieve consolidated endowment factories for common endowments.\n */\nconst registeredEndowments = buildCommonEndowments();\n\n/**\n * A map of endowment names to their factory functions. Some endowments share\n * the same factory function, but we only call each factory once for each snap.\n * See {@link createEndowments} for details.\n */\nconst endowmentFactories = registeredEndowments.reduce((factories, builder) => {\n builder.names.forEach((name) => {\n factories.set(name, builder.factory);\n });\n return factories;\n}, new Map<string, (options?: EndowmentFactoryOptions) => EndowmentFactoryResult>());\n\n/**\n * Gets the endowments for a particular Snap. Some endowments, like `setTimeout`\n * and `clearTimeout`, must be attenuated so that they can only affect behavior\n * within the Snap's own realm. Therefore, we use factory functions to create\n * such attenuated / modified endowments. Otherwise, the value that's on the\n * root realm global will be used.\n *\n * @param options - An options bag.\n * @param options.snap - The Snaps global API object.\n * @param options.ethereum - The Snap's EIP-1193 provider object.\n * @param options.snapId - The id of the snap that will use the created endowments.\n * @param options.endowments - The list of endowments to provide to the snap.\n * @param options.notify - A reference to the notify function of the snap executor.\n * @returns An object containing the Snap's endowments.\n */\nexport function createEndowments({\n snap,\n ethereum,\n snapId,\n endowments,\n notify,\n}: {\n snap: SnapsProvider;\n ethereum: StreamProvider;\n snapId: string;\n endowments: string[];\n notify: NotifyFunction;\n}): { endowments: Record<string, unknown>; teardown: () => Promise<void> } {\n const attenuatedEndowments: Record<string, unknown> = {};\n\n // TODO: All endowments should be hardened to prevent covert communication\n // channels. Hardening the returned objects breaks tests elsewhere in the\n // monorepo, so further research is needed.\n const result = endowments.reduce<{\n allEndowments: Record<string, unknown>;\n teardowns: (() => Promise<void> | void)[];\n }>(\n ({ allEndowments, teardowns }, endowmentName) => {\n // First, check if the endowment has a factory, and default to that.\n if (endowmentFactories.has(endowmentName)) {\n if (!hasProperty(attenuatedEndowments, endowmentName)) {\n // Call the endowment factory for the current endowment. If the factory\n // creates multiple endowments, they will all be assigned to the\n // `attenuatedEndowments` object, but will only be passed on to the snap\n // if explicitly listed among its endowment.\n // This may not have an actual use case, but, safety first.\n\n // We just confirmed that endowmentFactories has the specified key.\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const { teardownFunction, ...endowment } = endowmentFactories.get(\n endowmentName,\n )!({ snapId, notify });\n Object.assign(attenuatedEndowments, endowment);\n if (teardownFunction) {\n teardowns.push(teardownFunction);\n }\n }\n allEndowments[endowmentName] = attenuatedEndowments[endowmentName];\n } else if (endowmentName === 'ethereum') {\n // Special case for adding the EIP-1193 provider.\n allEndowments[endowmentName] = ethereum;\n } else if (endowmentName in rootRealmGlobal) {\n logWarning(`Access to unhardened global ${endowmentName}.`);\n // If the endowment doesn't have a factory, just use whatever is on the\n // global object.\n const globalValue = (rootRealmGlobal as Record<string, unknown>)[\n endowmentName\n ];\n allEndowments[endowmentName] = globalValue;\n } else {\n // If we get to this point, we've been passed an endowment that doesn't\n // exist in our current environment.\n throw rpcErrors.internal(`Unknown endowment: \"${endowmentName}\".`);\n }\n return { allEndowments, teardowns };\n },\n {\n allEndowments: { snap },\n teardowns: [],\n },\n );\n\n const teardown = async () => {\n await Promise.all(\n result.teardowns.map((teardownFunction) => teardownFunction()),\n );\n };\n return { endowments: result.allEndowments, teardown };\n}\n"],"mappings":";;;;;;;;AACA,SAAS,iBAAiB;AAE1B,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAuB5B,IAAM,uBAAuB,+BAAsB;AAOnD,IAAM,qBAAqB,qBAAqB,OAAO,CAAC,WAAW,YAAY;AAC7E,UAAQ,MAAM,QAAQ,CAAC,SAAS;AAC9B,cAAU,IAAI,MAAM,QAAQ,OAAO;AAAA,EACrC,CAAC;AACD,SAAO;AACT,GAAG,oBAAI,IAA2E,CAAC;AAiB5E,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAM2E;AACzE,QAAM,uBAAgD,CAAC;AAKvD,QAAM,SAAS,WAAW;AAAA,IAIxB,CAAC,EAAE,eAAe,UAAU,GAAG,kBAAkB;AAE/C,UAAI,mBAAmB,IAAI,aAAa,GAAG;AACzC,YAAI,CAAC,YAAY,sBAAsB,aAAa,GAAG;AASrD,gBAAM,EAAE,kBAAkB,GAAG,UAAU,IAAI,mBAAmB;AAAA,YAC5D;AAAA,UACF,EAAG,EAAE,QAAQ,OAAO,CAAC;AACrB,iBAAO,OAAO,sBAAsB,SAAS;AAC7C,cAAI,kBAAkB;AACpB,sBAAU,KAAK,gBAAgB;AAAA,UACjC;AAAA,QACF;AACA,sBAAc,aAAa,IAAI,qBAAqB,aAAa;AAAA,MACnE,WAAW,kBAAkB,YAAY;AAEvC,sBAAc,aAAa,IAAI;AAAA,MACjC,WAAW,iBAAiB,iBAAiB;AAC3C,mBAAW,+BAA+B,aAAa,GAAG;AAG1D,cAAM,cAAe,gBACnB,aACF;AACA,sBAAc,aAAa,IAAI;AAAA,MACjC,OAAO;AAGL,cAAM,UAAU,SAAS,uBAAuB,aAAa,IAAI;AAAA,MACnE;AACA,aAAO,EAAE,eAAe,UAAU;AAAA,IACpC;AAAA,IACA;AAAA,MACE,eAAe,EAAE,KAAK;AAAA,MACtB,WAAW,CAAC;AAAA,IACd;AAAA,EACF;AAEA,QAAM,WAAW,YAAY;AAC3B,UAAM,QAAQ;AAAA,MACZ,OAAO,UAAU,IAAI,CAAC,qBAAqB,iBAAiB,CAAC;AAAA,IAC/D;AAAA,EACF;AACA,SAAO,EAAE,YAAY,OAAO,eAAe,SAAS;AACtD;","names":[]}
|
package/dist/chunk-CV5LC4PP.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/common/sortParams.ts
|
|
2
|
-
var sortParamKeys = (methodParams, params) => {
|
|
3
|
-
if (!params) {
|
|
4
|
-
return [];
|
|
5
|
-
}
|
|
6
|
-
if (params instanceof Array) {
|
|
7
|
-
return params;
|
|
8
|
-
}
|
|
9
|
-
const methodParamsOrder = methodParams.reduce(
|
|
10
|
-
(paramsOrderObj, paramsName, i) => ({
|
|
11
|
-
...paramsOrderObj,
|
|
12
|
-
[paramsName]: i
|
|
13
|
-
}),
|
|
14
|
-
{}
|
|
15
|
-
);
|
|
16
|
-
return Object.entries(params).sort(
|
|
17
|
-
([name1, _1], [name2, _2]) => methodParamsOrder[name1] - methodParamsOrder[name2]
|
|
18
|
-
).map(([_, val]) => val);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
exports.sortParamKeys = sortParamKeys;
|
|
24
|
-
//# sourceMappingURL=chunk-CV5LC4PP.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/common/sortParams.ts"],"names":[],"mappings":";AAkBO,IAAM,gBAAgB,CAC3B,cACA,WACG;AACH,MAAI,CAAC,QAAQ;AACX,WAAO,CAAC;AAAA,EACV;AAEA,MAAI,kBAAkB,OAAO;AAC3B,WAAO;AAAA,EACT;AAEA,QAAM,oBAA6C,aAAa;AAAA,IAC9D,CAAC,gBAAgB,YAAY,OAAO;AAAA,MAClC,GAAG;AAAA,MACH,CAAC,UAAU,GAAG;AAAA,IAChB;AAAA,IACA,CAAC;AAAA,EACH;AAEA,SAAO,OAAO,QAAQ,MAAM,EACzB;AAAA,IACC,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,MACtB,kBAAkB,KAAK,IAAI,kBAAkB,KAAK;AAAA,EACtD,EACC,IAAI,CAAC,CAAC,GAAG,GAAG,MAAM,GAAG;AAC1B","sourcesContent":["// original source sortParamKeys from: https://github.com/etclabscore/sig.tools/blob/master/src/postMessageServer/postMessageServer.ts#L75-L77\n\nimport type { JsonRpcParams } from '@metamask/utils';\n\n/**\n * Deterministically sort JSON-RPC parameter keys. This makes it possible to\n * support both arrays and objects as parameters. Objects are sorted and turned\n * into arrays, for easier consumption by the snap.\n *\n * The order is defined by the `method` parameter.\n *\n * @param methodParams - The parameters of the JSON-RPC method, which\n * determines the ordering for the parameters.\n * @param params - JSON-RPC parameters as object or array.\n * @returns The values for the sorted keys. If `params` is not provided, this\n * returns an empty array. If `params` is an array, this returns the same\n * `params`.\n */\nexport const sortParamKeys = (\n methodParams: string[],\n params?: JsonRpcParams,\n) => {\n if (!params) {\n return [];\n }\n\n if (params instanceof Array) {\n return params;\n }\n\n const methodParamsOrder: { [k: string]: number } = methodParams.reduce(\n (paramsOrderObj, paramsName, i) => ({\n ...paramsOrderObj,\n [paramsName]: i,\n }),\n {},\n );\n\n return Object.entries(params)\n .sort(\n ([name1, _1], [name2, _2]) =>\n methodParamsOrder[name1] - methodParamsOrder[name2],\n )\n .map(([_, val]) => val);\n};\n"]}
|
package/dist/chunk-DAG7NWEU.mjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BaseSnapExecutor
|
|
3
|
-
} from "./chunk-TZAPZE45.mjs";
|
|
4
|
-
import {
|
|
5
|
-
log
|
|
6
|
-
} from "./chunk-5DEV3QQU.mjs";
|
|
7
|
-
|
|
8
|
-
// src/node-process/ChildProcessSnapExecutor.ts
|
|
9
|
-
import ObjectMultiplex from "@metamask/object-multiplex";
|
|
10
|
-
import { ProcessMessageStream } from "@metamask/post-message-stream";
|
|
11
|
-
import { logError, SNAP_STREAM_NAMES } from "@metamask/snaps-utils";
|
|
12
|
-
import { pipeline } from "readable-stream";
|
|
13
|
-
var ChildProcessSnapExecutor = class _ChildProcessSnapExecutor extends BaseSnapExecutor {
|
|
14
|
-
static initialize() {
|
|
15
|
-
log("Worker: Connecting to parent.");
|
|
16
|
-
const parentStream = new ProcessMessageStream();
|
|
17
|
-
const mux = new ObjectMultiplex();
|
|
18
|
-
pipeline(parentStream, mux, parentStream, (error) => {
|
|
19
|
-
if (error) {
|
|
20
|
-
logError(`Parent stream failure, closing worker.`, error);
|
|
21
|
-
}
|
|
22
|
-
self.close();
|
|
23
|
-
});
|
|
24
|
-
const commandStream = mux.createStream(SNAP_STREAM_NAMES.COMMAND);
|
|
25
|
-
const rpcStream = mux.createStream(SNAP_STREAM_NAMES.JSON_RPC);
|
|
26
|
-
return new _ChildProcessSnapExecutor(commandStream, rpcStream);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export {
|
|
31
|
-
ChildProcessSnapExecutor
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=chunk-DAG7NWEU.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/node-process/ChildProcessSnapExecutor.ts"],"sourcesContent":["import ObjectMultiplex from '@metamask/object-multiplex';\nimport { ProcessMessageStream } from '@metamask/post-message-stream';\nimport { logError, SNAP_STREAM_NAMES } from '@metamask/snaps-utils';\nimport { pipeline } from 'readable-stream';\n\nimport { BaseSnapExecutor } from '../common/BaseSnapExecutor';\nimport { log } from '../logging';\n\nexport class ChildProcessSnapExecutor extends BaseSnapExecutor {\n static initialize() {\n log('Worker: Connecting to parent.');\n\n const parentStream = new ProcessMessageStream();\n const mux = new ObjectMultiplex();\n pipeline(parentStream, mux as any, parentStream, (error) => {\n if (error) {\n logError(`Parent stream failure, closing worker.`, error);\n }\n self.close();\n });\n\n const commandStream = mux.createStream(SNAP_STREAM_NAMES.COMMAND);\n const rpcStream = mux.createStream(SNAP_STREAM_NAMES.JSON_RPC) as any;\n return new ChildProcessSnapExecutor(commandStream, rpcStream);\n }\n}\n"],"mappings":";;;;;;;;AAAA,OAAO,qBAAqB;AAC5B,SAAS,4BAA4B;AACrC,SAAS,UAAU,yBAAyB;AAC5C,SAAS,gBAAgB;AAKlB,IAAM,2BAAN,MAAM,kCAAiC,iBAAiB;AAAA,EAC7D,OAAO,aAAa;AAClB,QAAI,+BAA+B;AAEnC,UAAM,eAAe,IAAI,qBAAqB;AAC9C,UAAM,MAAM,IAAI,gBAAgB;AAChC,aAAS,cAAc,KAAY,cAAc,CAAC,UAAU;AAC1D,UAAI,OAAO;AACT,iBAAS,0CAA0C,KAAK;AAAA,MAC1D;AACA,WAAK,MAAM;AAAA,IACb,CAAC;AAED,UAAM,gBAAgB,IAAI,aAAa,kBAAkB,OAAO;AAChE,UAAM,YAAY,IAAI,aAAa,kBAAkB,QAAQ;AAC7D,WAAO,IAAI,0BAAyB,eAAe,SAAS;AAAA,EAC9D;AACF;","names":[]}
|
package/dist/chunk-DKDTGAFK.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunk4COIRXF5js = require('./chunk-4COIRXF5.js');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunkDLLLH5HNjs = require('./chunk-DLLLH5HN.js');
|
|
7
|
-
|
|
8
|
-
// src/common/endowments/index.ts
|
|
9
|
-
var _rpcerrors = require('@metamask/rpc-errors');
|
|
10
|
-
var _snapsutils = require('@metamask/snaps-utils');
|
|
11
|
-
var _utils = require('@metamask/utils');
|
|
12
|
-
var registeredEndowments = _chunk4COIRXF5js.commonEndowmentFactory_default.call(void 0, );
|
|
13
|
-
var endowmentFactories = registeredEndowments.reduce((factories, builder) => {
|
|
14
|
-
builder.names.forEach((name) => {
|
|
15
|
-
factories.set(name, builder.factory);
|
|
16
|
-
});
|
|
17
|
-
return factories;
|
|
18
|
-
}, /* @__PURE__ */ new Map());
|
|
19
|
-
function createEndowments({
|
|
20
|
-
snap,
|
|
21
|
-
ethereum,
|
|
22
|
-
snapId,
|
|
23
|
-
endowments,
|
|
24
|
-
notify
|
|
25
|
-
}) {
|
|
26
|
-
const attenuatedEndowments = {};
|
|
27
|
-
const result = endowments.reduce(
|
|
28
|
-
({ allEndowments, teardowns }, endowmentName) => {
|
|
29
|
-
if (endowmentFactories.has(endowmentName)) {
|
|
30
|
-
if (!_utils.hasProperty.call(void 0, attenuatedEndowments, endowmentName)) {
|
|
31
|
-
const { teardownFunction, ...endowment } = endowmentFactories.get(
|
|
32
|
-
endowmentName
|
|
33
|
-
)({ snapId, notify });
|
|
34
|
-
Object.assign(attenuatedEndowments, endowment);
|
|
35
|
-
if (teardownFunction) {
|
|
36
|
-
teardowns.push(teardownFunction);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
allEndowments[endowmentName] = attenuatedEndowments[endowmentName];
|
|
40
|
-
} else if (endowmentName === "ethereum") {
|
|
41
|
-
allEndowments[endowmentName] = ethereum;
|
|
42
|
-
} else if (endowmentName in _chunkDLLLH5HNjs.rootRealmGlobal) {
|
|
43
|
-
_snapsutils.logWarning.call(void 0, `Access to unhardened global ${endowmentName}.`);
|
|
44
|
-
const globalValue = _chunkDLLLH5HNjs.rootRealmGlobal[endowmentName];
|
|
45
|
-
allEndowments[endowmentName] = globalValue;
|
|
46
|
-
} else {
|
|
47
|
-
throw _rpcerrors.rpcErrors.internal(`Unknown endowment: "${endowmentName}".`);
|
|
48
|
-
}
|
|
49
|
-
return { allEndowments, teardowns };
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
allEndowments: { snap },
|
|
53
|
-
teardowns: []
|
|
54
|
-
}
|
|
55
|
-
);
|
|
56
|
-
const teardown = async () => {
|
|
57
|
-
await Promise.all(
|
|
58
|
-
result.teardowns.map((teardownFunction) => teardownFunction())
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
return { endowments: result.allEndowments, teardown };
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
exports.createEndowments = createEndowments;
|
|
67
|
-
//# sourceMappingURL=chunk-DKDTGAFK.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/common/endowments/index.ts"],"names":[],"mappings":";;;;;;;;AACA,SAAS,iBAAiB;AAE1B,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAuB5B,IAAM,uBAAuB,+BAAsB;AAOnD,IAAM,qBAAqB,qBAAqB,OAAO,CAAC,WAAW,YAAY;AAC7E,UAAQ,MAAM,QAAQ,CAAC,SAAS;AAC9B,cAAU,IAAI,MAAM,QAAQ,OAAO;AAAA,EACrC,CAAC;AACD,SAAO;AACT,GAAG,oBAAI,IAA2E,CAAC;AAiB5E,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAM2E;AACzE,QAAM,uBAAgD,CAAC;AAKvD,QAAM,SAAS,WAAW;AAAA,IAIxB,CAAC,EAAE,eAAe,UAAU,GAAG,kBAAkB;AAE/C,UAAI,mBAAmB,IAAI,aAAa,GAAG;AACzC,YAAI,CAAC,YAAY,sBAAsB,aAAa,GAAG;AASrD,gBAAM,EAAE,kBAAkB,GAAG,UAAU,IAAI,mBAAmB;AAAA,YAC5D;AAAA,UACF,EAAG,EAAE,QAAQ,OAAO,CAAC;AACrB,iBAAO,OAAO,sBAAsB,SAAS;AAC7C,cAAI,kBAAkB;AACpB,sBAAU,KAAK,gBAAgB;AAAA,UACjC;AAAA,QACF;AACA,sBAAc,aAAa,IAAI,qBAAqB,aAAa;AAAA,MACnE,WAAW,kBAAkB,YAAY;AAEvC,sBAAc,aAAa,IAAI;AAAA,MACjC,WAAW,iBAAiB,iBAAiB;AAC3C,mBAAW,+BAA+B,aAAa,GAAG;AAG1D,cAAM,cAAe,gBACnB,aACF;AACA,sBAAc,aAAa,IAAI;AAAA,MACjC,OAAO;AAGL,cAAM,UAAU,SAAS,uBAAuB,aAAa,IAAI;AAAA,MACnE;AACA,aAAO,EAAE,eAAe,UAAU;AAAA,IACpC;AAAA,IACA;AAAA,MACE,eAAe,EAAE,KAAK;AAAA,MACtB,WAAW,CAAC;AAAA,IACd;AAAA,EACF;AAEA,QAAM,WAAW,YAAY;AAC3B,UAAM,QAAQ;AAAA,MACZ,OAAO,UAAU,IAAI,CAAC,qBAAqB,iBAAiB,CAAC;AAAA,IAC/D;AAAA,EACF;AACA,SAAO,EAAE,YAAY,OAAO,eAAe,SAAS;AACtD","sourcesContent":["import type { StreamProvider } from '@metamask/providers';\nimport { rpcErrors } from '@metamask/rpc-errors';\nimport type { SnapsProvider } from '@metamask/snaps-sdk';\nimport { logWarning } from '@metamask/snaps-utils';\nimport { hasProperty } from '@metamask/utils';\n\nimport type { NotifyFunction } from '../BaseSnapExecutor';\nimport { rootRealmGlobal } from '../globalObject';\nimport type { EndowmentFactoryOptions } from './commonEndowmentFactory';\nimport buildCommonEndowments from './commonEndowmentFactory';\n\ntype EndowmentFactoryResult = {\n /**\n * A function that performs any necessary teardown when the snap becomes idle.\n *\n * NOTE:** The endowments are not reconstructed if the snap is re-invoked\n * before being terminated, so the teardown operation must not render the\n * endowments unusable; it should simply restore the endowments to their\n * original state.\n */\n teardownFunction?: () => Promise<void> | void;\n [key: string]: unknown;\n};\n\n/**\n * Retrieve consolidated endowment factories for common endowments.\n */\nconst registeredEndowments = buildCommonEndowments();\n\n/**\n * A map of endowment names to their factory functions. Some endowments share\n * the same factory function, but we only call each factory once for each snap.\n * See {@link createEndowments} for details.\n */\nconst endowmentFactories = registeredEndowments.reduce((factories, builder) => {\n builder.names.forEach((name) => {\n factories.set(name, builder.factory);\n });\n return factories;\n}, new Map<string, (options?: EndowmentFactoryOptions) => EndowmentFactoryResult>());\n\n/**\n * Gets the endowments for a particular Snap. Some endowments, like `setTimeout`\n * and `clearTimeout`, must be attenuated so that they can only affect behavior\n * within the Snap's own realm. Therefore, we use factory functions to create\n * such attenuated / modified endowments. Otherwise, the value that's on the\n * root realm global will be used.\n *\n * @param options - An options bag.\n * @param options.snap - The Snaps global API object.\n * @param options.ethereum - The Snap's EIP-1193 provider object.\n * @param options.snapId - The id of the snap that will use the created endowments.\n * @param options.endowments - The list of endowments to provide to the snap.\n * @param options.notify - A reference to the notify function of the snap executor.\n * @returns An object containing the Snap's endowments.\n */\nexport function createEndowments({\n snap,\n ethereum,\n snapId,\n endowments,\n notify,\n}: {\n snap: SnapsProvider;\n ethereum: StreamProvider;\n snapId: string;\n endowments: string[];\n notify: NotifyFunction;\n}): { endowments: Record<string, unknown>; teardown: () => Promise<void> } {\n const attenuatedEndowments: Record<string, unknown> = {};\n\n // TODO: All endowments should be hardened to prevent covert communication\n // channels. Hardening the returned objects breaks tests elsewhere in the\n // monorepo, so further research is needed.\n const result = endowments.reduce<{\n allEndowments: Record<string, unknown>;\n teardowns: (() => Promise<void> | void)[];\n }>(\n ({ allEndowments, teardowns }, endowmentName) => {\n // First, check if the endowment has a factory, and default to that.\n if (endowmentFactories.has(endowmentName)) {\n if (!hasProperty(attenuatedEndowments, endowmentName)) {\n // Call the endowment factory for the current endowment. If the factory\n // creates multiple endowments, they will all be assigned to the\n // `attenuatedEndowments` object, but will only be passed on to the snap\n // if explicitly listed among its endowment.\n // This may not have an actual use case, but, safety first.\n\n // We just confirmed that endowmentFactories has the specified key.\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const { teardownFunction, ...endowment } = endowmentFactories.get(\n endowmentName,\n )!({ snapId, notify });\n Object.assign(attenuatedEndowments, endowment);\n if (teardownFunction) {\n teardowns.push(teardownFunction);\n }\n }\n allEndowments[endowmentName] = attenuatedEndowments[endowmentName];\n } else if (endowmentName === 'ethereum') {\n // Special case for adding the EIP-1193 provider.\n allEndowments[endowmentName] = ethereum;\n } else if (endowmentName in rootRealmGlobal) {\n logWarning(`Access to unhardened global ${endowmentName}.`);\n // If the endowment doesn't have a factory, just use whatever is on the\n // global object.\n const globalValue = (rootRealmGlobal as Record<string, unknown>)[\n endowmentName\n ];\n allEndowments[endowmentName] = globalValue;\n } else {\n // If we get to this point, we've been passed an endowment that doesn't\n // exist in our current environment.\n throw rpcErrors.internal(`Unknown endowment: \"${endowmentName}\".`);\n }\n return { allEndowments, teardowns };\n },\n {\n allEndowments: { snap },\n teardowns: [],\n },\n );\n\n const teardown = async () => {\n await Promise.all(\n result.teardowns.map((teardownFunction) => teardownFunction()),\n );\n };\n return { endowments: result.allEndowments, teardown };\n}\n"]}
|
package/dist/chunk-DLLLH5HN.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/common/globalObject.ts
|
|
2
|
-
var _rootRealmGlobal;
|
|
3
|
-
var _rootRealmGlobalName;
|
|
4
|
-
if (typeof globalThis !== "undefined") {
|
|
5
|
-
_rootRealmGlobal = globalThis;
|
|
6
|
-
_rootRealmGlobalName = "globalThis" /* globalThis */;
|
|
7
|
-
} else if (typeof self !== "undefined") {
|
|
8
|
-
_rootRealmGlobal = self;
|
|
9
|
-
_rootRealmGlobalName = "self" /* self */;
|
|
10
|
-
} else if (typeof window !== "undefined") {
|
|
11
|
-
_rootRealmGlobal = window;
|
|
12
|
-
_rootRealmGlobalName = "window" /* window */;
|
|
13
|
-
} else if (typeof global !== "undefined") {
|
|
14
|
-
_rootRealmGlobal = global;
|
|
15
|
-
_rootRealmGlobalName = "global" /* global */;
|
|
16
|
-
} else {
|
|
17
|
-
throw new Error("Unknown realm type; failed to identify global object.");
|
|
18
|
-
}
|
|
19
|
-
var rootRealmGlobal = _rootRealmGlobal;
|
|
20
|
-
var rootRealmGlobalName = _rootRealmGlobalName;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
exports.rootRealmGlobal = rootRealmGlobal; exports.rootRealmGlobalName = rootRealmGlobalName;
|
|
26
|
-
//# sourceMappingURL=chunk-DLLLH5HN.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/common/globalObject.ts"],"names":[],"mappings":";AAYA,IAAI;AACJ,IAAI;AAIJ,IAAI,OAAO,eAAe,aAAa;AACrC,qBAAmB;AACnB,yBAAuB;AACzB,WAAW,OAAO,SAAS,aAAa;AACtC,qBAAmB;AACnB,yBAAuB;AACzB,WAAW,OAAO,WAAW,aAAa;AACxC,qBAAmB;AACnB,yBAAuB;AACzB,WAAW,OAAO,WAAW,aAAa;AACxC,qBAAmB;AACnB,yBAAuB;AACzB,OAAO;AACL,QAAM,IAAI,MAAM,uDAAuD;AACzE;AAMA,IAAM,kBAAkB;AAKxB,IAAM,sBAAsB","sourcesContent":["enum GlobalObjectNames {\n // The globalThis entry is incorrectly identified as shadowing the global\n // globalThis.\n /* eslint-disable @typescript-eslint/naming-convention */\n // eslint-disable-next-line @typescript-eslint/no-shadow\n globalThis = 'globalThis',\n global = 'global',\n self = 'self',\n window = 'window',\n /* eslint-enable @typescript-eslint/naming-convention */\n}\n\nlet _rootRealmGlobal: typeof globalThis;\nlet _rootRealmGlobalName: string;\n\n/* istanbul ignore next */\n/* eslint-disable no-negated-condition */\nif (typeof globalThis !== 'undefined') {\n _rootRealmGlobal = globalThis;\n _rootRealmGlobalName = GlobalObjectNames.globalThis;\n} else if (typeof self !== 'undefined') {\n _rootRealmGlobal = self;\n _rootRealmGlobalName = GlobalObjectNames.self;\n} else if (typeof window !== 'undefined') {\n _rootRealmGlobal = window;\n _rootRealmGlobalName = GlobalObjectNames.window;\n} else if (typeof global !== 'undefined') {\n _rootRealmGlobal = global;\n _rootRealmGlobalName = GlobalObjectNames.global;\n} else {\n throw new Error('Unknown realm type; failed to identify global object.');\n}\n/* eslint-enable no-negated-condition */\n\n/**\n * A platform-agnostic alias for the root realm global object.\n */\nconst rootRealmGlobal = _rootRealmGlobal;\n\n/**\n * The string literal corresponding to the name of the root realm global object.\n */\nconst rootRealmGlobalName = _rootRealmGlobalName;\n\nexport { rootRealmGlobal, rootRealmGlobalName };\n"]}
|
package/dist/chunk-EXN2TFDJ.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
-
}) : x)(function(x) {
|
|
4
|
-
if (typeof require !== "undefined")
|
|
5
|
-
return require.apply(this, arguments);
|
|
6
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
7
|
-
});
|
|
8
|
-
var __accessCheck = (obj, member, msg) => {
|
|
9
|
-
if (!member.has(obj))
|
|
10
|
-
throw TypeError("Cannot " + msg);
|
|
11
|
-
};
|
|
12
|
-
var __privateGet = (obj, member, getter) => {
|
|
13
|
-
__accessCheck(obj, member, "read from private field");
|
|
14
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
15
|
-
};
|
|
16
|
-
var __privateAdd = (obj, member, value) => {
|
|
17
|
-
if (member.has(obj))
|
|
18
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
19
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
20
|
-
};
|
|
21
|
-
var __privateSet = (obj, member, value, setter) => {
|
|
22
|
-
__accessCheck(obj, member, "write to private field");
|
|
23
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
24
|
-
return value;
|
|
25
|
-
};
|
|
26
|
-
var __privateMethod = (obj, member, method) => {
|
|
27
|
-
__accessCheck(obj, member, "access private method");
|
|
28
|
-
return method;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
exports.__require = __require; exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd; exports.__privateSet = __privateSet; exports.__privateMethod = __privateMethod;
|
|
38
|
-
//# sourceMappingURL=chunk-EXN2TFDJ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|