Skip to content

Commit f982cb4

Browse files
committed
Fix NS api endpoint for dev and prod, add env variables
1 parent 52ffd2e commit f982cb4

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

explorer-v2/src/app/api/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
CURRENT_EPOCH_REWARDS,
1717
DATA_OBSERVATORY_BALANCES_URL,
1818
DATA_OBSERVATORY_NODES_URL,
19-
NS_API_MIXNODES_STATS,
2019
NYM_ACCOUNT_ADDRESS,
2120
NYM_PRICES_API,
2221
OBSERVATORY_GATEWAYS_URL,
@@ -174,7 +173,12 @@ export const fetchOriginalStake = async (address: string): Promise<number> => {
174173
};
175174

176175
export const fetchNoise = async (): Promise<IPacketsAndStakingData[]> => {
177-
const response = await fetch(NS_API_MIXNODES_STATS, {
176+
if (!process.env.NEXT_PUBLIC_NS_API_MIXNODES_STATS) {
177+
throw new Error(
178+
"NEXT_PUBLIC_NS_API_MIXNODES_STATS environment variable is not defined",
179+
);
180+
}
181+
const response = await fetch(process.env.NEXT_PUBLIC_NS_API_MIXNODES_STATS, {
178182
headers: {
179183
Accept: "application/json",
180184
"Content-Type": "application/json; charset=utf-8",

explorer-v2/src/app/api/urls.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11

2-
export const NS_API_MIXNODES_STATS =
3-
"https://staging-node-status-api.nymte.ch/v2/mixnodes/stats";
42
export const CURRENT_EPOCH =
53
"https://validator.nymtech.net/api/v1/epoch/current";
64
export const CURRENT_EPOCH_REWARDS =

explorer-v2/src/components/lineChart/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const LineChart = ({
9898
format: "%Y-%m-%d",
9999
}}
100100
yScale={{
101-
min: 120000000, // Keeping the minimum static
101+
min: 0, // Keeping the minimum static
102102
max: maxYValue, // **Dynamically set max value**
103103
type: "linear",
104104
}}

0 commit comments

Comments
 (0)