Replace spectreDao delegations

This commit is contained in:
Yana
2025-05-07 18:59:05 +03:00
parent 7012bf9886
commit 135f248eba
4 changed files with 9 additions and 18 deletions
+5 -9
View File
@@ -17,7 +17,6 @@ import {
CURRENT_EPOCH,
CURRENT_EPOCH_REWARDS,
DATA_OBSERVATORY_BALANCES_URL,
DATA_OBSERVATORY_NODES_URL,
NS_API_NODES,
NYM_ACCOUNT_ADDRESS,
NYM_PRICES_API,
@@ -59,15 +58,12 @@ export const fetchGatewayStatus = async (
export const fetchNodeDelegations = async (
id: number,
): Promise<NodeRewardDetails[]> => {
const response = await fetch(
`${DATA_OBSERVATORY_NODES_URL}/${id}/delegations`,
{
headers: {
Accept: "application/json",
"Content-Type": "application/json; charset=utf-8",
},
const response = await fetch(`${NS_API_NODES}/${id}/delegations`, {
headers: {
Accept: "application/json",
"Content-Type": "application/json; charset=utf-8",
},
);
});
if (!response.ok) {
throw new Error("Failed to fetch delegations");
+2 -2
View File
@@ -206,10 +206,10 @@ export interface NodeRewardDetails {
amount: string;
denom: string;
};
block_height: number;
cumulative_reward_ratio: string;
height: number;
node_id: number;
owner: string;
proxy: string;
}
export type LastProbeResult = {
-5
View File
@@ -8,11 +8,6 @@ export const NYM_ACCOUNT_ADDRESS =
export const NYM_PRICES_API = "https://api.nym.spectredao.net/api/v1/nym-price";
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_DELEGATIONS_URL =
"https://api.nym.spectredao.net/api/v1/delegations";
export const DATA_OBSERVATORY_BALANCES_URL =
"https://api.nym.spectredao.net/api/v1/balances";
export const OBSERVATORY_GATEWAYS_URL =
@@ -55,7 +55,7 @@ const DelegationsTable = ({ id }: Props) => {
accessorKey: "height",
Cell: ({ row }) => (
<Stack spacing={1}>
<Typography variant="body4">{row.original.height}</Typography>
<Typography variant="body4">{row.original.block_height}</Typography>
</Stack>
),
},
@@ -86,7 +86,7 @@ const DelegationsTable = ({ id }: Props) => {
),
},
],
[],
[]
);
const table = useMaterialReactTable({
columns,