Kaynağa Gözat

Added simple UI for Validator Tool

singulart 3 yıl önce
ebeveyn
işleme
8bb02b560d

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

@@ -43,6 +43,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>
 

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

@@ -17,6 +17,11 @@ import {
   Transactions,
   Burners,
 } from "..";
+
+import 
+  ValidatorReport
+from "../Validators/ValidatorReport"
+
 import { IState } from "../../types";
 
 interface IProps extends IState {
@@ -80,6 +85,10 @@ const Routes = (props: IProps) => {
         path="/validators"
         render={(routeprops) => <Validators {...routeprops} {...props} />}
       />
+      <Route
+        path="/validators_report"
+        render={(routeprops) => <ValidatorReport {...routeprops} {...props} />}
+      />
       <Route
         path="/storage"
         render={(routeprops) => <Storage {...routeprops} {...props} />}

+ 1 - 0
src/components/index.ts

@@ -20,6 +20,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

@@ -2,5 +2,5 @@ export const domain = "https://testnet.joystream.org";
 export const wsLocation = "wss://joystreamstats.live:9945";
 export const apiLocation = "https://api.joystreamstats.live/api/v1"
 export const socketLocation = "/socket.io"
-// 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;