Skip to content

Commit

Permalink
Remove need for networks/index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgall committed Jul 6, 2024
1 parent 59eca5d commit 5366892
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 11 deletions.
3 changes: 2 additions & 1 deletion src/providers/NetworkConfig/NetworkConfigProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { Context, createContext, ReactNode, useContext, useEffect, useState } fr
import { useChainId } from 'wagmi';
import { NetworkConfig } from '../../types/network';

import * as networks from './networks';
const modules = import.meta.glob<{ default: NetworkConfig }>('./networks/*.ts', { eager: true });
const networks = Object.values(modules).map(module => module.default);

export const NetworkConfigContext = createContext({} as NetworkConfig);

Expand Down
4 changes: 3 additions & 1 deletion src/providers/NetworkConfig/networks/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { NetworkConfig } from '../../../types/network';

const SAFE_VERSION = '1.3.0';

export const baseConfig: NetworkConfig = {
const baseConfig: NetworkConfig = {
order: 10,
chain: base,
moralisSupported: true,
Expand Down Expand Up @@ -74,3 +74,5 @@ export const baseConfig: NetworkConfig = {
staking: {},
createOptions: [GovernanceType.MULTISIG, GovernanceType.AZORIUS_ERC20],
};

export default baseConfig;
5 changes: 0 additions & 5 deletions src/providers/NetworkConfig/networks/index.ts

This file was deleted.

4 changes: 3 additions & 1 deletion src/providers/NetworkConfig/networks/mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { NetworkConfig } from '../../../types/network';

const SAFE_VERSION = '1.3.0';

export const mainnetConfig: NetworkConfig = {
const mainnetConfig: NetworkConfig = {
order: 0,
chain: mainnet,
moralisSupported: true,
Expand Down Expand Up @@ -80,3 +80,5 @@ export const mainnetConfig: NetworkConfig = {
},
createOptions: [GovernanceType.MULTISIG, GovernanceType.AZORIUS_ERC20],
};

export default mainnetConfig;
4 changes: 3 additions & 1 deletion src/providers/NetworkConfig/networks/optimism.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { NetworkConfig } from '../../../types/network';

const SAFE_VERSION = '1.3.0';

export const optimismConfig: NetworkConfig = {
const optimismConfig: NetworkConfig = {
order: 15,
chain: optimism,
moralisSupported: true,
Expand Down Expand Up @@ -74,3 +74,5 @@ export const optimismConfig: NetworkConfig = {
staking: {},
createOptions: [GovernanceType.MULTISIG, GovernanceType.AZORIUS_ERC20],
};

export default optimismConfig;
4 changes: 3 additions & 1 deletion src/providers/NetworkConfig/networks/polygon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { NetworkConfig } from '../../../types/network';

const SAFE_VERSION = '1.3.0';

export const polygonConfig: NetworkConfig = {
const polygonConfig: NetworkConfig = {
order: 20,
chain: polygon,
moralisSupported: true,
Expand Down Expand Up @@ -74,3 +74,5 @@ export const polygonConfig: NetworkConfig = {
staking: {},
createOptions: [GovernanceType.MULTISIG, GovernanceType.AZORIUS_ERC20],
};

export default polygonConfig;
4 changes: 3 additions & 1 deletion src/providers/NetworkConfig/networks/sepolia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { NetworkConfig } from '../../../types/network';

const SAFE_VERSION = '1.3.0';

export const sepoliaConfig: NetworkConfig = {
const sepoliaConfig: NetworkConfig = {
order: 30,
chain: sepolia,
moralisSupported: true,
Expand Down Expand Up @@ -78,3 +78,5 @@ export const sepoliaConfig: NetworkConfig = {
GovernanceType.AZORIUS_ERC721,
],
};

export default sepoliaConfig;

0 comments on commit 5366892

Please sign in to comment.