@metamask/snaps-rpc-methods 11.0.0 → 11.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -1
- package/dist/__fixtures__/entropy.cjs +31 -0
- package/dist/__fixtures__/entropy.cjs.map +1 -0
- package/dist/{types/__fixtures__/entropy.d.ts → __fixtures__/entropy.d.cts} +1 -0
- package/dist/__fixtures__/entropy.d.cts.map +1 -0
- package/dist/__fixtures__/entropy.d.mts +15 -0
- package/dist/__fixtures__/entropy.d.mts.map +1 -0
- package/dist/__fixtures__/entropy.mjs +28 -0
- package/dist/__fixtures__/entropy.mjs.map +1 -0
- package/dist/__fixtures__/index.cjs +18 -0
- package/dist/__fixtures__/index.cjs.map +1 -0
- package/dist/__fixtures__/index.d.cts +2 -0
- package/dist/__fixtures__/index.d.cts.map +1 -0
- package/dist/__fixtures__/index.d.mts +2 -0
- package/dist/__fixtures__/index.d.mts.map +1 -0
- package/dist/__fixtures__/index.mjs +2 -0
- package/dist/__fixtures__/index.mjs.map +1 -0
- package/dist/endowments/caveats/generic.cjs +50 -0
- package/dist/endowments/caveats/generic.cjs.map +1 -0
- package/dist/{types/endowments/caveats/generic.d.ts → endowments/caveats/generic.d.cts} +3 -2
- package/dist/endowments/caveats/generic.d.cts.map +1 -0
- package/dist/endowments/caveats/generic.d.mts +20 -0
- package/dist/endowments/caveats/generic.d.mts.map +1 -0
- package/dist/endowments/caveats/generic.mjs +45 -6
- package/dist/endowments/caveats/generic.mjs.map +1 -1
- package/dist/endowments/caveats/index.cjs +19 -0
- package/dist/endowments/caveats/index.cjs.map +1 -0
- package/dist/endowments/caveats/index.d.cts +3 -0
- package/dist/endowments/caveats/index.d.cts.map +1 -0
- package/dist/endowments/caveats/index.d.mts +3 -0
- package/dist/endowments/caveats/index.d.mts.map +1 -0
- package/dist/endowments/caveats/index.mjs +2 -17
- package/dist/endowments/caveats/index.mjs.map +1 -1
- package/dist/endowments/caveats/requestTime.cjs +104 -0
- package/dist/{chunk-FCVWU5XH.js.map → endowments/caveats/requestTime.cjs.map} +1 -1
- package/dist/{types/endowments/caveats/requestTime.d.ts → endowments/caveats/requestTime.d.cts} +5 -4
- package/dist/endowments/caveats/requestTime.d.cts.map +1 -0
- package/dist/endowments/caveats/requestTime.d.mts +30 -0
- package/dist/endowments/caveats/requestTime.d.mts.map +1 -0
- package/dist/endowments/caveats/requestTime.mjs +96 -11
- package/dist/endowments/caveats/requestTime.mjs.map +1 -1
- package/dist/endowments/cronjob.cjs +105 -0
- package/dist/endowments/cronjob.cjs.map +1 -0
- package/dist/{types/endowments/cronjob.d.ts → endowments/cronjob.d.cts} +7 -6
- package/dist/endowments/cronjob.d.cts.map +1 -0
- package/dist/endowments/cronjob.d.mts +52 -0
- package/dist/endowments/cronjob.d.mts.map +1 -0
- package/dist/endowments/cronjob.mjs +97 -14
- package/dist/endowments/cronjob.mjs.map +1 -1
- package/dist/endowments/enum.cjs +18 -0
- package/dist/endowments/enum.cjs.map +1 -0
- package/dist/{types/endowments/enum.d.ts → endowments/enum.d.cts} +1 -0
- package/dist/endowments/enum.d.cts.map +1 -0
- package/dist/endowments/enum.d.mts +14 -0
- package/dist/endowments/enum.d.mts.map +1 -0
- package/dist/endowments/enum.mjs +14 -6
- package/dist/endowments/enum.mjs.map +1 -1
- package/dist/endowments/ethereum-provider.cjs +32 -0
- package/dist/endowments/ethereum-provider.cjs.map +1 -0
- package/dist/{types/endowments/ethereum-provider.d.ts → endowments/ethereum-provider.d.cts} +4 -3
- package/dist/endowments/ethereum-provider.d.cts.map +1 -0
- package/dist/endowments/ethereum-provider.d.mts +15 -0
- package/dist/endowments/ethereum-provider.d.mts.map +1 -0
- package/dist/endowments/ethereum-provider.mjs +27 -6
- package/dist/endowments/ethereum-provider.mjs.map +1 -1
- package/dist/endowments/home-page.cjs +28 -0
- package/dist/{chunk-2SFH57UV.js.map → endowments/home-page.cjs.map} +1 -1
- package/dist/{types/endowments/home-page.d.ts → endowments/home-page.d.cts} +5 -4
- package/dist/endowments/home-page.d.cts.map +1 -0
- package/dist/endowments/home-page.d.mts +16 -0
- package/dist/endowments/home-page.d.mts.map +1 -0
- package/dist/endowments/home-page.mjs +23 -6
- package/dist/endowments/home-page.mjs.map +1 -1
- package/dist/endowments/index.cjs +92 -0
- package/dist/endowments/index.cjs.map +1 -0
- package/dist/{types/endowments/index.d.ts → endowments/index.d.cts} +34 -33
- package/dist/endowments/index.d.cts.map +1 -0
- package/dist/endowments/index.d.mts +132 -0
- package/dist/endowments/index.d.mts.map +1 -0
- package/dist/endowments/index.mjs +65 -52
- package/dist/endowments/index.mjs.map +1 -1
- package/dist/endowments/keyring.cjs +96 -0
- package/dist/endowments/keyring.cjs.map +1 -0
- package/dist/{types/endowments/keyring.d.ts → endowments/keyring.d.cts} +7 -6
- package/dist/endowments/keyring.d.cts.map +1 -0
- package/dist/endowments/keyring.d.mts +40 -0
- package/dist/endowments/keyring.d.mts.map +1 -0
- package/dist/endowments/keyring.mjs +89 -15
- package/dist/endowments/keyring.mjs.map +1 -1
- package/dist/endowments/lifecycle-hooks.cjs +28 -0
- package/dist/endowments/lifecycle-hooks.cjs.map +1 -0
- package/dist/{types/endowments/lifecycle-hooks.d.ts → endowments/lifecycle-hooks.d.cts} +5 -4
- package/dist/endowments/lifecycle-hooks.d.cts.map +1 -0
- package/dist/endowments/lifecycle-hooks.d.mts +16 -0
- package/dist/endowments/lifecycle-hooks.d.mts.map +1 -0
- package/dist/endowments/lifecycle-hooks.mjs +23 -6
- package/dist/endowments/lifecycle-hooks.mjs.map +1 -1
- package/dist/endowments/name-lookup.cjs +141 -0
- package/dist/endowments/name-lookup.cjs.map +1 -0
- package/dist/{types/endowments/name-lookup.d.ts → endowments/name-lookup.d.cts} +6 -5
- package/dist/endowments/name-lookup.d.cts.map +1 -0
- package/dist/endowments/name-lookup.d.mts +50 -0
- package/dist/endowments/name-lookup.d.mts.map +1 -0
- package/dist/endowments/name-lookup.mjs +133 -17
- package/dist/endowments/name-lookup.mjs.map +1 -1
- package/dist/endowments/network-access.cjs +30 -0
- package/dist/endowments/network-access.cjs.map +1 -0
- package/dist/{types/endowments/network-access.d.ts → endowments/network-access.d.cts} +4 -3
- package/dist/endowments/network-access.d.cts.map +1 -0
- package/dist/endowments/network-access.d.mts +15 -0
- package/dist/endowments/network-access.d.mts.map +1 -0
- package/dist/endowments/network-access.mjs +25 -6
- package/dist/endowments/network-access.mjs.map +1 -1
- package/dist/endowments/rpc.cjs +90 -0
- package/dist/endowments/rpc.cjs.map +1 -0
- package/dist/{types/endowments/rpc.d.ts → endowments/rpc.d.cts} +7 -6
- package/dist/endowments/rpc.d.cts.map +1 -0
- package/dist/endowments/rpc.d.mts +39 -0
- package/dist/endowments/rpc.d.mts.map +1 -0
- package/dist/endowments/rpc.mjs +83 -15
- package/dist/endowments/rpc.mjs.map +1 -1
- package/dist/endowments/signature-insight.cjs +102 -0
- package/dist/endowments/signature-insight.cjs.map +1 -0
- package/dist/{types/endowments/signature-insight.d.ts → endowments/signature-insight.d.cts} +6 -5
- package/dist/endowments/signature-insight.d.cts.map +1 -0
- package/dist/endowments/signature-insight.d.mts +40 -0
- package/dist/endowments/signature-insight.d.mts.map +1 -0
- package/dist/endowments/signature-insight.mjs +95 -15
- package/dist/endowments/signature-insight.mjs.map +1 -1
- package/dist/endowments/transaction-insight.cjs +105 -0
- package/dist/endowments/transaction-insight.cjs.map +1 -0
- package/dist/{types/endowments/transaction-insight.d.ts → endowments/transaction-insight.d.cts} +6 -5
- package/dist/endowments/transaction-insight.d.cts.map +1 -0
- package/dist/endowments/transaction-insight.d.mts +40 -0
- package/dist/endowments/transaction-insight.d.mts.map +1 -0
- package/dist/endowments/transaction-insight.mjs +98 -15
- package/dist/endowments/transaction-insight.mjs.map +1 -1
- package/dist/endowments/web-assembly.cjs +31 -0
- package/dist/endowments/web-assembly.cjs.map +1 -0
- package/dist/{types/endowments/web-assembly.d.ts → endowments/web-assembly.d.cts} +4 -3
- package/dist/endowments/web-assembly.d.cts.map +1 -0
- package/dist/endowments/web-assembly.d.mts +15 -0
- package/dist/endowments/web-assembly.d.mts.map +1 -0
- package/dist/endowments/web-assembly.mjs +26 -6
- package/dist/endowments/web-assembly.mjs.map +1 -1
- package/dist/index.cjs +28 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +8 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +8 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +6 -122
- package/dist/index.mjs.map +1 -1
- package/dist/permissions.cjs +55 -0
- package/dist/permissions.cjs.map +1 -0
- package/dist/{types/permissions.d.ts → permissions.d.cts} +3 -2
- package/dist/permissions.d.cts.map +1 -0
- package/dist/permissions.d.mts +17 -0
- package/dist/permissions.d.mts.map +1 -0
- package/dist/permissions.mjs +48 -43
- package/dist/permissions.mjs.map +1 -1
- package/dist/permitted/createInterface.cjs +64 -0
- package/dist/permitted/createInterface.cjs.map +1 -0
- package/dist/{types/permitted/createInterface.d.ts → permitted/createInterface.d.cts} +62 -49
- package/dist/permitted/createInterface.d.cts.map +1 -0
- package/dist/permitted/createInterface.d.mts +193 -0
- package/dist/permitted/createInterface.d.mts.map +1 -0
- package/dist/permitted/createInterface.mjs +59 -5
- package/dist/permitted/createInterface.mjs.map +1 -1
- package/dist/permitted/getAllSnaps.cjs +39 -0
- package/dist/permitted/getAllSnaps.cjs.map +1 -0
- package/dist/{types/permitted/getAllSnaps.d.ts → permitted/getAllSnaps.d.cts} +4 -3
- package/dist/permitted/getAllSnaps.d.cts.map +1 -0
- package/dist/permitted/getAllSnaps.d.mts +15 -0
- package/dist/permitted/getAllSnaps.d.mts.map +1 -0
- package/dist/permitted/getAllSnaps.mjs +34 -5
- package/dist/permitted/getAllSnaps.mjs.map +1 -1
- package/dist/permitted/getClientStatus.cjs +32 -0
- package/dist/permitted/getClientStatus.cjs.map +1 -0
- package/dist/{types/permitted/getClientStatus.d.ts → permitted/getClientStatus.d.cts} +4 -3
- package/dist/permitted/getClientStatus.d.cts.map +1 -0
- package/dist/permitted/getClientStatus.d.mts +14 -0
- package/dist/permitted/getClientStatus.d.mts.map +1 -0
- package/dist/permitted/getClientStatus.mjs +27 -5
- package/dist/permitted/getClientStatus.mjs.map +1 -1
- package/dist/permitted/getFile.cjs +47 -0
- package/dist/permitted/getFile.cjs.map +1 -0
- package/dist/{types/permitted/getFile.d.ts → permitted/getFile.d.cts} +4 -3
- package/dist/permitted/getFile.d.cts.map +1 -0
- package/dist/permitted/getFile.d.mts +16 -0
- package/dist/permitted/getFile.d.mts.map +1 -0
- package/dist/permitted/getFile.mjs +42 -7
- package/dist/permitted/getFile.mjs.map +1 -1
- package/dist/permitted/getInterfaceState.cjs +62 -0
- package/dist/permitted/getInterfaceState.cjs.map +1 -0
- package/dist/{types/permitted/getInterfaceState.d.ts → permitted/getInterfaceState.d.cts} +4 -3
- package/dist/permitted/getInterfaceState.d.cts.map +1 -0
- package/dist/permitted/getInterfaceState.d.mts +19 -0
- package/dist/permitted/getInterfaceState.d.mts.map +1 -0
- package/dist/permitted/getInterfaceState.mjs +57 -5
- package/dist/permitted/getInterfaceState.mjs.map +1 -1
- package/dist/permitted/getSnaps.cjs +33 -0
- package/dist/permitted/getSnaps.cjs.map +1 -0
- package/dist/{types/permitted/getSnaps.d.ts → permitted/getSnaps.d.cts} +4 -3
- package/dist/permitted/getSnaps.d.cts.map +1 -0
- package/dist/permitted/getSnaps.d.mts +14 -0
- package/dist/permitted/getSnaps.d.mts.map +1 -0
- package/dist/permitted/getSnaps.mjs +28 -5
- package/dist/permitted/getSnaps.mjs.map +1 -1
- package/dist/permitted/handlers.cjs +31 -0
- package/dist/permitted/handlers.cjs.map +1 -0
- package/dist/permitted/handlers.d.cts +35 -0
- package/dist/permitted/handlers.d.cts.map +1 -0
- package/dist/permitted/handlers.d.mts +35 -0
- package/dist/permitted/handlers.d.mts.map +1 -0
- package/dist/permitted/handlers.mjs +26 -19
- package/dist/permitted/handlers.mjs.map +1 -1
- package/dist/permitted/index.cjs +19 -0
- package/dist/permitted/index.cjs.map +1 -0
- package/dist/permitted/index.d.cts +12 -0
- package/dist/permitted/index.d.cts.map +1 -0
- package/dist/permitted/index.d.mts +12 -0
- package/dist/permitted/index.d.mts.map +1 -0
- package/dist/permitted/index.mjs +2 -26
- package/dist/permitted/index.mjs.map +1 -1
- package/dist/permitted/invokeKeyring.cjs +83 -0
- package/dist/permitted/invokeKeyring.cjs.map +1 -0
- package/dist/{types/permitted/invokeKeyring.d.ts → permitted/invokeKeyring.d.cts} +4 -3
- package/dist/permitted/invokeKeyring.d.cts.map +1 -0
- package/dist/permitted/invokeKeyring.d.mts +16 -0
- package/dist/permitted/invokeKeyring.d.mts.map +1 -0
- package/dist/permitted/invokeKeyring.mjs +78 -6
- package/dist/permitted/invokeKeyring.mjs.map +1 -1
- package/dist/permitted/invokeSnapSugar.cjs +68 -0
- package/dist/permitted/invokeSnapSugar.cjs.map +1 -0
- package/dist/{types/permitted/invokeSnapSugar.d.ts → permitted/invokeSnapSugar.d.cts} +5 -4
- package/dist/permitted/invokeSnapSugar.d.cts.map +1 -0
- package/dist/permitted/invokeSnapSugar.d.mts +35 -0
- package/dist/permitted/invokeSnapSugar.d.mts.map +1 -0
- package/dist/permitted/invokeSnapSugar.mjs +61 -9
- package/dist/permitted/invokeSnapSugar.mjs.map +1 -1
- package/dist/permitted/middleware.cjs +40 -0
- package/dist/permitted/middleware.cjs.map +1 -0
- package/dist/{types/permitted/middleware.d.ts → permitted/middleware.d.cts} +3 -2
- package/dist/permitted/middleware.d.cts.map +1 -0
- package/dist/permitted/middleware.d.mts +11 -0
- package/dist/permitted/middleware.d.mts.map +1 -0
- package/dist/permitted/middleware.mjs +35 -20
- package/dist/permitted/middleware.mjs.map +1 -1
- package/dist/permitted/requestSnaps.cjs +121 -0
- package/dist/permitted/requestSnaps.cjs.map +1 -0
- package/dist/{types/permitted/requestSnaps.d.ts → permitted/requestSnaps.d.cts} +4 -3
- package/dist/permitted/requestSnaps.d.cts.map +1 -0
- package/dist/permitted/requestSnaps.d.mts +51 -0
- package/dist/permitted/requestSnaps.d.mts.map +1 -0
- package/dist/permitted/requestSnaps.mjs +114 -10
- package/dist/permitted/requestSnaps.mjs.map +1 -1
- package/dist/permitted/resolveInterface.cjs +65 -0
- package/dist/permitted/resolveInterface.cjs.map +1 -0
- package/dist/{types/permitted/resolveInterface.d.ts → permitted/resolveInterface.d.cts} +6 -5
- package/dist/permitted/resolveInterface.d.cts.map +1 -0
- package/dist/permitted/resolveInterface.d.mts +22 -0
- package/dist/permitted/resolveInterface.d.mts.map +1 -0
- package/dist/permitted/resolveInterface.mjs +60 -5
- package/dist/permitted/resolveInterface.mjs.map +1 -1
- package/dist/permitted/updateInterface.cjs +65 -0
- package/dist/permitted/updateInterface.cjs.map +1 -0
- package/dist/{types/permitted/updateInterface.d.ts → permitted/updateInterface.d.cts} +48 -47
- package/dist/permitted/updateInterface.d.cts.map +1 -0
- package/dist/permitted/updateInterface.d.mts +181 -0
- package/dist/permitted/updateInterface.d.mts.map +1 -0
- package/dist/permitted/updateInterface.mjs +60 -5
- package/dist/permitted/updateInterface.mjs.map +1 -1
- package/dist/restricted/caveats/index.cjs +22 -0
- package/dist/restricted/caveats/index.cjs.map +1 -0
- package/dist/{types/restricted/caveats/index.d.ts → restricted/caveats/index.d.cts} +3 -2
- package/dist/restricted/caveats/index.d.cts.map +1 -0
- package/dist/restricted/caveats/index.d.mts +9 -0
- package/dist/restricted/caveats/index.d.mts.map +1 -0
- package/dist/restricted/caveats/index.mjs +17 -15
- package/dist/restricted/caveats/index.mjs.map +1 -1
- package/dist/restricted/caveats/permittedCoinTypes.cjs +90 -0
- package/dist/restricted/caveats/permittedCoinTypes.cjs.map +1 -0
- package/dist/{types/restricted/caveats/permittedCoinTypes.d.ts → restricted/caveats/permittedCoinTypes.d.cts} +5 -4
- package/dist/restricted/caveats/permittedCoinTypes.d.cts.map +1 -0
- package/dist/restricted/caveats/permittedCoinTypes.d.mts +30 -0
- package/dist/restricted/caveats/permittedCoinTypes.d.mts.map +1 -0
- package/dist/restricted/caveats/permittedCoinTypes.mjs +82 -11
- package/dist/restricted/caveats/permittedCoinTypes.mjs.map +1 -1
- package/dist/restricted/caveats/permittedDerivationPaths.cjs +70 -0
- package/dist/restricted/caveats/permittedDerivationPaths.cjs.map +1 -0
- package/dist/{types/restricted/caveats/permittedDerivationPaths.d.ts → restricted/caveats/permittedDerivationPaths.d.cts} +5 -4
- package/dist/restricted/caveats/permittedDerivationPaths.d.cts.map +1 -0
- package/dist/restricted/caveats/permittedDerivationPaths.d.mts +33 -0
- package/dist/restricted/caveats/permittedDerivationPaths.d.mts.map +1 -0
- package/dist/restricted/caveats/permittedDerivationPaths.mjs +62 -11
- package/dist/restricted/caveats/permittedDerivationPaths.mjs.map +1 -1
- package/dist/restricted/caveats/snapIds.cjs +56 -0
- package/dist/restricted/caveats/snapIds.cjs.map +1 -0
- package/dist/{types/restricted/caveats/snapIds.d.ts → restricted/caveats/snapIds.d.cts} +5 -4
- package/dist/restricted/caveats/snapIds.d.cts.map +1 -0
- package/dist/restricted/caveats/snapIds.d.mts +22 -0
- package/dist/restricted/caveats/snapIds.d.mts.map +1 -0
- package/dist/restricted/caveats/snapIds.mjs +49 -9
- package/dist/restricted/caveats/snapIds.mjs.map +1 -1
- package/dist/restricted/dialog.cjs +222 -0
- package/dist/restricted/dialog.cjs.map +1 -0
- package/dist/restricted/dialog.d.cts +488 -0
- package/dist/restricted/dialog.d.cts.map +1 -0
- package/dist/restricted/dialog.d.mts +488 -0
- package/dist/restricted/dialog.d.mts.map +1 -0
- package/dist/restricted/dialog.mjs +216 -9
- package/dist/restricted/dialog.mjs.map +1 -1
- package/dist/restricted/getBip32Entropy.cjs +69 -0
- package/dist/restricted/getBip32Entropy.cjs.map +1 -0
- package/dist/{types/restricted/getBip32Entropy.d.ts → restricted/getBip32Entropy.d.cts} +6 -5
- package/dist/restricted/getBip32Entropy.d.cts.map +1 -0
- package/dist/restricted/getBip32Entropy.d.mts +45 -0
- package/dist/restricted/getBip32Entropy.d.mts.map +1 -0
- package/dist/restricted/getBip32Entropy.mjs +63 -8
- package/dist/restricted/getBip32Entropy.mjs.map +1 -1
- package/dist/restricted/getBip32PublicKey.cjs +78 -0
- package/dist/restricted/getBip32PublicKey.cjs.map +1 -0
- package/dist/{types/restricted/getBip32PublicKey.d.ts → restricted/getBip32PublicKey.d.cts} +7 -6
- package/dist/restricted/getBip32PublicKey.d.cts.map +1 -0
- package/dist/restricted/getBip32PublicKey.d.mts +54 -0
- package/dist/restricted/getBip32PublicKey.d.mts.map +1 -0
- package/dist/restricted/getBip32PublicKey.mjs +72 -10
- package/dist/restricted/getBip32PublicKey.mjs.map +1 -1
- package/dist/restricted/getBip44Entropy.cjs +71 -0
- package/dist/restricted/getBip44Entropy.cjs.map +1 -0
- package/dist/{types/restricted/getBip44Entropy.d.ts → restricted/getBip44Entropy.d.cts} +6 -5
- package/dist/restricted/getBip44Entropy.d.cts.map +1 -0
- package/dist/restricted/getBip44Entropy.d.mts +47 -0
- package/dist/restricted/getBip44Entropy.d.mts.map +1 -0
- package/dist/restricted/getBip44Entropy.mjs +65 -7
- package/dist/restricted/getBip44Entropy.mjs.map +1 -1
- package/dist/restricted/getEntropy.cjs +59 -0
- package/dist/restricted/getEntropy.cjs.map +1 -0
- package/dist/{types/restricted/getEntropy.d.ts → restricted/getEntropy.d.cts} +7 -6
- package/dist/restricted/getEntropy.d.cts.map +1 -0
- package/dist/restricted/getEntropy.d.mts +62 -0
- package/dist/restricted/getEntropy.d.mts.map +1 -0
- package/dist/restricted/getEntropy.mjs +54 -8
- package/dist/restricted/getEntropy.mjs.map +1 -1
- package/dist/restricted/getLocale.cjs +47 -0
- package/dist/restricted/getLocale.cjs.map +1 -0
- package/dist/{types/restricted/getLocale.d.ts → restricted/getLocale.d.cts} +6 -5
- package/dist/restricted/getLocale.d.cts.map +1 -0
- package/dist/restricted/getLocale.d.mts +50 -0
- package/dist/restricted/getLocale.d.mts.map +1 -0
- package/dist/restricted/getLocale.mjs +40 -9
- package/dist/restricted/getLocale.mjs.map +1 -1
- package/dist/restricted/getPreferences.cjs +46 -0
- package/dist/restricted/getPreferences.cjs.map +1 -0
- package/dist/{types/restricted/getPreferences.d.ts → restricted/getPreferences.d.cts} +6 -5
- package/dist/restricted/getPreferences.d.cts.map +1 -0
- package/dist/restricted/getPreferences.d.mts +49 -0
- package/dist/restricted/getPreferences.d.mts.map +1 -0
- package/dist/restricted/getPreferences.mjs +39 -9
- package/dist/restricted/getPreferences.mjs.map +1 -1
- package/dist/restricted/index.cjs +49 -0
- package/dist/restricted/index.cjs.map +1 -0
- package/dist/{types/restricted/index.d.ts → restricted/index.d.cts} +29 -28
- package/dist/restricted/index.d.cts.map +1 -0
- package/dist/restricted/index.d.mts +169 -0
- package/dist/restricted/index.d.mts.map +1 -0
- package/dist/restricted/index.mjs +27 -35
- package/dist/restricted/index.mjs.map +1 -1
- package/dist/restricted/invokeSnap.cjs +96 -0
- package/dist/restricted/invokeSnap.cjs.map +1 -0
- package/dist/{types/restricted/invokeSnap.d.ts → restricted/invokeSnap.d.cts} +8 -6
- package/dist/restricted/invokeSnap.d.cts.map +1 -0
- package/dist/restricted/invokeSnap.d.mts +65 -0
- package/dist/restricted/invokeSnap.d.mts.map +1 -0
- package/dist/restricted/invokeSnap.mjs +89 -11
- package/dist/restricted/invokeSnap.mjs.map +1 -1
- package/dist/restricted/manageAccounts.cjs +61 -0
- package/dist/restricted/manageAccounts.cjs.map +1 -0
- package/dist/{types/restricted/manageAccounts.d.ts → restricted/manageAccounts.d.cts} +6 -5
- package/dist/restricted/manageAccounts.d.cts.map +1 -0
- package/dist/restricted/manageAccounts.d.mts +65 -0
- package/dist/restricted/manageAccounts.d.mts.map +1 -0
- package/dist/restricted/manageAccounts.mjs +54 -11
- package/dist/restricted/manageAccounts.mjs.map +1 -1
- package/dist/restricted/manageState.cjs +175 -0
- package/dist/restricted/manageState.cjs.map +1 -0
- package/dist/{types/restricted/manageState.d.ts → restricted/manageState.d.cts} +6 -5
- package/dist/restricted/manageState.d.cts.map +1 -0
- package/dist/restricted/manageState.d.mts +111 -0
- package/dist/restricted/manageState.d.mts.map +1 -0
- package/dist/restricted/manageState.mjs +166 -18
- package/dist/restricted/manageState.mjs.map +1 -1
- package/dist/restricted/notify.cjs +108 -0
- package/dist/restricted/notify.cjs.map +1 -0
- package/dist/{types/restricted/notify.d.ts → restricted/notify.d.cts} +7 -6
- package/dist/restricted/notify.d.cts.map +1 -0
- package/dist/restricted/notify.d.mts +83 -0
- package/dist/restricted/notify.d.mts.map +1 -0
- package/dist/restricted/notify.mjs +100 -11
- package/dist/restricted/notify.mjs.map +1 -1
- package/dist/utils.cjs +140 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/{types/utils.d.ts → utils.d.cts} +6 -4
- package/dist/utils.d.cts.map +1 -0
- package/dist/utils.d.mts +98 -0
- package/dist/utils.d.mts.map +1 -0
- package/dist/utils.mjs +132 -12
- package/dist/utils.mjs.map +1 -1
- package/package.json +20 -19
- package/dist/chunk-23XDKQW2.mjs +0 -73
- package/dist/chunk-23XDKQW2.mjs.map +0 -1
- package/dist/chunk-2CTOCP34.mjs +0 -45
- package/dist/chunk-2CTOCP34.mjs.map +0 -1
- package/dist/chunk-2L2ATCIK.mjs +0 -78
- package/dist/chunk-2L2ATCIK.mjs.map +0 -1
- package/dist/chunk-2RDYC42U.mjs +0 -67
- package/dist/chunk-2RDYC42U.mjs.map +0 -1
- package/dist/chunk-2SFH57UV.js +0 -21
- package/dist/chunk-33LLA2MH.mjs +0 -75
- package/dist/chunk-33LLA2MH.mjs.map +0 -1
- package/dist/chunk-33MTKZ4H.js +0 -90
- package/dist/chunk-33MTKZ4H.js.map +0 -1
- package/dist/chunk-3UAWEHMF.js +0 -18
- package/dist/chunk-3UAWEHMF.js.map +0 -1
- package/dist/chunk-3WCLDJAS.mjs +0 -74
- package/dist/chunk-3WCLDJAS.mjs.map +0 -1
- package/dist/chunk-3WKIKYUH.js +0 -78
- package/dist/chunk-3WKIKYUH.js.map +0 -1
- package/dist/chunk-4D2B2UQ6.mjs +0 -23
- package/dist/chunk-4D2B2UQ6.mjs.map +0 -1
- package/dist/chunk-4LSOS7SM.js +0 -23
- package/dist/chunk-4LSOS7SM.js.map +0 -1
- package/dist/chunk-4PWFZPJC.js +0 -79
- package/dist/chunk-4PWFZPJC.js.map +0 -1
- package/dist/chunk-57BL7O2P.mjs +0 -69
- package/dist/chunk-57BL7O2P.mjs.map +0 -1
- package/dist/chunk-62URQ5VS.mjs +0 -18
- package/dist/chunk-62URQ5VS.mjs.map +0 -1
- package/dist/chunk-6XKVFSC2.js +0 -32
- package/dist/chunk-6XKVFSC2.js.map +0 -1
- package/dist/chunk-756OQVOC.js +0 -67
- package/dist/chunk-756OQVOC.js.map +0 -1
- package/dist/chunk-7CV677MM.js +0 -42
- package/dist/chunk-7CV677MM.js.map +0 -1
- package/dist/chunk-7HVABE5R.js +0 -74
- package/dist/chunk-7HVABE5R.js.map +0 -1
- package/dist/chunk-7P6TF6CE.mjs +0 -55
- package/dist/chunk-7P6TF6CE.mjs.map +0 -1
- package/dist/chunk-7TVJV425.js +0 -1
- package/dist/chunk-7TVJV425.js.map +0 -1
- package/dist/chunk-A6H6I4VH.js +0 -61
- package/dist/chunk-A6H6I4VH.js.map +0 -1
- package/dist/chunk-AMMJ744B.mjs +0 -32
- package/dist/chunk-AMMJ744B.mjs.map +0 -1
- package/dist/chunk-ATBKAX2S.js +0 -39
- package/dist/chunk-ATBKAX2S.js.map +0 -1
- package/dist/chunk-B3NIHNXW.js +0 -23
- package/dist/chunk-B3NIHNXW.js.map +0 -1
- package/dist/chunk-CD4OUHO5.mjs +0 -20
- package/dist/chunk-CD4OUHO5.mjs.map +0 -1
- package/dist/chunk-CDAVFOUS.js +0 -53
- package/dist/chunk-CDAVFOUS.js.map +0 -1
- package/dist/chunk-CH5O2YCX.mjs +0 -18
- package/dist/chunk-CH5O2YCX.mjs.map +0 -1
- package/dist/chunk-DLVPMPRZ.js +0 -45
- package/dist/chunk-DLVPMPRZ.js.map +0 -1
- package/dist/chunk-DTZF746A.mjs +0 -21
- package/dist/chunk-DTZF746A.mjs.map +0 -1
- package/dist/chunk-E27BGHCR.js +0 -78
- package/dist/chunk-E27BGHCR.js.map +0 -1
- package/dist/chunk-ELCOEVKA.js +0 -196
- package/dist/chunk-ELCOEVKA.js.map +0 -1
- package/dist/chunk-EOXTZF5U.js +0 -47
- package/dist/chunk-EOXTZF5U.js.map +0 -1
- package/dist/chunk-FCVWU5XH.js +0 -73
- package/dist/chunk-FFHVA6PP.js +0 -82
- package/dist/chunk-FFHVA6PP.js.map +0 -1
- package/dist/chunk-FJ7COFRJ.mjs +0 -54
- package/dist/chunk-FJ7COFRJ.mjs.map +0 -1
- package/dist/chunk-FM4LNQR7.mjs +0 -34
- package/dist/chunk-FM4LNQR7.mjs.map +0 -1
- package/dist/chunk-GE5XFDUE.js +0 -21
- package/dist/chunk-GE5XFDUE.js.map +0 -1
- package/dist/chunk-GEJDXRTL.mjs +0 -59
- package/dist/chunk-GEJDXRTL.mjs.map +0 -1
- package/dist/chunk-GPV4ETUH.mjs +0 -47
- package/dist/chunk-GPV4ETUH.mjs.map +0 -1
- package/dist/chunk-H6X3CWWQ.js +0 -54
- package/dist/chunk-H6X3CWWQ.js.map +0 -1
- package/dist/chunk-HOECEYMT.mjs +0 -70
- package/dist/chunk-HOECEYMT.mjs.map +0 -1
- package/dist/chunk-I2P65KBQ.mjs +0 -67
- package/dist/chunk-I2P65KBQ.mjs.map +0 -1
- package/dist/chunk-I3G6S6MJ.js +0 -68
- package/dist/chunk-I3G6S6MJ.js.map +0 -1
- package/dist/chunk-IE6EHYEG.js +0 -57
- package/dist/chunk-IE6EHYEG.js.map +0 -1
- package/dist/chunk-JWDQUKKU.mjs +0 -80
- package/dist/chunk-JWDQUKKU.mjs.map +0 -1
- package/dist/chunk-K3UL5RVN.mjs +0 -43
- package/dist/chunk-K3UL5RVN.mjs.map +0 -1
- package/dist/chunk-KRSIAVUJ.js +0 -115
- package/dist/chunk-KRSIAVUJ.js.map +0 -1
- package/dist/chunk-KSTF5JYB.mjs +0 -23
- package/dist/chunk-KSTF5JYB.mjs.map +0 -1
- package/dist/chunk-LP3RWEDJ.js +0 -43
- package/dist/chunk-LP3RWEDJ.js.map +0 -1
- package/dist/chunk-LR7UR4YU.mjs +0 -52
- package/dist/chunk-LR7UR4YU.mjs.map +0 -1
- package/dist/chunk-LXJBBRQ4.mjs +0 -57
- package/dist/chunk-LXJBBRQ4.mjs.map +0 -1
- package/dist/chunk-M2JQCKR7.js +0 -143
- package/dist/chunk-M2JQCKR7.js.map +0 -1
- package/dist/chunk-MC2Z4NF6.mjs +0 -45
- package/dist/chunk-MC2Z4NF6.mjs.map +0 -1
- package/dist/chunk-MXPVC2XP.mjs +0 -105
- package/dist/chunk-MXPVC2XP.mjs.map +0 -1
- package/dist/chunk-NU4NAAFG.js +0 -1
- package/dist/chunk-NU4NAAFG.js.map +0 -1
- package/dist/chunk-NWT2EXFD.js +0 -18
- package/dist/chunk-NWT2EXFD.js.map +0 -1
- package/dist/chunk-O66NZFSD.mjs +0 -23
- package/dist/chunk-O66NZFSD.mjs.map +0 -1
- package/dist/chunk-ODN35VOK.mjs +0 -119
- package/dist/chunk-ODN35VOK.mjs.map +0 -1
- package/dist/chunk-OI33OL7K.js +0 -47
- package/dist/chunk-OI33OL7K.js.map +0 -1
- package/dist/chunk-PIAWDTWO.mjs +0 -68
- package/dist/chunk-PIAWDTWO.mjs.map +0 -1
- package/dist/chunk-PIRQCNBJ.mjs +0 -78
- package/dist/chunk-PIRQCNBJ.mjs.map +0 -1
- package/dist/chunk-PK2RPAXI.js +0 -59
- package/dist/chunk-PK2RPAXI.js.map +0 -1
- package/dist/chunk-PS6OEQXL.js +0 -105
- package/dist/chunk-PS6OEQXL.js.map +0 -1
- package/dist/chunk-PXU6PORA.js +0 -119
- package/dist/chunk-PXU6PORA.js.map +0 -1
- package/dist/chunk-Q27K2I6Z.js +0 -23
- package/dist/chunk-Q27K2I6Z.js.map +0 -1
- package/dist/chunk-QDZAWH6F.js +0 -80
- package/dist/chunk-QDZAWH6F.js.map +0 -1
- package/dist/chunk-QMULJEYN.js +0 -35
- package/dist/chunk-QMULJEYN.js.map +0 -1
- package/dist/chunk-RHPSYX7X.js +0 -34
- package/dist/chunk-RHPSYX7X.js.map +0 -1
- package/dist/chunk-T56DKVFS.js +0 -70
- package/dist/chunk-T56DKVFS.js.map +0 -1
- package/dist/chunk-TAXLFFV4.mjs +0 -115
- package/dist/chunk-TAXLFFV4.mjs.map +0 -1
- package/dist/chunk-TE4W25CA.mjs +0 -143
- package/dist/chunk-TE4W25CA.mjs.map +0 -1
- package/dist/chunk-TG63GBK3.mjs +0 -1
- package/dist/chunk-TG63GBK3.mjs.map +0 -1
- package/dist/chunk-TNENASGX.mjs +0 -1
- package/dist/chunk-TNENASGX.mjs.map +0 -1
- package/dist/chunk-TQCUJQHY.mjs +0 -196
- package/dist/chunk-TQCUJQHY.mjs.map +0 -1
- package/dist/chunk-TT4DP2YW.mjs +0 -35
- package/dist/chunk-TT4DP2YW.mjs.map +0 -1
- package/dist/chunk-TVC3E5LI.mjs +0 -42
- package/dist/chunk-TVC3E5LI.mjs.map +0 -1
- package/dist/chunk-U6TJQLNV.js +0 -45
- package/dist/chunk-U6TJQLNV.js.map +0 -1
- package/dist/chunk-UB3733UY.mjs +0 -23
- package/dist/chunk-UB3733UY.mjs.map +0 -1
- package/dist/chunk-UCWANXBZ.js +0 -45
- package/dist/chunk-UCWANXBZ.js.map +0 -1
- package/dist/chunk-UF3UJTY3.js +0 -55
- package/dist/chunk-UF3UJTY3.js.map +0 -1
- package/dist/chunk-UY4DUF53.mjs +0 -45
- package/dist/chunk-UY4DUF53.mjs.map +0 -1
- package/dist/chunk-V3KRSCUK.mjs +0 -53
- package/dist/chunk-V3KRSCUK.mjs.map +0 -1
- package/dist/chunk-VUA6ICJO.js +0 -52
- package/dist/chunk-VUA6ICJO.js.map +0 -1
- package/dist/chunk-VVBTXSID.mjs +0 -82
- package/dist/chunk-VVBTXSID.mjs.map +0 -1
- package/dist/chunk-VYII7C3J.mjs +0 -79
- package/dist/chunk-VYII7C3J.mjs.map +0 -1
- package/dist/chunk-W33UWNA2.mjs +0 -90
- package/dist/chunk-W33UWNA2.mjs.map +0 -1
- package/dist/chunk-XGMYBPQR.mjs +0 -47
- package/dist/chunk-XGMYBPQR.mjs.map +0 -1
- package/dist/chunk-YGKFOOWI.js +0 -20
- package/dist/chunk-YGKFOOWI.js.map +0 -1
- package/dist/chunk-YOHE52XB.js +0 -23
- package/dist/chunk-YOHE52XB.js.map +0 -1
- package/dist/chunk-YT2Q3W5C.js +0 -69
- package/dist/chunk-YT2Q3W5C.js.map +0 -1
- package/dist/chunk-YZMFLB67.js +0 -75
- package/dist/chunk-YZMFLB67.js.map +0 -1
- package/dist/chunk-Z6YFGWHN.mjs +0 -61
- package/dist/chunk-Z6YFGWHN.mjs.map +0 -1
- package/dist/chunk-ZH3FC55E.mjs +0 -21
- package/dist/chunk-ZH3FC55E.mjs.map +0 -1
- package/dist/chunk-ZKISN6YP.js +0 -67
- package/dist/chunk-ZKISN6YP.js.map +0 -1
- package/dist/chunk-ZXDCQWMJ.mjs +0 -39
- package/dist/chunk-ZXDCQWMJ.mjs.map +0 -1
- package/dist/endowments/caveats/generic.js +0 -7
- package/dist/endowments/caveats/generic.js.map +0 -1
- package/dist/endowments/caveats/index.js +0 -18
- package/dist/endowments/caveats/index.js.map +0 -1
- package/dist/endowments/caveats/requestTime.js +0 -13
- package/dist/endowments/caveats/requestTime.js.map +0 -1
- package/dist/endowments/cronjob.js +0 -16
- package/dist/endowments/cronjob.js.map +0 -1
- package/dist/endowments/enum.js +0 -7
- package/dist/endowments/enum.js.map +0 -1
- package/dist/endowments/ethereum-provider.js +0 -8
- package/dist/endowments/ethereum-provider.js.map +0 -1
- package/dist/endowments/home-page.js +0 -8
- package/dist/endowments/home-page.js.map +0 -1
- package/dist/endowments/index.js +0 -54
- package/dist/endowments/index.js.map +0 -1
- package/dist/endowments/keyring.js +0 -17
- package/dist/endowments/keyring.js.map +0 -1
- package/dist/endowments/lifecycle-hooks.js +0 -8
- package/dist/endowments/lifecycle-hooks.js.map +0 -1
- package/dist/endowments/name-lookup.js +0 -19
- package/dist/endowments/name-lookup.js.map +0 -1
- package/dist/endowments/network-access.js +0 -8
- package/dist/endowments/network-access.js.map +0 -1
- package/dist/endowments/rpc.js +0 -17
- package/dist/endowments/rpc.js.map +0 -1
- package/dist/endowments/signature-insight.js +0 -17
- package/dist/endowments/signature-insight.js.map +0 -1
- package/dist/endowments/transaction-insight.js +0 -17
- package/dist/endowments/transaction-insight.js.map +0 -1
- package/dist/endowments/web-assembly.js +0 -8
- package/dist/endowments/web-assembly.js.map +0 -1
- package/dist/index.js +0 -123
- package/dist/index.js.map +0 -1
- package/dist/permissions.js +0 -44
- package/dist/permissions.js.map +0 -1
- package/dist/permitted/createInterface.js +0 -7
- package/dist/permitted/createInterface.js.map +0 -1
- package/dist/permitted/getAllSnaps.js +0 -7
- package/dist/permitted/getAllSnaps.js.map +0 -1
- package/dist/permitted/getClientStatus.js +0 -7
- package/dist/permitted/getClientStatus.js.map +0 -1
- package/dist/permitted/getFile.js +0 -9
- package/dist/permitted/getFile.js.map +0 -1
- package/dist/permitted/getInterfaceState.js +0 -7
- package/dist/permitted/getInterfaceState.js.map +0 -1
- package/dist/permitted/getSnaps.js +0 -7
- package/dist/permitted/getSnaps.js.map +0 -1
- package/dist/permitted/handlers.js +0 -21
- package/dist/permitted/handlers.js.map +0 -1
- package/dist/permitted/index.js +0 -27
- package/dist/permitted/index.js.map +0 -1
- package/dist/permitted/invokeKeyring.js +0 -8
- package/dist/permitted/invokeKeyring.js.map +0 -1
- package/dist/permitted/invokeSnapSugar.js +0 -11
- package/dist/permitted/invokeSnapSugar.js.map +0 -1
- package/dist/permitted/middleware.js +0 -21
- package/dist/permitted/middleware.js.map +0 -1
- package/dist/permitted/requestSnaps.js +0 -12
- package/dist/permitted/requestSnaps.js.map +0 -1
- package/dist/permitted/resolveInterface.js +0 -7
- package/dist/permitted/resolveInterface.js.map +0 -1
- package/dist/permitted/updateInterface.js +0 -7
- package/dist/permitted/updateInterface.js.map +0 -1
- package/dist/restricted/caveats/index.js +0 -17
- package/dist/restricted/caveats/index.js.map +0 -1
- package/dist/restricted/caveats/permittedCoinTypes.js +0 -13
- package/dist/restricted/caveats/permittedCoinTypes.js.map +0 -1
- package/dist/restricted/caveats/permittedDerivationPaths.js +0 -13
- package/dist/restricted/caveats/permittedDerivationPaths.js.map +0 -1
- package/dist/restricted/caveats/snapIds.js +0 -11
- package/dist/restricted/caveats/snapIds.js.map +0 -1
- package/dist/restricted/dialog.js +0 -11
- package/dist/restricted/dialog.js.map +0 -1
- package/dist/restricted/getBip32Entropy.js +0 -10
- package/dist/restricted/getBip32Entropy.js.map +0 -1
- package/dist/restricted/getBip32PublicKey.js +0 -12
- package/dist/restricted/getBip32PublicKey.js.map +0 -1
- package/dist/restricted/getBip44Entropy.js +0 -9
- package/dist/restricted/getBip44Entropy.js.map +0 -1
- package/dist/restricted/getEntropy.js +0 -10
- package/dist/restricted/getEntropy.js.map +0 -1
- package/dist/restricted/getLocale.js +0 -11
- package/dist/restricted/getLocale.js.map +0 -1
- package/dist/restricted/getPreferences.js +0 -11
- package/dist/restricted/getPreferences.js.map +0 -1
- package/dist/restricted/index.js +0 -37
- package/dist/restricted/index.js.map +0 -1
- package/dist/restricted/invokeSnap.js +0 -13
- package/dist/restricted/invokeSnap.js.map +0 -1
- package/dist/restricted/manageAccounts.js +0 -13
- package/dist/restricted/manageAccounts.js.map +0 -1
- package/dist/restricted/manageState.js +0 -20
- package/dist/restricted/manageState.js.map +0 -1
- package/dist/restricted/notify.js +0 -13
- package/dist/restricted/notify.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/dist/types/__fixtures__/index.d.ts +0 -1
- package/dist/types/endowments/caveats/index.d.ts +0 -2
- package/dist/types/index.d.ts +0 -7
- package/dist/types/permitted/handlers.d.ts +0 -34
- package/dist/types/permitted/index.d.ts +0 -11
- package/dist/types/restricted/dialog.d.ts +0 -1463
- package/dist/utils.js +0 -13
- package/dist/utils.js.map +0 -1
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { PermissionSpecificationBuilder, PermissionValidatorConstraint, RestrictedMethodOptions } from "@metamask/permission-controller";
|
|
2
|
+
import { PermissionType } from "@metamask/permission-controller";
|
|
3
|
+
import type { GetBip32PublicKeyParams, GetBip32PublicKeyResult } from "@metamask/snaps-sdk";
|
|
4
|
+
import type { NonEmptyArray } from "@metamask/utils";
|
|
5
|
+
import type { MethodHooksObject } from "../utils.mjs";
|
|
6
|
+
declare const targetName = "snap_getBip32PublicKey";
|
|
7
|
+
export type GetBip32PublicKeyMethodHooks = {
|
|
8
|
+
/**
|
|
9
|
+
* @returns The mnemonic of the user's primary keyring.
|
|
10
|
+
*/
|
|
11
|
+
getMnemonic: () => Promise<Uint8Array>;
|
|
12
|
+
/**
|
|
13
|
+
* Waits for the extension to be unlocked.
|
|
14
|
+
*
|
|
15
|
+
* @returns A promise that resolves once the extension is unlocked.
|
|
16
|
+
*/
|
|
17
|
+
getUnlockPromise: (shouldShowUnlockRequest: boolean) => Promise<void>;
|
|
18
|
+
};
|
|
19
|
+
type GetBip32PublicKeySpecificationBuilderOptions = {
|
|
20
|
+
methodHooks: GetBip32PublicKeyMethodHooks;
|
|
21
|
+
};
|
|
22
|
+
export declare const Bip32PublicKeyArgsStruct: import("@metamask/superstruct").Struct<{
|
|
23
|
+
curve: "ed25519" | "ed25519Bip32" | "secp256k1";
|
|
24
|
+
path: string[];
|
|
25
|
+
compressed?: boolean | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
path: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
28
|
+
curve: import("@metamask/superstruct").Describe<"ed25519" | "ed25519Bip32" | "secp256k1">;
|
|
29
|
+
compressed: import("@metamask/superstruct").Struct<boolean | undefined, null>;
|
|
30
|
+
}>;
|
|
31
|
+
export declare const getBip32PublicKeyBuilder: Readonly<{
|
|
32
|
+
readonly targetName: "snap_getBip32PublicKey";
|
|
33
|
+
readonly specificationBuilder: PermissionSpecificationBuilder<PermissionType.RestrictedMethod, GetBip32PublicKeySpecificationBuilderOptions, {
|
|
34
|
+
permissionType: PermissionType.RestrictedMethod;
|
|
35
|
+
targetName: typeof targetName;
|
|
36
|
+
methodImplementation: ReturnType<typeof getBip32PublicKeyImplementation>;
|
|
37
|
+
allowedCaveats: Readonly<NonEmptyArray<string>> | null;
|
|
38
|
+
validator: PermissionValidatorConstraint;
|
|
39
|
+
}>;
|
|
40
|
+
readonly methodHooks: MethodHooksObject<GetBip32PublicKeyMethodHooks>;
|
|
41
|
+
}>;
|
|
42
|
+
/**
|
|
43
|
+
* Builds the method implementation for `snap_getBip32PublicKey`.
|
|
44
|
+
*
|
|
45
|
+
* @param hooks - The RPC method hooks.
|
|
46
|
+
* @param hooks.getMnemonic - A function to retrieve the Secret Recovery Phrase of the user.
|
|
47
|
+
* @param hooks.getUnlockPromise - A function that resolves once the MetaMask extension is unlocked
|
|
48
|
+
* and prompts the user to unlock their MetaMask if it is locked.
|
|
49
|
+
* @returns The method implementation which returns a public key.
|
|
50
|
+
* @throws If the params are invalid.
|
|
51
|
+
*/
|
|
52
|
+
export declare function getBip32PublicKeyImplementation({ getMnemonic, getUnlockPromise, }: GetBip32PublicKeyMethodHooks): (args: RestrictedMethodOptions<GetBip32PublicKeyParams>) => Promise<GetBip32PublicKeyResult>;
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=getBip32PublicKey.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBip32PublicKey.d.mts","sourceRoot":"","sources":["../../src/restricted/getBip32PublicKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC9B,6BAA6B,EAC7B,uBAAuB,EAExB,wCAAwC;AACzC,OAAO,EAAE,cAAc,EAAe,wCAAwC;AAE9E,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACxB,4BAA4B;AAQ7B,OAAO,KAAK,EAAE,aAAa,EAAE,wBAAwB;AAGrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAiB;AAGlD,QAAA,MAAM,UAAU,2BAA2B,CAAC;AAE5C,MAAM,MAAM,4BAA4B,GAAG;IACzC;;OAEG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;IAEvC;;;;OAIG;IACH,gBAAgB,EAAE,CAAC,uBAAuB,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE,CAAC;AAEF,KAAK,4CAA4C,GAAG;IAClD,WAAW,EAAE,4BAA4B,CAAC;CAC3C,CAAC;AAUF,eAAO,MAAM,wBAAwB;;;;;;;;EAMpC,CAAC;AAwCF,eAAO,MAAM,wBAAwB;;;wBArDnB,eAAe,gBAAgB;oBACnC,iBAAiB;8BACP,WAAW,sCAAsC,CAAC;wBACxD,SAAS,cAAc,MAAM,CAAC,CAAC,GAAG,IAAI;mBAC3C,6BAA6B;;;EAqD/B,CAAC;AAEZ;;;;;;;;;GASG;AACH,wBAAgB,+BAA+B,CAAC,EAC9C,WAAW,EACX,gBAAgB,GACjB,EAAE,4BAA4B,UAErB,wBAAwB,uBAAuB,CAAC,KACrD,QAAQ,uBAAuB,CAAC,CAuBpC"}
|
|
@@ -1,12 +1,74 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from "
|
|
6
|
-
import "../
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { PermissionType, SubjectType } from "@metamask/permission-controller";
|
|
2
|
+
import { rpcErrors } from "@metamask/rpc-errors";
|
|
3
|
+
import { bip32entropy, Bip32PathStruct, CurveStruct, SnapCaveatType } from "@metamask/snaps-utils";
|
|
4
|
+
import { boolean, object, optional } from "@metamask/superstruct";
|
|
5
|
+
import { assertStruct } from "@metamask/utils";
|
|
6
|
+
import { getNode } from "../utils.mjs";
|
|
7
|
+
const targetName = 'snap_getBip32PublicKey';
|
|
8
|
+
export const Bip32PublicKeyArgsStruct = bip32entropy(object({
|
|
9
|
+
path: Bip32PathStruct,
|
|
10
|
+
curve: CurveStruct,
|
|
11
|
+
compressed: optional(boolean()),
|
|
12
|
+
}));
|
|
13
|
+
/**
|
|
14
|
+
* The specification builder for the `snap_getBip32PublicKey` permission.
|
|
15
|
+
* `snap_getBip32PublicKey` lets the Snap retrieve public keys for a particular
|
|
16
|
+
* BIP-32 node.
|
|
17
|
+
*
|
|
18
|
+
* @param options - The specification builder options.
|
|
19
|
+
* @param options.methodHooks - The RPC method hooks needed by the method implementation.
|
|
20
|
+
* @returns The specification for the `snap_getBip32PublicKey` permission.
|
|
21
|
+
*/
|
|
22
|
+
const specificationBuilder = ({ methodHooks }) => {
|
|
23
|
+
return {
|
|
24
|
+
permissionType: PermissionType.RestrictedMethod,
|
|
25
|
+
targetName,
|
|
26
|
+
allowedCaveats: [SnapCaveatType.PermittedDerivationPaths],
|
|
27
|
+
methodImplementation: getBip32PublicKeyImplementation(methodHooks),
|
|
28
|
+
validator: ({ caveats }) => {
|
|
29
|
+
if (caveats?.length !== 1 ||
|
|
30
|
+
caveats[0].type !== SnapCaveatType.PermittedDerivationPaths) {
|
|
31
|
+
throw rpcErrors.invalidParams({
|
|
32
|
+
message: `Expected a single "${SnapCaveatType.PermittedDerivationPaths}" caveat.`,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
subjectTypes: [SubjectType.Snap],
|
|
37
|
+
};
|
|
11
38
|
};
|
|
39
|
+
const methodHooks = {
|
|
40
|
+
getMnemonic: true,
|
|
41
|
+
getUnlockPromise: true,
|
|
42
|
+
};
|
|
43
|
+
export const getBip32PublicKeyBuilder = Object.freeze({
|
|
44
|
+
targetName,
|
|
45
|
+
specificationBuilder,
|
|
46
|
+
methodHooks,
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* Builds the method implementation for `snap_getBip32PublicKey`.
|
|
50
|
+
*
|
|
51
|
+
* @param hooks - The RPC method hooks.
|
|
52
|
+
* @param hooks.getMnemonic - A function to retrieve the Secret Recovery Phrase of the user.
|
|
53
|
+
* @param hooks.getUnlockPromise - A function that resolves once the MetaMask extension is unlocked
|
|
54
|
+
* and prompts the user to unlock their MetaMask if it is locked.
|
|
55
|
+
* @returns The method implementation which returns a public key.
|
|
56
|
+
* @throws If the params are invalid.
|
|
57
|
+
*/
|
|
58
|
+
export function getBip32PublicKeyImplementation({ getMnemonic, getUnlockPromise, }) {
|
|
59
|
+
return async function getBip32PublicKey(args) {
|
|
60
|
+
await getUnlockPromise(true);
|
|
61
|
+
assertStruct(args.params, Bip32PublicKeyArgsStruct, 'Invalid BIP-32 public key params', rpcErrors.invalidParams);
|
|
62
|
+
const { params } = args;
|
|
63
|
+
const node = await getNode({
|
|
64
|
+
curve: params.curve,
|
|
65
|
+
path: params.path,
|
|
66
|
+
secretRecoveryPhrase: await getMnemonic(),
|
|
67
|
+
});
|
|
68
|
+
if (params.compressed) {
|
|
69
|
+
return node.compressedPublicKey;
|
|
70
|
+
}
|
|
71
|
+
return node.publicKey;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
12
74
|
//# sourceMappingURL=getBip32PublicKey.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"file":"getBip32PublicKey.mjs","sourceRoot":"","sources":["../../src/restricted/getBip32PublicKey.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,wCAAwC;AAC9E,OAAO,EAAE,SAAS,EAAE,6BAA6B;AAKjD,OAAO,EACL,YAAY,EACZ,eAAe,EACf,WAAW,EACX,cAAc,EACf,8BAA8B;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,8BAA8B;AAElE,OAAO,EAAE,YAAY,EAAE,wBAAwB;AAG/C,OAAO,EAAE,OAAO,EAAE,qBAAiB;AAEnC,MAAM,UAAU,GAAG,wBAAwB,CAAC;AA4B5C,MAAM,CAAC,MAAM,wBAAwB,GAAG,YAAY,CAClD,MAAM,CAAC;IACL,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,WAAW;IAClB,UAAU,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;CAChC,CAAC,CACH,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,oBAAoB,GAItB,CAAC,EAAE,WAAW,EAAgD,EAAE,EAAE;IACpE,OAAO;QACL,cAAc,EAAE,cAAc,CAAC,gBAAgB;QAC/C,UAAU;QACV,cAAc,EAAE,CAAC,cAAc,CAAC,wBAAwB,CAAC;QACzD,oBAAoB,EAAE,+BAA+B,CAAC,WAAW,CAAC;QAClE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;YACzB,IACE,OAAO,EAAE,MAAM,KAAK,CAAC;gBACrB,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,cAAc,CAAC,wBAAwB,EAC3D,CAAC;gBACD,MAAM,SAAS,CAAC,aAAa,CAAC;oBAC5B,OAAO,EAAE,sBAAsB,cAAc,CAAC,wBAAwB,WAAW;iBAClF,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QACD,YAAY,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC;KACjC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,WAAW,GAAoD;IACnE,WAAW,EAAE,IAAI;IACjB,gBAAgB,EAAE,IAAI;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,CAAC;IACpD,UAAU;IACV,oBAAoB;IACpB,WAAW;CACH,CAAC,CAAC;AAEZ;;;;;;;;;GASG;AACH,MAAM,UAAU,+BAA+B,CAAC,EAC9C,WAAW,EACX,gBAAgB,GACa;IAC7B,OAAO,KAAK,UAAU,iBAAiB,CACrC,IAAsD;QAEtD,MAAM,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAE7B,YAAY,CACV,IAAI,CAAC,MAAM,EACX,wBAAwB,EACxB,kCAAkC,EAClC,SAAS,CAAC,aAAa,CACxB,CAAC;QAEF,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QACxB,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC;YACzB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,oBAAoB,EAAE,MAAM,WAAW,EAAE;SAC1C,CAAC,CAAC;QAEH,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;YACtB,OAAO,IAAI,CAAC,mBAAmB,CAAC;QAClC,CAAC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type {\n PermissionSpecificationBuilder,\n PermissionValidatorConstraint,\n RestrictedMethodOptions,\n ValidPermissionSpecification,\n} from '@metamask/permission-controller';\nimport { PermissionType, SubjectType } from '@metamask/permission-controller';\nimport { rpcErrors } from '@metamask/rpc-errors';\nimport type {\n GetBip32PublicKeyParams,\n GetBip32PublicKeyResult,\n} from '@metamask/snaps-sdk';\nimport {\n bip32entropy,\n Bip32PathStruct,\n CurveStruct,\n SnapCaveatType,\n} from '@metamask/snaps-utils';\nimport { boolean, object, optional } from '@metamask/superstruct';\nimport type { NonEmptyArray } from '@metamask/utils';\nimport { assertStruct } from '@metamask/utils';\n\nimport type { MethodHooksObject } from '../utils';\nimport { getNode } from '../utils';\n\nconst targetName = 'snap_getBip32PublicKey';\n\nexport type GetBip32PublicKeyMethodHooks = {\n /**\n * @returns The mnemonic of the user's primary keyring.\n */\n getMnemonic: () => Promise<Uint8Array>;\n\n /**\n * Waits for the extension to be unlocked.\n *\n * @returns A promise that resolves once the extension is unlocked.\n */\n getUnlockPromise: (shouldShowUnlockRequest: boolean) => Promise<void>;\n};\n\ntype GetBip32PublicKeySpecificationBuilderOptions = {\n methodHooks: GetBip32PublicKeyMethodHooks;\n};\n\ntype GetBip32PublicKeySpecification = ValidPermissionSpecification<{\n permissionType: PermissionType.RestrictedMethod;\n targetName: typeof targetName;\n methodImplementation: ReturnType<typeof getBip32PublicKeyImplementation>;\n allowedCaveats: Readonly<NonEmptyArray<string>> | null;\n validator: PermissionValidatorConstraint;\n}>;\n\nexport const Bip32PublicKeyArgsStruct = bip32entropy(\n object({\n path: Bip32PathStruct,\n curve: CurveStruct,\n compressed: optional(boolean()),\n }),\n);\n\n/**\n * The specification builder for the `snap_getBip32PublicKey` permission.\n * `snap_getBip32PublicKey` lets the Snap retrieve public keys for a particular\n * BIP-32 node.\n *\n * @param options - The specification builder options.\n * @param options.methodHooks - The RPC method hooks needed by the method implementation.\n * @returns The specification for the `snap_getBip32PublicKey` permission.\n */\nconst specificationBuilder: PermissionSpecificationBuilder<\n PermissionType.RestrictedMethod,\n GetBip32PublicKeySpecificationBuilderOptions,\n GetBip32PublicKeySpecification\n> = ({ methodHooks }: GetBip32PublicKeySpecificationBuilderOptions) => {\n return {\n permissionType: PermissionType.RestrictedMethod,\n targetName,\n allowedCaveats: [SnapCaveatType.PermittedDerivationPaths],\n methodImplementation: getBip32PublicKeyImplementation(methodHooks),\n validator: ({ caveats }) => {\n if (\n caveats?.length !== 1 ||\n caveats[0].type !== SnapCaveatType.PermittedDerivationPaths\n ) {\n throw rpcErrors.invalidParams({\n message: `Expected a single \"${SnapCaveatType.PermittedDerivationPaths}\" caveat.`,\n });\n }\n },\n subjectTypes: [SubjectType.Snap],\n };\n};\n\nconst methodHooks: MethodHooksObject<GetBip32PublicKeyMethodHooks> = {\n getMnemonic: true,\n getUnlockPromise: true,\n};\n\nexport const getBip32PublicKeyBuilder = Object.freeze({\n targetName,\n specificationBuilder,\n methodHooks,\n} as const);\n\n/**\n * Builds the method implementation for `snap_getBip32PublicKey`.\n *\n * @param hooks - The RPC method hooks.\n * @param hooks.getMnemonic - A function to retrieve the Secret Recovery Phrase of the user.\n * @param hooks.getUnlockPromise - A function that resolves once the MetaMask extension is unlocked\n * and prompts the user to unlock their MetaMask if it is locked.\n * @returns The method implementation which returns a public key.\n * @throws If the params are invalid.\n */\nexport function getBip32PublicKeyImplementation({\n getMnemonic,\n getUnlockPromise,\n}: GetBip32PublicKeyMethodHooks) {\n return async function getBip32PublicKey(\n args: RestrictedMethodOptions<GetBip32PublicKeyParams>,\n ): Promise<GetBip32PublicKeyResult> {\n await getUnlockPromise(true);\n\n assertStruct(\n args.params,\n Bip32PublicKeyArgsStruct,\n 'Invalid BIP-32 public key params',\n rpcErrors.invalidParams,\n );\n\n const { params } = args;\n const node = await getNode({\n curve: params.curve,\n path: params.path,\n secretRecoveryPhrase: await getMnemonic(),\n });\n\n if (params.compressed) {\n return node.compressedPublicKey;\n }\n\n return node.publicKey;\n };\n}\n"]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBip44EntropyImplementation = exports.getBip44EntropyBuilder = void 0;
|
|
4
|
+
const key_tree_1 = require("@metamask/key-tree");
|
|
5
|
+
const permission_controller_1 = require("@metamask/permission-controller");
|
|
6
|
+
const rpc_errors_1 = require("@metamask/rpc-errors");
|
|
7
|
+
const snaps_utils_1 = require("@metamask/snaps-utils");
|
|
8
|
+
const targetName = 'snap_getBip44Entropy';
|
|
9
|
+
/**
|
|
10
|
+
* The specification builder for the `snap_getBip44Entropy` permission.
|
|
11
|
+
* `snap_getBip44Entropy_*` lets the Snap control private keys for a particular
|
|
12
|
+
* BIP-32 coin type.
|
|
13
|
+
*
|
|
14
|
+
* @param options - The specification builder options.
|
|
15
|
+
* @param options.methodHooks - The RPC method hooks needed by the method
|
|
16
|
+
* implementation.
|
|
17
|
+
* @returns The specification for the `snap_getBip44Entropy` permission.
|
|
18
|
+
*/
|
|
19
|
+
const specificationBuilder = ({ methodHooks }) => {
|
|
20
|
+
return {
|
|
21
|
+
permissionType: permission_controller_1.PermissionType.RestrictedMethod,
|
|
22
|
+
targetName,
|
|
23
|
+
allowedCaveats: [snaps_utils_1.SnapCaveatType.PermittedCoinTypes],
|
|
24
|
+
methodImplementation: getBip44EntropyImplementation(methodHooks),
|
|
25
|
+
validator: ({ caveats }) => {
|
|
26
|
+
if (caveats?.length !== 1 ||
|
|
27
|
+
caveats[0].type !== snaps_utils_1.SnapCaveatType.PermittedCoinTypes) {
|
|
28
|
+
throw rpc_errors_1.rpcErrors.invalidParams({
|
|
29
|
+
message: `Expected a single "${snaps_utils_1.SnapCaveatType.PermittedCoinTypes}" caveat.`,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
subjectTypes: [permission_controller_1.SubjectType.Snap],
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
const methodHooks = {
|
|
37
|
+
getMnemonic: true,
|
|
38
|
+
getUnlockPromise: true,
|
|
39
|
+
};
|
|
40
|
+
exports.getBip44EntropyBuilder = Object.freeze({
|
|
41
|
+
targetName,
|
|
42
|
+
specificationBuilder,
|
|
43
|
+
methodHooks,
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Builds the method implementation for `snap_getBip44Entropy`.
|
|
47
|
+
*
|
|
48
|
+
* @param hooks - The RPC method hooks.
|
|
49
|
+
* @param hooks.getMnemonic - A function to retrieve the Secret Recovery Phrase
|
|
50
|
+
* of the user.
|
|
51
|
+
* @param hooks.getUnlockPromise - A function that resolves once the MetaMask
|
|
52
|
+
* extension is unlocked and prompts the user to unlock their MetaMask if it is
|
|
53
|
+
* locked.
|
|
54
|
+
* @returns The method implementation which returns a `BIP44CoinTypeNode`.
|
|
55
|
+
* @throws If the params are invalid.
|
|
56
|
+
*/
|
|
57
|
+
function getBip44EntropyImplementation({ getMnemonic, getUnlockPromise, }) {
|
|
58
|
+
return async function getBip44Entropy(args) {
|
|
59
|
+
await getUnlockPromise(true);
|
|
60
|
+
// `args.params` is validated by the decorator, so it's safe to assert here.
|
|
61
|
+
const params = args.params;
|
|
62
|
+
const node = await key_tree_1.BIP44CoinTypeNode.fromDerivationPath([
|
|
63
|
+
await getMnemonic(),
|
|
64
|
+
`bip32:44'`,
|
|
65
|
+
`bip32:${params.coinType}'`,
|
|
66
|
+
]);
|
|
67
|
+
return node.toJSON();
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
exports.getBip44EntropyImplementation = getBip44EntropyImplementation;
|
|
71
|
+
//# sourceMappingURL=getBip44Entropy.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBip44Entropy.cjs","sourceRoot":"","sources":["../../src/restricted/getBip44Entropy.ts"],"names":[],"mappings":";;;AAAA,iDAAuD;AAOvD,2EAA8E;AAC9E,qDAAiD;AAKjD,uDAAuD;AAKvD,MAAM,UAAU,GAAG,sBAAsB,CAAC;AA4B1C;;;;;;;;;GASG;AACH,MAAM,oBAAoB,GAItB,CAAC,EAAE,WAAW,EAA8C,EAAE,EAAE;IAClE,OAAO;QACL,cAAc,EAAE,sCAAc,CAAC,gBAAgB;QAC/C,UAAU;QACV,cAAc,EAAE,CAAC,4BAAc,CAAC,kBAAkB,CAAC;QACnD,oBAAoB,EAAE,6BAA6B,CAAC,WAAW,CAAC;QAChE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;YACzB,IACE,OAAO,EAAE,MAAM,KAAK,CAAC;gBACrB,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,4BAAc,CAAC,kBAAkB,EACrD,CAAC;gBACD,MAAM,sBAAS,CAAC,aAAa,CAAC;oBAC5B,OAAO,EAAE,sBAAsB,4BAAc,CAAC,kBAAkB,WAAW;iBAC5E,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QACD,YAAY,EAAE,CAAC,mCAAW,CAAC,IAAI,CAAC;KACjC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,WAAW,GAAkD;IACjE,WAAW,EAAE,IAAI;IACjB,gBAAgB,EAAE,IAAI;CACvB,CAAC;AAEW,QAAA,sBAAsB,GAAG,MAAM,CAAC,MAAM,CAAC;IAClD,UAAU;IACV,oBAAoB;IACpB,WAAW;CACH,CAAC,CAAC;AAEZ;;;;;;;;;;;GAWG;AACH,SAAgB,6BAA6B,CAAC,EAC5C,WAAW,EACX,gBAAgB,GACW;IAC3B,OAAO,KAAK,UAAU,eAAe,CACnC,IAAoD;QAEpD,MAAM,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAE7B,4EAA4E;QAC5E,MAAM,MAAM,GAAG,IAAI,CAAC,MAA+B,CAAC;QAEpD,MAAM,IAAI,GAAG,MAAM,4BAAiB,CAAC,kBAAkB,CAAC;YACtD,MAAM,WAAW,EAAE;YACnB,WAAW;YACX,SAAS,MAAM,CAAC,QAAQ,GAAG;SAC5B,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC;AApBD,sEAoBC","sourcesContent":["import { BIP44CoinTypeNode } from '@metamask/key-tree';\nimport type {\n PermissionSpecificationBuilder,\n PermissionValidatorConstraint,\n RestrictedMethodOptions,\n ValidPermissionSpecification,\n} from '@metamask/permission-controller';\nimport { PermissionType, SubjectType } from '@metamask/permission-controller';\nimport { rpcErrors } from '@metamask/rpc-errors';\nimport type {\n GetBip44EntropyParams,\n GetBip44EntropyResult,\n} from '@metamask/snaps-sdk';\nimport { SnapCaveatType } from '@metamask/snaps-utils';\nimport type { NonEmptyArray } from '@metamask/utils';\n\nimport type { MethodHooksObject } from '../utils';\n\nconst targetName = 'snap_getBip44Entropy';\n\nexport type GetBip44EntropyMethodHooks = {\n /**\n * @returns The mnemonic of the user's primary keyring.\n */\n getMnemonic: () => Promise<Uint8Array>;\n\n /**\n * Waits for the extension to be unlocked.\n *\n * @returns A promise that resolves once the extension is unlocked.\n */\n getUnlockPromise: (shouldShowUnlockRequest: boolean) => Promise<void>;\n};\n\ntype GetBip44EntropySpecificationBuilderOptions = {\n methodHooks: GetBip44EntropyMethodHooks;\n};\n\ntype GetBip44EntropySpecification = ValidPermissionSpecification<{\n permissionType: PermissionType.RestrictedMethod;\n targetName: typeof targetName;\n methodImplementation: ReturnType<typeof getBip44EntropyImplementation>;\n allowedCaveats: Readonly<NonEmptyArray<string>> | null;\n validator: PermissionValidatorConstraint;\n}>;\n\n/**\n * The specification builder for the `snap_getBip44Entropy` permission.\n * `snap_getBip44Entropy_*` lets the Snap control private keys for a particular\n * BIP-32 coin type.\n *\n * @param options - The specification builder options.\n * @param options.methodHooks - The RPC method hooks needed by the method\n * implementation.\n * @returns The specification for the `snap_getBip44Entropy` permission.\n */\nconst specificationBuilder: PermissionSpecificationBuilder<\n PermissionType.RestrictedMethod,\n GetBip44EntropySpecificationBuilderOptions,\n GetBip44EntropySpecification\n> = ({ methodHooks }: GetBip44EntropySpecificationBuilderOptions) => {\n return {\n permissionType: PermissionType.RestrictedMethod,\n targetName,\n allowedCaveats: [SnapCaveatType.PermittedCoinTypes],\n methodImplementation: getBip44EntropyImplementation(methodHooks),\n validator: ({ caveats }) => {\n if (\n caveats?.length !== 1 ||\n caveats[0].type !== SnapCaveatType.PermittedCoinTypes\n ) {\n throw rpcErrors.invalidParams({\n message: `Expected a single \"${SnapCaveatType.PermittedCoinTypes}\" caveat.`,\n });\n }\n },\n subjectTypes: [SubjectType.Snap],\n };\n};\n\nconst methodHooks: MethodHooksObject<GetBip44EntropyMethodHooks> = {\n getMnemonic: true,\n getUnlockPromise: true,\n};\n\nexport const getBip44EntropyBuilder = Object.freeze({\n targetName,\n specificationBuilder,\n methodHooks,\n} as const);\n\n/**\n * Builds the method implementation for `snap_getBip44Entropy`.\n *\n * @param hooks - The RPC method hooks.\n * @param hooks.getMnemonic - A function to retrieve the Secret Recovery Phrase\n * of the user.\n * @param hooks.getUnlockPromise - A function that resolves once the MetaMask\n * extension is unlocked and prompts the user to unlock their MetaMask if it is\n * locked.\n * @returns The method implementation which returns a `BIP44CoinTypeNode`.\n * @throws If the params are invalid.\n */\nexport function getBip44EntropyImplementation({\n getMnemonic,\n getUnlockPromise,\n}: GetBip44EntropyMethodHooks) {\n return async function getBip44Entropy(\n args: RestrictedMethodOptions<GetBip44EntropyParams>,\n ): Promise<GetBip44EntropyResult> {\n await getUnlockPromise(true);\n\n // `args.params` is validated by the decorator, so it's safe to assert here.\n const params = args.params as GetBip44EntropyParams;\n\n const node = await BIP44CoinTypeNode.fromDerivationPath([\n await getMnemonic(),\n `bip32:44'`,\n `bip32:${params.coinType}'`,\n ]);\n\n return node.toJSON();\n };\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { PermissionSpecificationBuilder, PermissionValidatorConstraint, RestrictedMethodOptions } from
|
|
2
|
-
import { PermissionType } from
|
|
3
|
-
import type { GetBip44EntropyParams, GetBip44EntropyResult } from
|
|
4
|
-
import type { NonEmptyArray } from
|
|
5
|
-
import type { MethodHooksObject } from
|
|
1
|
+
import type { PermissionSpecificationBuilder, PermissionValidatorConstraint, RestrictedMethodOptions } from "@metamask/permission-controller";
|
|
2
|
+
import { PermissionType } from "@metamask/permission-controller";
|
|
3
|
+
import type { GetBip44EntropyParams, GetBip44EntropyResult } from "@metamask/snaps-sdk";
|
|
4
|
+
import type { NonEmptyArray } from "@metamask/utils";
|
|
5
|
+
import type { MethodHooksObject } from "../utils.cjs";
|
|
6
6
|
declare const targetName = "snap_getBip44Entropy";
|
|
7
7
|
export type GetBip44EntropyMethodHooks = {
|
|
8
8
|
/**
|
|
@@ -44,3 +44,4 @@ export declare const getBip44EntropyBuilder: Readonly<{
|
|
|
44
44
|
*/
|
|
45
45
|
export declare function getBip44EntropyImplementation({ getMnemonic, getUnlockPromise, }: GetBip44EntropyMethodHooks): (args: RestrictedMethodOptions<GetBip44EntropyParams>) => Promise<GetBip44EntropyResult>;
|
|
46
46
|
export {};
|
|
47
|
+
//# sourceMappingURL=getBip44Entropy.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBip44Entropy.d.cts","sourceRoot":"","sources":["../../src/restricted/getBip44Entropy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,8BAA8B,EAC9B,6BAA6B,EAC7B,uBAAuB,EAExB,wCAAwC;AACzC,OAAO,EAAE,cAAc,EAAe,wCAAwC;AAE9E,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACtB,4BAA4B;AAE7B,OAAO,KAAK,EAAE,aAAa,EAAE,wBAAwB;AAErD,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAiB;AAElD,QAAA,MAAM,UAAU,yBAAyB,CAAC;AAE1C,MAAM,MAAM,0BAA0B,GAAG;IACvC;;OAEG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;IAEvC;;;;OAIG;IACH,gBAAgB,EAAE,CAAC,uBAAuB,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE,CAAC;AAEF,KAAK,0CAA0C,GAAG;IAChD,WAAW,EAAE,0BAA0B,CAAC;CACzC,CAAC;AAiDF,eAAO,MAAM,sBAAsB;;;wBA9CjB,eAAe,gBAAgB;oBACnC,iBAAiB;8BACP,WAAW,oCAAoC,CAAC;wBACtD,SAAS,cAAc,MAAM,CAAC,CAAC,GAAG,IAAI;mBAC3C,6BAA6B;;;EA8C/B,CAAC;AAEZ;;;;;;;;;;;GAWG;AACH,wBAAgB,6BAA6B,CAAC,EAC5C,WAAW,EACX,gBAAgB,GACjB,EAAE,0BAA0B,UAEnB,wBAAwB,qBAAqB,CAAC,KACnD,QAAQ,qBAAqB,CAAC,CAclC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { PermissionSpecificationBuilder, PermissionValidatorConstraint, RestrictedMethodOptions } from "@metamask/permission-controller";
|
|
2
|
+
import { PermissionType } from "@metamask/permission-controller";
|
|
3
|
+
import type { GetBip44EntropyParams, GetBip44EntropyResult } from "@metamask/snaps-sdk";
|
|
4
|
+
import type { NonEmptyArray } from "@metamask/utils";
|
|
5
|
+
import type { MethodHooksObject } from "../utils.mjs";
|
|
6
|
+
declare const targetName = "snap_getBip44Entropy";
|
|
7
|
+
export type GetBip44EntropyMethodHooks = {
|
|
8
|
+
/**
|
|
9
|
+
* @returns The mnemonic of the user's primary keyring.
|
|
10
|
+
*/
|
|
11
|
+
getMnemonic: () => Promise<Uint8Array>;
|
|
12
|
+
/**
|
|
13
|
+
* Waits for the extension to be unlocked.
|
|
14
|
+
*
|
|
15
|
+
* @returns A promise that resolves once the extension is unlocked.
|
|
16
|
+
*/
|
|
17
|
+
getUnlockPromise: (shouldShowUnlockRequest: boolean) => Promise<void>;
|
|
18
|
+
};
|
|
19
|
+
type GetBip44EntropySpecificationBuilderOptions = {
|
|
20
|
+
methodHooks: GetBip44EntropyMethodHooks;
|
|
21
|
+
};
|
|
22
|
+
export declare const getBip44EntropyBuilder: Readonly<{
|
|
23
|
+
readonly targetName: "snap_getBip44Entropy";
|
|
24
|
+
readonly specificationBuilder: PermissionSpecificationBuilder<PermissionType.RestrictedMethod, GetBip44EntropySpecificationBuilderOptions, {
|
|
25
|
+
permissionType: PermissionType.RestrictedMethod;
|
|
26
|
+
targetName: typeof targetName;
|
|
27
|
+
methodImplementation: ReturnType<typeof getBip44EntropyImplementation>;
|
|
28
|
+
allowedCaveats: Readonly<NonEmptyArray<string>> | null;
|
|
29
|
+
validator: PermissionValidatorConstraint;
|
|
30
|
+
}>;
|
|
31
|
+
readonly methodHooks: MethodHooksObject<GetBip44EntropyMethodHooks>;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Builds the method implementation for `snap_getBip44Entropy`.
|
|
35
|
+
*
|
|
36
|
+
* @param hooks - The RPC method hooks.
|
|
37
|
+
* @param hooks.getMnemonic - A function to retrieve the Secret Recovery Phrase
|
|
38
|
+
* of the user.
|
|
39
|
+
* @param hooks.getUnlockPromise - A function that resolves once the MetaMask
|
|
40
|
+
* extension is unlocked and prompts the user to unlock their MetaMask if it is
|
|
41
|
+
* locked.
|
|
42
|
+
* @returns The method implementation which returns a `BIP44CoinTypeNode`.
|
|
43
|
+
* @throws If the params are invalid.
|
|
44
|
+
*/
|
|
45
|
+
export declare function getBip44EntropyImplementation({ getMnemonic, getUnlockPromise, }: GetBip44EntropyMethodHooks): (args: RestrictedMethodOptions<GetBip44EntropyParams>) => Promise<GetBip44EntropyResult>;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=getBip44Entropy.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getBip44Entropy.d.mts","sourceRoot":"","sources":["../../src/restricted/getBip44Entropy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,8BAA8B,EAC9B,6BAA6B,EAC7B,uBAAuB,EAExB,wCAAwC;AACzC,OAAO,EAAE,cAAc,EAAe,wCAAwC;AAE9E,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACtB,4BAA4B;AAE7B,OAAO,KAAK,EAAE,aAAa,EAAE,wBAAwB;AAErD,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAiB;AAElD,QAAA,MAAM,UAAU,yBAAyB,CAAC;AAE1C,MAAM,MAAM,0BAA0B,GAAG;IACvC;;OAEG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;IAEvC;;;;OAIG;IACH,gBAAgB,EAAE,CAAC,uBAAuB,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE,CAAC;AAEF,KAAK,0CAA0C,GAAG;IAChD,WAAW,EAAE,0BAA0B,CAAC;CACzC,CAAC;AAiDF,eAAO,MAAM,sBAAsB;;;wBA9CjB,eAAe,gBAAgB;oBACnC,iBAAiB;8BACP,WAAW,oCAAoC,CAAC;wBACtD,SAAS,cAAc,MAAM,CAAC,CAAC,GAAG,IAAI;mBAC3C,6BAA6B;;;EA8C/B,CAAC;AAEZ;;;;;;;;;;;GAWG;AACH,wBAAgB,6BAA6B,CAAC,EAC5C,WAAW,EACX,gBAAgB,GACjB,EAAE,0BAA0B,UAEnB,wBAAwB,qBAAqB,CAAC,KACnD,QAAQ,qBAAqB,CAAC,CAclC"}
|
|
@@ -1,9 +1,67 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { BIP44CoinTypeNode } from "@metamask/key-tree";
|
|
2
|
+
import { PermissionType, SubjectType } from "@metamask/permission-controller";
|
|
3
|
+
import { rpcErrors } from "@metamask/rpc-errors";
|
|
4
|
+
import { SnapCaveatType } from "@metamask/snaps-utils";
|
|
5
|
+
const targetName = 'snap_getBip44Entropy';
|
|
6
|
+
/**
|
|
7
|
+
* The specification builder for the `snap_getBip44Entropy` permission.
|
|
8
|
+
* `snap_getBip44Entropy_*` lets the Snap control private keys for a particular
|
|
9
|
+
* BIP-32 coin type.
|
|
10
|
+
*
|
|
11
|
+
* @param options - The specification builder options.
|
|
12
|
+
* @param options.methodHooks - The RPC method hooks needed by the method
|
|
13
|
+
* implementation.
|
|
14
|
+
* @returns The specification for the `snap_getBip44Entropy` permission.
|
|
15
|
+
*/
|
|
16
|
+
const specificationBuilder = ({ methodHooks }) => {
|
|
17
|
+
return {
|
|
18
|
+
permissionType: PermissionType.RestrictedMethod,
|
|
19
|
+
targetName,
|
|
20
|
+
allowedCaveats: [SnapCaveatType.PermittedCoinTypes],
|
|
21
|
+
methodImplementation: getBip44EntropyImplementation(methodHooks),
|
|
22
|
+
validator: ({ caveats }) => {
|
|
23
|
+
if (caveats?.length !== 1 ||
|
|
24
|
+
caveats[0].type !== SnapCaveatType.PermittedCoinTypes) {
|
|
25
|
+
throw rpcErrors.invalidParams({
|
|
26
|
+
message: `Expected a single "${SnapCaveatType.PermittedCoinTypes}" caveat.`,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
subjectTypes: [SubjectType.Snap],
|
|
31
|
+
};
|
|
8
32
|
};
|
|
33
|
+
const methodHooks = {
|
|
34
|
+
getMnemonic: true,
|
|
35
|
+
getUnlockPromise: true,
|
|
36
|
+
};
|
|
37
|
+
export const getBip44EntropyBuilder = Object.freeze({
|
|
38
|
+
targetName,
|
|
39
|
+
specificationBuilder,
|
|
40
|
+
methodHooks,
|
|
41
|
+
});
|
|
42
|
+
/**
|
|
43
|
+
* Builds the method implementation for `snap_getBip44Entropy`.
|
|
44
|
+
*
|
|
45
|
+
* @param hooks - The RPC method hooks.
|
|
46
|
+
* @param hooks.getMnemonic - A function to retrieve the Secret Recovery Phrase
|
|
47
|
+
* of the user.
|
|
48
|
+
* @param hooks.getUnlockPromise - A function that resolves once the MetaMask
|
|
49
|
+
* extension is unlocked and prompts the user to unlock their MetaMask if it is
|
|
50
|
+
* locked.
|
|
51
|
+
* @returns The method implementation which returns a `BIP44CoinTypeNode`.
|
|
52
|
+
* @throws If the params are invalid.
|
|
53
|
+
*/
|
|
54
|
+
export function getBip44EntropyImplementation({ getMnemonic, getUnlockPromise, }) {
|
|
55
|
+
return async function getBip44Entropy(args) {
|
|
56
|
+
await getUnlockPromise(true);
|
|
57
|
+
// `args.params` is validated by the decorator, so it's safe to assert here.
|
|
58
|
+
const params = args.params;
|
|
59
|
+
const node = await BIP44CoinTypeNode.fromDerivationPath([
|
|
60
|
+
await getMnemonic(),
|
|
61
|
+
`bip32:44'`,
|
|
62
|
+
`bip32:${params.coinType}'`,
|
|
63
|
+
]);
|
|
64
|
+
return node.toJSON();
|
|
65
|
+
};
|
|
66
|
+
}
|
|
9
67
|
//# sourceMappingURL=getBip44Entropy.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"
|
|
1
|
+
{"version":3,"file":"getBip44Entropy.mjs","sourceRoot":"","sources":["../../src/restricted/getBip44Entropy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,2BAA2B;AAOvD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,wCAAwC;AAC9E,OAAO,EAAE,SAAS,EAAE,6BAA6B;AAKjD,OAAO,EAAE,cAAc,EAAE,8BAA8B;AAKvD,MAAM,UAAU,GAAG,sBAAsB,CAAC;AA4B1C;;;;;;;;;GASG;AACH,MAAM,oBAAoB,GAItB,CAAC,EAAE,WAAW,EAA8C,EAAE,EAAE;IAClE,OAAO;QACL,cAAc,EAAE,cAAc,CAAC,gBAAgB;QAC/C,UAAU;QACV,cAAc,EAAE,CAAC,cAAc,CAAC,kBAAkB,CAAC;QACnD,oBAAoB,EAAE,6BAA6B,CAAC,WAAW,CAAC;QAChE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;YACzB,IACE,OAAO,EAAE,MAAM,KAAK,CAAC;gBACrB,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,cAAc,CAAC,kBAAkB,EACrD,CAAC;gBACD,MAAM,SAAS,CAAC,aAAa,CAAC;oBAC5B,OAAO,EAAE,sBAAsB,cAAc,CAAC,kBAAkB,WAAW;iBAC5E,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QACD,YAAY,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC;KACjC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,WAAW,GAAkD;IACjE,WAAW,EAAE,IAAI;IACjB,gBAAgB,EAAE,IAAI;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,CAAC;IAClD,UAAU;IACV,oBAAoB;IACpB,WAAW;CACH,CAAC,CAAC;AAEZ;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,6BAA6B,CAAC,EAC5C,WAAW,EACX,gBAAgB,GACW;IAC3B,OAAO,KAAK,UAAU,eAAe,CACnC,IAAoD;QAEpD,MAAM,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAE7B,4EAA4E;QAC5E,MAAM,MAAM,GAAG,IAAI,CAAC,MAA+B,CAAC;QAEpD,MAAM,IAAI,GAAG,MAAM,iBAAiB,CAAC,kBAAkB,CAAC;YACtD,MAAM,WAAW,EAAE;YACnB,WAAW;YACX,SAAS,MAAM,CAAC,QAAQ,GAAG;SAC5B,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { BIP44CoinTypeNode } from '@metamask/key-tree';\nimport type {\n PermissionSpecificationBuilder,\n PermissionValidatorConstraint,\n RestrictedMethodOptions,\n ValidPermissionSpecification,\n} from '@metamask/permission-controller';\nimport { PermissionType, SubjectType } from '@metamask/permission-controller';\nimport { rpcErrors } from '@metamask/rpc-errors';\nimport type {\n GetBip44EntropyParams,\n GetBip44EntropyResult,\n} from '@metamask/snaps-sdk';\nimport { SnapCaveatType } from '@metamask/snaps-utils';\nimport type { NonEmptyArray } from '@metamask/utils';\n\nimport type { MethodHooksObject } from '../utils';\n\nconst targetName = 'snap_getBip44Entropy';\n\nexport type GetBip44EntropyMethodHooks = {\n /**\n * @returns The mnemonic of the user's primary keyring.\n */\n getMnemonic: () => Promise<Uint8Array>;\n\n /**\n * Waits for the extension to be unlocked.\n *\n * @returns A promise that resolves once the extension is unlocked.\n */\n getUnlockPromise: (shouldShowUnlockRequest: boolean) => Promise<void>;\n};\n\ntype GetBip44EntropySpecificationBuilderOptions = {\n methodHooks: GetBip44EntropyMethodHooks;\n};\n\ntype GetBip44EntropySpecification = ValidPermissionSpecification<{\n permissionType: PermissionType.RestrictedMethod;\n targetName: typeof targetName;\n methodImplementation: ReturnType<typeof getBip44EntropyImplementation>;\n allowedCaveats: Readonly<NonEmptyArray<string>> | null;\n validator: PermissionValidatorConstraint;\n}>;\n\n/**\n * The specification builder for the `snap_getBip44Entropy` permission.\n * `snap_getBip44Entropy_*` lets the Snap control private keys for a particular\n * BIP-32 coin type.\n *\n * @param options - The specification builder options.\n * @param options.methodHooks - The RPC method hooks needed by the method\n * implementation.\n * @returns The specification for the `snap_getBip44Entropy` permission.\n */\nconst specificationBuilder: PermissionSpecificationBuilder<\n PermissionType.RestrictedMethod,\n GetBip44EntropySpecificationBuilderOptions,\n GetBip44EntropySpecification\n> = ({ methodHooks }: GetBip44EntropySpecificationBuilderOptions) => {\n return {\n permissionType: PermissionType.RestrictedMethod,\n targetName,\n allowedCaveats: [SnapCaveatType.PermittedCoinTypes],\n methodImplementation: getBip44EntropyImplementation(methodHooks),\n validator: ({ caveats }) => {\n if (\n caveats?.length !== 1 ||\n caveats[0].type !== SnapCaveatType.PermittedCoinTypes\n ) {\n throw rpcErrors.invalidParams({\n message: `Expected a single \"${SnapCaveatType.PermittedCoinTypes}\" caveat.`,\n });\n }\n },\n subjectTypes: [SubjectType.Snap],\n };\n};\n\nconst methodHooks: MethodHooksObject<GetBip44EntropyMethodHooks> = {\n getMnemonic: true,\n getUnlockPromise: true,\n};\n\nexport const getBip44EntropyBuilder = Object.freeze({\n targetName,\n specificationBuilder,\n methodHooks,\n} as const);\n\n/**\n * Builds the method implementation for `snap_getBip44Entropy`.\n *\n * @param hooks - The RPC method hooks.\n * @param hooks.getMnemonic - A function to retrieve the Secret Recovery Phrase\n * of the user.\n * @param hooks.getUnlockPromise - A function that resolves once the MetaMask\n * extension is unlocked and prompts the user to unlock their MetaMask if it is\n * locked.\n * @returns The method implementation which returns a `BIP44CoinTypeNode`.\n * @throws If the params are invalid.\n */\nexport function getBip44EntropyImplementation({\n getMnemonic,\n getUnlockPromise,\n}: GetBip44EntropyMethodHooks) {\n return async function getBip44Entropy(\n args: RestrictedMethodOptions<GetBip44EntropyParams>,\n ): Promise<GetBip44EntropyResult> {\n await getUnlockPromise(true);\n\n // `args.params` is validated by the decorator, so it's safe to assert here.\n const params = args.params as GetBip44EntropyParams;\n\n const node = await BIP44CoinTypeNode.fromDerivationPath([\n await getMnemonic(),\n `bip32:44'`,\n `bip32:${params.coinType}'`,\n ]);\n\n return node.toJSON();\n };\n}\n"]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEntropyBuilder = exports.GetEntropyArgsStruct = void 0;
|
|
4
|
+
const permission_controller_1 = require("@metamask/permission-controller");
|
|
5
|
+
const rpc_errors_1 = require("@metamask/rpc-errors");
|
|
6
|
+
const snaps_utils_1 = require("@metamask/snaps-utils");
|
|
7
|
+
const superstruct_1 = require("@metamask/superstruct");
|
|
8
|
+
const utils_1 = require("@metamask/utils");
|
|
9
|
+
const utils_2 = require("../utils.cjs");
|
|
10
|
+
const targetName = 'snap_getEntropy';
|
|
11
|
+
exports.GetEntropyArgsStruct = (0, superstruct_1.object)({
|
|
12
|
+
version: (0, superstruct_1.literal)(1),
|
|
13
|
+
salt: (0, superstruct_1.optional)((0, superstruct_1.string)()),
|
|
14
|
+
});
|
|
15
|
+
const specificationBuilder = ({ allowedCaveats = null, methodHooks, }) => {
|
|
16
|
+
return {
|
|
17
|
+
permissionType: permission_controller_1.PermissionType.RestrictedMethod,
|
|
18
|
+
targetName,
|
|
19
|
+
allowedCaveats,
|
|
20
|
+
methodImplementation: getEntropyImplementation(methodHooks),
|
|
21
|
+
subjectTypes: [permission_controller_1.SubjectType.Snap],
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
const methodHooks = {
|
|
25
|
+
getMnemonic: true,
|
|
26
|
+
getUnlockPromise: true,
|
|
27
|
+
};
|
|
28
|
+
exports.getEntropyBuilder = Object.freeze({
|
|
29
|
+
targetName,
|
|
30
|
+
specificationBuilder,
|
|
31
|
+
methodHooks,
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* Builds the method implementation for `snap_getEntropy`. The implementation
|
|
35
|
+
* is based on the reference implementation of
|
|
36
|
+
* [SIP-6](https://metamask.github.io/SIPs/SIPS/sip-6).
|
|
37
|
+
*
|
|
38
|
+
* @param hooks - The RPC method hooks.
|
|
39
|
+
* @param hooks.getMnemonic - The method to get the mnemonic of the user's
|
|
40
|
+
* primary keyring.
|
|
41
|
+
* @param hooks.getUnlockPromise - The method to get a promise that resolves
|
|
42
|
+
* once the extension is unlocked.
|
|
43
|
+
* @returns The method implementation.
|
|
44
|
+
*/
|
|
45
|
+
function getEntropyImplementation({ getMnemonic, getUnlockPromise, }) {
|
|
46
|
+
return async function getEntropy(options) {
|
|
47
|
+
const { params, context: { origin }, } = options;
|
|
48
|
+
(0, utils_1.assertStruct)(params, exports.GetEntropyArgsStruct, 'Invalid "snap_getEntropy" parameters', rpc_errors_1.rpcErrors.invalidParams);
|
|
49
|
+
await getUnlockPromise(true);
|
|
50
|
+
const mnemonicPhrase = await getMnemonic();
|
|
51
|
+
return (0, utils_2.deriveEntropy)({
|
|
52
|
+
input: origin,
|
|
53
|
+
salt: params.salt,
|
|
54
|
+
mnemonicPhrase,
|
|
55
|
+
magic: snaps_utils_1.SIP_6_MAGIC_VALUE,
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=getEntropy.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getEntropy.cjs","sourceRoot":"","sources":["../../src/restricted/getEntropy.ts"],"names":[],"mappings":";;;AAKA,2EAA8E;AAC9E,qDAAiD;AAEjD,uDAA0D;AAE1D,uDAA0E;AAE1E,2CAA+C;AAG/C,wCAAyC;AAEzC,MAAM,UAAU,GAAG,iBAAiB,CAAC;AAcxB,QAAA,oBAAoB,GAAG,IAAA,oBAAM,EAAC;IACzC,OAAO,EAAE,IAAA,qBAAO,EAAC,CAAC,CAAC;IACnB,IAAI,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;CACzB,CAAC,CAAC;AAUH,MAAM,oBAAoB,GAItB,CAAC,EACH,cAAc,GAAG,IAAI,EACrB,WAAW,GAC2B,EAAE,EAAE;IAC1C,OAAO;QACL,cAAc,EAAE,sCAAc,CAAC,gBAAgB;QAC/C,UAAU;QACV,cAAc;QACd,oBAAoB,EAAE,wBAAwB,CAAC,WAAW,CAAC;QAC3D,YAAY,EAAE,CAAC,mCAAW,CAAC,IAAI,CAAC;KACjC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,WAAW,GAAuC;IACtD,WAAW,EAAE,IAAI;IACjB,gBAAgB,EAAE,IAAI;CACvB,CAAC;AAEW,QAAA,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC;IAC7C,UAAU;IACV,oBAAoB;IACpB,WAAW;CACH,CAAC,CAAC;AAgBZ;;;;;;;;;;;GAWG;AACH,SAAS,wBAAwB,CAAC,EAChC,WAAW,EACX,gBAAgB,GACA;IAChB,OAAO,KAAK,UAAU,UAAU,CAC9B,OAAkD;QAElD,MAAM,EACJ,MAAM,EACN,OAAO,EAAE,EAAE,MAAM,EAAE,GACpB,GAAG,OAAO,CAAC;QAEZ,IAAA,oBAAY,EACV,MAAM,EACN,4BAAoB,EACpB,sCAAsC,EACtC,sBAAS,CAAC,aAAa,CACxB,CAAC;QAEF,MAAM,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC7B,MAAM,cAAc,GAAG,MAAM,WAAW,EAAE,CAAC;QAE3C,OAAO,IAAA,qBAAa,EAAC;YACnB,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,cAAc;YACd,KAAK,EAAE,+BAAiB;SACzB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type {\n PermissionSpecificationBuilder,\n RestrictedMethodOptions,\n ValidPermissionSpecification,\n} from '@metamask/permission-controller';\nimport { PermissionType, SubjectType } from '@metamask/permission-controller';\nimport { rpcErrors } from '@metamask/rpc-errors';\nimport type { GetEntropyParams, GetEntropyResult } from '@metamask/snaps-sdk';\nimport { SIP_6_MAGIC_VALUE } from '@metamask/snaps-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { literal, object, optional, string } from '@metamask/superstruct';\nimport type { NonEmptyArray } from '@metamask/utils';\nimport { assertStruct } from '@metamask/utils';\n\nimport type { MethodHooksObject } from '../utils';\nimport { deriveEntropy } from '../utils';\n\nconst targetName = 'snap_getEntropy';\n\ntype GetEntropySpecificationBuilderOptions = {\n allowedCaveats?: Readonly<NonEmptyArray<string>> | null;\n methodHooks: GetEntropyHooks;\n};\n\ntype GetEntropySpecification = ValidPermissionSpecification<{\n permissionType: PermissionType.RestrictedMethod;\n targetName: typeof targetName;\n methodImplementation: ReturnType<typeof getEntropyImplementation>;\n allowedCaveats: Readonly<NonEmptyArray<string>> | null;\n}>;\n\nexport const GetEntropyArgsStruct = object({\n version: literal(1),\n salt: optional(string()),\n});\n\n/**\n * @property version - The version of the `snap_getEntropy` method. This must be\n * the numeric literal `1`.\n * @property salt - A string to use as the salt when deriving the entropy. If\n * omitted, the salt will be an empty string.\n */\nexport type GetEntropyArgs = Infer<typeof GetEntropyArgsStruct>;\n\nconst specificationBuilder: PermissionSpecificationBuilder<\n PermissionType.RestrictedMethod,\n GetEntropySpecificationBuilderOptions,\n GetEntropySpecification\n> = ({\n allowedCaveats = null,\n methodHooks,\n}: GetEntropySpecificationBuilderOptions) => {\n return {\n permissionType: PermissionType.RestrictedMethod,\n targetName,\n allowedCaveats,\n methodImplementation: getEntropyImplementation(methodHooks),\n subjectTypes: [SubjectType.Snap],\n };\n};\n\nconst methodHooks: MethodHooksObject<GetEntropyHooks> = {\n getMnemonic: true,\n getUnlockPromise: true,\n};\n\nexport const getEntropyBuilder = Object.freeze({\n targetName,\n specificationBuilder,\n methodHooks,\n} as const);\n\nexport type GetEntropyHooks = {\n /**\n * @returns The mnemonic of the user's primary keyring.\n */\n getMnemonic: () => Promise<Uint8Array>;\n\n /**\n * Waits for the extension to be unlocked.\n *\n * @returns A promise that resolves once the extension is unlocked.\n */\n getUnlockPromise: (shouldShowUnlockRequest: boolean) => Promise<void>;\n};\n\n/**\n * Builds the method implementation for `snap_getEntropy`. The implementation\n * is based on the reference implementation of\n * [SIP-6](https://metamask.github.io/SIPs/SIPS/sip-6).\n *\n * @param hooks - The RPC method hooks.\n * @param hooks.getMnemonic - The method to get the mnemonic of the user's\n * primary keyring.\n * @param hooks.getUnlockPromise - The method to get a promise that resolves\n * once the extension is unlocked.\n * @returns The method implementation.\n */\nfunction getEntropyImplementation({\n getMnemonic,\n getUnlockPromise,\n}: GetEntropyHooks) {\n return async function getEntropy(\n options: RestrictedMethodOptions<GetEntropyParams>,\n ): Promise<GetEntropyResult> {\n const {\n params,\n context: { origin },\n } = options;\n\n assertStruct(\n params,\n GetEntropyArgsStruct,\n 'Invalid \"snap_getEntropy\" parameters',\n rpcErrors.invalidParams,\n );\n\n await getUnlockPromise(true);\n const mnemonicPhrase = await getMnemonic();\n\n return deriveEntropy({\n input: origin,\n salt: params.salt,\n mnemonicPhrase,\n magic: SIP_6_MAGIC_VALUE,\n });\n };\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { PermissionSpecificationBuilder, RestrictedMethodOptions } from
|
|
2
|
-
import { PermissionType } from
|
|
3
|
-
import type { GetEntropyParams, GetEntropyResult } from
|
|
4
|
-
import type { Infer } from
|
|
5
|
-
import type { NonEmptyArray } from
|
|
6
|
-
import type { MethodHooksObject } from
|
|
1
|
+
import type { PermissionSpecificationBuilder, RestrictedMethodOptions } from "@metamask/permission-controller";
|
|
2
|
+
import { PermissionType } from "@metamask/permission-controller";
|
|
3
|
+
import type { GetEntropyParams, GetEntropyResult } from "@metamask/snaps-sdk";
|
|
4
|
+
import type { Infer } from "@metamask/superstruct";
|
|
5
|
+
import type { NonEmptyArray } from "@metamask/utils";
|
|
6
|
+
import type { MethodHooksObject } from "../utils.cjs";
|
|
7
7
|
declare const targetName = "snap_getEntropy";
|
|
8
8
|
type GetEntropySpecificationBuilderOptions = {
|
|
9
9
|
allowedCaveats?: Readonly<NonEmptyArray<string>> | null;
|
|
@@ -59,3 +59,4 @@ export type GetEntropyHooks = {
|
|
|
59
59
|
*/
|
|
60
60
|
declare function getEntropyImplementation({ getMnemonic, getUnlockPromise, }: GetEntropyHooks): (options: RestrictedMethodOptions<GetEntropyParams>) => Promise<GetEntropyResult>;
|
|
61
61
|
export {};
|
|
62
|
+
//# sourceMappingURL=getEntropy.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getEntropy.d.cts","sourceRoot":"","sources":["../../src/restricted/getEntropy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC9B,uBAAuB,EAExB,wCAAwC;AACzC,OAAO,EAAE,cAAc,EAAe,wCAAwC;AAE9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,4BAA4B;AAE9E,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,wBAAwB;AAGrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAiB;AAGlD,QAAA,MAAM,UAAU,oBAAoB,CAAC;AAErC,KAAK,qCAAqC,GAAG;IAC3C,cAAc,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC;IACxD,WAAW,EAAE,eAAe,CAAC;CAC9B,CAAC;AASF,eAAO,MAAM,oBAAoB;;;;;;EAG/B,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAwBhE,eAAO,MAAM,iBAAiB;;;wBAzCZ,eAAe,gBAAgB;oBACnC,iBAAiB;8BACP,WAAW,+BAA+B,CAAC;wBACjD,SAAS,cAAc,MAAM,CAAC,CAAC,GAAG,IAAI;;;EA0C7C,CAAC;AAEZ,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;IAEvC;;;;OAIG;IACH,gBAAgB,EAAE,CAAC,uBAAuB,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,iBAAS,wBAAwB,CAAC,EAChC,WAAW,EACX,gBAAgB,GACjB,EAAE,eAAe,aAEL,wBAAwB,gBAAgB,CAAC,KACjD,QAAQ,gBAAgB,CAAC,CAuB7B"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { PermissionSpecificationBuilder, RestrictedMethodOptions } from "@metamask/permission-controller";
|
|
2
|
+
import { PermissionType } from "@metamask/permission-controller";
|
|
3
|
+
import type { GetEntropyParams, GetEntropyResult } from "@metamask/snaps-sdk";
|
|
4
|
+
import type { Infer } from "@metamask/superstruct";
|
|
5
|
+
import type { NonEmptyArray } from "@metamask/utils";
|
|
6
|
+
import type { MethodHooksObject } from "../utils.mjs";
|
|
7
|
+
declare const targetName = "snap_getEntropy";
|
|
8
|
+
type GetEntropySpecificationBuilderOptions = {
|
|
9
|
+
allowedCaveats?: Readonly<NonEmptyArray<string>> | null;
|
|
10
|
+
methodHooks: GetEntropyHooks;
|
|
11
|
+
};
|
|
12
|
+
export declare const GetEntropyArgsStruct: import("@metamask/superstruct").Struct<{
|
|
13
|
+
version: 1;
|
|
14
|
+
salt?: string | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
version: import("@metamask/superstruct").Struct<1, 1>;
|
|
17
|
+
salt: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* @property version - The version of the `snap_getEntropy` method. This must be
|
|
21
|
+
* the numeric literal `1`.
|
|
22
|
+
* @property salt - A string to use as the salt when deriving the entropy. If
|
|
23
|
+
* omitted, the salt will be an empty string.
|
|
24
|
+
*/
|
|
25
|
+
export type GetEntropyArgs = Infer<typeof GetEntropyArgsStruct>;
|
|
26
|
+
export declare const getEntropyBuilder: Readonly<{
|
|
27
|
+
readonly targetName: "snap_getEntropy";
|
|
28
|
+
readonly specificationBuilder: PermissionSpecificationBuilder<PermissionType.RestrictedMethod, GetEntropySpecificationBuilderOptions, {
|
|
29
|
+
permissionType: PermissionType.RestrictedMethod;
|
|
30
|
+
targetName: typeof targetName;
|
|
31
|
+
methodImplementation: ReturnType<typeof getEntropyImplementation>;
|
|
32
|
+
allowedCaveats: Readonly<NonEmptyArray<string>> | null;
|
|
33
|
+
}>;
|
|
34
|
+
readonly methodHooks: MethodHooksObject<GetEntropyHooks>;
|
|
35
|
+
}>;
|
|
36
|
+
export type GetEntropyHooks = {
|
|
37
|
+
/**
|
|
38
|
+
* @returns The mnemonic of the user's primary keyring.
|
|
39
|
+
*/
|
|
40
|
+
getMnemonic: () => Promise<Uint8Array>;
|
|
41
|
+
/**
|
|
42
|
+
* Waits for the extension to be unlocked.
|
|
43
|
+
*
|
|
44
|
+
* @returns A promise that resolves once the extension is unlocked.
|
|
45
|
+
*/
|
|
46
|
+
getUnlockPromise: (shouldShowUnlockRequest: boolean) => Promise<void>;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Builds the method implementation for `snap_getEntropy`. The implementation
|
|
50
|
+
* is based on the reference implementation of
|
|
51
|
+
* [SIP-6](https://metamask.github.io/SIPs/SIPS/sip-6).
|
|
52
|
+
*
|
|
53
|
+
* @param hooks - The RPC method hooks.
|
|
54
|
+
* @param hooks.getMnemonic - The method to get the mnemonic of the user's
|
|
55
|
+
* primary keyring.
|
|
56
|
+
* @param hooks.getUnlockPromise - The method to get a promise that resolves
|
|
57
|
+
* once the extension is unlocked.
|
|
58
|
+
* @returns The method implementation.
|
|
59
|
+
*/
|
|
60
|
+
declare function getEntropyImplementation({ getMnemonic, getUnlockPromise, }: GetEntropyHooks): (options: RestrictedMethodOptions<GetEntropyParams>) => Promise<GetEntropyResult>;
|
|
61
|
+
export {};
|
|
62
|
+
//# sourceMappingURL=getEntropy.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getEntropy.d.mts","sourceRoot":"","sources":["../../src/restricted/getEntropy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,8BAA8B,EAC9B,uBAAuB,EAExB,wCAAwC;AACzC,OAAO,EAAE,cAAc,EAAe,wCAAwC;AAE9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,4BAA4B;AAE9E,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAEnD,OAAO,KAAK,EAAE,aAAa,EAAE,wBAAwB;AAGrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,qBAAiB;AAGlD,QAAA,MAAM,UAAU,oBAAoB,CAAC;AAErC,KAAK,qCAAqC,GAAG;IAC3C,cAAc,CAAC,EAAE,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC;IACxD,WAAW,EAAE,eAAe,CAAC;CAC9B,CAAC;AASF,eAAO,MAAM,oBAAoB;;;;;;EAG/B,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAwBhE,eAAO,MAAM,iBAAiB;;;wBAzCZ,eAAe,gBAAgB;oBACnC,iBAAiB;8BACP,WAAW,+BAA+B,CAAC;wBACjD,SAAS,cAAc,MAAM,CAAC,CAAC,GAAG,IAAI;;;EA0C7C,CAAC;AAEZ,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;IAEvC;;;;OAIG;IACH,gBAAgB,EAAE,CAAC,uBAAuB,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvE,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,iBAAS,wBAAwB,CAAC,EAChC,WAAW,EACX,gBAAgB,GACjB,EAAE,eAAe,aAEL,wBAAwB,gBAAgB,CAAC,KACjD,QAAQ,gBAAgB,CAAC,CAuB7B"}
|