Skip to content

Commit ac4cd76

Browse files
chore: Remove network-controller dependency for chain-agnostic-permission (#7561)
## Explanation Remove `network-controller` dependency for `chain-agnostic-permission` as it brings in a massive amount of dependencies and is only used for a single type union that contains `string` anyway. The additional dependencies becomes hard to manage when using `chain-agnostic-permission` outside a MetaMask client (e.g. in Snaps). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Removes the `@metamask/network-controller` dependency and eliminates its type usage. > > - Drops `@metamask/network-controller` from `package.json` and `yarn.lock` > - Updates `caip25Permission.ts` to remove the import and change `findNetworkClientIdByChainId` return type from `NetworkClientId` to `string` > - Notes the change in `CHANGELOG.md` > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 36a8356. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 9493bbc commit ac4cd76

File tree

4 files changed

+2
-4
lines changed

4 files changed

+2
-4
lines changed

packages/chain-agnostic-permission/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
### Changed
1515

16+
- Remove `@metamask/network-controller` dependency ([#7561](https://github.com/MetaMask/core/pull/7561))
1617
- Upgrade `@metamask/utils` from `^11.8.1` to `^11.9.0` ([#7511](https://github.com/MetaMask/core/pull/7511))
1718
- Bump `@metamask/network-controller` from `^27.0.0` to `^27.1.0` ([#7534](https://github.com/MetaMask/core/pull/7534))
1819
- Bump `@metamask/controller-utils` from `^11.16.0` to `^11.17.0` ([#7534](https://github.com/MetaMask/core/pull/7534))

packages/chain-agnostic-permission/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
"dependencies": {
5151
"@metamask/api-specs": "^0.14.0",
5252
"@metamask/controller-utils": "^11.17.0",
53-
"@metamask/network-controller": "^27.1.0",
5453
"@metamask/permission-controller": "^12.2.0",
5554
"@metamask/rpc-errors": "^7.0.2",
5655
"@metamask/utils": "^11.9.0",

packages/chain-agnostic-permission/src/caip25Permission.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type { NetworkClientId } from '@metamask/network-controller';
21
import type {
32
PermissionSpecificationBuilder,
43
EndowmentGetterParams,
@@ -85,7 +84,7 @@ export const createCaip25Caveat = (value: Caip25CaveatValue) => {
8584
};
8685

8786
type Caip25EndowmentCaveatSpecificationBuilderOptions = {
88-
findNetworkClientIdByChainId: (chainId: Hex) => NetworkClientId;
87+
findNetworkClientIdByChainId: (chainId: Hex) => string;
8988
listAccounts: () => { type: string; address: Hex }[];
9089
isNonEvmScopeSupported: (scope: CaipChainId) => boolean;
9190
getNonEvmAccountAddresses: (scope: CaipChainId) => string[];

yarn.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2888,7 +2888,6 @@ __metadata:
28882888
"@metamask/auto-changelog": "npm:^3.4.4"
28892889
"@metamask/controller-utils": "npm:^11.17.0"
28902890
"@metamask/keyring-internal-api": "npm:^9.0.0"
2891-
"@metamask/network-controller": "npm:^27.1.0"
28922891
"@metamask/permission-controller": "npm:^12.2.0"
28932892
"@metamask/rpc-errors": "npm:^7.0.2"
28942893
"@metamask/utils": "npm:^11.9.0"

0 commit comments

Comments
 (0)