Skip to content

Commit

Permalink
feat(configs): exports networks properly typed with generics (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathewmeconry authored Jan 4, 2024
1 parent ad0c148 commit 92967df
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion configs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@aragon/osx-commons-configs",
"author": "Aragon Association",
"version": "0.0.1",
"version": "0.0.2",
"license": "AGPL-3.0-or-later",
"typings": "dist/index.d.ts",
"main": "dist/index.js",
Expand Down
7 changes: 6 additions & 1 deletion configs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ import * as mumbai from './deployments/mumbai.json';
import * as polygon from './deployments/polygon.json';
import * as sepolia from './deployments/sepolia.json';
import * as networks from './networks.json';
import {NetworkConfigs} from './types';

export * from './types';

const networksTyped: NetworkConfigs = networks;

export {
networks,
networksTyped as networks,
arbitrum,
arbitrumSepolia,
baseGoerli,
Expand Down
16 changes: 16 additions & 0 deletions configs/src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export type NetworkConfig = {
url: string;
isTestnet: boolean;
chainId: number;
aliases: NetworkAliases;
};

export type NetworkAliases = {
ethers5?: string;
ethers6?: string;
alchemySubgraphs?: string;
};

export type NetworkConfigs<T = NetworkConfig> = {
[network: string]: T;
};

0 comments on commit 92967df

Please sign in to comment.