Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge extension ens controller #1170

Merged
merged 13 commits into from
Apr 20, 2023
16 changes: 15 additions & 1 deletion packages/controller-utils/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { NetworkType, NetworksTicker, NetworksChainId } from './types';
import {
NetworkType,
NetworksTicker,
NetworksChainId,
NetworkId,
} from './types';

export const RPC = 'rpc';
export const FALL_BACK_VS_CURRENCY = 'ETH';
Expand Down Expand Up @@ -110,3 +115,12 @@ export enum ApprovalType {
Unlock = 'unlock',
ConnectAccounts = 'connect_accounts',
}

export const NETWORK_ID_TO_ETHERS_NETWORK_NAME_MAP: Record<
NetworkId,
NetworkType
> = {
[NetworkId.goerli]: NetworkType.goerli,
[NetworkId.sepolia]: NetworkType.sepolia,
[NetworkId.mainnet]: NetworkType.mainnet,
};
6 changes: 6 additions & 0 deletions packages/controller-utils/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ export enum NetworksChainId {
rpc = '',
}

export enum NetworkId {
mainnet = '1',
goerli = '5',
sepolia = '11155111',
}

export enum NetworksTicker {
mainnet = 'ETH',
goerli = 'GoerliETH',
Expand Down
6 changes: 5 additions & 1 deletion packages/ens-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@
"test:watch": "jest --watch"
},
"dependencies": {
"@ethersproject/providers": "^5.7.0",
"@metamask/base-controller": "workspace:^",
"@metamask/controller-utils": "workspace:^"
"@metamask/controller-utils": "workspace:^",
"@metamask/utils": "^5.0.1",
"ethereum-ens-network-map": "^1.0.2",
"punycode": "^2.1.1"
},
"devDependencies": {
"@metamask/auto-changelog": "^3.1.0",
Expand Down
Loading