Skip to content

Commit

Permalink
Merge extension ens controller (#1170)
Browse files Browse the repository at this point in the history
Merge extension ens controller
  • Loading branch information
cryptodev-2s authored Apr 20, 2023
1 parent c9bade5 commit 7d5057b
Show file tree
Hide file tree
Showing 7 changed files with 500 additions and 9 deletions.
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

0 comments on commit 7d5057b

Please sign in to comment.