@metamask/snaps-controllers 0.38.0-flask.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +568 -11
- package/dist/{types/cronjob → cronjob}/CronjobController.d.ts +6 -7
- package/dist/cronjob/CronjobController.js +248 -0
- package/dist/cronjob/CronjobController.js.map +1 -0
- package/dist/cronjob/index.js +18 -0
- package/dist/cronjob/index.js.map +1 -0
- package/dist/{types/fsm.d.ts → fsm.d.ts} +1 -1
- package/dist/fsm.js +75 -0
- package/dist/fsm.js.map +1 -0
- package/dist/{types/index.d.ts → index.d.ts} +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/logging.js +13 -0
- package/dist/logging.js.map +1 -0
- package/dist/multichain/MultiChainController.d.ts +137 -0
- package/dist/multichain/MultiChainController.js +339 -0
- package/dist/multichain/MultiChainController.js.map +1 -0
- package/dist/multichain/index.d.ts +3 -0
- package/dist/multichain/index.js +20 -0
- package/dist/multichain/index.js.map +1 -0
- package/dist/multichain/matching.d.ts +9 -0
- package/dist/multichain/matching.js +57 -0
- package/dist/multichain/matching.js.map +1 -0
- package/dist/multichain/middleware.d.ts +14 -0
- package/dist/multichain/middleware.js +42 -0
- package/dist/multichain/middleware.js.map +1 -0
- package/dist/{types/services → services}/AbstractExecutionService.d.ts +4 -4
- package/dist/services/AbstractExecutionService.js +318 -0
- package/dist/services/AbstractExecutionService.js.map +1 -0
- package/dist/{types/services → services}/ExecutionService.d.ts +3 -3
- package/dist/services/ExecutionService.js +4 -0
- package/dist/services/ExecutionService.js.map +1 -0
- package/dist/{types/services → services}/browser.d.ts +0 -2
- package/dist/services/browser.js +22 -0
- package/dist/services/browser.js.map +1 -0
- package/dist/{types/services → services}/iframe/IframeExecutionService.d.ts +2 -3
- package/dist/services/iframe/IframeExecutionService.js +30 -0
- package/dist/services/iframe/IframeExecutionService.js.map +1 -0
- package/dist/services/iframe/index.js +18 -0
- package/dist/services/iframe/index.js.map +1 -0
- package/dist/{types/services → services}/index.d.ts +0 -2
- package/dist/services/index.js +22 -0
- package/dist/services/index.js.map +1 -0
- package/dist/{types/services → services}/node/NodeProcessExecutionService.d.ts +3 -4
- package/dist/services/node/NodeProcessExecutionService.js +18 -0
- package/dist/services/node/NodeProcessExecutionService.js.map +1 -0
- package/dist/{types/services → services}/node/NodeThreadExecutionService.d.ts +2 -3
- package/dist/services/node/NodeThreadExecutionService.js +19 -0
- package/dist/services/node/NodeThreadExecutionService.js.map +1 -0
- package/dist/services/node/index.js +19 -0
- package/dist/services/node/index.js.map +1 -0
- package/dist/{types/services → services}/offscreen/OffscreenExecutionService.d.ts +3 -4
- package/dist/services/offscreen/OffscreenExecutionService.js +100 -0
- package/dist/services/offscreen/OffscreenExecutionService.js.map +1 -0
- package/dist/{types/services/ProxyPostMessageStream.d.ts → services/offscreen/OffscreenPostMessageStream.d.ts} +10 -10
- package/dist/services/offscreen/OffscreenPostMessageStream.js +66 -0
- package/dist/services/offscreen/OffscreenPostMessageStream.js.map +1 -0
- package/dist/services/offscreen/index.d.ts +2 -0
- package/dist/services/offscreen/index.js +19 -0
- package/dist/services/offscreen/index.js.map +1 -0
- package/dist/snaps/RequestQueue.js +44 -0
- package/dist/snaps/RequestQueue.js.map +1 -0
- package/dist/{types/snaps → snaps}/SnapController.d.ts +38 -62
- package/dist/snaps/SnapController.js +1478 -0
- package/dist/snaps/SnapController.js.map +1 -0
- package/dist/snaps/Timer.js +86 -0
- package/dist/snaps/Timer.js.map +1 -0
- package/dist/{types/snaps → snaps}/endowments/cronjob.d.ts +3 -5
- package/dist/snaps/endowments/cronjob.js +105 -0
- package/dist/snaps/endowments/cronjob.js.map +1 -0
- package/dist/{types/snaps → snaps}/endowments/enum.d.ts +2 -2
- package/dist/snaps/endowments/enum.js +15 -0
- package/dist/snaps/endowments/enum.js.map +1 -0
- package/dist/{types/snaps → snaps}/endowments/ethereum-provider.d.ts +1 -2
- package/dist/snaps/endowments/ethereum-provider.js +32 -0
- package/dist/snaps/endowments/ethereum-provider.js.map +1 -0
- package/dist/{types/snaps → snaps}/endowments/index.d.ts +14 -11
- package/dist/snaps/endowments/index.js +60 -0
- package/dist/snaps/endowments/index.js.map +1 -0
- package/dist/snaps/endowments/keyring.d.ts +40 -0
- package/dist/snaps/endowments/keyring.js +103 -0
- package/dist/snaps/endowments/keyring.js.map +1 -0
- package/dist/{types/snaps → snaps}/endowments/long-running.d.ts +1 -2
- package/dist/snaps/endowments/long-running.js +29 -0
- package/dist/snaps/endowments/long-running.js.map +1 -0
- package/dist/{types/snaps → snaps}/endowments/network-access.d.ts +1 -2
- package/dist/snaps/endowments/network-access.js +30 -0
- package/dist/snaps/endowments/network-access.js.map +1 -0
- package/dist/{types/snaps → snaps}/endowments/rpc.d.ts +3 -5
- package/dist/snaps/endowments/rpc.js +92 -0
- package/dist/snaps/endowments/rpc.js.map +1 -0
- package/dist/{types/snaps → snaps}/endowments/transaction-insight.d.ts +2 -3
- package/dist/snaps/endowments/transaction-insight.js +106 -0
- package/dist/snaps/endowments/transaction-insight.js.map +1 -0
- package/dist/{types/snaps → snaps}/endowments/web-assembly.d.ts +1 -2
- package/dist/snaps/endowments/web-assembly.js +31 -0
- package/dist/snaps/endowments/web-assembly.js.map +1 -0
- package/dist/{types/snaps → snaps}/index.d.ts +0 -2
- package/dist/snaps/index.js +21 -0
- package/dist/snaps/index.js.map +1 -0
- package/dist/{types/snaps → snaps}/location/http.d.ts +2 -3
- package/dist/{esm/snaps → snaps}/location/http.js +31 -52
- package/dist/snaps/location/http.js.map +1 -0
- package/dist/snaps/location/index.js +21 -0
- package/dist/snaps/location/index.js.map +1 -0
- package/dist/{types/snaps → snaps}/location/local.d.ts +3 -3
- package/dist/snaps/location/local.js +51 -0
- package/dist/snaps/location/local.js.map +1 -0
- package/dist/{types/snaps → snaps}/location/location.d.ts +2 -2
- package/dist/snaps/location/location.js +34 -0
- package/dist/snaps/location/location.js.map +1 -0
- package/dist/snaps/location/npm.d.ts +28 -0
- package/dist/{esm/snaps → snaps}/location/npm.js +117 -141
- package/dist/snaps/location/npm.js.map +1 -0
- package/dist/snaps/registry/index.js +19 -0
- package/dist/snaps/registry/index.js.map +1 -0
- package/dist/{types/snaps → snaps}/registry/json.d.ts +4 -5
- package/dist/snaps/registry/json.js +171 -0
- package/dist/snaps/registry/json.js.map +1 -0
- package/dist/{types/snaps → snaps}/registry/registry.d.ts +5 -5
- package/dist/snaps/registry/registry.js +11 -0
- package/dist/snaps/registry/registry.js.map +1 -0
- package/dist/snaps/selectors.d.ts +2 -0
- package/dist/snaps/selectors.js +6 -0
- package/dist/snaps/selectors.js.map +1 -0
- package/dist/{types/utils.d.ts → utils.d.ts} +14 -14
- package/dist/{esm/utils.js → utils.js} +30 -21
- package/dist/utils.js.map +1 -0
- package/package.json +32 -46
- package/dist/cjs/cronjob/CronjobController.js +0 -290
- package/dist/cjs/cronjob/CronjobController.js.map +0 -1
- package/dist/cjs/cronjob/index.js +0 -20
- package/dist/cjs/cronjob/index.js.map +0 -1
- package/dist/cjs/fsm.js +0 -69
- package/dist/cjs/fsm.js.map +0 -1
- package/dist/cjs/index.js +0 -23
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/logging.js +0 -15
- package/dist/cjs/logging.js.map +0 -1
- package/dist/cjs/services/AbstractExecutionService.js +0 -386
- package/dist/cjs/services/AbstractExecutionService.js.map +0 -1
- package/dist/cjs/services/ExecutionService.js +0 -7
- package/dist/cjs/services/ExecutionService.js.map +0 -1
- package/dist/cjs/services/ProxyPostMessageStream.js +0 -116
- package/dist/cjs/services/ProxyPostMessageStream.js.map +0 -1
- package/dist/cjs/services/browser.js +0 -32
- package/dist/cjs/services/browser.js.map +0 -1
- package/dist/cjs/services/iframe/IframeExecutionService.js +0 -54
- package/dist/cjs/services/iframe/IframeExecutionService.js.map +0 -1
- package/dist/cjs/services/iframe/index.js +0 -20
- package/dist/cjs/services/iframe/index.js.map +0 -1
- package/dist/cjs/services/index.js +0 -32
- package/dist/cjs/services/index.js.map +0 -1
- package/dist/cjs/services/node/NodeProcessExecutionService.js +0 -30
- package/dist/cjs/services/node/NodeProcessExecutionService.js.map +0 -1
- package/dist/cjs/services/node/NodeThreadExecutionService.js +0 -30
- package/dist/cjs/services/node/NodeThreadExecutionService.js.map +0 -1
- package/dist/cjs/services/node/index.js +0 -21
- package/dist/cjs/services/node/index.js.map +0 -1
- package/dist/cjs/services/offscreen/OffscreenExecutionService.js +0 -159
- package/dist/cjs/services/offscreen/OffscreenExecutionService.js.map +0 -1
- package/dist/cjs/services/offscreen/index.js +0 -20
- package/dist/cjs/services/offscreen/index.js.map +0 -1
- package/dist/cjs/services/webworker/WebWorkerExecutionService.js +0 -148
- package/dist/cjs/services/webworker/WebWorkerExecutionService.js.map +0 -1
- package/dist/cjs/services/webworker/index.js +0 -20
- package/dist/cjs/services/webworker/index.js.map +0 -1
- package/dist/cjs/snaps/RequestQueue.js +0 -63
- package/dist/cjs/snaps/RequestQueue.js.map +0 -1
- package/dist/cjs/snaps/SnapController.js +0 -1735
- package/dist/cjs/snaps/SnapController.js.map +0 -1
- package/dist/cjs/snaps/Timer.js +0 -117
- package/dist/cjs/snaps/Timer.js.map +0 -1
- package/dist/cjs/snaps/endowments/cronjob.js +0 -100
- package/dist/cjs/snaps/endowments/cronjob.js.map +0 -1
- package/dist/cjs/snaps/endowments/enum.js +0 -23
- package/dist/cjs/snaps/endowments/enum.js.map +0 -1
- package/dist/cjs/snaps/endowments/ethereum-provider.js +0 -43
- package/dist/cjs/snaps/endowments/ethereum-provider.js.map +0 -1
- package/dist/cjs/snaps/endowments/index.js +0 -82
- package/dist/cjs/snaps/endowments/index.js.map +0 -1
- package/dist/cjs/snaps/endowments/lifecycle-hooks.js +0 -37
- package/dist/cjs/snaps/endowments/lifecycle-hooks.js.map +0 -1
- package/dist/cjs/snaps/endowments/long-running.js +0 -38
- package/dist/cjs/snaps/endowments/long-running.js.map +0 -1
- package/dist/cjs/snaps/endowments/network-access.js +0 -44
- package/dist/cjs/snaps/endowments/network-access.js.map +0 -1
- package/dist/cjs/snaps/endowments/rpc.js +0 -99
- package/dist/cjs/snaps/endowments/rpc.js.map +0 -1
- package/dist/cjs/snaps/endowments/transaction-insight.js +0 -106
- package/dist/cjs/snaps/endowments/transaction-insight.js.map +0 -1
- package/dist/cjs/snaps/endowments/web-assembly.js +0 -42
- package/dist/cjs/snaps/endowments/web-assembly.js.map +0 -1
- package/dist/cjs/snaps/index.js +0 -25
- package/dist/cjs/snaps/index.js.map +0 -1
- package/dist/cjs/snaps/location/http.js +0 -106
- package/dist/cjs/snaps/location/http.js.map +0 -1
- package/dist/cjs/snaps/location/index.js +0 -23
- package/dist/cjs/snaps/location/index.js.map +0 -1
- package/dist/cjs/snaps/location/local.js +0 -93
- package/dist/cjs/snaps/location/local.js.map +0 -1
- package/dist/cjs/snaps/location/location.js +0 -34
- package/dist/cjs/snaps/location/location.js.map +0 -1
- package/dist/cjs/snaps/location/npm.js +0 -291
- package/dist/cjs/snaps/location/npm.js.map +0 -1
- package/dist/cjs/snaps/permissions.js +0 -61
- package/dist/cjs/snaps/permissions.js.map +0 -1
- package/dist/cjs/snaps/registry/index.js +0 -21
- package/dist/cjs/snaps/registry/index.js.map +0 -1
- package/dist/cjs/snaps/registry/json.js +0 -250
- package/dist/cjs/snaps/registry/json.js.map +0 -1
- package/dist/cjs/snaps/registry/registry.js +0 -18
- package/dist/cjs/snaps/registry/registry.js.map +0 -1
- package/dist/cjs/snaps/selectors.js +0 -13
- package/dist/cjs/snaps/selectors.js.map +0 -1
- package/dist/cjs/utils.js +0 -70
- package/dist/cjs/utils.js.map +0 -1
- package/dist/esm/cronjob/CronjobController.js +0 -275
- package/dist/esm/cronjob/CronjobController.js.map +0 -1
- package/dist/esm/cronjob/index.js +0 -3
- package/dist/esm/cronjob/index.js.map +0 -1
- package/dist/esm/fsm.js +0 -70
- package/dist/esm/fsm.js.map +0 -1
- package/dist/esm/index.js +0 -6
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/logging.js +0 -10
- package/dist/esm/logging.js.map +0 -1
- package/dist/esm/services/AbstractExecutionService.js +0 -369
- package/dist/esm/services/AbstractExecutionService.js.map +0 -1
- package/dist/esm/services/ExecutionService.js +0 -4
- package/dist/esm/services/ExecutionService.js.map +0 -1
- package/dist/esm/services/ProxyPostMessageStream.js +0 -109
- package/dist/esm/services/ProxyPostMessageStream.js.map +0 -1
- package/dist/esm/services/browser.js +0 -9
- package/dist/esm/services/browser.js.map +0 -1
- package/dist/esm/services/iframe/IframeExecutionService.js +0 -44
- package/dist/esm/services/iframe/IframeExecutionService.js.map +0 -1
- package/dist/esm/services/iframe/index.js +0 -3
- package/dist/esm/services/iframe/index.js.map +0 -1
- package/dist/esm/services/index.js +0 -9
- package/dist/esm/services/index.js.map +0 -1
- package/dist/esm/services/node/NodeProcessExecutionService.js +0 -20
- package/dist/esm/services/node/NodeProcessExecutionService.js.map +0 -1
- package/dist/esm/services/node/NodeThreadExecutionService.js +0 -21
- package/dist/esm/services/node/NodeThreadExecutionService.js.map +0 -1
- package/dist/esm/services/node/index.js +0 -4
- package/dist/esm/services/node/index.js.map +0 -1
- package/dist/esm/services/offscreen/OffscreenExecutionService.js +0 -149
- package/dist/esm/services/offscreen/OffscreenExecutionService.js.map +0 -1
- package/dist/esm/services/offscreen/index.js +0 -3
- package/dist/esm/services/offscreen/index.js.map +0 -1
- package/dist/esm/services/webworker/WebWorkerExecutionService.js +0 -130
- package/dist/esm/services/webworker/WebWorkerExecutionService.js.map +0 -1
- package/dist/esm/services/webworker/index.js +0 -3
- package/dist/esm/services/webworker/index.js.map +0 -1
- package/dist/esm/snaps/RequestQueue.js +0 -53
- package/dist/esm/snaps/RequestQueue.js.map +0 -1
- package/dist/esm/snaps/SnapController.js +0 -1714
- package/dist/esm/snaps/SnapController.js.map +0 -1
- package/dist/esm/snaps/Timer.js +0 -107
- package/dist/esm/snaps/Timer.js.map +0 -1
- package/dist/esm/snaps/endowments/cronjob.js +0 -99
- package/dist/esm/snaps/endowments/cronjob.js.map +0 -1
- package/dist/esm/snaps/endowments/enum.js +0 -13
- package/dist/esm/snaps/endowments/enum.js.map +0 -1
- package/dist/esm/snaps/endowments/ethereum-provider.js +0 -33
- package/dist/esm/snaps/endowments/ethereum-provider.js.map +0 -1
- package/dist/esm/snaps/endowments/index.js +0 -41
- package/dist/esm/snaps/endowments/index.js.map +0 -1
- package/dist/esm/snaps/endowments/lifecycle-hooks.js +0 -27
- package/dist/esm/snaps/endowments/lifecycle-hooks.js.map +0 -1
- package/dist/esm/snaps/endowments/long-running.js +0 -28
- package/dist/esm/snaps/endowments/long-running.js.map +0 -1
- package/dist/esm/snaps/endowments/network-access.js +0 -34
- package/dist/esm/snaps/endowments/network-access.js.map +0 -1
- package/dist/esm/snaps/endowments/rpc.js +0 -88
- package/dist/esm/snaps/endowments/rpc.js.map +0 -1
- package/dist/esm/snaps/endowments/transaction-insight.js +0 -99
- package/dist/esm/snaps/endowments/transaction-insight.js.map +0 -1
- package/dist/esm/snaps/endowments/web-assembly.js +0 -32
- package/dist/esm/snaps/endowments/web-assembly.js.map +0 -1
- package/dist/esm/snaps/index.js +0 -8
- package/dist/esm/snaps/index.js.map +0 -1
- package/dist/esm/snaps/location/http.js.map +0 -1
- package/dist/esm/snaps/location/index.js +0 -6
- package/dist/esm/snaps/location/index.js.map +0 -1
- package/dist/esm/snaps/location/local.js +0 -83
- package/dist/esm/snaps/location/local.js.map +0 -1
- package/dist/esm/snaps/location/location.js +0 -30
- package/dist/esm/snaps/location/location.js.map +0 -1
- package/dist/esm/snaps/location/npm.js.map +0 -1
- package/dist/esm/snaps/permissions.js +0 -50
- package/dist/esm/snaps/permissions.js.map +0 -1
- package/dist/esm/snaps/registry/index.js +0 -4
- package/dist/esm/snaps/registry/index.js.map +0 -1
- package/dist/esm/snaps/registry/json.js +0 -240
- package/dist/esm/snaps/registry/json.js.map +0 -1
- package/dist/esm/snaps/registry/registry.js +0 -8
- package/dist/esm/snaps/registry/registry.js.map +0 -1
- package/dist/esm/snaps/selectors.js +0 -3
- package/dist/esm/snaps/selectors.js.map +0 -1
- package/dist/esm/utils.js.map +0 -1
- package/dist/types/services/offscreen/index.d.ts +0 -1
- package/dist/types/services/webworker/WebWorkerExecutionService.d.ts +0 -45
- package/dist/types/services/webworker/index.d.ts +0 -1
- package/dist/types/snaps/endowments/lifecycle-hooks.d.ts +0 -15
- package/dist/types/snaps/location/npm.d.ts +0 -49
- package/dist/types/snaps/permissions.d.ts +0 -16
- package/dist/types/snaps/selectors.d.ts +0 -2
- /package/dist/{types/cronjob → cronjob}/index.d.ts +0 -0
- /package/dist/{types/logging.d.ts → logging.d.ts} +0 -0
- /package/dist/{types/services → services}/iframe/index.d.ts +0 -0
- /package/dist/{types/services → services}/node/index.d.ts +0 -0
- /package/dist/{types/snaps → snaps}/RequestQueue.d.ts +0 -0
- /package/dist/{types/snaps → snaps}/Timer.d.ts +0 -0
- /package/dist/{types/snaps → snaps}/location/index.d.ts +0 -0
- /package/dist/{types/snaps → snaps}/registry/index.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../../src/snaps/registry/json.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAGmC;AACnC,6DAAyE;AAEzE,2CAMyB;AAEzB,yCAOoB;AAEpB,kCAAkC;AAClC,MAAM,iBAAiB,GACrB,mFAAmF,CAAC;AAEtF,MAAM,2BAA2B,GAC/B,oFAAoF,CAAC;AAkDvF,MAAM,cAAc,GAAG,eAAe,CAAC;AAEvC,MAAM,YAAY,GAAG;IACnB,QAAQ,EAAE,IAAI;IACd,WAAW,EAAE,IAAI;CAClB,CAAC;AAEF,MAAa,iBAAkB,SAAQ,kCAItC;IAaC,YAAY,EACV,SAAS,EACT,KAAK,EACL,GAAG,GAAG;QACJ,QAAQ,EAAE,iBAAiB;QAC3B,SAAS,EAAE,2BAA2B;KACvC,EACD,SAAS,EAC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;AAED;;;;;;GAMG;AACH,KAAK,uCAAY,GAAW;IAC1B,MAAM,QAAQ,GAAG,MAAM,uBAAA,IAAI,wCAAe,MAAnB,IAAI,EAAgB,GAAG,CAAC,CAAC;IAChD,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;QAChB,MAAM,IAAI,KAAK,CAAC,mBAAmB,GAAG,GAAG,CAAC,CAAC;KAC5C;IAED,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC/B,CAAC","sourcesContent":["import {\n BaseControllerV2 as BaseController,\n RestrictedControllerMessenger,\n} from '@metamask/base-controller';\nimport { SnapsRegistryDatabase, verify } from '@metamask/snaps-registry';\nimport { SnapId } from '@metamask/snaps-utils';\nimport {\n assert,\n Duration,\n Hex,\n inMilliseconds,\n satisfiesVersionRange,\n} from '@metamask/utils';\n\nimport {\n SnapsRegistry,\n SnapsRegistryInfo,\n SnapsRegistryMetadata,\n SnapsRegistryRequest,\n SnapsRegistryResult,\n SnapsRegistryStatus,\n} from './registry';\n\n// TODO: Replace with a Codefi URL\nconst SNAP_REGISTRY_URL =\n 'https://cdn.jsdelivr.net/gh/MetaMask/snaps-registry@gh-pages/latest/registry.json';\n\nconst SNAP_REGISTRY_SIGNATURE_URL =\n 'https://cdn.jsdelivr.net/gh/MetaMask/snaps-registry@gh-pages/latest/signature.json';\n\ntype JsonSnapsRegistryUrl = {\n registry: string;\n signature: string;\n};\n\nexport type JsonSnapsRegistryArgs = {\n messenger: SnapsRegistryMessenger;\n state?: SnapsRegistryState;\n fetchFunction?: typeof fetch;\n url?: JsonSnapsRegistryUrl;\n recentFetchThreshold?: number;\n refetchOnAllowlistMiss?: boolean;\n failOnUnavailableRegistry?: boolean;\n publicKey?: Hex;\n};\n\nexport type GetResult = {\n type: `${typeof controllerName}:get`;\n handler: SnapsRegistry['get'];\n};\n\nexport type GetMetadata = {\n type: `${typeof controllerName}:getMetadata`;\n handler: SnapsRegistry['getMetadata'];\n};\n\nexport type Update = {\n type: `${typeof controllerName}:update`;\n handler: SnapsRegistry['update'];\n};\n\nexport type SnapsRegistryActions = GetResult | GetMetadata | Update;\n\nexport type SnapsRegistryEvents = never;\n\nexport type SnapsRegistryMessenger = RestrictedControllerMessenger<\n 'SnapsRegistry',\n SnapsRegistryActions,\n SnapsRegistryEvents,\n SnapsRegistryActions['type'],\n SnapsRegistryEvents['type']\n>;\n\nexport type SnapsRegistryState = {\n database: SnapsRegistryDatabase | null;\n lastUpdated: number | null;\n};\n\nconst controllerName = 'SnapsRegistry';\n\nconst defaultState = {\n database: null,\n lastUpdated: null,\n};\n\nexport class JsonSnapsRegistry extends BaseController<\n typeof controllerName,\n SnapsRegistryState,\n SnapsRegistryMessenger\n> {\n #url: JsonSnapsRegistryUrl;\n\n #publicKey?: Hex;\n\n #fetchFunction: typeof fetch;\n\n #recentFetchThreshold: number;\n\n #refetchOnAllowlistMiss: boolean;\n\n #failOnUnavailableRegistry: boolean;\n\n constructor({\n messenger,\n state,\n url = {\n registry: SNAP_REGISTRY_URL,\n signature: SNAP_REGISTRY_SIGNATURE_URL,\n },\n publicKey,\n fetchFunction = globalThis.fetch.bind(globalThis),\n recentFetchThreshold = inMilliseconds(5, Duration.Minute),\n failOnUnavailableRegistry = true,\n refetchOnAllowlistMiss = true,\n }: JsonSnapsRegistryArgs) {\n super({\n messenger,\n metadata: {\n database: { persist: true, anonymous: false },\n lastUpdated: { persist: true, anonymous: false },\n },\n name: controllerName,\n state: {\n ...defaultState,\n ...state,\n },\n });\n this.#url = url;\n this.#publicKey = publicKey;\n this.#fetchFunction = fetchFunction;\n this.#recentFetchThreshold = recentFetchThreshold;\n this.#refetchOnAllowlistMiss = refetchOnAllowlistMiss;\n this.#failOnUnavailableRegistry = failOnUnavailableRegistry;\n\n this.messagingSystem.registerActionHandler(\n 'SnapsRegistry:get',\n async (...args) => this.#get(...args),\n );\n this.messagingSystem.registerActionHandler(\n 'SnapsRegistry:getMetadata',\n async (...args) => this.#getMetadata(...args),\n );\n\n this.messagingSystem.registerActionHandler(\n 'SnapsRegistry:update',\n async () => this.#update(),\n );\n }\n\n #wasRecentlyFetched() {\n return (\n this.state.lastUpdated &&\n Date.now() - this.state.lastUpdated < this.#recentFetchThreshold\n );\n }\n\n async #update() {\n // No-op if we recently fetched the registry.\n if (this.#wasRecentlyFetched()) {\n return;\n }\n\n try {\n const database = await this.#safeFetch(this.#url.registry);\n\n if (this.#publicKey) {\n const signature = await this.#safeFetch(this.#url.signature);\n await this.#verifySignature(database, signature);\n }\n\n this.update((state) => {\n state.database = JSON.parse(database);\n state.lastUpdated = Date.now();\n });\n } catch {\n // Ignore\n }\n }\n\n async #getDatabase(): Promise<SnapsRegistryDatabase | null> {\n if (this.state.database === null) {\n await this.#update();\n }\n\n // If the database is still null and we require it, throw.\n if (this.#failOnUnavailableRegistry && this.state.database === null) {\n throw new Error('Snaps registry is unavailable, installation blocked.');\n }\n return this.state.database;\n }\n\n async #getSingle(\n snapId: SnapId,\n snapInfo: SnapsRegistryInfo,\n refetch = false,\n ): Promise<SnapsRegistryResult> {\n const database = await this.#getDatabase();\n\n const blockedEntry = database?.blockedSnaps.find((blocked) => {\n if ('id' in blocked) {\n return (\n blocked.id === snapId &&\n satisfiesVersionRange(snapInfo.version, blocked.versionRange)\n );\n }\n\n return blocked.checksum === snapInfo.checksum;\n });\n\n if (blockedEntry) {\n return {\n status: SnapsRegistryStatus.Blocked,\n reason: blockedEntry.reason,\n };\n }\n\n const verified = database?.verifiedSnaps[snapId];\n const version = verified?.versions?.[snapInfo.version];\n if (version && version.checksum === snapInfo.checksum) {\n return { status: SnapsRegistryStatus.Verified };\n }\n // For now, if we have an allowlist miss, we can refetch once and try again.\n if (this.#refetchOnAllowlistMiss && !refetch) {\n await this.#update();\n return this.#getSingle(snapId, snapInfo, true);\n }\n return { status: SnapsRegistryStatus.Unverified };\n }\n\n async #get(\n snaps: SnapsRegistryRequest,\n ): Promise<Record<SnapId, SnapsRegistryResult>> {\n return Object.entries(snaps).reduce<\n Promise<Record<SnapId, SnapsRegistryResult>>\n >(async (previousPromise, [snapId, snapInfo]) => {\n const result = await this.#getSingle(snapId, snapInfo);\n const acc = await previousPromise;\n acc[snapId] = result;\n return acc;\n }, Promise.resolve({}));\n }\n\n /**\n * Get metadata for the given snap ID.\n *\n * @param snapId - The ID of the snap to get metadata for.\n * @returns The metadata for the given snap ID, or `null` if the snap is not\n * verified.\n */\n async #getMetadata(snapId: SnapId): Promise<SnapsRegistryMetadata | null> {\n const database = await this.#getDatabase();\n return database?.verifiedSnaps[snapId]?.metadata ?? null;\n }\n\n /**\n * Verify the signature of the registry.\n *\n * @param database - The registry database.\n * @param signature - The signature of the registry.\n * @throws If the signature is invalid.\n * @private\n */\n async #verifySignature(database: string, signature: string) {\n assert(this.#publicKey, 'No public key provided.');\n\n const valid = await verify({\n registry: database,\n signature: JSON.parse(signature),\n publicKey: this.#publicKey,\n });\n\n assert(valid, 'Invalid registry signature.');\n }\n\n /**\n * Fetch the given URL, throwing if the response is not OK.\n *\n * @param url - The URL to fetch.\n * @returns The response body.\n * @private\n */\n async #safeFetch(url: string) {\n const response = await this.#fetchFunction(url);\n if (!response.ok) {\n throw new Error(`Failed to fetch ${url}.`);\n }\n\n return await response.text();\n }\n}\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { BlockReason, SnapsRegistryDatabase } from '@metamask/snaps-registry';
|
|
2
|
+
import { SnapId } from '@metamask/snaps-utils';
|
|
3
|
+
import { SemVerVersion } from '@metamask/utils';
|
|
4
4
|
export declare type SnapsRegistryInfo = {
|
|
5
5
|
version: SemVerVersion;
|
|
6
6
|
checksum: string;
|
|
7
7
|
};
|
|
8
8
|
export declare type SnapsRegistryRequest = Record<SnapId, SnapsRegistryInfo>;
|
|
9
|
-
export declare type SnapsRegistryMetadata = SnapsRegistryDatabase['verifiedSnaps'][
|
|
9
|
+
export declare type SnapsRegistryMetadata = SnapsRegistryDatabase['verifiedSnaps'][SnapId]['metadata'];
|
|
10
10
|
export declare enum SnapsRegistryStatus {
|
|
11
11
|
Unverified = 0,
|
|
12
12
|
Blocked = 1,
|
|
@@ -17,7 +17,7 @@ export declare type SnapsRegistryResult = {
|
|
|
17
17
|
reason?: BlockReason;
|
|
18
18
|
};
|
|
19
19
|
export declare type SnapsRegistry = {
|
|
20
|
-
get(snaps: SnapsRegistryRequest): Promise<Record<
|
|
20
|
+
get(snaps: SnapsRegistryRequest): Promise<Record<SnapId, SnapsRegistryResult>>;
|
|
21
21
|
update(): Promise<void>;
|
|
22
22
|
/**
|
|
23
23
|
* Get metadata for the given snap ID.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SnapsRegistryStatus = void 0;
|
|
4
|
+
// TODO: Decide on names for these
|
|
5
|
+
var SnapsRegistryStatus;
|
|
6
|
+
(function (SnapsRegistryStatus) {
|
|
7
|
+
SnapsRegistryStatus[SnapsRegistryStatus["Unverified"] = 0] = "Unverified";
|
|
8
|
+
SnapsRegistryStatus[SnapsRegistryStatus["Blocked"] = 1] = "Blocked";
|
|
9
|
+
SnapsRegistryStatus[SnapsRegistryStatus["Verified"] = 2] = "Verified";
|
|
10
|
+
})(SnapsRegistryStatus = exports.SnapsRegistryStatus || (exports.SnapsRegistryStatus = {}));
|
|
11
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/snaps/registry/registry.ts"],"names":[],"mappings":";;;AASA,kCAAkC;AAClC,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC7B,yEAAU,CAAA;IACV,mEAAO,CAAA;IACP,qEAAQ,CAAA;AACV,CAAC,EAJW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAI9B","sourcesContent":["import { BlockReason, SnapsRegistryDatabase } from '@metamask/snaps-registry';\nimport { SnapId } from '@metamask/snaps-utils';\nimport { SemVerVersion } from '@metamask/utils';\n\nexport type SnapsRegistryInfo = { version: SemVerVersion; checksum: string };\nexport type SnapsRegistryRequest = Record<SnapId, SnapsRegistryInfo>;\nexport type SnapsRegistryMetadata =\n SnapsRegistryDatabase['verifiedSnaps'][SnapId]['metadata'];\n\n// TODO: Decide on names for these\nexport enum SnapsRegistryStatus {\n Unverified,\n Blocked,\n Verified,\n}\n\nexport type SnapsRegistryResult = {\n status: SnapsRegistryStatus;\n reason?: BlockReason;\n};\n\nexport type SnapsRegistry = {\n get(\n snaps: SnapsRegistryRequest,\n ): Promise<Record<SnapId, SnapsRegistryResult>>;\n\n update(): Promise<void>;\n\n /**\n * Get metadata for the given snap ID.\n *\n * @param snapId - The ID of the snap to get metadata for.\n * @returns The metadata for the given snap ID, or `null` if the snap is not\n * verified.\n */\n getMetadata(snapId: SnapId): Promise<SnapsRegistryMetadata | null>;\n};\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRunnableSnaps = void 0;
|
|
4
|
+
const getRunnableSnaps = (snaps) => snaps.filter((snap) => snap.enabled && !snap.blocked);
|
|
5
|
+
exports.getRunnableSnaps = getRunnableSnaps;
|
|
6
|
+
//# sourceMappingURL=selectors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectors.js","sourceRoot":"","sources":["../../src/snaps/selectors.ts"],"names":[],"mappings":";;;AAEO,MAAM,gBAAgB,GAAG,CAA0B,KAAU,EAAE,EAAE,CACtE,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAD3C,QAAA,gBAAgB,oBAC2B","sourcesContent":["import { TruncatedSnap } from '@metamask/snaps-utils';\n\nexport const getRunnableSnaps = <T extends TruncatedSnap>(snaps: T[]) =>\n snaps.filter((snap) => snap.enabled && !snap.blocked);\n"]}
|
|
@@ -15,7 +15,7 @@ import { Timer } from './snaps/Timer';
|
|
|
15
15
|
*/
|
|
16
16
|
export declare function setDiff<ObjectA extends Record<any, unknown>, ObjectB extends Record<any, unknown>>(objectA: ObjectA, objectB: ObjectB): Diff<ObjectA, ObjectB>;
|
|
17
17
|
/**
|
|
18
|
-
* A Promise that delays
|
|
18
|
+
* A Promise that delays it's return for a given amount of milliseconds.
|
|
19
19
|
*
|
|
20
20
|
* @param ms - Milliseconds to delay the execution for.
|
|
21
21
|
* @param result - The result to return from the Promise after delay.
|
|
@@ -46,7 +46,7 @@ export declare const hasTimedOut: unique symbol;
|
|
|
46
46
|
* @param timerOrMs - The timer controlling the timeout or a ms value.
|
|
47
47
|
* @returns The resolved `PromiseValue`, or the hasTimedOut symbol if
|
|
48
48
|
* returning early.
|
|
49
|
-
* @template PromiseValue - The value of the Promise.
|
|
49
|
+
* @template PromiseValue- - The value of the Promise.
|
|
50
50
|
*/
|
|
51
51
|
export declare function withTimeout<PromiseValue = void>(promise: Promise<PromiseValue>, timerOrMs: Timer | number): Promise<PromiseValue | typeof hasTimedOut>;
|
|
52
52
|
/**
|
|
@@ -72,7 +72,7 @@ export declare function withTimeout<PromiseValue = void>(promise: Promise<Promis
|
|
|
72
72
|
* // t5 = false;
|
|
73
73
|
* ```
|
|
74
74
|
*/
|
|
75
|
-
declare type IsLiteral<
|
|
75
|
+
declare type IsLiteral<T> = T extends string | number | boolean | symbol ? Extract<string | number | boolean | symbol, T> extends never ? true : false : false;
|
|
76
76
|
/**
|
|
77
77
|
* Returns all keys of an object, that are literal, as an union
|
|
78
78
|
*
|
|
@@ -83,9 +83,9 @@ declare type IsLiteral<Type> = Type extends string | number | boolean | symbol ?
|
|
|
83
83
|
* ```
|
|
84
84
|
* @see [Literal types]{@link https://www.typescriptlang.org/docs/handbook/literal-types.html}
|
|
85
85
|
*/
|
|
86
|
-
declare type LiteralKeys<
|
|
87
|
-
[Key in keyof
|
|
88
|
-
}[keyof
|
|
86
|
+
declare type LiteralKeys<T> = NonNullable<{
|
|
87
|
+
[Key in keyof T]: IsLiteral<Key> extends true ? Key : never;
|
|
88
|
+
}[keyof T]>;
|
|
89
89
|
/**
|
|
90
90
|
* Returns all keys of an object, that are not literal, as an union
|
|
91
91
|
*
|
|
@@ -96,9 +96,9 @@ declare type LiteralKeys<Type> = NonNullable<{
|
|
|
96
96
|
* ```
|
|
97
97
|
* @see [Literal types]{@link https://www.typescriptlang.org/docs/handbook/literal-types.html}
|
|
98
98
|
*/
|
|
99
|
-
declare type NonLiteralKeys<
|
|
100
|
-
[Key in keyof
|
|
101
|
-
}[keyof
|
|
99
|
+
declare type NonLiteralKeys<T> = NonNullable<{
|
|
100
|
+
[Key in keyof T]: IsLiteral<Key> extends false ? Key : never;
|
|
101
|
+
}[keyof T]>;
|
|
102
102
|
/**
|
|
103
103
|
* A set difference of two objects based on their keys
|
|
104
104
|
*
|
|
@@ -113,16 +113,16 @@ declare type NonLiteralKeys<Type> = NonNullable<{
|
|
|
113
113
|
* ```
|
|
114
114
|
* @see {@link setDiff} for the main use-case
|
|
115
115
|
*/
|
|
116
|
-
export declare type Diff<
|
|
116
|
+
export declare type Diff<A, B> = Omit<A, LiteralKeys<B>> & Partial<Pick<A, Extract<keyof A, NonLiteralKeys<B>>>>;
|
|
117
117
|
/**
|
|
118
118
|
* Makes every specified property of the specified object type mutable.
|
|
119
119
|
*
|
|
120
|
-
* @template
|
|
120
|
+
* @template T - The object whose readonly properties to make mutable.
|
|
121
121
|
* @template TargetKey - The property key(s) to make mutable.
|
|
122
122
|
*/
|
|
123
|
-
export declare type Mutable<
|
|
124
|
-
-readonly [Key in keyof Pick<
|
|
123
|
+
export declare type Mutable<T extends Record<string, unknown>, TargetKey extends string> = {
|
|
124
|
+
-readonly [Key in keyof Pick<T, TargetKey>]: T[Key];
|
|
125
125
|
} & {
|
|
126
|
-
[Key in keyof Omit<
|
|
126
|
+
[Key in keyof Omit<T, TargetKey>]: T[Key];
|
|
127
127
|
};
|
|
128
128
|
export {};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withTimeout = exports.hasTimedOut = exports.delayWithTimer = exports.delay = exports.setDiff = void 0;
|
|
4
|
+
const Timer_1 = require("./snaps/Timer");
|
|
2
5
|
/**
|
|
3
6
|
* Takes two objects and does a Set Difference of them.
|
|
4
7
|
* Set Difference is generally defined as follows:
|
|
@@ -12,24 +15,28 @@ import { Timer } from './snaps/Timer';
|
|
|
12
15
|
* @param objectA - The object on which the difference is being calculated.
|
|
13
16
|
* @param objectB - The object whose properties will be removed from objectA.
|
|
14
17
|
* @returns The objectA without properties from objectB.
|
|
15
|
-
*/
|
|
16
|
-
|
|
18
|
+
*/
|
|
19
|
+
function setDiff(objectA, objectB) {
|
|
20
|
+
return Object.entries(objectA).reduce((acc, [key, value]) => {
|
|
17
21
|
if (!(key in objectB)) {
|
|
18
22
|
acc[key] = value;
|
|
19
23
|
}
|
|
20
24
|
return acc;
|
|
21
25
|
}, {});
|
|
22
26
|
}
|
|
27
|
+
exports.setDiff = setDiff;
|
|
23
28
|
/**
|
|
24
|
-
* A Promise that delays
|
|
29
|
+
* A Promise that delays it's return for a given amount of milliseconds.
|
|
25
30
|
*
|
|
26
31
|
* @param ms - Milliseconds to delay the execution for.
|
|
27
32
|
* @param result - The result to return from the Promise after delay.
|
|
28
33
|
* @returns A promise that is void if no result provided, result otherwise.
|
|
29
34
|
* @template Result - The `result`.
|
|
30
|
-
*/
|
|
31
|
-
|
|
35
|
+
*/
|
|
36
|
+
function delay(ms, result) {
|
|
37
|
+
return delayWithTimer(new Timer_1.Timer(ms), result);
|
|
32
38
|
}
|
|
39
|
+
exports.delay = delay;
|
|
33
40
|
/**
|
|
34
41
|
* A Promise that delays it's return by using a pausable Timer.
|
|
35
42
|
*
|
|
@@ -37,15 +44,16 @@ import { Timer } from './snaps/Timer';
|
|
|
37
44
|
* @param result - The result to return from the Promise after delay.
|
|
38
45
|
* @returns A promise that is void if no result provided, result otherwise.
|
|
39
46
|
* @template Result - The `result`.
|
|
40
|
-
*/
|
|
47
|
+
*/
|
|
48
|
+
function delayWithTimer(timer, result) {
|
|
41
49
|
let rejectFunc;
|
|
42
|
-
const promise = new Promise((resolve, reject)=>{
|
|
43
|
-
timer.start(()=>{
|
|
50
|
+
const promise = new Promise((resolve, reject) => {
|
|
51
|
+
timer.start(() => {
|
|
44
52
|
result === undefined ? resolve() : resolve(result);
|
|
45
53
|
});
|
|
46
54
|
rejectFunc = reject;
|
|
47
55
|
});
|
|
48
|
-
promise.cancel = ()=>{
|
|
56
|
+
promise.cancel = () => {
|
|
49
57
|
if (timer.status !== 'finished') {
|
|
50
58
|
timer.cancel();
|
|
51
59
|
rejectFunc(new Error('The delay has been canceled.'));
|
|
@@ -53,10 +61,12 @@ import { Timer } from './snaps/Timer';
|
|
|
53
61
|
};
|
|
54
62
|
return promise;
|
|
55
63
|
}
|
|
64
|
+
exports.delayWithTimer = delayWithTimer;
|
|
56
65
|
/*
|
|
57
66
|
* We use a Symbol instead of rejecting the promise so that Errors thrown
|
|
58
67
|
* by the main promise will propagate.
|
|
59
|
-
*/
|
|
68
|
+
*/
|
|
69
|
+
exports.hasTimedOut = Symbol('Used to check if the requested promise has timeout (see withTimeout)');
|
|
60
70
|
/**
|
|
61
71
|
* Executes the given Promise, if the Timer expires before the Promise settles, we return earlier.
|
|
62
72
|
*
|
|
@@ -66,18 +76,17 @@ import { Timer } from './snaps/Timer';
|
|
|
66
76
|
* @param timerOrMs - The timer controlling the timeout or a ms value.
|
|
67
77
|
* @returns The resolved `PromiseValue`, or the hasTimedOut symbol if
|
|
68
78
|
* returning early.
|
|
69
|
-
* @template PromiseValue - The value of the Promise.
|
|
70
|
-
*/
|
|
71
|
-
|
|
72
|
-
const
|
|
79
|
+
* @template PromiseValue- - The value of the Promise.
|
|
80
|
+
*/
|
|
81
|
+
async function withTimeout(promise, timerOrMs) {
|
|
82
|
+
const timer = typeof timerOrMs === 'number' ? new Timer_1.Timer(timerOrMs) : timerOrMs;
|
|
83
|
+
const delayPromise = delayWithTimer(timer, exports.hasTimedOut);
|
|
73
84
|
try {
|
|
74
|
-
return await Promise.race([
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
]);
|
|
78
|
-
} finally{
|
|
85
|
+
return await Promise.race([promise, delayPromise]);
|
|
86
|
+
}
|
|
87
|
+
finally {
|
|
79
88
|
delayPromise.cancel();
|
|
80
89
|
}
|
|
81
90
|
}
|
|
82
|
-
|
|
91
|
+
exports.withTimeout = withTimeout;
|
|
83
92
|
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AAEtC;;;;;;;;;;;;;GAaG;AACH,SAAgB,OAAO,CAGrB,OAAgB,EAAE,OAAgB;IAClC,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CACnC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;QACpB,IAAI,CAAC,CAAC,GAAG,IAAI,OAAO,CAAC,EAAE;YACrB,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;SAClB;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EACD,EAAE,CACuB,CAAC;AAC9B,CAAC;AAbD,0BAaC;AAED;;;;;;;GAOG;AACH,SAAgB,KAAK,CACnB,EAAU,EACV,MAAe;IAEf,OAAO,cAAc,CAAC,IAAI,aAAK,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;AAC/C,CAAC;AALD,sBAKC;AAED;;;;;;;GAOG;AACH,SAAgB,cAAc,CAC5B,KAAY,EACZ,MAAe;IAEf,IAAI,UAAmC,CAAC;IACxC,MAAM,OAAO,GAAQ,IAAI,OAAO,CAAS,CAAC,OAAY,EAAE,MAAM,EAAE,EAAE;QAChE,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE;YACf,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;QACH,UAAU,GAAG,MAAM,CAAC;IACtB,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,MAAM,GAAG,GAAG,EAAE;QACpB,IAAI,KAAK,CAAC,MAAM,KAAK,UAAU,EAAE;YAC/B,KAAK,CAAC,MAAM,EAAE,CAAC;YACf,UAAU,CAAC,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC,CAAC;SACvD;IACH,CAAC,CAAC;IACF,OAAO,OAAO,CAAC;AACjB,CAAC;AAnBD,wCAmBC;AAED;;;GAGG;AACU,QAAA,WAAW,GAAG,MAAM,CAC/B,sEAAsE,CACvE,CAAC;AAEF;;;;;;;;;;GAUG;AACI,KAAK,UAAU,WAAW,CAC/B,OAA8B,EAC9B,SAAyB;IAEzB,MAAM,KAAK,GACT,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,aAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACnE,MAAM,YAAY,GAAG,cAAc,CAAC,KAAK,EAAE,mBAAW,CAAC,CAAC;IACxD,IAAI;QACF,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;KACpD;YAAS;QACR,YAAY,CAAC,MAAM,EAAE,CAAC;KACvB;AACH,CAAC;AAZD,kCAYC","sourcesContent":["import { Timer } from './snaps/Timer';\n\n/**\n * Takes two objects and does a Set Difference of them.\n * Set Difference is generally defined as follows:\n * ```\n * 𝑥 ∈ A ∖ B ⟺ 𝑥 ∈ A ∧ 𝑥 ∉ B\n * ```\n * Meaning that the returned object contains all properties of A expect those that also\n * appear in B. Notice that properties that appear in B, but not in A, have no effect.\n *\n * @see [Set Difference]{@link https://proofwiki.org/wiki/Definition:Set_Difference}\n * @param objectA - The object on which the difference is being calculated.\n * @param objectB - The object whose properties will be removed from objectA.\n * @returns The objectA without properties from objectB.\n */\nexport function setDiff<\n ObjectA extends Record<any, unknown>,\n ObjectB extends Record<any, unknown>,\n>(objectA: ObjectA, objectB: ObjectB): Diff<ObjectA, ObjectB> {\n return Object.entries(objectA).reduce<Record<any, unknown>>(\n (acc, [key, value]) => {\n if (!(key in objectB)) {\n acc[key] = value;\n }\n return acc;\n },\n {},\n ) as Diff<ObjectA, ObjectB>;\n}\n\n/**\n * A Promise that delays it's return for a given amount of milliseconds.\n *\n * @param ms - Milliseconds to delay the execution for.\n * @param result - The result to return from the Promise after delay.\n * @returns A promise that is void if no result provided, result otherwise.\n * @template Result - The `result`.\n */\nexport function delay<Result = void>(\n ms: number,\n result?: Result,\n): Promise<Result> & { cancel: () => void } {\n return delayWithTimer(new Timer(ms), result);\n}\n\n/**\n * A Promise that delays it's return by using a pausable Timer.\n *\n * @param timer - Timer used to control the delay.\n * @param result - The result to return from the Promise after delay.\n * @returns A promise that is void if no result provided, result otherwise.\n * @template Result - The `result`.\n */\nexport function delayWithTimer<Result = void>(\n timer: Timer,\n result?: Result,\n): Promise<Result> & { cancel: () => void } {\n let rejectFunc: (reason: Error) => void;\n const promise: any = new Promise<Result>((resolve: any, reject) => {\n timer.start(() => {\n result === undefined ? resolve() : resolve(result);\n });\n rejectFunc = reject;\n });\n\n promise.cancel = () => {\n if (timer.status !== 'finished') {\n timer.cancel();\n rejectFunc(new Error('The delay has been canceled.'));\n }\n };\n return promise;\n}\n\n/*\n * We use a Symbol instead of rejecting the promise so that Errors thrown\n * by the main promise will propagate.\n */\nexport const hasTimedOut = Symbol(\n 'Used to check if the requested promise has timeout (see withTimeout)',\n);\n\n/**\n * Executes the given Promise, if the Timer expires before the Promise settles, we return earlier.\n *\n * NOTE:** The given Promise is not cancelled or interrupted, and will continue to execute uninterrupted. We will just discard its result if it does not complete before the timeout.\n *\n * @param promise - The promise that you want to execute.\n * @param timerOrMs - The timer controlling the timeout or a ms value.\n * @returns The resolved `PromiseValue`, or the hasTimedOut symbol if\n * returning early.\n * @template PromiseValue- - The value of the Promise.\n */\nexport async function withTimeout<PromiseValue = void>(\n promise: Promise<PromiseValue>,\n timerOrMs: Timer | number,\n): Promise<PromiseValue | typeof hasTimedOut> {\n const timer =\n typeof timerOrMs === 'number' ? new Timer(timerOrMs) : timerOrMs;\n const delayPromise = delayWithTimer(timer, hasTimedOut);\n try {\n return await Promise.race([promise, delayPromise]);\n } finally {\n delayPromise.cancel();\n }\n}\n\n/**\n * Checks whether the type is composed of literal types\n *\n * @returns @type {true} if whole type is composed of literals, @type {false} if whole type is not literals, @type {boolean} if mixed\n * @example\n * ```\n * type t1 = IsLiteral<1 | 2 | \"asd\" | true>;\n * // t1 = true\n *\n * type t2 = IsLiteral<number | string>;\n * // t2 = false\n *\n * type t3 = IsLiteral<1 | string>;\n * // t3 = boolean\n *\n * const s = Symbol();\n * type t4 = IsLiteral<typeof s>;\n * // t4 = true\n *\n * type t5 = IsLiteral<symbol>\n * // t5 = false;\n * ```\n */\ntype IsLiteral<T> = T extends string | number | boolean | symbol\n ? Extract<string | number | boolean | symbol, T> extends never\n ? true\n : false\n : false;\n\n/**\n * Returns all keys of an object, that are literal, as an union\n *\n * @example\n * ```\n * type t1 = _LiteralKeys<{a: number, b: 0, c: 'foo', d: string}>\n * // t1 = 'b' | 'c'\n * ```\n * @see [Literal types]{@link https://www.typescriptlang.org/docs/handbook/literal-types.html}\n */\ntype LiteralKeys<T> = NonNullable<\n {\n [Key in keyof T]: IsLiteral<Key> extends true ? Key : never;\n }[keyof T]\n>;\n\n/**\n * Returns all keys of an object, that are not literal, as an union\n *\n * @example\n * ```\n * type t1 = _NonLiteralKeys<{a: number, b: 0, c: 'foo', d: string}>\n * // t1 = 'a' | 'd'\n * ```\n * @see [Literal types]{@link https://www.typescriptlang.org/docs/handbook/literal-types.html}\n */\ntype NonLiteralKeys<T> = NonNullable<\n {\n [Key in keyof T]: IsLiteral<Key> extends false ? Key : never;\n }[keyof T]\n>;\n\n/**\n * A set difference of two objects based on their keys\n *\n * @example\n * ```\n * type t1 = Diff<{a: string, b: string}, {a: number}>\n * // t1 = {b: string};\n * type t2 = Diff<{a: string, 0: string}, Record<string, unknown>>;\n * // t2 = { a?: string, 0: string};\n * type t3 = Diff<{a: string, 0: string, 1: string}, Record<1 | string, unknown>>;\n * // t3 = {a?: string, 0: string}\n * ```\n * @see {@link setDiff} for the main use-case\n */\nexport type Diff<A, B> = Omit<A, LiteralKeys<B>> &\n Partial<Pick<A, Extract<keyof A, NonLiteralKeys<B>>>>;\n\n/**\n * Makes every specified property of the specified object type mutable.\n *\n * @template T - The object whose readonly properties to make mutable.\n * @template TargetKey - The property key(s) to make mutable.\n */\nexport type Mutable<\n T extends Record<string, unknown>,\n TargetKey extends string,\n> = {\n -readonly [Key in keyof Pick<T, TargetKey>]: T[Key];\n} & {\n [Key in keyof Omit<T, TargetKey>]: T[Key];\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask/snaps-controllers",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Controllers for MetaMask Snaps.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/MetaMask/snaps.git"
|
|
8
8
|
},
|
|
9
|
-
"
|
|
10
|
-
"main": "./dist/cjs/index.js",
|
|
11
|
-
"module": "./dist/esm/index.js",
|
|
9
|
+
"main": "dist/index.js",
|
|
12
10
|
"browser": {
|
|
13
|
-
"./dist/
|
|
14
|
-
"./dist/esm/services": "./dist/esm/services/browser.js"
|
|
11
|
+
"./dist/services": "./dist/services/browser.js"
|
|
15
12
|
},
|
|
16
|
-
"types": "
|
|
13
|
+
"types": "dist/index.d.ts",
|
|
17
14
|
"files": [
|
|
18
|
-
"dist/
|
|
19
|
-
"dist/esm/**",
|
|
20
|
-
"dist/types/**"
|
|
15
|
+
"dist/"
|
|
21
16
|
],
|
|
22
17
|
"scripts": {
|
|
23
18
|
"test:prepare": "yarn mkdirp test/fixtures && ./scripts/generate-fixtures.sh",
|
|
@@ -25,21 +20,18 @@
|
|
|
25
20
|
"posttest": "ts-node scripts/coverage.ts && rimraf coverage/jest coverage/wdio",
|
|
26
21
|
"test:browser": "wdio run wdio.config.ts",
|
|
27
22
|
"test:ci": "yarn test",
|
|
28
|
-
"build": "
|
|
29
|
-
"build
|
|
30
|
-
"build:types": "tsc --project tsconfig.build.json",
|
|
31
|
-
"build:esm": "swc src --out-dir dist/esm --config-file ../../.swcrc.build.json --config module.type=es6",
|
|
32
|
-
"build:cjs": "swc src --out-dir dist/cjs --config-file ../../.swcrc.build.json --config module.type=commonjs",
|
|
23
|
+
"build:tsc": "tsc --project tsconfig.build.json",
|
|
24
|
+
"build": "yarn build:tsc",
|
|
33
25
|
"build:clean": "yarn clean && yarn build",
|
|
34
|
-
"clean": "rimraf '*.tsbuildinfo' 'dist'",
|
|
35
|
-
"lint:eslint": "eslint . --cache --ext js,ts
|
|
36
|
-
"lint:misc": "prettier
|
|
37
|
-
"lint": "yarn lint:eslint && yarn lint:misc --check
|
|
26
|
+
"clean": "rimraf '*.tsbuildinfo' 'dist/*'",
|
|
27
|
+
"lint:eslint": "eslint . --cache --ext js,ts",
|
|
28
|
+
"lint:misc": "prettier '**/*.json' '**/*.md' '!CHANGELOG.md' --ignore-path ../../.gitignore",
|
|
29
|
+
"lint": "yarn lint:eslint && yarn lint:misc --check",
|
|
38
30
|
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write",
|
|
39
|
-
"lint:changelog": "
|
|
31
|
+
"lint:changelog": "yarn auto-changelog validate",
|
|
40
32
|
"prepare-manifest:preview": "../../scripts/prepare-preview-manifest.sh",
|
|
41
33
|
"publish:preview": "yarn npm publish --tag preview",
|
|
42
|
-
"
|
|
34
|
+
"publish:package": "../../scripts/publish-package.sh"
|
|
43
35
|
},
|
|
44
36
|
"dependencies": {
|
|
45
37
|
"@metamask/approval-controller": "^3.0.0",
|
|
@@ -47,15 +39,15 @@
|
|
|
47
39
|
"@metamask/object-multiplex": "^1.2.0",
|
|
48
40
|
"@metamask/permission-controller": "^4.0.0",
|
|
49
41
|
"@metamask/post-message-stream": "^6.1.2",
|
|
50
|
-
"@metamask/rpc-methods": "^0.
|
|
51
|
-
"@metamask/snaps-execution-environments": "^0.
|
|
42
|
+
"@metamask/rpc-methods": "^1.0.0",
|
|
43
|
+
"@metamask/snaps-execution-environments": "^1.0.0",
|
|
52
44
|
"@metamask/snaps-registry": "^1.2.1",
|
|
53
|
-
"@metamask/snaps-utils": "^0.
|
|
45
|
+
"@metamask/snaps-utils": "^1.0.0",
|
|
54
46
|
"@metamask/utils": "^6.0.1",
|
|
55
47
|
"@xstate/fsm": "^2.0.0",
|
|
56
48
|
"concat-stream": "^2.0.0",
|
|
57
49
|
"cron-parser": "^4.5.0",
|
|
58
|
-
"eth-rpc-errors": "^4.0.
|
|
50
|
+
"eth-rpc-errors": "^4.0.2",
|
|
59
51
|
"gunzip-maybe": "^1.4.2",
|
|
60
52
|
"immer": "^9.0.6",
|
|
61
53
|
"json-rpc-engine": "^6.1.0",
|
|
@@ -68,44 +60,37 @@
|
|
|
68
60
|
"devDependencies": {
|
|
69
61
|
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
|
|
70
62
|
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
|
|
71
|
-
"@lavamoat/allow-scripts": "^2.3
|
|
63
|
+
"@lavamoat/allow-scripts": "^2.0.3",
|
|
72
64
|
"@metamask/auto-changelog": "^3.1.0",
|
|
73
|
-
"@metamask/eslint-config": "^
|
|
74
|
-
"@metamask/eslint-config-jest": "^
|
|
75
|
-
"@metamask/eslint-config-nodejs": "^
|
|
76
|
-
"@metamask/eslint-config-typescript": "^
|
|
65
|
+
"@metamask/eslint-config": "^11.0.0",
|
|
66
|
+
"@metamask/eslint-config-jest": "^11.0.0",
|
|
67
|
+
"@metamask/eslint-config-nodejs": "^11.0.1",
|
|
68
|
+
"@metamask/eslint-config-typescript": "^11.0.0",
|
|
77
69
|
"@metamask/template-snap": "^0.7.0",
|
|
78
70
|
"@peculiar/webcrypto": "^1.3.3",
|
|
79
|
-
"@swc/cli": "^0.1.62",
|
|
80
|
-
"@swc/core": "^1.3.66",
|
|
81
|
-
"@swc/jest": "^0.2.26",
|
|
82
|
-
"@types/chrome": "^0.0.237",
|
|
83
71
|
"@types/concat-stream": "^2.0.0",
|
|
84
72
|
"@types/gunzip-maybe": "^1.4.0",
|
|
85
73
|
"@types/jest": "^27.5.1",
|
|
86
74
|
"@types/mocha": "^10.0.1",
|
|
87
|
-
"@types/node": "^20.3.1",
|
|
88
75
|
"@types/pump": "^1.1.1",
|
|
89
76
|
"@types/readable-stream": "^2.3.15",
|
|
90
77
|
"@types/tar-stream": "^2.2.2",
|
|
91
78
|
"@typescript-eslint/eslint-plugin": "^5.42.1",
|
|
92
79
|
"@typescript-eslint/parser": "^5.42.1",
|
|
93
|
-
"@wdio/browser-runner": "^8.
|
|
94
|
-
"@wdio/cli": "^8.
|
|
95
|
-
"@wdio/globals": "^8.
|
|
96
|
-
"@wdio/mocha-framework": "^8.
|
|
97
|
-
"@wdio/spec-reporter": "^8.
|
|
98
|
-
"@wdio/static-server-service": "^8.
|
|
80
|
+
"@wdio/browser-runner": "^8.3.10",
|
|
81
|
+
"@wdio/cli": "^8.3.10",
|
|
82
|
+
"@wdio/globals": "^8.3.10",
|
|
83
|
+
"@wdio/mocha-framework": "^8.3.0",
|
|
84
|
+
"@wdio/spec-reporter": "^8.3.0",
|
|
85
|
+
"@wdio/static-server-service": "^8.3.0",
|
|
99
86
|
"deepmerge": "^4.2.2",
|
|
100
|
-
"esbuild": "^0.17.15",
|
|
101
87
|
"eslint": "^8.27.0",
|
|
102
88
|
"eslint-config-prettier": "^8.5.0",
|
|
103
89
|
"eslint-plugin-import": "^2.26.0",
|
|
104
90
|
"eslint-plugin-jest": "^27.1.5",
|
|
105
91
|
"eslint-plugin-jsdoc": "^39.6.2",
|
|
106
|
-
"eslint-plugin-
|
|
92
|
+
"eslint-plugin-node": "^11.1.0",
|
|
107
93
|
"eslint-plugin-prettier": "^4.2.1",
|
|
108
|
-
"eslint-plugin-promise": "^6.1.1",
|
|
109
94
|
"expect-webdriverio": "^4.1.2",
|
|
110
95
|
"istanbul-lib-coverage": "^3.2.0",
|
|
111
96
|
"istanbul-lib-report": "^3.0.0",
|
|
@@ -116,15 +101,16 @@
|
|
|
116
101
|
"mkdirp": "^1.0.4",
|
|
117
102
|
"prettier": "^2.7.1",
|
|
118
103
|
"prettier-plugin-packagejson": "^2.2.11",
|
|
119
|
-
"rimraf": "^
|
|
104
|
+
"rimraf": "^3.0.2",
|
|
120
105
|
"serve-handler": "^6.1.5",
|
|
106
|
+
"ts-jest": "^29.0.0",
|
|
121
107
|
"ts-node": "^10.9.1",
|
|
122
108
|
"typescript": "~4.8.4",
|
|
123
109
|
"vite": "^4.3.9",
|
|
124
110
|
"vite-tsconfig-paths": "^4.0.5",
|
|
125
111
|
"wdio-chromedriver-service": "^8.1.1",
|
|
126
112
|
"wdio-geckodriver-service": "^4.1.0",
|
|
127
|
-
"webdriverio": "^8.
|
|
113
|
+
"webdriverio": "^8.3.10"
|
|
128
114
|
},
|
|
129
115
|
"engines": {
|
|
130
116
|
"node": ">=16.0.0"
|