Merge pull request #5636 from nymtech/BugFix/explorer_styling_broken

/ regenerated yarn.lock
This commit is contained in:
Yana Matrosova
2025-03-20 19:08:02 +02:00
committed by GitHub
8 changed files with 2494 additions and 5817 deletions
@@ -1,5 +1,5 @@
import { fetchNodes } from "@/app/api";
import type { NodeData } from "@/app/api/types";
import { fetchObservatoryNodes } from "@/app/api";
import type { IObservatoryNode } from "@/app/api/types";
import { Box, Typography } from "@mui/material";
import Grid from "@mui/material/Grid2";
import { AccountBalancesCard } from "../../../../components/accountPageComponents/AccountBalancesCard";
@@ -16,10 +16,10 @@ export default async function Account({
try {
const address = (await params).address;
const nymNodes: NodeData[] = await fetchNodes();
const nymNodes: IObservatoryNode[] = await fetchObservatoryNodes();
const nymNode = nymNodes.find(
(node) => node.bond_information.owner === address,
(node) => node.bonding_address === address,
);
return (
+8 -20
View File
@@ -7,7 +7,6 @@ import type {
IAccountBalancesInfo,
IObservatoryNode,
IPacketsAndStakingData,
NodeData,
NodeRewardDetails,
NymTokenomics,
ObservatoryBalance,
@@ -16,11 +15,8 @@ import {
CURRENT_EPOCH,
CURRENT_EPOCH_REWARDS,
DATA_OBSERVATORY_BALANCES_URL,
DATA_OBSERVATORY_NODES_DELEGATIONS_URL,
DATA_OBSERVATORY_NODES_URL,
NS_API_MIXNODES_STATS,
NYM_ACCOUNT_ADDRESS,
NYM_NODES,
NYM_PRICES_API,
OBSERVATORY_GATEWAYS_URL,
} from "./urls";
@@ -76,7 +72,7 @@ export const fetchNodeDelegations = async (
id: number,
): Promise<NodeRewardDetails[]> => {
const response = await fetch(
`${DATA_OBSERVATORY_NODES_DELEGATIONS_URL}/${id}/delegations`,
`${DATA_OBSERVATORY_NODES_URL}/${id}/delegations`,
{
headers: {
Accept: "application/json",
@@ -177,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",
@@ -206,20 +207,7 @@ export const fetchAccountBalance = async (
return data;
};
// 🔹 Fetch Nodes
export const fetchNodes = async (): Promise<NodeData[]> => {
const res = await fetch(NYM_NODES, {
headers: {
Accept: "application/json",
"Content-Type": "application/json; charset=utf-8",
},
});
if (!res.ok) {
throw new Error("Failed to fetch nodes");
}
const data: NodeData[] = await res.json();
return data;
};
export const fetchObservatoryNodes = async (): Promise<IObservatoryNode[]> => {
const allNodes: IObservatoryNode[] = [];
+1 -8
View File
@@ -1,9 +1,3 @@
export const NYM_NODES =
"https://explorer.nymtech.net/api/v1/tmp/unstable/nym-nodes";
export const HARBOURMASTER_API_MIXNODES_STATS =
"https://harbourmaster.nymtech.net/v2/mixnodes/stats";
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";
@@ -18,8 +12,7 @@ export const VALIDATOR_BASE_URL =
process.env.NEXT_PUBLIC_VALIDATOR_URL || "https://rpc.nymtech.net";
export const DATA_OBSERVATORY_NODES_URL =
"https://api.nym.spectredao.net/api/v1/nodes";
export const DATA_OBSERVATORY_NODES_DELEGATIONS_URL =
"https://api.nym.spectredao.net/api/v1/nodes";
export const DATA_OBSERVATORY_DELEGATIONS_URL =
"https://api.nym.spectredao.net/api/v1/delegations";
export const DATA_OBSERVATORY_BALANCES_URL =
+3 -5
View File
@@ -1,4 +1,4 @@
import { Stack, Typography } from "@mui/material";
import { Stack } from "@mui/material";
import Grid from "@mui/material/Grid2";
import BlogArticlesCards from "../components/blogs/BlogArticleCards";
import { ContentLayout } from "../components/contentLayout/ContentLayout";
@@ -15,14 +15,12 @@ export default async function Home() {
return (
<ContentLayout>
<Stack gap={5}>
<Typography variant="h1" textTransform={"uppercase"}>
Mixnet in your hands
</Typography>
<NodeAndAddressSearch />
</Stack>
<Grid container columnSpacing={5} rowSpacing={5}>
<Grid size={12}>
<SectionHeading title="Noise Generating Mixnet Overview" />
<SectionHeading title="Noise Generating Network Overview" />
</Grid>
<Grid size={{ xs: 12, sm: 6, md: 3 }}>
<NoiseCard />
+1 -1
View File
@@ -15,7 +15,7 @@ export async function Footer() {
const locale = "en";
const footerData = await getFooter(locale);
const legalContent1 =
"Nym Noise Generating Mixnet Explorer, V 2.1.0 Public Beta release.";
"Nym Noise Generating Network Explorer, V 2.1.0 Public Beta release.";
const legalContent2 = footerData?.attributes?.legalContent2 || false;
const footerLinkBlocks = footerData?.attributes?.linkBlocks || [];
@@ -19,7 +19,8 @@ const MENU_DATA: MenuItem[] = [
id: 3,
title: "Onboarding",
url: "/onboarding",
},
}
];
export default MENU_DATA;
@@ -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",
}}
+2474 -5777
View File
File diff suppressed because it is too large Load Diff