diff --git a/backend/src/controllers/account.controller.ts b/backend/src/controllers/account.controller.ts index a2611cc..48a38e3 100644 --- a/backend/src/controllers/account.controller.ts +++ b/backend/src/controllers/account.controller.ts @@ -1,5 +1,5 @@ import { BlockService } from '../services/block.service'; -import { CHECKPOINT_CONTRACT, PARENTCHAIN_WALLET } from '../config'; +import { CHECKPOINT_CONTRACT, PARENTCHAIN_WALLET, SUBNET_URL } from '../config'; import { getService } from '../services'; import { AccountService } from '../services/account.service'; import { NextFunction, Request, Response } from 'express'; @@ -33,4 +33,14 @@ export class RelayerController { next(error); } }; + + // TODO: Fetch the chain grandmaster address etc. + public getChainDetails = async (req: Request, res: Response, next: NextFunction): Promise => { + const data = { + rpcUrl: SUBNET_URL, + grandmasterAddress: 'xxx', + minimumDelegation: '10000000000000000000000000', + }; + res.status(200).json(data); + }; } diff --git a/backend/src/controllers/blocks.controller.ts b/backend/src/controllers/blocks.controller.ts index 3f7ec2d..0c1cf51 100644 --- a/backend/src/controllers/blocks.controller.ts +++ b/backend/src/controllers/blocks.controller.ts @@ -14,7 +14,7 @@ export class BlocksController { } public loadRecentBlocks = async (req: Request, res: Response, next: NextFunction): Promise => { - const blockNumIndex = req.query.blockNumIndex? Number(req.query.blockNumIndex) : -1; + const blockNumIndex = req.query.blockNumIndex ? Number(req.query.blockNumIndex) : -1; try { const [latestMinedBlock, recentBlocks, chainStatus, lastSubnetCommittedBlock, parentchainSubnetBlock] = await Promise.all([ diff --git a/backend/src/routes/index.ts b/backend/src/routes/index.ts index 41c92d5..cbf20d7 100644 --- a/backend/src/routes/index.ts +++ b/backend/src/routes/index.ts @@ -21,6 +21,7 @@ export class Route implements Routes { this.router.get('/information/masternodes', this.masterNodeController.getMasternodesInfo); this.router.get('/information/network', this.blocksController.getBlockChainStats); this.router.get('/information/relayer', this.relayerController.getRelayerRelatedDetails); + this.router.get('/information/chainsetting', this.relayerController.getChainDetails); this.router.get('/confirmation', this.blocksController.confirmBlock); } } diff --git a/backend/swagger.yaml b/backend/swagger.yaml index f4b2a5e..4b23893 100644 --- a/backend/swagger.yaml +++ b/backend/swagger.yaml @@ -236,6 +236,39 @@ paths: description: 'Bad Request' '500': description: 'Server Error' + /information/chainsetting: + get: + summary: Get the subnet network metadata such as the RPC URL. This is particularly useful for help to validate the setting parameters from XDC pay/wallet in management page + tags: + - management + responses: + '200': + content: + 'application/json': + schema: + type: object + properties: + subnet: + type: object + properties: + rpcUrl: + description: Subnet Chain RPC URL + type: string + grandmasterAddress: + description: The grandmaster wallet address for verification + type: string + minimumDelegation: + description: Minimum delegation required when increase the candidates's voting/ranking power + required: + - rpcUrl + - grandmasterAddress + - minimumDelegation + required: + - subnet + '400': + description: 'Bad Request' + '500': + description: 'Server Error' /confirmation: get: diff --git a/frontend/package.json b/frontend/package.json index db69578..89e04cf 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -11,34 +11,35 @@ }, "dependencies": { "@radix-ui/react-tooltip": "^1.0.6", - "@types/lodash.debounce": "^4.0.7", - "@types/react": "^18.0.37", - "@types/react-dom": "^18.0.11", - "@vitejs/plugin-react": "^4.0.0", - "autoprefixer": "^10.4.14", "axios": "^1.4.0", "formik": "^2.4.3", "lodash.debounce": "^4.0.8", - "postcss": "^8.4.24", "react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^6.14.0", - "sass": "^1.63.6", - "tailwind-merge": "^1.13.2", - "tailwindcss": "^3.3.2", - "typescript": "^5.0.2", - "vite": "^4.4.7", - "vite-tsconfig-paths": "^4.2.0", - "web3": "1.6.1", + "web3": "4.0.3", "yup": "^1.2.0" }, "devDependencies": { "@types/axios": "^0.14.0", + "@types/lodash.debounce": "^4.0.7", + "@types/react": "^18.0.37", + "@types/react-dom": "^18.0.11", "@types/web3": "^1.2.2", "@typescript-eslint/eslint-plugin": "^5.59.0", "@typescript-eslint/parser": "^5.59.0", + "@vitejs/plugin-react": "^4.0.0", + "autoprefixer": "^10.4.14", "eslint": "^8.38.0", "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-react-refresh": "^0.3.4" + "eslint-plugin-react-refresh": "^0.3.4", + "postcss": "^8.4.24", + "sass": "^1.63.6", + "tailwind-merge": "^1.13.2", + "tailwindcss": "^3.3.2", + "typescript": "^5.0.2", + "vite": "^4.4.7", + "vite-plugin-node-polyfills": "^0.9.0", + "vite-tsconfig-paths": "^4.2.0" } } diff --git a/frontend/src/pages/management-master-committee-page/ManagementMasterCommitteePage.tsx b/frontend/src/pages/management-master-committee-page/ManagementMasterCommitteePage.tsx index eae171f..25f2dea 100644 --- a/frontend/src/pages/management-master-committee-page/ManagementMasterCommitteePage.tsx +++ b/frontend/src/pages/management-master-committee-page/ManagementMasterCommitteePage.tsx @@ -143,7 +143,7 @@ export default function ManagementMasterCommitteePage() { {formatHash(row.address)} {row.delegation} xdc - {row.rank} + {i} {getDisplayStatus(row.status)}