Skip to content

Commit 345e3fd

Browse files
committed
Refactor imports and update onInstall handler documentation for clarity
1 parent 9d7ad4f commit 345e3fd

File tree

1 file changed

+8
-5
lines changed
  • packages/gator-permissions-snap/src

1 file changed

+8
-5
lines changed

packages/gator-permissions-snap/src/index.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-disable no-restricted-globals */
2+
import type { GetSnapsResponse } from '@metamask/7715-permissions-shared/types';
23
import { logger } from '@metamask/7715-permissions-shared/utils';
34
import {
45
AuthType,
@@ -7,14 +8,16 @@ import {
78
UserStorage,
89
} from '@metamask/profile-sync-controller/sdk';
910
import {
10-
type Json,
11-
type JsonRpcParams,
12-
type OnRpcRequestHandler,
13-
type OnUserInputHandler,
1411
MethodNotFoundError,
1512
InvalidRequestError,
1613
InternalError,
14+
} from '@metamask/snaps-sdk';
15+
import type {
1716
OnInstallHandler,
17+
Json,
18+
JsonRpcParams,
19+
OnRpcRequestHandler,
20+
OnUserInputHandler,
1821
} from '@metamask/snaps-sdk';
1922

2023
import { AccountApiClient } from './clients/accountApiClient';
@@ -38,7 +41,6 @@ import { TokenMetadataService } from './services/tokenMetadataService';
3841
import { TokenPricesService } from './services/tokenPricesService';
3942
import { createStateManager } from './stateManagement';
4043
import { UserEventDispatcher } from './userEventDispatcher';
41-
import { GetSnapsResponse } from '@metamask/7715-permissions-shared/types';
4244

4345
const isStorePermissionsFeatureEnabled =
4446
process.env.STORE_PERMISSIONS_ENABLED === 'true';
@@ -240,6 +242,7 @@ export const onInstall: OnInstallHandler = async () => {
240242
*
241243
* Since the message signing snap is preinstalled in production, and has
242244
* initialConnections configured to automatically connect to the gator snap, this is not needed in production.
245+
* The following code will be tree-shaken out in production builds.
243246
*/
244247
// eslint-disable-next-line no-restricted-globals
245248
if (snapEnv === 'local' && isStorePermissionsFeatureEnabled) {

0 commit comments

Comments
 (0)