@metamask/snaps-rpc-methods 10.0.1 → 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.
Files changed (70) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/dist/{chunk-SYUGPLEP.js → chunk-6XKVFSC2.js} +4 -4
  3. package/dist/chunk-6XKVFSC2.js.map +1 -0
  4. package/dist/{chunk-IZYMBIBD.mjs → chunk-AMMJ744B.mjs} +4 -4
  5. package/dist/chunk-AMMJ744B.mjs.map +1 -0
  6. package/dist/{chunk-HZQ34FQT.js → chunk-CDAVFOUS.js} +9 -5
  7. package/dist/chunk-CDAVFOUS.js.map +1 -0
  8. package/dist/chunk-FM4LNQR7.mjs +34 -0
  9. package/dist/chunk-FM4LNQR7.mjs.map +1 -0
  10. package/dist/{chunk-BSAXPL2T.mjs → chunk-GEJDXRTL.mjs} +3 -3
  11. package/dist/{chunk-FNUO7MQ4.mjs → chunk-K3UL5RVN.mjs} +5 -5
  12. package/dist/{chunk-6VJVURH5.js → chunk-LP3RWEDJ.js} +4 -4
  13. package/dist/{chunk-4TUORIA6.js → chunk-PK2RPAXI.js} +6 -6
  14. package/dist/chunk-RHPSYX7X.js +34 -0
  15. package/dist/chunk-RHPSYX7X.js.map +1 -0
  16. package/dist/{chunk-SYB5TG5O.mjs → chunk-V3KRSCUK.mjs} +10 -6
  17. package/dist/chunk-V3KRSCUK.mjs.map +1 -0
  18. package/dist/index.js +10 -9
  19. package/dist/index.js.map +1 -1
  20. package/dist/index.mjs +9 -8
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/permissions.js +8 -7
  23. package/dist/permissions.mjs +7 -6
  24. package/dist/restricted/caveats/index.js +3 -3
  25. package/dist/restricted/caveats/index.mjs +2 -2
  26. package/dist/restricted/getLocale.js +2 -2
  27. package/dist/restricted/getLocale.mjs +1 -1
  28. package/dist/restricted/getPreferences.js +11 -0
  29. package/dist/restricted/getPreferences.js.map +1 -0
  30. package/dist/restricted/getPreferences.mjs +11 -0
  31. package/dist/restricted/getPreferences.mjs.map +1 -0
  32. package/dist/restricted/index.js +9 -8
  33. package/dist/restricted/index.mjs +8 -7
  34. package/dist/tsconfig.build.tsbuildinfo +1 -1
  35. package/dist/types/endowments/caveats/generic.d.ts +2 -2
  36. package/dist/types/endowments/rpc.d.ts +1 -1
  37. package/dist/types/permitted/createInterface.d.ts +16 -2
  38. package/dist/types/permitted/getAllSnaps.d.ts +1 -1
  39. package/dist/types/permitted/getClientStatus.d.ts +1 -1
  40. package/dist/types/permitted/getFile.d.ts +2 -2
  41. package/dist/types/permitted/getInterfaceState.d.ts +2 -2
  42. package/dist/types/permitted/getSnaps.d.ts +1 -1
  43. package/dist/types/permitted/index.d.ts +1 -1
  44. package/dist/types/permitted/invokeKeyring.d.ts +1 -1
  45. package/dist/types/permitted/invokeSnapSugar.d.ts +1 -1
  46. package/dist/types/permitted/requestSnaps.d.ts +1 -1
  47. package/dist/types/permitted/resolveInterface.d.ts +2 -2
  48. package/dist/types/permitted/updateInterface.d.ts +16 -2
  49. package/dist/types/restricted/dialog.d.ts +121 -9
  50. package/dist/types/restricted/getBip32Entropy.d.ts +2 -2
  51. package/dist/types/restricted/getBip32PublicKey.d.ts +2 -2
  52. package/dist/types/restricted/getBip44Entropy.d.ts +2 -2
  53. package/dist/types/restricted/getEntropy.d.ts +3 -3
  54. package/dist/types/restricted/getLocale.d.ts +8 -7
  55. package/dist/types/restricted/getPreferences.d.ts +48 -0
  56. package/dist/types/restricted/index.d.ts +15 -1
  57. package/dist/types/restricted/invokeSnap.d.ts +6 -6
  58. package/dist/types/restricted/manageAccounts.d.ts +4 -4
  59. package/dist/types/restricted/manageState.d.ts +4 -4
  60. package/dist/types/restricted/notify.d.ts +4 -4
  61. package/dist/types/utils.d.ts +3 -3
  62. package/package.json +4 -4
  63. package/dist/chunk-HZQ34FQT.js.map +0 -1
  64. package/dist/chunk-IZYMBIBD.mjs.map +0 -1
  65. package/dist/chunk-SYB5TG5O.mjs.map +0 -1
  66. package/dist/chunk-SYUGPLEP.js.map +0 -1
  67. /package/dist/{chunk-BSAXPL2T.mjs.map → chunk-GEJDXRTL.mjs.map} +0 -0
  68. /package/dist/{chunk-FNUO7MQ4.mjs.map → chunk-K3UL5RVN.mjs.map} +0 -0
  69. /package/dist/{chunk-6VJVURH5.js.map → chunk-LP3RWEDJ.js.map} +0 -0
  70. /package/dist/{chunk-4TUORIA6.js.map → chunk-PK2RPAXI.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -6,6 +6,11 @@ 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
+
9
14
  ## [10.0.1]
10
15
  ### Changed
11
16
  - Bump `@metamask/json-rpc-engine` from `^9.0.0` to `^9.0.2` ([#2593](https://github.com/metamask/snaps/pull/2593))
@@ -184,7 +189,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
184
189
  - The version of the package no longer needs to match the version of all other
185
190
  MetaMask Snaps packages.
186
191
 
187
- [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-rpc-methods@10.0.1...HEAD
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
188
194
  [10.0.1]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-rpc-methods@10.0.0...@metamask/snaps-rpc-methods@10.0.1
189
195
  [10.0.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-rpc-methods@9.1.4...@metamask/snaps-rpc-methods@10.0.0
190
196
  [9.1.4]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-rpc-methods@9.1.3...@metamask/snaps-rpc-methods@9.1.4
@@ -11,16 +11,16 @@ var specificationBuilder = ({ allowedCaveats = null, methodHooks: methodHooks2 }
11
11
  };
12
12
  };
13
13
  var methodHooks = {
14
- getLocale: true
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({ getLocale }) {
21
+ function getImplementation({ getPreferences }) {
22
22
  return async function implementation(_args) {
23
- return getLocale();
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-SYUGPLEP.js.map
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
- getLocale: true
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({ getLocale }) {
21
+ function getImplementation({ getPreferences }) {
22
22
  return async function implementation(_args) {
23
- return getLocale();
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-IZYMBIBD.mjs.map
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 _chunkSYUGPLEPjs = require('./chunk-SYUGPLEP.js');
18
+ var _chunk6XKVFSC2js = require('./chunk-6XKVFSC2.js');
16
19
 
17
20
 
18
- var _chunkA6H6I4VHjs = require('./chunk-A6H6I4VH.js');
21
+ var _chunkRHPSYX7Xjs = require('./chunk-RHPSYX7X.js');
19
22
 
20
23
 
21
- var _chunkM2JQCKR7js = require('./chunk-M2JQCKR7.js');
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
- [_chunkSYUGPLEPjs.getLocaleBuilder.targetName]: _chunkSYUGPLEPjs.getLocaleBuilder
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-HZQ34FQT.js.map
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-SYB5TG5O.mjs";
3
+ } from "./chunk-V3KRSCUK.mjs";
4
4
  import {
5
5
  caveatMappers
6
- } from "./chunk-FNUO7MQ4.mjs";
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-BSAXPL2T.mjs.map
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-FNUO7MQ4.mjs.map
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 _chunkI3G6S6MJjs = require('./chunk-I3G6S6MJ.js');
4
+ var _chunkH6X3CWWQjs = require('./chunk-H6X3CWWQ.js');
5
5
 
6
6
 
7
7
 
8
- var _chunk756OQVOCjs = require('./chunk-756OQVOC.js');
8
+ var _chunkI3G6S6MJjs = require('./chunk-I3G6S6MJ.js');
9
9
 
10
10
 
11
11
 
12
- var _chunkH6X3CWWQjs = require('./chunk-H6X3CWWQ.js');
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-6VJVURH5.js.map
43
+ //# sourceMappingURL=chunk-LP3RWEDJ.js.map
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkHZQ34FQTjs = require('./chunk-HZQ34FQT.js');
3
+ var _chunkCDAVFOUSjs = require('./chunk-CDAVFOUS.js');
4
4
 
5
5
 
6
- var _chunk6VJVURH5js = require('./chunk-6VJVURH5.js');
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, _chunk6VJVURH5js.caveatMappers, initialPermission)) {
21
- return [initialPermission, _chunk6VJVURH5js.caveatMappers[initialPermission](value)];
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(_chunkHZQ34FQTjs.restrictedMethodPermissionBuilders).reduce((specifications, { targetName, specificationBuilder, methodHooks }) => {
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-4TUORIA6.js.map
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-IZYMBIBD.mjs";
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-SYB5TG5O.mjs.map
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 _chunk4TUORIA6js = require('./chunk-4TUORIA6.js');
23
+ var _chunkPK2RPAXIjs = require('./chunk-PK2RPAXI.js');
24
24
 
25
25
 
26
- var _chunkHZQ34FQTjs = require('./chunk-HZQ34FQT.js');
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 _chunk6VJVURH5js = require('./chunk-6VJVURH5.js');
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-SYUGPLEP.js');
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 = _chunk4TUORIA6js.buildSnapEndowmentSpecifications; exports.buildSnapRestrictedMethodSpecifications = _chunk4TUORIA6js.buildSnapRestrictedMethodSpecifications; exports.caveatMappers = _chunk6VJVURH5js.caveatMappers; exports.caveatSpecifications = _chunk6VJVURH5js.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 = _chunk4TUORIA6js.processSnapPermissions; exports.restrictedMethodPermissionBuilders = _chunkHZQ34FQTjs.restrictedMethodPermissionBuilders; exports.selectHooks = _chunk33MTKZ4Hjs.selectHooks;
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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"]}
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-BSAXPL2T.mjs";
23
+ } from "./chunk-GEJDXRTL.mjs";
24
24
  import {
25
25
  restrictedMethodPermissionBuilders
26
- } from "./chunk-SYB5TG5O.mjs";
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-FNUO7MQ4.mjs";
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-IZYMBIBD.mjs";
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";
@@ -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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,SAAS,sBAAsB;","names":[]}
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":[]}
@@ -2,19 +2,20 @@
2
2
 
3
3
 
4
4
 
5
- var _chunk4TUORIA6js = require('./chunk-4TUORIA6.js');
6
- require('./chunk-HZQ34FQT.js');
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-6VJVURH5.js');
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-SYUGPLEP.js');
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 = _chunk4TUORIA6js.buildSnapEndowmentSpecifications; exports.buildSnapRestrictedMethodSpecifications = _chunk4TUORIA6js.buildSnapRestrictedMethodSpecifications; exports.processSnapPermissions = _chunk4TUORIA6js.processSnapPermissions;
43
+ exports.buildSnapEndowmentSpecifications = _chunkPK2RPAXIjs.buildSnapEndowmentSpecifications; exports.buildSnapRestrictedMethodSpecifications = _chunkPK2RPAXIjs.buildSnapRestrictedMethodSpecifications; exports.processSnapPermissions = _chunkPK2RPAXIjs.processSnapPermissions;
43
44
  //# sourceMappingURL=permissions.js.map
@@ -2,19 +2,20 @@ import {
2
2
  buildSnapEndowmentSpecifications,
3
3
  buildSnapRestrictedMethodSpecifications,
4
4
  processSnapPermissions
5
- } from "./chunk-BSAXPL2T.mjs";
6
- import "./chunk-SYB5TG5O.mjs";
5
+ } from "./chunk-GEJDXRTL.mjs";
6
+ import "./chunk-V3KRSCUK.mjs";
7
+ import "./chunk-TE4W25CA.mjs";
7
8
  import "./chunk-JWDQUKKU.mjs";
8
- import "./chunk-FNUO7MQ4.mjs";
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-IZYMBIBD.mjs";
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 _chunk6VJVURH5js = require('../../chunk-6VJVURH5.js');
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 = _chunk6VJVURH5js.caveatMappers; exports.caveatSpecifications = _chunk6VJVURH5js.caveatSpecifications;
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-FNUO7MQ4.mjs";
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 _chunkSYUGPLEPjs = require('../chunk-SYUGPLEP.js');
5
+ var _chunk6XKVFSC2js = require('../chunk-6XKVFSC2.js');
6
6
 
7
7
 
8
8
 
9
9
 
10
- exports.getImplementation = _chunkSYUGPLEPjs.getImplementation; exports.getLocaleBuilder = _chunkSYUGPLEPjs.getLocaleBuilder; exports.specificationBuilder = _chunkSYUGPLEPjs.specificationBuilder;
10
+ exports.getImplementation = _chunk6XKVFSC2js.getImplementation; exports.getLocaleBuilder = _chunk6XKVFSC2js.getLocaleBuilder; exports.specificationBuilder = _chunk6XKVFSC2js.specificationBuilder;
11
11
  //# sourceMappingURL=getLocale.js.map
@@ -2,7 +2,7 @@ import {
2
2
  getImplementation,
3
3
  getLocaleBuilder,
4
4
  specificationBuilder
5
- } from "../chunk-IZYMBIBD.mjs";
5
+ } from "../chunk-AMMJ744B.mjs";
6
6
  export {
7
7
  getImplementation,
8
8
  getLocaleBuilder,
@@ -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":""}