Prechádzať zdrojové kódy

Added simple UI for Validator Tool

singulart 3 rokov pred
rodič
commit
1706fe0899

+ 1 - 0
src/components/Dashboard/index.tsx

@@ -42,6 +42,7 @@ const Dashboard = (props: IProps) => {
           <Link to={`/spending`}>Spending</Link>
           <Link to={`/transactions`}>Transfers</Link>
           <Link to={`/burners`}>Top Burners</Link>
+          <Link to={`/validators_report`}>Validators Reporting Tool</Link>
           <Link to="/mint">Toolbox</Link>
         </div>
 

+ 3 - 0
src/components/Routes/index.tsx

@@ -19,6 +19,9 @@ import {
   Bounties,
   Burners,
 } from "..";
+
+import ValidatorReport from "../Validators/ValidatorReport";
+
 import { IState } from "../../types";
 import ValidatorReport from "../ValidatorReport/ValidatorReport";
 

+ 1 - 0
src/components/index.ts

@@ -22,6 +22,7 @@ export { default as Tokenomics } from "./Tokenomics";
 export { default as Transactions } from "./Transactions";
 export { default as Burners } from "./Burners";
 export { default as Validators } from "./Validators";
+export { default as ValidatorReport } from "./Validators";
 export { default as Timeline } from "./Timeline";
 export { default as TableFromObject } from "./TableFromObject";
 

+ 1 - 1
src/config.ts

@@ -3,5 +3,5 @@ export const wsLocation = "wss://joystreamstats.live:9945";
 export const apiLocation = "https://api.joystreamstats.live/api/v1"
 export const socketLocation = "/socket.io"
 export const hydraLocation = "https://hydra.joystream.org/graphql"
-// export const alternativeBackendApis = "http://localhost:3000"
+//export const alternativeBackendApis = "http://localhost:3000"
 export const alternativeBackendApis = "https://validators.joystreamstats.live"

+ 26 - 5
src/types.ts

@@ -287,14 +287,35 @@ export interface Burner {
   totalburned: number;
 }
 
-export interface CalendarItem {
+export interface Burner {
+  wallet: string,
+  totalburned: number;
+}
+
+export interface ValidatorApiResponse {
+  pageSize: number;
+  totalCount: number;
+  startBlock: number;
+  endBlock: number;
+  startTime: string;
+  endTime: string;
+  startEra: number;
+  endEra: number;
+  totalBlocks: number;
+  report: ValidatorReportLineItem[]
+}
+
+export interface ValidatorReportLineItem {
   id: number;
-  group: number;
-  title: string;
-  start_time: number;
-  end_time: number;
+  stakeTotal: string;
+  stakeOwn: string;
+  points: number;
+  rewards: number;
+  commission: number;
+  blocksCount: number;
 }
 
+
 export interface CalendarGroup {
   id: number;
   title: string;