swagger: '2.0' info: version: 2.0.0 title: VicMaster APIs description: Happy to code VicMaster APIs license: name: Github url: 'https://github.com/BuildOnViction/tomomaster' tags: - name: Config description: Get VicMaster Application Configuration - name: Candidates description: Get Candidates information - name: Voters description: Get Voter information - name: Transaction description: Get transactions of candidate and voter - name: Signer description: Get a list of signers schemes: - https - http host: www.vicmaster.xyz consumes: - application/json produces: - application/json paths: /api/config: get: tags: - Config summary: Get VicMaster Application Configuration responses: '200': description: OK schema: $ref: '#/definitions/config' '400': description: Bad Request '401': description: Unauthorized '406': description: Not Acceptable '500': description: Server Internal Error /api/candidates: parameters: - name: limit in: query description: Number of record in a query type: number - name: page in: query description: Page number type: number get: tags: - Candidates summary: Get candidates information responses: '200': description: OK schema: $ref: '#/definitions/candidate' '406': description: Not Acceptable /api/candidates/masternodes: parameters: - name: limit in: query description: Number of record in a query type: number - name: page in: query description: Page number type: number get: tags: - Candidates summary: Get masternodes(exclude Proposed candidates) information responses: '200': description: OK schema: $ref: '#/definitions/masternode' '406': description: Not Acceptable /api/candidates/slashedMNs: parameters: - name: limit in: query description: Number of record in a query type: number - name: page in: query description: Page number type: number get: tags: - Candidates summary: Get slashed Masternodes responses: '200': description: OK schema: $ref: '#/definitions/slashedMN' '406': description: Not Acceptable /api/candidates/proposedMNs: parameters: - name: limit in: query description: Number of record in a query type: number - name: page in: query description: Page number type: number get: tags: - Candidates summary: Get proposed Masternodes responses: '200': description: OK schema: $ref: '#/definitions/proposedMN' '406': description: Not Acceptable /api/candidates/resignedMNs: parameters: - name: limit in: query description: Number of record in a query type: number - name: page in: query description: Page number type: number get: tags: - Candidates summary: Get resigned Masternodes responses: '200': description: OK schema: $ref: '#/definitions/resignedMN' '406': description: Not Acceptable '/api/candidates/{candidate}': parameters: - name: candidate in: path type: string description: candidate's address required: true get: tags: - Candidates summary: Get candidate's information responses: '200': description: OK schema: $ref: '#/definitions/candidateDetail' '406': description: Not Acceptable '/api/candidates/{candidate}/voters': parameters: - name: candidate in: path type: string description: candidate's address required: true - name: limit in: query description: Number of record in a query type: number - name: page in: query description: Page number type: number get: tags: - Candidates summary: Get voters who voted for the candidate responses: '200': description: OK schema: $ref: '#/definitions/candidateVoter' '406': description: Not Acceptable '/api/candidates/{candidate}/isMasternode': parameters: - name: candidate in: path type: string description: candidate's address required: true get: tags: - Candidates summary: Masternode checking responses: '200': description: OK schema: $ref: '#/definitions/isMasternode' '406': description: Not Acceptable '/api/candidates/{candidate}/isCandidate': parameters: - name: candidate in: path type: string description: candidate's address required: true get: tags: - Candidates summary: Candidate checking responses: '200': description: OK schema: $ref: '#/definitions/isCandidate' '406': description: Not Acceptable '/api/candidates/{candidate}/{owner}/isOwner': parameters: - name: candidate in: path type: string description: candidate's address required: true - name: owner in: path type: string description: owner's address required: true get: tags: - Candidates summary: Owner checking responses: '200': description: OK schema: $ref: '#/definitions/isOwner' '406': description: Not Acceptable '/api/candidates/{candidate}/{owner}/getRewards': parameters: - name: candidate in: path type: string description: candidate's address required: true - name: owner in: path type: string description: owner's address required: true - name: limit in: query type: number description: number of records required: false - name: page in: query type: number description: page number required: false get: tags: - Candidates summary: Get reward of candidate responses: '200': description: OK schema: $ref: '#/definitions/candidateRewards' '406': description: Not Acceptable '/api/candidates/slashed/{epoch}': parameters: - name: epoch in: path type: string description: epoch number required: true get: tags: - Candidates summary: Get list of slashed masternodes responses: '200': description: OK schema: $ref: '#/definitions/slashedMasternodes' '406': description: Not Acceptable '/api/voters/{voter}/candidates': parameters: - name: voter in: path type: string description: voter's address required: true - name: limit in: query description: Number of record in a query type: number required: false - name: page in: query description: Page number type: number required: false get: tags: - Voters summary: Get voted candidates responses: '200': description: OK schema: $ref: '#/definitions/voterCandidates' '406': description: Not Acceptable '/api/voters/{voter}/rewards': parameters: - name: voter in: path type: string description: voter's address required: true - name: limit in: query type: number description: number of records required: false - name: page in: query type: number description: page number required: false get: tags: - Voters summary: Get reward of voter responses: '200': description: OK schema: $ref: '#/definitions/voterRewards' '406': description: Not Acceptable /api/voters/annualReward: parameters: - name: candidate in: query type: string description: candidate's address required: true get: tags: - Voters summary: Get ROI of masternode and voter responses: '200': description: OK schema: $ref: '#/definitions/annualReward' '406': description: Not Acceptable '/api/transactions/candidate/{candidate}': parameters: - name: candidate in: path type: string description: candidate's address required: true - name: limit in: query type: number description: number of records - name: page in: query type: number description: page number get: tags: - Transaction summary: Get transactions of a candidate responses: '200': description: OK schema: $ref: '#/definitions/txCandidate' '/api/transactions/voter/{voter}': parameters: - name: voter in: path type: string description: voter's address required: true - name: limit in: query type: number description: number of records - name: page in: query type: number description: page number get: tags: - Transaction summary: Get transactions of a voter responses: '200': description: OK schema: $ref: '#/definitions/txVoter' '/api/transactions/{tx}': parameters: - name: tx in: path type: string description: Transaction required: true get: tags: - Transaction summary: Get a transaction's detail responses: '200': description: OK schema: $ref: '#/definitions/transaction' /api/signers/get/latest: get: tags: - Signer summary: Get a list of latest signers responses: '200': description: OK schema: $ref: '#/definitions/signers' definitions: config: properties: blockchain: type: object description: Tomochain's configurations properties: rpc: type: string description: rpc ws: type: string description: websocket epoch: type: number description: Number of blocks for 1 epoch default: 900 blockTime: type: number description: Block time explorerUrl: type: string description: Tomoscan's API GA: type: string description: Google Analytic code candidate: properties: items: type: array description: Candidate's data items: type: object description: candidate's information example: _id: '123' candidate: '0x11621900588eca4410c00097a9f59237f34064cd' smartContractAddress: '0x0000000000000000000000000000000000000088' __v: 0 capacity: '91540333800000001000000' createdAt: '2018-10-31T03:42:39.375Z' owner: '0x11621900588eca4410c00097a9f59237f34064cd' status: RESIGNED updatedAt: '2019-01-11T09:21:55.028Z' latestSignedBlock: 2917487 capacityNumber: 91540.33380000001 isMasternode: false isPenalty: false total: type: number description: Total number of candidate example: 100 activeCandidates: type: number description: Number of active candidate example: 10 candidateDetail: properties: _id: type: string description: id example: '123' candidate: type: string description: candidate's address example: '0x11621900588eca4410c00097a9f59237f34064cd' smartContractAddress: type: string description: smart contract's address example: '0x0000000000000000000000000000000000000088' __v: type: number description: __v example: 0 capacity: type: string description: capacity in wei example: '91540333800000001000000' createdAt: type: string description: creation date of candidate example: '2018-10-31T03:42:39.375Z' owner: type: string description: owner's address example: '0x11621900588eca4410c00097a9f59237f34064cd' status: type: string description: candidate's status example: RESIGNED updatedAt: type: string description: update time example: '2019-01-11T09:17:59.535Z' latestSignedBlock: type: string description: latest signed block example: '2917487' capacityNumber: type: number description: capacity number example: 91540.33380000001 isMasternode: type: boolean description: is masternode example: false isPenalty: type: boolean description: is penalty example: false candidateRewards: properties: items: type: array description: Candidate's data items: type: object description: candidate's information example: _id: 5c19847f0e77307940be9216 epoch: 3193 startBlock: 2872801 endBlock: 2873700 address: '0x11621900588eca4410c00097a9f59237f34064cd' validator: '0x11621900588eca4410c00097a9f59237f34064cd' reason: Voter lockBalance: '1000' reward: '8.03540381764608993247' rewardTime: '2018-12-18T23:36:18.000Z' signNumber: 843 __v: 0 createdAt: '2018-12-18T23:36:31.435Z' updatedAt: '2018-12-18T23:36:31.435Z' total: type: number description: Number of candidate example: 100 candidateVoter: properties: items: type: array description: Candidate's data items: type: object description: candidate's information example: _id: 5bd924a9aa41b819395d9207 candidate: '0x11621900588eca4410c00097a9f59237f34064cd' smartContractAddress: '0x0000000000000000000000000000000000000088' voter: '0xf2cce442c7ab5baf194838081b5f9396330ecfb8' __v: 0 capacity: '105000000000000000000' createdAt: '2018-10-31T03:42:33.922Z' updatedAt: '2019-01-05T02:11:31.489Z' capacityNumber: 105 total: type: number description: Total number of voters example: 100 voterCandidates: properties: items: type: array description: Candidate's data items: type: object description: candidate's information example: candidate: '0xfc5571921c6d3672e13b58ea23dea534f2b35fa0' capacity: '10000000000000000000' capacityNumber: 10 candidateName: Earth total: type: number description: Total number of rewards example: 100 voterRewards: properties: items: type: array description: Voter's reward array items: type: object description: voter's reward example: _id: 5c19847f0e77307940be922a epoch: 3193 startBlock: 2872801 endBlock: 2873700 address: '0x11621900588eca4410c00097a9f59237f34064cd' validator: '0x11621900588eca4410c00097a9f59237f34064cd' reason: MasterNode lockBalance: '1000' reward: '25.97042513863216266174' rewardTime: '2018-12-18T23:36:18.000Z' signNumber: 843 __v: 0 createdAt: '2018-12-18T23:36:31.580Z' updatedAt: '2018-12-18T23:36:31.580Z' candidateName: '0x11621900588eca4410c00097a9f59237f34064cd' total: type: number description: Number of candidate example: 100 isMasternode: type: number enum: - '1' - '0' isCandidate: type: number enum: - '1' - '0' txCandidate: properties: items: type: array description: Candidate's transactions array items: type: object description: Candidate's transactions example: _id: 5c247c545e769d2f2c10ab38 smartContractAddress: '0x0000000000000000000000000000000000000088' tx: '0x0f96e419c89dcf1397a6206959334a4485c5a158a0320cb8a8e98db3b7888141' event: Vote voter: '0xe91dc9746eed1b5971aabd6e1681da1a4d06be8d' owner: '' candidate: '0x11621900588eca4410c00097a9f59237f34064cd' capacity: '11000000000000000000' blockNumber: 2897395 createdAt: '2018-12-27T07:16:36.000Z' __v: 0 total: type: number description: Number of candidate example: 100 txVoter: properties: items: type: array description: Candidate's transactions array items: type: object description: Candidate's transactions example: _id: 5c24a189ff305840a2498bf0 smartContractAddress: '0x0000000000000000000000000000000000000088' tx: '0xf8f2d402c6b1cb5f891b687d69ddcd920e58d9e9fe002857cac0e7ce47998884' event: Unvote voter: '0x487d62d33467c4842c5e54eb370837e4e88bba0f' owner: '' candidate: '0xfc5571921c6d3672e13b58ea23dea534f2b35fa0' capacity: '10000999000000000000000' blockNumber: 763397 createdAt: '2018-12-27T09:55:21.000Z' __v: 0 total: type: number description: Number of candidate example: 100 slashedMN: properties: items: type: array description: Candidate's data items: type: object description: candidate's information example: _id: 5c4006b47ff073e7961fabd5 candidate: '0x1c5a1cb41c920c2532cbb77be5845b258eca32f3' smartContractAddress: '0x0000000000000000000000000000000000000088' __v: 0 capacity: '114213709385390179602070' capacityNumber: 114213.70938539018 createdAt: '2019-01-17T04:38:12.051Z' nodeId: 1c5a1cb41c920c2532cbb77be5845b258eca32f3 owner: '0xe60f54049759a11d764756ece4d27815e990d92f' status: SLASHED updatedAt: '2019-01-29T10:38:18.268Z' latestSignedBlock: 1220265 total: type: number description: Total number of candidate example: 1 proposedMN: properties: items: type: array description: Candidate's data items: type: object description: candidate's information example: _id: 5c4006b47ff073e7961fabd5 candidate: '0x1c5a1cb41c920c2532cbb77be5845b258eca32f3' smartContractAddress: '0x0000000000000000000000000000000000000088' __v: 0 capacity: '114213709385390179602070' capacityNumber: 114213.70938539018 createdAt: '2019-01-17T04:38:12.051Z' nodeId: 1c5a1cb41c920c2532cbb77be5845b258eca32f3 owner: '0xe60f54049759a11d764756ece4d27815e990d92f' status: PROPOSED updatedAt: '2019-01-29T10:38:18.268Z' latestSignedBlock: 1220265 total: type: number description: Total number of candidate example: 1 resignedMN: properties: items: type: array description: Candidate's data items: type: object description: candidate's information example: _id: 5c4006b37ff073e7961fab14 candidate: '0x7a3b86261cd2042a3190c81dd37d0a12e0397daf' smartContractAddress: '0x0000000000000000000000000000000000000088' __v: 0 capacity: '40508760000000000000000' capacityNumber: 40508.76 createdAt: '2019-01-17T04:38:11.949Z' nodeId: 7a3b86261cd2042a3190c81dd37d0a12e0397daf owner: '0xbff690303287ce327c319f575c7671c3ad626de4' status: RESIGNED updatedAt: '2019-01-29T10:11:19.464Z' latestSignedBlock: 957442 total: type: number description: Total number of candidate example: 1 isOwner: type: number enum: - 'true' - 'false' transaction: properties: _id: type: string description: id example: 5c52a4465f0abf3496da0e91 tx: type: string description: transaction hash example: '0xdd03614f86982663b4c17eaaf9051b3df7a88fefc445df41921fa223c6178bf7' smartContractAddress: type: string description: smart contract's address example: '0x0000000000000000000000000000000000000088' __v: type: number description: __v example: 0 capacity: type: string description: capacity in wei example: '1715000000000000000000' createdAt: type: string description: creation date of candidate example: '2018-10-31T03:42:39.375Z' owner: type: string description: owner's address example: '0x7e0d154cba89190ce1801031cba9d46ad21eb317' blockNumber: type: number description: blockNumber example: 1310702 updatedAt: type: string description: update time example: '2019-01-11T09:17:59.535Z' voter: type: string description: voter address example: '0x7e0d154cba89190ce1801031cba9d46ad21eb317' candidate: type: string description: candidate address example: '' event: type: string description: event example: Withdraw enum: - Vote - Unvote - Withdraw - Propose - Resign signers: properties: _id: type: string description: id example: 5c52a4465f0abf3496da0e91 signers: type: array description: List of latest signers items: type: string description: signer address example: '0x98ffa09ae64a3ad63289ee0def385e6455b777e5' example: - '0x98ffa09ae64a3ad63289ee0def385e6455b777e5' - '0x6670fe10f076539459753b7aabc53fc218644042' - '0x71ab3b4352084f13bedb15693cd6bb923a1b80a1' __v: type: number description: __v example: 0 networkId: type: string description: capacity in wei example: '1715000000000000000000' createdAt: type: string description: creation date of candidate example: '2018-10-31T03:42:39.375Z' blockNumber: type: number description: blockNumber example: 1310702 updatedAt: type: string description: update time example: '2019-01-11T09:17:59.535Z' masternode: properties: items: type: array description: Masternode's data items: type: object description: masternode's information example: _id: 5c52a0df5f0abf3496d9a38f candidate: '0x1d50df657b6dce50bac634bf18e2d986d807e940' smartContractAddress: '0x0000000000000000000000000000000000000088' __v: 0 capacity: '574962709628904011242293' capacityNumber: 574962.709628904 createdAt: '2019-01-31T07:16:47.833Z' nodeId: 1d50df657b6dce50bac634bf18e2d986d807e940 owner: '0x300d18c65563d0c9021d7722dd1aab74b9cc447f' status: MASTERNODE updatedAt: '2019-04-11T02:56:39.928Z' latestSignedBlock: 3899535 name: GNBA.GE rank: 1 activeCandidates: type: number description: Total number of active masternode(status = 'MASTERNODE') example: 150 totalSlashed: type: number description: Number of slashed masternode example: 1 totalResigned: type: number description: Number of resigned masternode example: 53 totalProposed: type: number description: Number of proposed masternode example: 10 slashedMasternodes: properties: items: type: object description: Masternode's data items: type: object description: slashed masternodelist example: penalties: - '0x8597e3920d5bb0e159a2a2d730f21977d89c2270' _id: 5caeadc6f6aacdcc4d19d30f epoch: 4334 __v: 0 blockNumber: 3899700 createdAt: '2019-04-11T03:00:22.636Z' networkId: 88 updatedAt: '2019-04-11T03:22:16.136Z' blockNumber: type: number description: Blocknumber slashed example: 3899700 epoch: type: number description: epoch slashed example: 4334 networkId: type: number description: Network id example: 88 annualReward: properties: epochDuration: type: number description: Epoch duration in minutes example: 30 lastEpoch: type: number description: Last epoch example: 6945 numberOfMN: type: number description: Masternode numbers example: 150 capacity: type: string description: Masternode capacity example: 200000 voterROI: type: number description: Voter ROI example: 6 mnROI: type: number description: Masternode ROI example: 29