(null);
@@ -22,8 +30,8 @@ export const StatsManager = ({ className }: statsManagerProps) => {
async function getStats() {
try {
const [res1, res2] = await Promise.all([
- fetch('https://api.token.vega.xyz/statistics'),
- fetch('https://api.token.vega.xyz/nodes-data'),
+ fetch(statsEndpoint),
+ fetch(nodesEndpoint),
]);
const [{ statistics }, { nodeData }] = await Promise.all([
res1.json(),
@@ -69,7 +77,7 @@ export const StatsManager = ({ className }: statsManagerProps) => {
return () => {
clearInterval(interval);
};
- }, []);
+ }, [nodesEndpoint, statsEndpoint]);
const classes = classnames(
className,
@@ -79,7 +87,7 @@ export const StatsManager = ({ className }: statsManagerProps) => {
return (
- {(error && `/ ${error}`) || (data ? '/ Mainnet' : '/ Connecting...')}
+ {(error && `/ ${error}`) || (data ? `/ ${envName}` : '/ Connecting...')}
{data?.promoted ? (
diff --git a/libs/mainnet-stats-manager/src/components/table-row/index.ts b/libs/network-stats/src/components/table-row/index.ts
similarity index 100%
rename from libs/mainnet-stats-manager/src/components/table-row/index.ts
rename to libs/network-stats/src/components/table-row/index.ts
diff --git a/libs/mainnet-stats-manager/src/components/table-row/table-row.tsx b/libs/network-stats/src/components/table-row/table-row.tsx
similarity index 100%
rename from libs/mainnet-stats-manager/src/components/table-row/table-row.tsx
rename to libs/network-stats/src/components/table-row/table-row.tsx
diff --git a/libs/mainnet-stats-manager/src/components/table/index.ts b/libs/network-stats/src/components/table/index.ts
similarity index 100%
rename from libs/mainnet-stats-manager/src/components/table/index.ts
rename to libs/network-stats/src/components/table/index.ts
diff --git a/libs/mainnet-stats-manager/src/components/table/table.tsx b/libs/network-stats/src/components/table/table.tsx
similarity index 100%
rename from libs/mainnet-stats-manager/src/components/table/table.tsx
rename to libs/network-stats/src/components/table/table.tsx
diff --git a/libs/mainnet-stats-manager/src/components/tooltip/index.ts b/libs/network-stats/src/components/tooltip/index.ts
similarity index 100%
rename from libs/mainnet-stats-manager/src/components/tooltip/index.ts
rename to libs/network-stats/src/components/tooltip/index.ts
diff --git a/libs/mainnet-stats-manager/src/components/tooltip/tooltip.tsx b/libs/network-stats/src/components/tooltip/tooltip.tsx
similarity index 100%
rename from libs/mainnet-stats-manager/src/components/tooltip/tooltip.tsx
rename to libs/network-stats/src/components/tooltip/tooltip.tsx
diff --git a/libs/mainnet-stats-manager/src/config/stats-fields.ts b/libs/network-stats/src/config/stats-fields.ts
similarity index 100%
rename from libs/mainnet-stats-manager/src/config/stats-fields.ts
rename to libs/network-stats/src/config/stats-fields.ts
diff --git a/libs/mainnet-stats-manager/src/config/types.ts b/libs/network-stats/src/config/types.ts
similarity index 100%
rename from libs/mainnet-stats-manager/src/config/types.ts
rename to libs/network-stats/src/config/types.ts
diff --git a/libs/mainnet-stats-manager/src/index.ts b/libs/network-stats/src/index.ts
similarity index 100%
rename from libs/mainnet-stats-manager/src/index.ts
rename to libs/network-stats/src/index.ts
diff --git a/libs/mainnet-stats-manager/tsconfig.json b/libs/network-stats/tsconfig.json
similarity index 100%
rename from libs/mainnet-stats-manager/tsconfig.json
rename to libs/network-stats/tsconfig.json
diff --git a/libs/mainnet-stats-manager/tsconfig.lib.json b/libs/network-stats/tsconfig.lib.json
similarity index 100%
rename from libs/mainnet-stats-manager/tsconfig.lib.json
rename to libs/network-stats/tsconfig.lib.json
diff --git a/libs/mainnet-stats-manager/tsconfig.spec.json b/libs/network-stats/tsconfig.spec.json
similarity index 100%
rename from libs/mainnet-stats-manager/tsconfig.spec.json
rename to libs/network-stats/tsconfig.spec.json
diff --git a/tsconfig.base.json b/tsconfig.base.json
index 55dd28414..9ca955a42 100644
--- a/tsconfig.base.json
+++ b/tsconfig.base.json
@@ -17,10 +17,8 @@
"paths": {
"@vegaprotocol/deal-ticket": ["libs/deal-ticket/src/index.ts"],
"@vegaprotocol/graphql": ["libs/graphql/src/index.ts"],
- "@vegaprotocol/mainnet-stats-manager": [
- "libs/mainnet-stats-manager/src/index.ts"
- ],
"@vegaprotocol/market-list": ["libs/market-list/src/index.ts"],
+ "@vegaprotocol/network-stats": ["libs/network-stats/src/index.ts"],
"@vegaprotocol/order-list": ["libs/order-list/src/index.ts"],
"@vegaprotocol/react-helpers": ["libs/react-helpers/src/index.ts"],
"@vegaprotocol/tailwindcss-config": [
diff --git a/workspace.json b/workspace.json
index 9ae846565..271efd4cf 100644
--- a/workspace.json
+++ b/workspace.json
@@ -5,12 +5,12 @@
"explorer": "apps/explorer",
"explorer-e2e": "apps/explorer-e2e",
"graphql": "libs/graphql",
- "mainnet-stats-manager": "libs/mainnet-stats-manager",
"market-list": "libs/market-list",
+ "network-stats": "libs/network-stats",
"order-list": "libs/order-list",
"react-helpers": "libs/react-helpers",
- "stats-mainnet": "apps/stats-mainnet",
- "stats-mainnet-e2e": "apps/stats-mainnet-e2e",
+ "stats": "apps/stats",
+ "stats-e2e": "apps/stats-e2e",
"tailwindcss-config": "libs/tailwindcss-config",
"trading": "apps/trading",
"trading-e2e": "apps/trading-e2e",