@metamask/snaps-rpc-methods 10.0.0 → 11.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 +14 -1
- package/dist/{chunk-SYUGPLEP.js → chunk-6XKVFSC2.js} +4 -4
- package/dist/chunk-6XKVFSC2.js.map +1 -0
- package/dist/{chunk-IZYMBIBD.mjs → chunk-AMMJ744B.mjs} +4 -4
- package/dist/chunk-AMMJ744B.mjs.map +1 -0
- package/dist/{chunk-HZQ34FQT.js → chunk-CDAVFOUS.js} +9 -5
- package/dist/chunk-CDAVFOUS.js.map +1 -0
- package/dist/chunk-FM4LNQR7.mjs +34 -0
- package/dist/chunk-FM4LNQR7.mjs.map +1 -0
- package/dist/{chunk-BSAXPL2T.mjs → chunk-GEJDXRTL.mjs} +3 -3
- package/dist/{chunk-FNUO7MQ4.mjs → chunk-K3UL5RVN.mjs} +5 -5
- package/dist/{chunk-6VJVURH5.js → chunk-LP3RWEDJ.js} +4 -4
- package/dist/{chunk-4TUORIA6.js → chunk-PK2RPAXI.js} +6 -6
- package/dist/chunk-RHPSYX7X.js +34 -0
- package/dist/chunk-RHPSYX7X.js.map +1 -0
- package/dist/{chunk-SYB5TG5O.mjs → chunk-V3KRSCUK.mjs} +10 -6
- package/dist/chunk-V3KRSCUK.mjs.map +1 -0
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -8
- package/dist/index.mjs.map +1 -1
- package/dist/permissions.js +8 -7
- package/dist/permissions.mjs +7 -6
- package/dist/restricted/caveats/index.js +3 -3
- package/dist/restricted/caveats/index.mjs +2 -2
- package/dist/restricted/getLocale.js +2 -2
- package/dist/restricted/getLocale.mjs +1 -1
- package/dist/restricted/getPreferences.js +11 -0
- package/dist/restricted/getPreferences.js.map +1 -0
- package/dist/restricted/getPreferences.mjs +11 -0
- package/dist/restricted/getPreferences.mjs.map +1 -0
- package/dist/restricted/index.js +9 -8
- package/dist/restricted/index.mjs +8 -7
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/endowments/caveats/generic.d.ts +2 -2
- package/dist/types/endowments/rpc.d.ts +1 -1
- package/dist/types/permitted/createInterface.d.ts +16 -2
- package/dist/types/permitted/getAllSnaps.d.ts +1 -1
- package/dist/types/permitted/getClientStatus.d.ts +1 -1
- package/dist/types/permitted/getFile.d.ts +2 -2
- package/dist/types/permitted/getInterfaceState.d.ts +2 -2
- package/dist/types/permitted/getSnaps.d.ts +1 -1
- package/dist/types/permitted/index.d.ts +1 -1
- package/dist/types/permitted/invokeKeyring.d.ts +1 -1
- package/dist/types/permitted/invokeSnapSugar.d.ts +1 -1
- package/dist/types/permitted/requestSnaps.d.ts +1 -1
- package/dist/types/permitted/resolveInterface.d.ts +2 -2
- package/dist/types/permitted/updateInterface.d.ts +16 -2
- package/dist/types/restricted/dialog.d.ts +121 -9
- package/dist/types/restricted/getBip32Entropy.d.ts +2 -2
- package/dist/types/restricted/getBip32PublicKey.d.ts +2 -2
- package/dist/types/restricted/getBip44Entropy.d.ts +2 -2
- package/dist/types/restricted/getEntropy.d.ts +3 -3
- package/dist/types/restricted/getLocale.d.ts +8 -7
- package/dist/types/restricted/getPreferences.d.ts +48 -0
- package/dist/types/restricted/index.d.ts +15 -1
- package/dist/types/restricted/invokeSnap.d.ts +6 -6
- package/dist/types/restricted/manageAccounts.d.ts +4 -4
- package/dist/types/restricted/manageState.d.ts +4 -4
- package/dist/types/restricted/notify.d.ts +4 -4
- package/dist/types/utils.d.ts +3 -3
- package/package.json +6 -6
- package/dist/chunk-HZQ34FQT.js.map +0 -1
- package/dist/chunk-IZYMBIBD.mjs.map +0 -1
- package/dist/chunk-SYB5TG5O.mjs.map +0 -1
- package/dist/chunk-SYUGPLEP.js.map +0 -1
- /package/dist/{chunk-BSAXPL2T.mjs.map → chunk-GEJDXRTL.mjs.map} +0 -0
- /package/dist/{chunk-FNUO7MQ4.mjs.map → chunk-K3UL5RVN.mjs.map} +0 -0
- /package/dist/{chunk-6VJVURH5.js.map → chunk-LP3RWEDJ.js.map} +0 -0
- /package/dist/{chunk-4TUORIA6.js.map → chunk-PK2RPAXI.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [11.0.0]
|
|
10
|
+
### Added
|
|
11
|
+
- **BREAKING:** Add `snap_getPreferences` ([#2607](https://github.com/MetaMask/snaps/pull/2607))
|
|
12
|
+
- This is breaking because a `getPreferences` method hook is now required.
|
|
13
|
+
|
|
14
|
+
## [10.0.1]
|
|
15
|
+
### Changed
|
|
16
|
+
- Bump `@metamask/json-rpc-engine` from `^9.0.0` to `^9.0.2` ([#2593](https://github.com/metamask/snaps/pull/2593))
|
|
17
|
+
- Bump `@metamask/permission-controller` from `^10.0.1` to `^11.0.0` ([#2593](https://github.com/metamask/snaps/pull/2593))
|
|
18
|
+
- Bump `@metamask/snaps-utils` from `^7.8.0` to `^7.8.1` ([#2595](https://github.com/MetaMask/snaps/pull/2595))
|
|
19
|
+
|
|
9
20
|
## [10.0.0]
|
|
10
21
|
### Added
|
|
11
22
|
- **BREAKING:** `snap_dialog` now takes the `requestUserApproval` hook ([#2509](https://github.com/metamask/snaps/pull/2509))
|
|
@@ -178,7 +189,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
178
189
|
- The version of the package no longer needs to match the version of all other
|
|
179
190
|
MetaMask Snaps packages.
|
|
180
191
|
|
|
181
|
-
[Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-rpc-methods@
|
|
192
|
+
[Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-rpc-methods@11.0.0...HEAD
|
|
193
|
+
[11.0.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-rpc-methods@10.0.1...@metamask/snaps-rpc-methods@11.0.0
|
|
194
|
+
[10.0.1]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-rpc-methods@10.0.0...@metamask/snaps-rpc-methods@10.0.1
|
|
182
195
|
[10.0.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-rpc-methods@9.1.4...@metamask/snaps-rpc-methods@10.0.0
|
|
183
196
|
[9.1.4]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-rpc-methods@9.1.3...@metamask/snaps-rpc-methods@9.1.4
|
|
184
197
|
[9.1.3]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-rpc-methods@9.1.2...@metamask/snaps-rpc-methods@9.1.3
|
|
@@ -11,16 +11,16 @@ var specificationBuilder = ({ allowedCaveats = null, methodHooks: methodHooks2 }
|
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
var methodHooks = {
|
|
14
|
-
|
|
14
|
+
getPreferences: true
|
|
15
15
|
};
|
|
16
16
|
var getLocaleBuilder = Object.freeze({
|
|
17
17
|
targetName: methodName,
|
|
18
18
|
specificationBuilder,
|
|
19
19
|
methodHooks
|
|
20
20
|
});
|
|
21
|
-
function getImplementation({
|
|
21
|
+
function getImplementation({ getPreferences }) {
|
|
22
22
|
return async function implementation(_args) {
|
|
23
|
-
return
|
|
23
|
+
return getPreferences().locale;
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -29,4 +29,4 @@ function getImplementation({ getLocale }) {
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
exports.specificationBuilder = specificationBuilder; exports.getLocaleBuilder = getLocaleBuilder; exports.getImplementation = getImplementation;
|
|
32
|
-
//# sourceMappingURL=chunk-
|
|
32
|
+
//# sourceMappingURL=chunk-6XKVFSC2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/restricted/getLocale.ts"],"names":["methodHooks"],"mappings":";AAMA,SAAS,gBAAgB,mBAAmB;AAS5C,IAAM,aAAa;AA4BZ,IAAM,uBAIT,CAAC,EAAE,iBAAiB,MAAM,aAAAA,aAAY,MAAmC;AAC3E,SAAO;AAAA,IACL,gBAAgB,eAAe;AAAA,IAC/B,YAAY;AAAA,IACZ;AAAA,IACA,sBAAsB,kBAAkBA,YAAW;AAAA,IACnD,cAAc,CAAC,YAAY,IAAI;AAAA,EACjC;AACF;AAEA,IAAM,cAAuD;AAAA,EAC3D,gBAAgB;AAClB;AAEO,IAAM,mBAAmB,OAAO,OAAO;AAAA,EAC5C,YAAY;AAAA,EACZ;AAAA,EACA;AACF,CAAU;AASH,SAAS,kBAAkB,EAAE,eAAe,GAAyB;AAC1E,SAAO,eAAe,eACpB,OAC0B;AAC1B,WAAO,eAAe,EAAE;AAAA,EAC1B;AACF","sourcesContent":["import type {\n PermissionSpecificationBuilder,\n ValidPermissionSpecification,\n RestrictedMethodOptions,\n RestrictedMethodParameters,\n} from '@metamask/permission-controller';\nimport { PermissionType, SubjectType } from '@metamask/permission-controller';\nimport type {\n GetLocaleResult,\n GetPreferencesResult,\n} from '@metamask/snaps-sdk';\nimport type { NonEmptyArray } from '@metamask/utils';\n\nimport type { MethodHooksObject } from '../utils';\n\nconst methodName = 'snap_getLocale';\n\nexport type GetLocaleMethodHooks = {\n getPreferences: () => GetPreferencesResult;\n};\n\ntype SpecificationBuilderOptions = {\n allowedCaveats?: Readonly<NonEmptyArray<string>> | null;\n methodHooks: GetLocaleMethodHooks;\n};\n\ntype Specification = ValidPermissionSpecification<{\n permissionType: PermissionType.RestrictedMethod;\n targetName: typeof methodName;\n methodImplementation: ReturnType<typeof getImplementation>;\n allowedCaveats: Readonly<NonEmptyArray<string>> | null;\n}>;\n\n/**\n * The specification builder for the `snap_getLocale` permission.\n * `snap_getLocale` allows snaps to get the user selected locale.\n *\n * @param options - The specification builder options.\n * @param options.allowedCaveats - The optional allowed caveats for the permission.\n * @param options.methodHooks - The RPC method hooks needed by the method implementation.\n * @returns The specification for the `snap_getLocale` permission.\n * @deprecated - To be removed in favor of `snap_getPreferences`.\n */\nexport const specificationBuilder: PermissionSpecificationBuilder<\n PermissionType.RestrictedMethod,\n SpecificationBuilderOptions,\n Specification\n> = ({ allowedCaveats = null, methodHooks }: SpecificationBuilderOptions) => {\n return {\n permissionType: PermissionType.RestrictedMethod,\n targetName: methodName,\n allowedCaveats,\n methodImplementation: getImplementation(methodHooks),\n subjectTypes: [SubjectType.Snap],\n };\n};\n\nconst methodHooks: MethodHooksObject<GetLocaleMethodHooks> = {\n getPreferences: true,\n};\n\nexport const getLocaleBuilder = Object.freeze({\n targetName: methodName,\n specificationBuilder,\n methodHooks,\n} as const);\n\n/**\n * Builds the method implementation for `snap_getLocale`.\n *\n * @param hooks - The RPC method hooks.\n * @param hooks.getPreferences - A function that returns the user selected preferences.\n * @returns The user selected locale.\n */\nexport function getImplementation({ getPreferences }: GetLocaleMethodHooks) {\n return async function implementation(\n _args: RestrictedMethodOptions<RestrictedMethodParameters>,\n ): Promise<GetLocaleResult> {\n return getPreferences().locale;\n };\n}\n"]}
|
|
@@ -11,16 +11,16 @@ var specificationBuilder = ({ allowedCaveats = null, methodHooks: methodHooks2 }
|
|
|
11
11
|
};
|
|
12
12
|
};
|
|
13
13
|
var methodHooks = {
|
|
14
|
-
|
|
14
|
+
getPreferences: true
|
|
15
15
|
};
|
|
16
16
|
var getLocaleBuilder = Object.freeze({
|
|
17
17
|
targetName: methodName,
|
|
18
18
|
specificationBuilder,
|
|
19
19
|
methodHooks
|
|
20
20
|
});
|
|
21
|
-
function getImplementation({
|
|
21
|
+
function getImplementation({ getPreferences }) {
|
|
22
22
|
return async function implementation(_args) {
|
|
23
|
-
return
|
|
23
|
+
return getPreferences().locale;
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -29,4 +29,4 @@ export {
|
|
|
29
29
|
getLocaleBuilder,
|
|
30
30
|
getImplementation
|
|
31
31
|
};
|
|
32
|
-
//# sourceMappingURL=chunk-
|
|
32
|
+
//# sourceMappingURL=chunk-AMMJ744B.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/restricted/getLocale.ts"],"sourcesContent":["import type {\n PermissionSpecificationBuilder,\n ValidPermissionSpecification,\n RestrictedMethodOptions,\n RestrictedMethodParameters,\n} from '@metamask/permission-controller';\nimport { PermissionType, SubjectType } from '@metamask/permission-controller';\nimport type {\n GetLocaleResult,\n GetPreferencesResult,\n} from '@metamask/snaps-sdk';\nimport type { NonEmptyArray } from '@metamask/utils';\n\nimport type { MethodHooksObject } from '../utils';\n\nconst methodName = 'snap_getLocale';\n\nexport type GetLocaleMethodHooks = {\n getPreferences: () => GetPreferencesResult;\n};\n\ntype SpecificationBuilderOptions = {\n allowedCaveats?: Readonly<NonEmptyArray<string>> | null;\n methodHooks: GetLocaleMethodHooks;\n};\n\ntype Specification = ValidPermissionSpecification<{\n permissionType: PermissionType.RestrictedMethod;\n targetName: typeof methodName;\n methodImplementation: ReturnType<typeof getImplementation>;\n allowedCaveats: Readonly<NonEmptyArray<string>> | null;\n}>;\n\n/**\n * The specification builder for the `snap_getLocale` permission.\n * `snap_getLocale` allows snaps to get the user selected locale.\n *\n * @param options - The specification builder options.\n * @param options.allowedCaveats - The optional allowed caveats for the permission.\n * @param options.methodHooks - The RPC method hooks needed by the method implementation.\n * @returns The specification for the `snap_getLocale` permission.\n * @deprecated - To be removed in favor of `snap_getPreferences`.\n */\nexport const specificationBuilder: PermissionSpecificationBuilder<\n PermissionType.RestrictedMethod,\n SpecificationBuilderOptions,\n Specification\n> = ({ allowedCaveats = null, methodHooks }: SpecificationBuilderOptions) => {\n return {\n permissionType: PermissionType.RestrictedMethod,\n targetName: methodName,\n allowedCaveats,\n methodImplementation: getImplementation(methodHooks),\n subjectTypes: [SubjectType.Snap],\n };\n};\n\nconst methodHooks: MethodHooksObject<GetLocaleMethodHooks> = {\n getPreferences: true,\n};\n\nexport const getLocaleBuilder = Object.freeze({\n targetName: methodName,\n specificationBuilder,\n methodHooks,\n} as const);\n\n/**\n * Builds the method implementation for `snap_getLocale`.\n *\n * @param hooks - The RPC method hooks.\n * @param hooks.getPreferences - A function that returns the user selected preferences.\n * @returns The user selected locale.\n */\nexport function getImplementation({ getPreferences }: GetLocaleMethodHooks) {\n return async function implementation(\n _args: RestrictedMethodOptions<RestrictedMethodParameters>,\n ): Promise<GetLocaleResult> {\n return getPreferences().locale;\n };\n}\n"],"mappings":";AAMA,SAAS,gBAAgB,mBAAmB;AAS5C,IAAM,aAAa;AA4BZ,IAAM,uBAIT,CAAC,EAAE,iBAAiB,MAAM,aAAAA,aAAY,MAAmC;AAC3E,SAAO;AAAA,IACL,gBAAgB,eAAe;AAAA,IAC/B,YAAY;AAAA,IACZ;AAAA,IACA,sBAAsB,kBAAkBA,YAAW;AAAA,IACnD,cAAc,CAAC,YAAY,IAAI;AAAA,EACjC;AACF;AAEA,IAAM,cAAuD;AAAA,EAC3D,gBAAgB;AAClB;AAEO,IAAM,mBAAmB,OAAO,OAAO;AAAA,EAC5C,YAAY;AAAA,EACZ;AAAA,EACA;AACF,CAAU;AASH,SAAS,kBAAkB,EAAE,eAAe,GAAyB;AAC1E,SAAO,eAAe,eACpB,OAC0B;AAC1B,WAAO,eAAe,EAAE;AAAA,EAC1B;AACF;","names":["methodHooks"]}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
+
var _chunkM2JQCKR7js = require('./chunk-M2JQCKR7.js');
|
|
4
|
+
|
|
5
|
+
|
|
3
6
|
var _chunkQDZAWH6Fjs = require('./chunk-QDZAWH6F.js');
|
|
4
7
|
|
|
5
8
|
|
|
@@ -12,13 +15,13 @@ var _chunkVUA6ICJOjs = require('./chunk-VUA6ICJO.js');
|
|
|
12
15
|
var _chunkZKISN6YPjs = require('./chunk-ZKISN6YP.js');
|
|
13
16
|
|
|
14
17
|
|
|
15
|
-
var
|
|
18
|
+
var _chunk6XKVFSC2js = require('./chunk-6XKVFSC2.js');
|
|
16
19
|
|
|
17
20
|
|
|
18
|
-
var
|
|
21
|
+
var _chunkRHPSYX7Xjs = require('./chunk-RHPSYX7X.js');
|
|
19
22
|
|
|
20
23
|
|
|
21
|
-
var
|
|
24
|
+
var _chunkA6H6I4VHjs = require('./chunk-A6H6I4VH.js');
|
|
22
25
|
|
|
23
26
|
|
|
24
27
|
var _chunkELCOEVKAjs = require('./chunk-ELCOEVKA.js');
|
|
@@ -40,10 +43,11 @@ var restrictedMethodPermissionBuilders = {
|
|
|
40
43
|
[_chunkM2JQCKR7js.manageStateBuilder.targetName]: _chunkM2JQCKR7js.manageStateBuilder,
|
|
41
44
|
[_chunkQDZAWH6Fjs.notifyBuilder.targetName]: _chunkQDZAWH6Fjs.notifyBuilder,
|
|
42
45
|
[_chunkA6H6I4VHjs.manageAccountsBuilder.targetName]: _chunkA6H6I4VHjs.manageAccountsBuilder,
|
|
43
|
-
[
|
|
46
|
+
[_chunk6XKVFSC2js.getLocaleBuilder.targetName]: _chunk6XKVFSC2js.getLocaleBuilder,
|
|
47
|
+
[_chunkRHPSYX7Xjs.getPreferencesBuilder.targetName]: _chunkRHPSYX7Xjs.getPreferencesBuilder
|
|
44
48
|
};
|
|
45
49
|
|
|
46
50
|
|
|
47
51
|
|
|
48
52
|
exports.restrictedMethodPermissionBuilders = restrictedMethodPermissionBuilders;
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
53
|
+
//# sourceMappingURL=chunk-CDAVFOUS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/restricted/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCO,IAAM,qCAAqC;AAAA,EAChD,CAAC,cAAc,UAAU,GAAG;AAAA,EAC5B,CAAC,uBAAuB,UAAU,GAAG;AAAA,EACrC,CAAC,yBAAyB,UAAU,GAAG;AAAA,EACvC,CAAC,uBAAuB,UAAU,GAAG;AAAA,EACrC,CAAC,kBAAkB,UAAU,GAAG;AAAA,EAChC,CAAC,kBAAkB,UAAU,GAAG;AAAA,EAChC,CAAC,mBAAmB,UAAU,GAAG;AAAA,EACjC,CAAC,cAAc,UAAU,GAAG;AAAA,EAC5B,CAAC,sBAAsB,UAAU,GAAG;AAAA,EACpC,CAAC,iBAAiB,UAAU,GAAG;AAAA,EAC/B,CAAC,sBAAsB,UAAU,GAAG;AACtC","sourcesContent":["import type { DialogMethodHooks } from './dialog';\nimport { dialogBuilder } from './dialog';\nimport type { GetBip32EntropyMethodHooks } from './getBip32Entropy';\nimport { getBip32EntropyBuilder } from './getBip32Entropy';\nimport type { GetBip32PublicKeyMethodHooks } from './getBip32PublicKey';\nimport { getBip32PublicKeyBuilder } from './getBip32PublicKey';\nimport type { GetBip44EntropyMethodHooks } from './getBip44Entropy';\nimport { getBip44EntropyBuilder } from './getBip44Entropy';\nimport type { GetEntropyHooks } from './getEntropy';\nimport { getEntropyBuilder } from './getEntropy';\nimport type { GetLocaleMethodHooks } from './getLocale';\nimport { getLocaleBuilder } from './getLocale';\nimport type { GetPreferencesMethodHooks } from './getPreferences';\nimport { getPreferencesBuilder } from './getPreferences';\nimport type { InvokeSnapMethodHooks } from './invokeSnap';\nimport { invokeSnapBuilder } from './invokeSnap';\nimport type { ManageAccountsMethodHooks } from './manageAccounts';\nimport { manageAccountsBuilder } from './manageAccounts';\nimport type { ManageStateMethodHooks } from './manageState';\nimport { manageStateBuilder } from './manageState';\nimport type { NotifyMethodHooks } from './notify';\nimport { notifyBuilder } from './notify';\n\nexport { WALLET_SNAP_PERMISSION_KEY } from './invokeSnap';\nexport { getEncryptionEntropy } from './manageState';\n\nexport type RestrictedMethodHooks = DialogMethodHooks &\n GetBip32EntropyMethodHooks &\n GetBip32PublicKeyMethodHooks &\n GetBip44EntropyMethodHooks &\n GetEntropyHooks &\n InvokeSnapMethodHooks &\n ManageStateMethodHooks &\n NotifyMethodHooks &\n ManageAccountsMethodHooks &\n GetLocaleMethodHooks &\n GetPreferencesMethodHooks;\n\nexport const restrictedMethodPermissionBuilders = {\n [dialogBuilder.targetName]: dialogBuilder,\n [getBip32EntropyBuilder.targetName]: getBip32EntropyBuilder,\n [getBip32PublicKeyBuilder.targetName]: getBip32PublicKeyBuilder,\n [getBip44EntropyBuilder.targetName]: getBip44EntropyBuilder,\n [getEntropyBuilder.targetName]: getEntropyBuilder,\n [invokeSnapBuilder.targetName]: invokeSnapBuilder,\n [manageStateBuilder.targetName]: manageStateBuilder,\n [notifyBuilder.targetName]: notifyBuilder,\n [manageAccountsBuilder.targetName]: manageAccountsBuilder,\n [getLocaleBuilder.targetName]: getLocaleBuilder,\n [getPreferencesBuilder.targetName]: getPreferencesBuilder,\n} as const;\n\nexport * from './caveats';\nexport type { DialogApprovalTypes } from './dialog';\nexport { DIALOG_APPROVAL_TYPES } from './dialog';\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// src/restricted/getPreferences.ts
|
|
2
|
+
import { PermissionType, SubjectType } from "@metamask/permission-controller";
|
|
3
|
+
var methodName = "snap_getPreferences";
|
|
4
|
+
var specificationBuilder = ({ allowedCaveats = null, methodHooks: methodHooks2 }) => {
|
|
5
|
+
return {
|
|
6
|
+
permissionType: PermissionType.RestrictedMethod,
|
|
7
|
+
targetName: methodName,
|
|
8
|
+
allowedCaveats,
|
|
9
|
+
methodImplementation: getImplementation(methodHooks2),
|
|
10
|
+
subjectTypes: [SubjectType.Snap]
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
var methodHooks = {
|
|
14
|
+
getPreferences: true
|
|
15
|
+
};
|
|
16
|
+
var getPreferencesBuilder = Object.freeze({
|
|
17
|
+
targetName: methodName,
|
|
18
|
+
specificationBuilder,
|
|
19
|
+
methodHooks
|
|
20
|
+
});
|
|
21
|
+
function getImplementation({
|
|
22
|
+
getPreferences
|
|
23
|
+
}) {
|
|
24
|
+
return async function implementation(_args) {
|
|
25
|
+
return getPreferences();
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
specificationBuilder,
|
|
31
|
+
getPreferencesBuilder,
|
|
32
|
+
getImplementation
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=chunk-FM4LNQR7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/restricted/getPreferences.ts"],"sourcesContent":["import type {\n PermissionSpecificationBuilder,\n ValidPermissionSpecification,\n RestrictedMethodOptions,\n RestrictedMethodParameters,\n} from '@metamask/permission-controller';\nimport { PermissionType, SubjectType } from '@metamask/permission-controller';\nimport type { GetPreferencesResult } from '@metamask/snaps-sdk';\nimport type { NonEmptyArray } from '@metamask/utils';\n\nimport type { MethodHooksObject } from '../utils';\n\nconst methodName = 'snap_getPreferences';\n\nexport type GetPreferencesMethodHooks = {\n getPreferences: () => GetPreferencesResult;\n};\n\ntype SpecificationBuilderOptions = {\n allowedCaveats?: Readonly<NonEmptyArray<string>> | null;\n methodHooks: GetPreferencesMethodHooks;\n};\n\ntype Specification = ValidPermissionSpecification<{\n permissionType: PermissionType.RestrictedMethod;\n targetName: typeof methodName;\n methodImplementation: ReturnType<typeof getImplementation>;\n allowedCaveats: Readonly<NonEmptyArray<string>> | null;\n}>;\n\n/**\n * The specification builder for the `snap_getPreferences` permission.\n * `snap_getPreferences` allows snaps to access user preferences.\n *\n * @param options - The specification builder options.\n * @param options.allowedCaveats - The optional allowed caveats for the permission.\n * @param options.methodHooks - The RPC method hooks needed by the method implementation.\n * @returns The specification for the `snap_getPreferences` permission.\n */\nexport const specificationBuilder: PermissionSpecificationBuilder<\n PermissionType.RestrictedMethod,\n SpecificationBuilderOptions,\n Specification\n> = ({ allowedCaveats = null, methodHooks }: SpecificationBuilderOptions) => {\n return {\n permissionType: PermissionType.RestrictedMethod,\n targetName: methodName,\n allowedCaveats,\n methodImplementation: getImplementation(methodHooks),\n subjectTypes: [SubjectType.Snap],\n };\n};\n\nconst methodHooks: MethodHooksObject<GetPreferencesMethodHooks> = {\n getPreferences: true,\n};\n\nexport const getPreferencesBuilder = Object.freeze({\n targetName: methodName,\n specificationBuilder,\n methodHooks,\n} as const);\n\n/**\n * Builds the method implementation for `snap_getPreferences`.\n *\n * @param hooks - The RPC method hooks.\n * @param hooks.getPreferences - A function that returns the user selected preferences.\n * @returns The user preferences.\n */\nexport function getImplementation({\n getPreferences,\n}: GetPreferencesMethodHooks) {\n return async function implementation(\n _args: RestrictedMethodOptions<RestrictedMethodParameters>,\n ): Promise<GetPreferencesResult> {\n return getPreferences();\n };\n}\n"],"mappings":";AAMA,SAAS,gBAAgB,mBAAmB;AAM5C,IAAM,aAAa;AA2BZ,IAAM,uBAIT,CAAC,EAAE,iBAAiB,MAAM,aAAAA,aAAY,MAAmC;AAC3E,SAAO;AAAA,IACL,gBAAgB,eAAe;AAAA,IAC/B,YAAY;AAAA,IACZ;AAAA,IACA,sBAAsB,kBAAkBA,YAAW;AAAA,IACnD,cAAc,CAAC,YAAY,IAAI;AAAA,EACjC;AACF;AAEA,IAAM,cAA4D;AAAA,EAChE,gBAAgB;AAClB;AAEO,IAAM,wBAAwB,OAAO,OAAO;AAAA,EACjD,YAAY;AAAA,EACZ;AAAA,EACA;AACF,CAAU;AASH,SAAS,kBAAkB;AAAA,EAChC;AACF,GAA8B;AAC5B,SAAO,eAAe,eACpB,OAC+B;AAC/B,WAAO,eAAe;AAAA,EACxB;AACF;","names":["methodHooks"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
restrictedMethodPermissionBuilders
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-V3KRSCUK.mjs";
|
|
4
4
|
import {
|
|
5
5
|
caveatMappers
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-K3UL5RVN.mjs";
|
|
7
7
|
import {
|
|
8
8
|
selectHooks
|
|
9
9
|
} from "./chunk-W33UWNA2.mjs";
|
|
@@ -56,4 +56,4 @@ export {
|
|
|
56
56
|
buildSnapEndowmentSpecifications,
|
|
57
57
|
buildSnapRestrictedMethodSpecifications
|
|
58
58
|
};
|
|
59
|
-
//# sourceMappingURL=chunk-
|
|
59
|
+
//# sourceMappingURL=chunk-GEJDXRTL.mjs.map
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SnapIdsCaveatSpecification,
|
|
3
|
+
snapIdsCaveatMapper
|
|
4
|
+
} from "./chunk-FJ7COFRJ.mjs";
|
|
1
5
|
import {
|
|
2
6
|
PermittedCoinTypesCaveatSpecification,
|
|
3
7
|
permittedCoinTypesCaveatMapper
|
|
@@ -6,10 +10,6 @@ import {
|
|
|
6
10
|
PermittedDerivationPathsCaveatSpecification,
|
|
7
11
|
permittedDerivationPathsCaveatMapper
|
|
8
12
|
} from "./chunk-I2P65KBQ.mjs";
|
|
9
|
-
import {
|
|
10
|
-
SnapIdsCaveatSpecification,
|
|
11
|
-
snapIdsCaveatMapper
|
|
12
|
-
} from "./chunk-FJ7COFRJ.mjs";
|
|
13
13
|
import {
|
|
14
14
|
getBip32PublicKeyBuilder
|
|
15
15
|
} from "./chunk-VYII7C3J.mjs";
|
|
@@ -40,4 +40,4 @@ export {
|
|
|
40
40
|
caveatSpecifications,
|
|
41
41
|
caveatMappers
|
|
42
42
|
};
|
|
43
|
-
//# sourceMappingURL=chunk-
|
|
43
|
+
//# sourceMappingURL=chunk-K3UL5RVN.mjs.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkH6X3CWWQjs = require('./chunk-H6X3CWWQ.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkI3G6S6MJjs = require('./chunk-I3G6S6MJ.js');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunk756OQVOCjs = require('./chunk-756OQVOC.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
var _chunk4PWFZPJCjs = require('./chunk-4PWFZPJC.js');
|
|
@@ -40,4 +40,4 @@ var caveatMappers = {
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
exports.caveatSpecifications = caveatSpecifications; exports.caveatMappers = caveatMappers;
|
|
43
|
-
//# sourceMappingURL=chunk-
|
|
43
|
+
//# sourceMappingURL=chunk-LP3RWEDJ.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkCDAVFOUSjs = require('./chunk-CDAVFOUS.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkLP3RWEDJjs = require('./chunk-LP3RWEDJ.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunk33MTKZ4Hjs = require('./chunk-33MTKZ4H.js');
|
|
@@ -17,8 +17,8 @@ var _utils = require('@metamask/utils');
|
|
|
17
17
|
function processSnapPermissions(initialPermissions) {
|
|
18
18
|
return Object.fromEntries(
|
|
19
19
|
Object.entries(initialPermissions).map(([initialPermission, value]) => {
|
|
20
|
-
if (_utils.hasProperty.call(void 0,
|
|
21
|
-
return [initialPermission,
|
|
20
|
+
if (_utils.hasProperty.call(void 0, _chunkLP3RWEDJjs.caveatMappers, initialPermission)) {
|
|
21
|
+
return [initialPermission, _chunkLP3RWEDJjs.caveatMappers[initialPermission](value)];
|
|
22
22
|
} else if (_utils.hasProperty.call(void 0, _chunkKRSIAVUJjs.endowmentCaveatMappers, initialPermission)) {
|
|
23
23
|
return [
|
|
24
24
|
initialPermission,
|
|
@@ -38,7 +38,7 @@ var buildSnapEndowmentSpecifications = (excludedEndowments) => Object.values(_ch
|
|
|
38
38
|
}
|
|
39
39
|
return allSpecifications;
|
|
40
40
|
}, {});
|
|
41
|
-
var buildSnapRestrictedMethodSpecifications = (excludedPermissions, hooks) => Object.values(
|
|
41
|
+
var buildSnapRestrictedMethodSpecifications = (excludedPermissions, hooks) => Object.values(_chunkCDAVFOUSjs.restrictedMethodPermissionBuilders).reduce((specifications, { targetName, specificationBuilder, methodHooks }) => {
|
|
42
42
|
if (!excludedPermissions.includes(targetName)) {
|
|
43
43
|
specifications[targetName] = specificationBuilder({
|
|
44
44
|
// @ts-expect-error The selectHooks type is wonky
|
|
@@ -56,4 +56,4 @@ var buildSnapRestrictedMethodSpecifications = (excludedPermissions, hooks) => Ob
|
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
exports.processSnapPermissions = processSnapPermissions; exports.buildSnapEndowmentSpecifications = buildSnapEndowmentSpecifications; exports.buildSnapRestrictedMethodSpecifications = buildSnapRestrictedMethodSpecifications;
|
|
59
|
-
//# sourceMappingURL=chunk-
|
|
59
|
+
//# sourceMappingURL=chunk-PK2RPAXI.js.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/restricted/getPreferences.ts
|
|
2
|
+
var _permissioncontroller = require('@metamask/permission-controller');
|
|
3
|
+
var methodName = "snap_getPreferences";
|
|
4
|
+
var specificationBuilder = ({ allowedCaveats = null, methodHooks: methodHooks2 }) => {
|
|
5
|
+
return {
|
|
6
|
+
permissionType: _permissioncontroller.PermissionType.RestrictedMethod,
|
|
7
|
+
targetName: methodName,
|
|
8
|
+
allowedCaveats,
|
|
9
|
+
methodImplementation: getImplementation(methodHooks2),
|
|
10
|
+
subjectTypes: [_permissioncontroller.SubjectType.Snap]
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
var methodHooks = {
|
|
14
|
+
getPreferences: true
|
|
15
|
+
};
|
|
16
|
+
var getPreferencesBuilder = Object.freeze({
|
|
17
|
+
targetName: methodName,
|
|
18
|
+
specificationBuilder,
|
|
19
|
+
methodHooks
|
|
20
|
+
});
|
|
21
|
+
function getImplementation({
|
|
22
|
+
getPreferences
|
|
23
|
+
}) {
|
|
24
|
+
return async function implementation(_args) {
|
|
25
|
+
return getPreferences();
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
exports.specificationBuilder = specificationBuilder; exports.getPreferencesBuilder = getPreferencesBuilder; exports.getImplementation = getImplementation;
|
|
34
|
+
//# sourceMappingURL=chunk-RHPSYX7X.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/restricted/getPreferences.ts"],"names":["methodHooks"],"mappings":";AAMA,SAAS,gBAAgB,mBAAmB;AAM5C,IAAM,aAAa;AA2BZ,IAAM,uBAIT,CAAC,EAAE,iBAAiB,MAAM,aAAAA,aAAY,MAAmC;AAC3E,SAAO;AAAA,IACL,gBAAgB,eAAe;AAAA,IAC/B,YAAY;AAAA,IACZ;AAAA,IACA,sBAAsB,kBAAkBA,YAAW;AAAA,IACnD,cAAc,CAAC,YAAY,IAAI;AAAA,EACjC;AACF;AAEA,IAAM,cAA4D;AAAA,EAChE,gBAAgB;AAClB;AAEO,IAAM,wBAAwB,OAAO,OAAO;AAAA,EACjD,YAAY;AAAA,EACZ;AAAA,EACA;AACF,CAAU;AASH,SAAS,kBAAkB;AAAA,EAChC;AACF,GAA8B;AAC5B,SAAO,eAAe,eACpB,OAC+B;AAC/B,WAAO,eAAe;AAAA,EACxB;AACF","sourcesContent":["import type {\n PermissionSpecificationBuilder,\n ValidPermissionSpecification,\n RestrictedMethodOptions,\n RestrictedMethodParameters,\n} from '@metamask/permission-controller';\nimport { PermissionType, SubjectType } from '@metamask/permission-controller';\nimport type { GetPreferencesResult } from '@metamask/snaps-sdk';\nimport type { NonEmptyArray } from '@metamask/utils';\n\nimport type { MethodHooksObject } from '../utils';\n\nconst methodName = 'snap_getPreferences';\n\nexport type GetPreferencesMethodHooks = {\n getPreferences: () => GetPreferencesResult;\n};\n\ntype SpecificationBuilderOptions = {\n allowedCaveats?: Readonly<NonEmptyArray<string>> | null;\n methodHooks: GetPreferencesMethodHooks;\n};\n\ntype Specification = ValidPermissionSpecification<{\n permissionType: PermissionType.RestrictedMethod;\n targetName: typeof methodName;\n methodImplementation: ReturnType<typeof getImplementation>;\n allowedCaveats: Readonly<NonEmptyArray<string>> | null;\n}>;\n\n/**\n * The specification builder for the `snap_getPreferences` permission.\n * `snap_getPreferences` allows snaps to access user preferences.\n *\n * @param options - The specification builder options.\n * @param options.allowedCaveats - The optional allowed caveats for the permission.\n * @param options.methodHooks - The RPC method hooks needed by the method implementation.\n * @returns The specification for the `snap_getPreferences` permission.\n */\nexport const specificationBuilder: PermissionSpecificationBuilder<\n PermissionType.RestrictedMethod,\n SpecificationBuilderOptions,\n Specification\n> = ({ allowedCaveats = null, methodHooks }: SpecificationBuilderOptions) => {\n return {\n permissionType: PermissionType.RestrictedMethod,\n targetName: methodName,\n allowedCaveats,\n methodImplementation: getImplementation(methodHooks),\n subjectTypes: [SubjectType.Snap],\n };\n};\n\nconst methodHooks: MethodHooksObject<GetPreferencesMethodHooks> = {\n getPreferences: true,\n};\n\nexport const getPreferencesBuilder = Object.freeze({\n targetName: methodName,\n specificationBuilder,\n methodHooks,\n} as const);\n\n/**\n * Builds the method implementation for `snap_getPreferences`.\n *\n * @param hooks - The RPC method hooks.\n * @param hooks.getPreferences - A function that returns the user selected preferences.\n * @returns The user preferences.\n */\nexport function getImplementation({\n getPreferences,\n}: GetPreferencesMethodHooks) {\n return async function implementation(\n _args: RestrictedMethodOptions<RestrictedMethodParameters>,\n ): Promise<GetPreferencesResult> {\n return getPreferences();\n };\n}\n"]}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
manageStateBuilder
|
|
3
|
+
} from "./chunk-TE4W25CA.mjs";
|
|
1
4
|
import {
|
|
2
5
|
notifyBuilder
|
|
3
6
|
} from "./chunk-JWDQUKKU.mjs";
|
|
@@ -12,13 +15,13 @@ import {
|
|
|
12
15
|
} from "./chunk-2RDYC42U.mjs";
|
|
13
16
|
import {
|
|
14
17
|
getLocaleBuilder
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-AMMJ744B.mjs";
|
|
19
|
+
import {
|
|
20
|
+
getPreferencesBuilder
|
|
21
|
+
} from "./chunk-FM4LNQR7.mjs";
|
|
16
22
|
import {
|
|
17
23
|
manageAccountsBuilder
|
|
18
24
|
} from "./chunk-Z6YFGWHN.mjs";
|
|
19
|
-
import {
|
|
20
|
-
manageStateBuilder
|
|
21
|
-
} from "./chunk-TE4W25CA.mjs";
|
|
22
25
|
import {
|
|
23
26
|
dialogBuilder
|
|
24
27
|
} from "./chunk-TQCUJQHY.mjs";
|
|
@@ -40,10 +43,11 @@ var restrictedMethodPermissionBuilders = {
|
|
|
40
43
|
[manageStateBuilder.targetName]: manageStateBuilder,
|
|
41
44
|
[notifyBuilder.targetName]: notifyBuilder,
|
|
42
45
|
[manageAccountsBuilder.targetName]: manageAccountsBuilder,
|
|
43
|
-
[getLocaleBuilder.targetName]: getLocaleBuilder
|
|
46
|
+
[getLocaleBuilder.targetName]: getLocaleBuilder,
|
|
47
|
+
[getPreferencesBuilder.targetName]: getPreferencesBuilder
|
|
44
48
|
};
|
|
45
49
|
|
|
46
50
|
export {
|
|
47
51
|
restrictedMethodPermissionBuilders
|
|
48
52
|
};
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
53
|
+
//# sourceMappingURL=chunk-V3KRSCUK.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/restricted/index.ts"],"sourcesContent":["import type { DialogMethodHooks } from './dialog';\nimport { dialogBuilder } from './dialog';\nimport type { GetBip32EntropyMethodHooks } from './getBip32Entropy';\nimport { getBip32EntropyBuilder } from './getBip32Entropy';\nimport type { GetBip32PublicKeyMethodHooks } from './getBip32PublicKey';\nimport { getBip32PublicKeyBuilder } from './getBip32PublicKey';\nimport type { GetBip44EntropyMethodHooks } from './getBip44Entropy';\nimport { getBip44EntropyBuilder } from './getBip44Entropy';\nimport type { GetEntropyHooks } from './getEntropy';\nimport { getEntropyBuilder } from './getEntropy';\nimport type { GetLocaleMethodHooks } from './getLocale';\nimport { getLocaleBuilder } from './getLocale';\nimport type { GetPreferencesMethodHooks } from './getPreferences';\nimport { getPreferencesBuilder } from './getPreferences';\nimport type { InvokeSnapMethodHooks } from './invokeSnap';\nimport { invokeSnapBuilder } from './invokeSnap';\nimport type { ManageAccountsMethodHooks } from './manageAccounts';\nimport { manageAccountsBuilder } from './manageAccounts';\nimport type { ManageStateMethodHooks } from './manageState';\nimport { manageStateBuilder } from './manageState';\nimport type { NotifyMethodHooks } from './notify';\nimport { notifyBuilder } from './notify';\n\nexport { WALLET_SNAP_PERMISSION_KEY } from './invokeSnap';\nexport { getEncryptionEntropy } from './manageState';\n\nexport type RestrictedMethodHooks = DialogMethodHooks &\n GetBip32EntropyMethodHooks &\n GetBip32PublicKeyMethodHooks &\n GetBip44EntropyMethodHooks &\n GetEntropyHooks &\n InvokeSnapMethodHooks &\n ManageStateMethodHooks &\n NotifyMethodHooks &\n ManageAccountsMethodHooks &\n GetLocaleMethodHooks &\n GetPreferencesMethodHooks;\n\nexport const restrictedMethodPermissionBuilders = {\n [dialogBuilder.targetName]: dialogBuilder,\n [getBip32EntropyBuilder.targetName]: getBip32EntropyBuilder,\n [getBip32PublicKeyBuilder.targetName]: getBip32PublicKeyBuilder,\n [getBip44EntropyBuilder.targetName]: getBip44EntropyBuilder,\n [getEntropyBuilder.targetName]: getEntropyBuilder,\n [invokeSnapBuilder.targetName]: invokeSnapBuilder,\n [manageStateBuilder.targetName]: manageStateBuilder,\n [notifyBuilder.targetName]: notifyBuilder,\n [manageAccountsBuilder.targetName]: manageAccountsBuilder,\n [getLocaleBuilder.targetName]: getLocaleBuilder,\n [getPreferencesBuilder.targetName]: getPreferencesBuilder,\n} as const;\n\nexport * from './caveats';\nexport type { DialogApprovalTypes } from './dialog';\nexport { DIALOG_APPROVAL_TYPES } from './dialog';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCO,IAAM,qCAAqC;AAAA,EAChD,CAAC,cAAc,UAAU,GAAG;AAAA,EAC5B,CAAC,uBAAuB,UAAU,GAAG;AAAA,EACrC,CAAC,yBAAyB,UAAU,GAAG;AAAA,EACvC,CAAC,uBAAuB,UAAU,GAAG;AAAA,EACrC,CAAC,kBAAkB,UAAU,GAAG;AAAA,EAChC,CAAC,kBAAkB,UAAU,GAAG;AAAA,EAChC,CAAC,mBAAmB,UAAU,GAAG;AAAA,EACjC,CAAC,cAAc,UAAU,GAAG;AAAA,EAC5B,CAAC,sBAAsB,UAAU,GAAG;AAAA,EACpC,CAAC,iBAAiB,UAAU,GAAG;AAAA,EAC/B,CAAC,sBAAsB,UAAU,GAAG;AACtC;","names":[]}
|
package/dist/index.js
CHANGED
|
@@ -20,28 +20,29 @@ require('./chunk-NWT2EXFD.js');
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
var
|
|
23
|
+
var _chunkPK2RPAXIjs = require('./chunk-PK2RPAXI.js');
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkCDAVFOUSjs = require('./chunk-CDAVFOUS.js');
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
var _chunkM2JQCKR7js = require('./chunk-M2JQCKR7.js');
|
|
27
30
|
require('./chunk-QDZAWH6F.js');
|
|
28
31
|
|
|
29
32
|
|
|
30
33
|
|
|
31
|
-
var
|
|
34
|
+
var _chunkLP3RWEDJjs = require('./chunk-LP3RWEDJ.js');
|
|
35
|
+
require('./chunk-H6X3CWWQ.js');
|
|
32
36
|
require('./chunk-I3G6S6MJ.js');
|
|
33
37
|
require('./chunk-756OQVOC.js');
|
|
34
|
-
require('./chunk-H6X3CWWQ.js');
|
|
35
38
|
require('./chunk-4PWFZPJC.js');
|
|
36
39
|
require('./chunk-VUA6ICJO.js');
|
|
37
40
|
require('./chunk-ZKISN6YP.js');
|
|
38
|
-
require('./chunk-
|
|
41
|
+
require('./chunk-6XKVFSC2.js');
|
|
42
|
+
require('./chunk-RHPSYX7X.js');
|
|
39
43
|
require('./chunk-A6H6I4VH.js');
|
|
40
44
|
|
|
41
45
|
|
|
42
|
-
var _chunkM2JQCKR7js = require('./chunk-M2JQCKR7.js');
|
|
43
|
-
|
|
44
|
-
|
|
45
46
|
var _chunkELCOEVKAjs = require('./chunk-ELCOEVKA.js');
|
|
46
47
|
require('./chunk-IE6EHYEG.js');
|
|
47
48
|
|
|
@@ -118,5 +119,5 @@ var _snapsutils = require('@metamask/snaps-utils');
|
|
|
118
119
|
|
|
119
120
|
|
|
120
121
|
|
|
121
|
-
exports.DIALOG_APPROVAL_TYPES = _chunkELCOEVKAjs.DIALOG_APPROVAL_TYPES; exports.SnapCaveatType = _snapsutils.SnapCaveatType; exports.SnapEndowments = _chunkYGKFOOWIjs.SnapEndowments; exports.WALLET_SNAP_PERMISSION_KEY = _chunkFFHVA6PPjs.WALLET_SNAP_PERMISSION_KEY; exports.buildSnapEndowmentSpecifications =
|
|
122
|
+
exports.DIALOG_APPROVAL_TYPES = _chunkELCOEVKAjs.DIALOG_APPROVAL_TYPES; exports.SnapCaveatType = _snapsutils.SnapCaveatType; exports.SnapEndowments = _chunkYGKFOOWIjs.SnapEndowments; exports.WALLET_SNAP_PERMISSION_KEY = _chunkFFHVA6PPjs.WALLET_SNAP_PERMISSION_KEY; exports.buildSnapEndowmentSpecifications = _chunkPK2RPAXIjs.buildSnapEndowmentSpecifications; exports.buildSnapRestrictedMethodSpecifications = _chunkPK2RPAXIjs.buildSnapRestrictedMethodSpecifications; exports.caveatMappers = _chunkLP3RWEDJjs.caveatMappers; exports.caveatSpecifications = _chunkLP3RWEDJjs.caveatSpecifications; exports.createSnapsMethodMiddleware = _chunkATBKAX2Sjs.createSnapsMethodMiddleware; exports.endowmentCaveatMappers = _chunkKRSIAVUJjs.endowmentCaveatMappers; exports.endowmentCaveatSpecifications = _chunkKRSIAVUJjs.endowmentCaveatSpecifications; exports.endowmentPermissionBuilders = _chunkKRSIAVUJjs.endowmentPermissionBuilders; exports.getChainIdsCaveat = _chunkPXU6PORAjs.getChainIdsCaveat; exports.getCronjobCaveatJobs = _chunk7HVABE5Rjs.getCronjobCaveatJobs; exports.getEncryptionEntropy = _chunkM2JQCKR7js.getEncryptionEntropy; exports.getKeyringCaveatOrigins = _chunkT56DKVFSjs.getKeyringCaveatOrigins; exports.getLookupMatchersCaveat = _chunkPXU6PORAjs.getLookupMatchersCaveat; exports.getMaxRequestTimeCaveat = _chunkFCVWU5XHjs.getMaxRequestTimeCaveat; exports.getRpcCaveatOrigins = _chunkYT2Q3W5Cjs.getRpcCaveatOrigins; exports.getSignatureOriginCaveat = _chunkYZMFLB67js.getSignatureOriginCaveat; exports.getTransactionOriginCaveat = _chunk3WKIKYUHjs.getTransactionOriginCaveat; exports.handlerEndowments = _chunkKRSIAVUJjs.handlerEndowments; exports.permittedMethods = _chunkUF3UJTY3js.handlers; exports.processSnapPermissions = _chunkPK2RPAXIjs.processSnapPermissions; exports.restrictedMethodPermissionBuilders = _chunkCDAVFOUSjs.restrictedMethodPermissionBuilders; exports.selectHooks = _chunk33MTKZ4Hjs.selectHooks;
|
|
122
123
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,SAAS,sBAAsB","sourcesContent":["export {\n handlers as permittedMethods,\n createSnapsMethodMiddleware,\n} from './permitted';\nexport type { PermittedRpcMethodHooks } from './permitted';\nexport { SnapCaveatType } from '@metamask/snaps-utils';\nexport { selectHooks } from './utils';\nexport * from './endowments';\nexport * from './permissions';\nexport * from './restricted';\n"]}
|
package/dist/index.mjs
CHANGED
|
@@ -20,26 +20,27 @@ import {
|
|
|
20
20
|
buildSnapEndowmentSpecifications,
|
|
21
21
|
buildSnapRestrictedMethodSpecifications,
|
|
22
22
|
processSnapPermissions
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-GEJDXRTL.mjs";
|
|
24
24
|
import {
|
|
25
25
|
restrictedMethodPermissionBuilders
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-V3KRSCUK.mjs";
|
|
27
|
+
import {
|
|
28
|
+
getEncryptionEntropy
|
|
29
|
+
} from "./chunk-TE4W25CA.mjs";
|
|
27
30
|
import "./chunk-JWDQUKKU.mjs";
|
|
28
31
|
import {
|
|
29
32
|
caveatMappers,
|
|
30
33
|
caveatSpecifications
|
|
31
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-K3UL5RVN.mjs";
|
|
35
|
+
import "./chunk-FJ7COFRJ.mjs";
|
|
32
36
|
import "./chunk-PIAWDTWO.mjs";
|
|
33
37
|
import "./chunk-I2P65KBQ.mjs";
|
|
34
|
-
import "./chunk-FJ7COFRJ.mjs";
|
|
35
38
|
import "./chunk-VYII7C3J.mjs";
|
|
36
39
|
import "./chunk-LR7UR4YU.mjs";
|
|
37
40
|
import "./chunk-2RDYC42U.mjs";
|
|
38
|
-
import "./chunk-
|
|
41
|
+
import "./chunk-AMMJ744B.mjs";
|
|
42
|
+
import "./chunk-FM4LNQR7.mjs";
|
|
39
43
|
import "./chunk-Z6YFGWHN.mjs";
|
|
40
|
-
import {
|
|
41
|
-
getEncryptionEntropy
|
|
42
|
-
} from "./chunk-TE4W25CA.mjs";
|
|
43
44
|
import {
|
|
44
45
|
DIALOG_APPROVAL_TYPES
|
|
45
46
|
} from "./chunk-TQCUJQHY.mjs";
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n handlers as permittedMethods,\n createSnapsMethodMiddleware,\n} from './permitted';\nexport type { PermittedRpcMethodHooks } from './permitted';\nexport { SnapCaveatType } from '@metamask/snaps-utils';\nexport { selectHooks } from './utils';\nexport * from './endowments';\nexport * from './permissions';\nexport * from './restricted';\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n handlers as permittedMethods,\n createSnapsMethodMiddleware,\n} from './permitted';\nexport type { PermittedRpcMethodHooks } from './permitted';\nexport { SnapCaveatType } from '@metamask/snaps-utils';\nexport { selectHooks } from './utils';\nexport * from './endowments';\nexport * from './permissions';\nexport * from './restricted';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,SAAS,sBAAsB;","names":[]}
|
package/dist/permissions.js
CHANGED
|
@@ -2,19 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
require('./chunk-
|
|
5
|
+
var _chunkPK2RPAXIjs = require('./chunk-PK2RPAXI.js');
|
|
6
|
+
require('./chunk-CDAVFOUS.js');
|
|
7
|
+
require('./chunk-M2JQCKR7.js');
|
|
7
8
|
require('./chunk-QDZAWH6F.js');
|
|
8
|
-
require('./chunk-
|
|
9
|
+
require('./chunk-LP3RWEDJ.js');
|
|
10
|
+
require('./chunk-H6X3CWWQ.js');
|
|
9
11
|
require('./chunk-I3G6S6MJ.js');
|
|
10
12
|
require('./chunk-756OQVOC.js');
|
|
11
|
-
require('./chunk-H6X3CWWQ.js');
|
|
12
13
|
require('./chunk-4PWFZPJC.js');
|
|
13
14
|
require('./chunk-VUA6ICJO.js');
|
|
14
15
|
require('./chunk-ZKISN6YP.js');
|
|
15
|
-
require('./chunk-
|
|
16
|
+
require('./chunk-6XKVFSC2.js');
|
|
17
|
+
require('./chunk-RHPSYX7X.js');
|
|
16
18
|
require('./chunk-A6H6I4VH.js');
|
|
17
|
-
require('./chunk-M2JQCKR7.js');
|
|
18
19
|
require('./chunk-ELCOEVKA.js');
|
|
19
20
|
require('./chunk-IE6EHYEG.js');
|
|
20
21
|
require('./chunk-FFHVA6PP.js');
|
|
@@ -39,5 +40,5 @@ require('./chunk-YGKFOOWI.js');
|
|
|
39
40
|
|
|
40
41
|
|
|
41
42
|
|
|
42
|
-
exports.buildSnapEndowmentSpecifications =
|
|
43
|
+
exports.buildSnapEndowmentSpecifications = _chunkPK2RPAXIjs.buildSnapEndowmentSpecifications; exports.buildSnapRestrictedMethodSpecifications = _chunkPK2RPAXIjs.buildSnapRestrictedMethodSpecifications; exports.processSnapPermissions = _chunkPK2RPAXIjs.processSnapPermissions;
|
|
43
44
|
//# sourceMappingURL=permissions.js.map
|
package/dist/permissions.mjs
CHANGED
|
@@ -2,19 +2,20 @@ import {
|
|
|
2
2
|
buildSnapEndowmentSpecifications,
|
|
3
3
|
buildSnapRestrictedMethodSpecifications,
|
|
4
4
|
processSnapPermissions
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-GEJDXRTL.mjs";
|
|
6
|
+
import "./chunk-V3KRSCUK.mjs";
|
|
7
|
+
import "./chunk-TE4W25CA.mjs";
|
|
7
8
|
import "./chunk-JWDQUKKU.mjs";
|
|
8
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-K3UL5RVN.mjs";
|
|
10
|
+
import "./chunk-FJ7COFRJ.mjs";
|
|
9
11
|
import "./chunk-PIAWDTWO.mjs";
|
|
10
12
|
import "./chunk-I2P65KBQ.mjs";
|
|
11
|
-
import "./chunk-FJ7COFRJ.mjs";
|
|
12
13
|
import "./chunk-VYII7C3J.mjs";
|
|
13
14
|
import "./chunk-LR7UR4YU.mjs";
|
|
14
15
|
import "./chunk-2RDYC42U.mjs";
|
|
15
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-AMMJ744B.mjs";
|
|
17
|
+
import "./chunk-FM4LNQR7.mjs";
|
|
16
18
|
import "./chunk-Z6YFGWHN.mjs";
|
|
17
|
-
import "./chunk-TE4W25CA.mjs";
|
|
18
19
|
import "./chunk-TQCUJQHY.mjs";
|
|
19
20
|
import "./chunk-LXJBBRQ4.mjs";
|
|
20
21
|
import "./chunk-VVBTXSID.mjs";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkLP3RWEDJjs = require('../../chunk-LP3RWEDJ.js');
|
|
5
|
+
require('../../chunk-H6X3CWWQ.js');
|
|
5
6
|
require('../../chunk-I3G6S6MJ.js');
|
|
6
7
|
require('../../chunk-756OQVOC.js');
|
|
7
|
-
require('../../chunk-H6X3CWWQ.js');
|
|
8
8
|
require('../../chunk-4PWFZPJC.js');
|
|
9
9
|
require('../../chunk-VUA6ICJO.js');
|
|
10
10
|
require('../../chunk-IE6EHYEG.js');
|
|
@@ -13,5 +13,5 @@ require('../../chunk-33MTKZ4H.js');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
exports.caveatMappers =
|
|
16
|
+
exports.caveatMappers = _chunkLP3RWEDJjs.caveatMappers; exports.caveatSpecifications = _chunkLP3RWEDJjs.caveatSpecifications;
|
|
17
17
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
caveatMappers,
|
|
3
3
|
caveatSpecifications
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-K3UL5RVN.mjs";
|
|
5
|
+
import "../../chunk-FJ7COFRJ.mjs";
|
|
5
6
|
import "../../chunk-PIAWDTWO.mjs";
|
|
6
7
|
import "../../chunk-I2P65KBQ.mjs";
|
|
7
|
-
import "../../chunk-FJ7COFRJ.mjs";
|
|
8
8
|
import "../../chunk-VYII7C3J.mjs";
|
|
9
9
|
import "../../chunk-LR7UR4YU.mjs";
|
|
10
10
|
import "../../chunk-LXJBBRQ4.mjs";
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunk6XKVFSC2js = require('../chunk-6XKVFSC2.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.getImplementation =
|
|
10
|
+
exports.getImplementation = _chunk6XKVFSC2js.getImplementation; exports.getLocaleBuilder = _chunk6XKVFSC2js.getLocaleBuilder; exports.specificationBuilder = _chunk6XKVFSC2js.specificationBuilder;
|
|
11
11
|
//# sourceMappingURL=getLocale.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkRHPSYX7Xjs = require('../chunk-RHPSYX7X.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.getImplementation = _chunkRHPSYX7Xjs.getImplementation; exports.getPreferencesBuilder = _chunkRHPSYX7Xjs.getPreferencesBuilder; exports.specificationBuilder = _chunkRHPSYX7Xjs.specificationBuilder;
|
|
11
|
+
//# sourceMappingURL=getPreferences.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|