Fix NS api endpoint for dev and prod, add env variables
This commit is contained in:
@@ -16,7 +16,6 @@ import {
|
||||
CURRENT_EPOCH_REWARDS,
|
||||
DATA_OBSERVATORY_BALANCES_URL,
|
||||
DATA_OBSERVATORY_NODES_URL,
|
||||
NS_API_MIXNODES_STATS,
|
||||
NYM_ACCOUNT_ADDRESS,
|
||||
NYM_PRICES_API,
|
||||
OBSERVATORY_GATEWAYS_URL,
|
||||
@@ -174,7 +173,12 @@ export const fetchOriginalStake = async (address: string): Promise<number> => {
|
||||
};
|
||||
|
||||
export const fetchNoise = async (): Promise<IPacketsAndStakingData[]> => {
|
||||
const response = await fetch(NS_API_MIXNODES_STATS, {
|
||||
if (!process.env.NEXT_PUBLIC_NS_API_MIXNODES_STATS) {
|
||||
throw new Error(
|
||||
"NEXT_PUBLIC_NS_API_MIXNODES_STATS environment variable is not defined",
|
||||
);
|
||||
}
|
||||
const response = await fetch(process.env.NEXT_PUBLIC_NS_API_MIXNODES_STATS, {
|
||||
headers: {
|
||||
Accept: "application/json",
|
||||
"Content-Type": "application/json; charset=utf-8",
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
|
||||
export const NS_API_MIXNODES_STATS =
|
||||
"https://staging-node-status-api.nymte.ch/v2/mixnodes/stats";
|
||||
export const CURRENT_EPOCH =
|
||||
"https://validator.nymtech.net/api/v1/epoch/current";
|
||||
export const CURRENT_EPOCH_REWARDS =
|
||||
|
||||
@@ -98,7 +98,7 @@ export const LineChart = ({
|
||||
format: "%Y-%m-%d",
|
||||
}}
|
||||
yScale={{
|
||||
min: 120000000, // Keeping the minimum static
|
||||
min: 0, // Keeping the minimum static
|
||||
max: maxYValue, // **Dynamically set max value**
|
||||
type: "linear",
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user