From 03dcf5db7352aa6fc64e25ed568d9038f4844f10 Mon Sep 17 00:00:00 2001 From: 1000101 Date: Sun, 21 Jan 2024 00:40:47 +0100 Subject: [PATCH] feat(governance): add new endpoints --- openapi.json | 592 ++++++++++++++++++ openapi.yaml | 425 +++++++++++++ src/definitions.yaml | 22 +- src/generated-types.ts | 311 +++++++++ src/paths/api/governance/dreps/index.yaml | 12 +- .../dreps/{drep_id}/delegators.yaml | 14 +- .../api/governance/dreps/{drep_id}/index.yaml | 14 +- .../governance/dreps/{drep_id}/metadata.yaml | 14 +- .../governance/dreps/{drep_id}/updates.yaml | 14 +- .../api/governance/dreps/{drep_id}/votes.yaml | 58 ++ src/paths/api/governance/proposals/index.yaml | 44 +- .../api/governance/proposals/voting.yaml | 22 - .../proposals/{tx_hash}/{tx_index}/index.yaml | 37 ++ .../{tx_hash}/{tx_index}/parameters.yaml | 37 ++ .../proposals/{tx_hash}/{tx_index}/votes.yaml | 65 ++ .../governance/{voting.yaml => votes.yaml} | 0 src/paths/api/pools/{pool_id}/votes.yaml | 60 ++ src/schemas/governance/committee_content.yaml | 18 + src/schemas/governance/drep_content.yaml | 8 +- src/schemas/governance/drep_updates.yaml | 1 - src/schemas/governance/drep_votes.yaml | 39 ++ src/schemas/governance/proposal_content.yaml | 27 + .../governance/proposal_details_content.yaml | 73 +++ .../proposal_details_parameters.yaml | 275 ++++++++ .../governance/proposal_details_votes.yaml | 36 ++ src/schemas/pools/pool_votes.yaml | 36 ++ 26 files changed, 2175 insertions(+), 79 deletions(-) create mode 100644 src/paths/api/governance/dreps/{drep_id}/votes.yaml delete mode 100644 src/paths/api/governance/proposals/voting.yaml create mode 100644 src/paths/api/governance/proposals/{tx_hash}/{tx_index}/index.yaml create mode 100644 src/paths/api/governance/proposals/{tx_hash}/{tx_index}/parameters.yaml create mode 100644 src/paths/api/governance/proposals/{tx_hash}/{tx_index}/votes.yaml rename src/paths/api/governance/{voting.yaml => votes.yaml} (100%) create mode 100644 src/paths/api/pools/{pool_id}/votes.yaml create mode 100644 src/schemas/governance/committee_content.yaml create mode 100644 src/schemas/governance/drep_votes.yaml create mode 100644 src/schemas/governance/proposal_content.yaml create mode 100644 src/schemas/governance/proposal_details_content.yaml create mode 100644 src/schemas/governance/proposal_details_parameters.yaml create mode 100644 src/schemas/governance/proposal_details_votes.yaml create mode 100644 src/schemas/pools/pool_votes.yaml diff --git a/openapi.json b/openapi.json index c774fdc6..09351fc8 100644 --- a/openapi.json +++ b/openapi.json @@ -1227,6 +1227,351 @@ } } }, + "/governance/dreps/{drep_id}/votes": { + "get": { + "tags": [ + "Cardano » Governance" + ], + "summary": "DRep votes", + "description": "History of Drep votes.", + "parameters": [ + { + "in": "path", + "name": "drep_id", + "required": true, + "schema": { + "type": "string" + }, + "description": "Bech32 or hexadecimal drep ID.", + "example": "drep1mvdu8slennngja7w4un6knwezufra70887zuxpprd64jxfveahn" + }, + { + "in": "query", + "name": "count", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "default": 100 + }, + "description": "The number of results displayed on one page." + }, + { + "in": "query", + "name": "page", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 21474836, + "default": 1 + }, + "description": "The page number for listing the results." + }, + { + "in": "query", + "name": "order", + "required": false, + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "asc" + }, + "description": "The ordering of items from the point of view of the blockchain,\nnot the page listing itself. By default, we return oldest first, newest last.\n" + } + ], + "responses": { + "200": { + "description": "Return the DRep votes", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/drep_votes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "418": { + "$ref": "#/components/responses/418" + }, + "429": { + "$ref": "#/components/responses/429" + }, + "500": { + "$ref": "#/components/responses/500" + } + } + } + }, + "/governance/proposals": { + "get": { + "tags": [ + "Cardano » Governance" + ], + "summary": "Proposals", + "description": "Return the information about Proposals", + "parameters": [ + { + "in": "query", + "name": "count", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "default": 100 + }, + "description": "The number of results displayed on one page." + }, + { + "in": "query", + "name": "page", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 21474836, + "default": 1 + }, + "description": "The page number for listing the results." + }, + { + "in": "query", + "name": "order", + "required": false, + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "asc" + }, + "description": "The ordering of items from the point of view of the blockchain,\nnot the page listing itself. By default, we return oldest first, newest last.\nOrdering in this case is based on the time of the first mint transaction.\n" + } + ], + "responses": { + "200": { + "description": "Paginated array with the proposal data", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/proposal_content" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "418": { + "$ref": "#/components/responses/418" + }, + "429": { + "$ref": "#/components/responses/429" + }, + "500": { + "$ref": "#/components/responses/500" + } + } + } + }, + "/governance/proposals/{tx_hash}/{tx_index}": { + "get": { + "tags": [ + "Cardano » Governance" + ], + "summary": "Specific proposal", + "description": "Proposal information.", + "parameters": [ + { + "in": "path", + "name": "tx_hash", + "required": true, + "schema": { + "type": "string" + }, + "description": "Transaction hash.", + "example": "drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc" + }, + { + "in": "path", + "name": "tx_index", + "required": true, + "schema": { + "type": "integer" + }, + "description": "Transaction index.", + "example": 1 + } + ], + "responses": { + "200": { + "description": "Return the proposal information content", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/proposal_details_content" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "418": { + "$ref": "#/components/responses/418" + }, + "429": { + "$ref": "#/components/responses/429" + }, + "500": { + "$ref": "#/components/responses/500" + } + } + } + }, + "/governance/proposals/{tx_hash}/{tx_index}/votes": { + "get": { + "tags": [ + "Cardano » Governance" + ], + "summary": "Proposal votes", + "description": "History of Proposal votes.", + "parameters": [ + { + "in": "path", + "name": "tx_hash", + "required": true, + "schema": { + "type": "string" + }, + "description": "Transaction hash.", + "example": "drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc" + }, + { + "in": "path", + "name": "tx_index", + "required": true, + "schema": { + "type": "integer" + }, + "description": "Transaction index.", + "example": 1 + }, + { + "in": "query", + "name": "count", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "default": 100 + }, + "description": "The number of results displayed on one page." + }, + { + "in": "query", + "name": "page", + "required": false, + "schema": { + "type": "integer", + "minimum": 1, + "maximum": 21474836, + "default": 1 + }, + "description": "The page number for listing the results." + }, + { + "in": "query", + "name": "order", + "required": false, + "schema": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "default": "asc" + }, + "description": "The ordering of items from the point of view of the blockchain,\nnot the page listing itself. By default, we return oldest first, newest last.\n" + } + ], + "responses": { + "200": { + "description": "Return the Proposal votes", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/proposal_details_votes" + } + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "418": { + "$ref": "#/components/responses/418" + }, + "429": { + "$ref": "#/components/responses/429" + }, + "500": { + "$ref": "#/components/responses/500" + } + } + } + }, + "/governance/votes": { + "get": { + "tags": [ + "Cardano » Governance" + ], + "summary": "xxx", + "description": "xxx", + "responses": { + "200": { + "description": "Return the voting parameters." + }, + "400": { + "$ref": "#/components/responses/400" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "418": { + "$ref": "#/components/responses/418" + }, + "429": { + "$ref": "#/components/responses/429" + }, + "500": { + "$ref": "#/components/responses/500" + } + } + } + }, "/epochs/latest": { "get": { "tags": [ @@ -8022,6 +8367,253 @@ } ] }, + "drep_votes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "tx_hash": { + "type": "string", + "description": "Hash of the transaction." + }, + "tx_index": { + "type": "integer", + "description": "Transaction index within the block." + }, + "voter_role": { + "type": "string", + "enum": [ + "constitutional_committee", + "drep", + "spo" + ], + "description": "The role of the voter. Can be one of ConstitutionalCommittee, DRep, SPO." + }, + "committee_voter_hash": { + "type": "string", + "nullable": true + }, + "vote": { + "type": "string", + "enum": [ + "yes", + "no", + "abstain" + ], + "description": "The Vote. Can be one of yes, no, abstain." + } + }, + "required": [ + "tx_hash", + "tx_index", + "voter_role", + "committee_voter_hash", + "vote" + ] + }, + "example": [ + { + "tx_hash": "b302de601defdf11a5261ed31a263804dac4a582a888c998ce24dec5", + "tx_index": 2, + "voter_role": "spo", + "committee_voter_hash": null, + "vote": "yes" + }, + { + "tx_hash": "b302de601defdf11a5261ed31a263804dac4a582a888c998ce24dec5", + "tx_index": 3, + "voter_role": "constitutional_committee", + "committee_voter_hash": "53a42debdc7ffd90085ab7fd9800b63e6d1c9ac481ba6eb7b6a844e4", + "vote": "abstain" + } + ] + }, + "proposal_content": { + "type": "array", + "items": { + "type": "object", + "properties": { + "tx_hash": { + "type": "string", + "description": "Hash of the transaction." + }, + "tx_index": { + "type": "integer", + "description": "Transaction index within the block." + }, + "governance_type": { + "type": "string", + "description": "Type of proposal." + } + }, + "required": [ + "tx_hash", + "tx_index", + "governance_type" + ] + }, + "example": [ + { + "tx_hash": "2dd15e0ef6e6a17841cb9541c27724072ce4d4b79b91e58432fbaa32d9572531", + "tx_index": 1, + "governance_type": "TreasuryWithdrawals" + }, + { + "tx_hash": "71317e951b20aa46e9fbf45a46a6e950d5723a481225519655bf6c60", + "tx_index": 4, + "governance_type": "NoConfidence" + } + ] + }, + "proposal_details_content": { + "type": "object", + "properties": { + "tx_hash": { + "type": "string", + "description": "Hash of the transaction." + }, + "tx_index": { + "type": "integer", + "description": "Transaction index within the block." + }, + "governance_type": { + "type": "string", + "description": "Type of proposal." + }, + "governance_description": { + "type": "string", + "description": "A Text describing the content of this GovActionProposal in a readable way." + }, + "deposit": { + "type": "string", + "description": "The deposit amount paid for this proposal." + }, + "return_address": { + "type": "string", + "description": "Bech32 stake address of the reward address to receive the deposit when it is repaid." + }, + "ratified_epoch": { + "type": "integer", + "nullable": true + }, + "enacted_epoch": { + "type": "integer", + "nullable": true + }, + "dropped_epoch": { + "type": "integer", + "nullable": true + }, + "expired_epoch": { + "type": "integer", + "nullable": true + }, + "expiration": { + "type": "integer", + "description": "Shows the epoch at which this governance action will expire." + }, + "anchor_url": { + "type": "string", + "nullable": true, + "description": "The URL of the offchain anchor data." + }, + "anchor_hash": { + "type": "string", + "nullable": true, + "description": "The hash of the offchain anchor data." + } + }, + "required": [ + "tx_hash", + "tx_index", + "governance_type", + "deposit", + "return_address", + "description", + "ratified_epoch", + "enacted_epoch", + "dropped_epoch", + "expired_epoch", + "expiration", + "anchor_url", + "anchor_hash" + ], + "example": [ + { + "tx_hash": "2dd15e0ef6e6a17841cb9541c27724072ce4d4b79b91e58432fbaa32d9572531", + "tx_index": 1, + "governance_type": "TreasuryWithdrawals", + "deposit": 12000, + "return_address": "stake_test1urd3hs7rlxwwdzthe6hj026dmyt3y0heuulctscyydh2kgck6nkmz", + "description": "TreasuryWithdrawals (fromList [(RewardAcnt {getRwdNetwork = Testnet, getRwdCred = KeyHashObj (KeyHash \"71317e951b20aa46e9fbf45a46a6e950d5723a481225519655bf6c60\")},Coin 20000000)])", + "ratified_epoch": null, + "enacted_epoch": 123, + "dropped_epoch": null, + "expired_epoch": null, + "expiration": 120, + "anchor_url": "https://gist.github.com/123", + "anchor_hash": "50b340624d49823720505e3f0095be0d6cd8f26501e094a6ab9068dd" + } + ] + }, + "proposal_details_votes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "tx_hash": { + "type": "string", + "description": "Hash of the transaction." + }, + "tx_index": { + "type": "integer", + "description": "Transaction index within the block." + }, + "voter_role": { + "type": "string", + "enum": [ + "constitutional_committee", + "drep", + "spo" + ], + "description": "The role of the voter. Can be one of ConstitutionalCommittee, DRep, SPO." + }, + "committee_voter_hash": { + "type": "string", + "nullable": true + }, + "vote": { + "type": "string", + "enum": [ + "yes", + "no", + "abstain" + ], + "description": "The Vote. Can be one of yes, no, abstain." + } + }, + "required": [ + "drep_id", + "hex" + ] + }, + "example": [ + { + "tx_hash": "b302de601defdf11a5261ed31a263804dac4a582a888c998ce24dec5", + "tx_index": 2, + "voter_role": "spo", + "committee_voter_hash": null, + "vote": "yes" + }, + { + "tx_hash": "b302de601defdf11a5261ed31a263804dac4a582a888c998ce24dec5", + "tx_index": 3, + "voter_role": "constitutional_committee", + "committee_voter_hash": "53a42debdc7ffd90085ab7fd9800b63e6d1c9ac481ba6eb7b6a844e4", + "vote": "abstain" + } + ] + }, "epoch_content": { "type": "object", "properties": { diff --git a/openapi.yaml b/openapi.yaml index c58ea8b5..798fb303 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -1052,6 +1052,247 @@ paths: $ref: '#/components/responses/429' '500': $ref: '#/components/responses/500' + /governance/dreps/{drep_id}/votes: + get: + tags: + - Cardano » Governance + summary: DRep votes + description: History of Drep votes. + parameters: + - in: path + name: drep_id + required: true + schema: + type: string + description: Bech32 or hexadecimal drep ID. + example: drep1mvdu8slennngja7w4un6knwezufra70887zuxpprd64jxfveahn + - in: query + name: count + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + default: 100 + description: The number of results displayed on one page. + - in: query + name: page + required: false + schema: + type: integer + minimum: 1 + maximum: 21474836 + default: 1 + description: The page number for listing the results. + - in: query + name: order + required: false + schema: + type: string + enum: + - asc + - desc + default: asc + description: | + The ordering of items from the point of view of the blockchain, + not the page listing itself. By default, we return oldest first, newest last. + responses: + '200': + description: Return the DRep votes + content: + application/json: + schema: + $ref: '#/components/schemas/drep_votes' + '400': + $ref: '#/components/responses/400' + '403': + $ref: '#/components/responses/403' + '418': + $ref: '#/components/responses/418' + '429': + $ref: '#/components/responses/429' + '500': + $ref: '#/components/responses/500' + /governance/proposals: + get: + tags: + - Cardano » Governance + summary: Proposals + description: Return the information about Proposals + parameters: + - in: query + name: count + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + default: 100 + description: The number of results displayed on one page. + - in: query + name: page + required: false + schema: + type: integer + minimum: 1 + maximum: 21474836 + default: 1 + description: The page number for listing the results. + - in: query + name: order + required: false + schema: + type: string + enum: + - asc + - desc + default: asc + description: | + The ordering of items from the point of view of the blockchain, + not the page listing itself. By default, we return oldest first, newest last. + Ordering in this case is based on the time of the first mint transaction. + responses: + '200': + description: Paginated array with the proposal data + content: + application/json: + schema: + $ref: '#/components/schemas/proposal_content' + '400': + $ref: '#/components/responses/400' + '403': + $ref: '#/components/responses/403' + '418': + $ref: '#/components/responses/418' + '429': + $ref: '#/components/responses/429' + '500': + $ref: '#/components/responses/500' + /governance/proposals/{tx_hash}/{tx_index}: + get: + tags: + - Cardano » Governance + summary: Specific proposal + description: Proposal information. + parameters: + - in: path + name: tx_hash + required: true + schema: + type: string + description: Transaction hash. + example: drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc + - in: path + name: tx_index + required: true + schema: + type: integer + description: Transaction index. + example: 1 + responses: + '200': + description: Return the proposal information content + content: + application/json: + schema: + $ref: '#/components/schemas/proposal_details_content' + '400': + $ref: '#/components/responses/400' + '403': + $ref: '#/components/responses/403' + '418': + $ref: '#/components/responses/418' + '429': + $ref: '#/components/responses/429' + '500': + $ref: '#/components/responses/500' + /governance/proposals/{tx_hash}/{tx_index}/votes: + get: + tags: + - Cardano » Governance + summary: Proposal votes + description: History of Proposal votes. + parameters: + - in: path + name: tx_hash + required: true + schema: + type: string + description: Transaction hash. + example: drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc + - in: path + name: tx_index + required: true + schema: + type: integer + description: Transaction index. + example: 1 + - in: query + name: count + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + default: 100 + description: The number of results displayed on one page. + - in: query + name: page + required: false + schema: + type: integer + minimum: 1 + maximum: 21474836 + default: 1 + description: The page number for listing the results. + - in: query + name: order + required: false + schema: + type: string + enum: + - asc + - desc + default: asc + description: | + The ordering of items from the point of view of the blockchain, + not the page listing itself. By default, we return oldest first, newest last. + responses: + '200': + description: Return the Proposal votes + content: + application/json: + schema: + $ref: '#/components/schemas/proposal_details_votes' + '400': + $ref: '#/components/responses/400' + '403': + $ref: '#/components/responses/403' + '418': + $ref: '#/components/responses/418' + '429': + $ref: '#/components/responses/429' + '500': + $ref: '#/components/responses/500' + /governance/votes: + get: + tags: + - Cardano » Governance + summary: xxx + description: xxx + responses: + '200': + description: Return the voting parameters. + '400': + $ref: '#/components/responses/400' + '403': + $ref: '#/components/responses/403' + '418': + $ref: '#/components/responses/418' + '429': + $ref: '#/components/responses/429' + '500': + $ref: '#/components/responses/500' /epochs/latest: get: tags: @@ -5868,6 +6109,190 @@ components: - tx_hash: dd3243af975be4b5bedce4e5f5b483b2386d5ad207d05e0289c1df0eb261447e cert_index: 0 action: deregistered + drep_votes: + type: array + items: + type: object + properties: + tx_hash: + type: string + description: Hash of the transaction. + tx_index: + type: integer + description: Transaction index within the block. + voter_role: + type: string + enum: + - constitutional_committee + - drep + - spo + description: The role of the voter. Can be one of ConstitutionalCommittee, DRep, SPO. + committee_voter_hash: + type: string + nullable: true + vote: + type: string + enum: + - 'yes' + - 'no' + - abstain + description: The Vote. Can be one of yes, no, abstain. + required: + - tx_hash + - tx_index + - voter_role + - committee_voter_hash + - vote + example: + - tx_hash: b302de601defdf11a5261ed31a263804dac4a582a888c998ce24dec5 + tx_index: 2 + voter_role: spo + committee_voter_hash: null + vote: 'yes' + - tx_hash: b302de601defdf11a5261ed31a263804dac4a582a888c998ce24dec5 + tx_index: 3 + voter_role: constitutional_committee + committee_voter_hash: 53a42debdc7ffd90085ab7fd9800b63e6d1c9ac481ba6eb7b6a844e4 + vote: abstain + proposal_content: + type: array + items: + type: object + properties: + tx_hash: + type: string + description: Hash of the transaction. + tx_index: + type: integer + description: Transaction index within the block. + governance_type: + type: string + description: Type of proposal. + required: + - tx_hash + - tx_index + - governance_type + example: + - tx_hash: 2dd15e0ef6e6a17841cb9541c27724072ce4d4b79b91e58432fbaa32d9572531 + tx_index: 1 + governance_type: TreasuryWithdrawals + - tx_hash: 71317e951b20aa46e9fbf45a46a6e950d5723a481225519655bf6c60 + tx_index: 4 + governance_type: NoConfidence + proposal_details_content: + type: object + properties: + tx_hash: + type: string + description: Hash of the transaction. + tx_index: + type: integer + description: Transaction index within the block. + governance_type: + type: string + description: Type of proposal. + governance_description: + type: string + description: A Text describing the content of this GovActionProposal in a readable way. + deposit: + type: string + description: The deposit amount paid for this proposal. + return_address: + type: string + description: Bech32 stake address of the reward address to receive the deposit when it is repaid. + ratified_epoch: + type: integer + nullable: true + enacted_epoch: + type: integer + nullable: true + dropped_epoch: + type: integer + nullable: true + expired_epoch: + type: integer + nullable: true + expiration: + type: integer + description: Shows the epoch at which this governance action will expire. + anchor_url: + type: string + nullable: true + description: The URL of the offchain anchor data. + anchor_hash: + type: string + nullable: true + description: The hash of the offchain anchor data. + required: + - tx_hash + - tx_index + - governance_type + - deposit + - return_address + - description + - ratified_epoch + - enacted_epoch + - dropped_epoch + - expired_epoch + - expiration + - anchor_url + - anchor_hash + example: + - tx_hash: 2dd15e0ef6e6a17841cb9541c27724072ce4d4b79b91e58432fbaa32d9572531 + tx_index: 1 + governance_type: TreasuryWithdrawals + deposit: 12000 + return_address: stake_test1urd3hs7rlxwwdzthe6hj026dmyt3y0heuulctscyydh2kgck6nkmz + description: TreasuryWithdrawals (fromList [(RewardAcnt {getRwdNetwork = Testnet, getRwdCred = KeyHashObj (KeyHash "71317e951b20aa46e9fbf45a46a6e950d5723a481225519655bf6c60")},Coin 20000000)]) + ratified_epoch: null + enacted_epoch: 123 + dropped_epoch: null + expired_epoch: null + expiration: 120 + anchor_url: https://gist.github.com/123 + anchor_hash: 50b340624d49823720505e3f0095be0d6cd8f26501e094a6ab9068dd + proposal_details_votes: + type: array + items: + type: object + properties: + tx_hash: + type: string + description: Hash of the transaction. + tx_index: + type: integer + description: Transaction index within the block. + voter_role: + type: string + enum: + - constitutional_committee + - drep + - spo + description: The role of the voter. Can be one of ConstitutionalCommittee, DRep, SPO. + committee_voter_hash: + type: string + nullable: true + vote: + type: string + enum: + - 'yes' + - 'no' + - abstain + description: The Vote. Can be one of yes, no, abstain. + required: + - drep_id + - hex + example: + - tx_hash: b302de601defdf11a5261ed31a263804dac4a582a888c998ce24dec5 + tx_index: 2 + voter_role: spo + committee_voter_hash: null + vote: 'yes' + - tx_hash: b302de601defdf11a5261ed31a263804dac4a582a888c998ce24dec5 + tx_index: 3 + voter_role: constitutional_committee + committee_voter_hash: 53a42debdc7ffd90085ab7fd9800b63e6d1c9ac481ba6eb7b6a844e4 + vote: abstain epoch_content: type: object properties: diff --git a/src/definitions.yaml b/src/definitions.yaml index bc89b909..482fb5e7 100644 --- a/src/definitions.yaml +++ b/src/definitions.yaml @@ -324,9 +324,6 @@ paths: # governance - # /governance/actions: - # $ref: ./paths/api/governance/actions.yaml - /governance/dreps: $ref: ./paths/api/governance/dreps/index.yaml @@ -342,17 +339,20 @@ paths: /governance/dreps/{drep_id}/updates: $ref: ./paths/api/governance/dreps/{drep_id}/updates.yaml - # /governance/proposals: - # $ref: ./paths/api/governance/proposals/index.yaml + /governance/dreps/{drep_id}/votes: + $ref: ./paths/api/governance/dreps/{drep_id}/votes.yaml + + /governance/proposals: + $ref: ./paths/api/governance/proposals/index.yaml - # /governance/proposals/voting: - # $ref: ./paths/api/governance/proposals/voting.yaml + /governance/proposals/{tx_hash}/{tx_index}: + $ref: ./paths/api/governance/proposals/{tx_hash}/{tx_index}/index.yaml - # /governance/treasury: - # $ref: ./paths/api/governance/treasury.yaml + /governance/proposals/{tx_hash}/{tx_index}/votes: + $ref: ./paths/api/governance/proposals/{tx_hash}/{tx_index}/votes.yaml - # /governance/voting: - # $ref: ./paths/api/governance/voting.yaml + /governance/votes: + $ref: ./paths/api/governance/votes.yaml # epochs diff --git a/src/generated-types.ts b/src/generated-types.ts index 6bdd6e4a..60fd8bec 100644 --- a/src/generated-types.ts +++ b/src/generated-types.ts @@ -597,6 +597,182 @@ export interface paths { }; }; }; + "/governance/dreps/{drep_id}/votes": { + /** + * DRep votes + * @description History of Drep votes. + */ + get: { + parameters: { + query?: { + /** @description The number of results displayed on one page. */ + count?: number; + /** @description The page number for listing the results. */ + page?: number; + /** + * @description The ordering of items from the point of view of the blockchain, + * not the page listing itself. By default, we return oldest first, newest last. + */ + order?: "asc" | "desc"; + }; + path: { + /** + * @description Bech32 or hexadecimal drep ID. + * @example drep1mvdu8slennngja7w4un6knwezufra70887zuxpprd64jxfveahn + */ + drep_id: string; + }; + }; + responses: { + /** @description Return the DRep votes */ + 200: { + content: { + "application/json": components["schemas"]["drep_votes"]; + }; + }; + 400: components["responses"]["400"]; + 403: components["responses"]["403"]; + 418: components["responses"]["418"]; + 429: components["responses"]["429"]; + 500: components["responses"]["500"]; + }; + }; + }; + "/governance/proposals": { + /** + * Proposals + * @description Return the information about Proposals + */ + get: { + parameters: { + query?: { + /** @description The number of results displayed on one page. */ + count?: number; + /** @description The page number for listing the results. */ + page?: number; + /** + * @description The ordering of items from the point of view of the blockchain, + * not the page listing itself. By default, we return oldest first, newest last. + * Ordering in this case is based on the time of the first mint transaction. + */ + order?: "asc" | "desc"; + }; + }; + responses: { + /** @description Paginated array with the proposal data */ + 200: { + content: { + "application/json": components["schemas"]["proposal_content"]; + }; + }; + 400: components["responses"]["400"]; + 403: components["responses"]["403"]; + 418: components["responses"]["418"]; + 429: components["responses"]["429"]; + 500: components["responses"]["500"]; + }; + }; + }; + "/governance/proposals/{tx_hash}/{tx_index}": { + /** + * Specific proposal + * @description Proposal information. + */ + get: { + parameters: { + path: { + /** + * @description Transaction hash. + * @example drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc + */ + tx_hash: string; + /** + * @description Transaction index. + * @example 1 + */ + tx_index: number; + }; + }; + responses: { + /** @description Return the proposal information content */ + 200: { + content: { + "application/json": components["schemas"]["proposal_details_content"]; + }; + }; + 400: components["responses"]["400"]; + 403: components["responses"]["403"]; + 418: components["responses"]["418"]; + 429: components["responses"]["429"]; + 500: components["responses"]["500"]; + }; + }; + }; + "/governance/proposals/{tx_hash}/{tx_index}/votes": { + /** + * Proposal votes + * @description History of Proposal votes. + */ + get: { + parameters: { + query?: { + /** @description The number of results displayed on one page. */ + count?: number; + /** @description The page number for listing the results. */ + page?: number; + /** + * @description The ordering of items from the point of view of the blockchain, + * not the page listing itself. By default, we return oldest first, newest last. + */ + order?: "asc" | "desc"; + }; + path: { + /** + * @description Transaction hash. + * @example drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc + */ + tx_hash: string; + /** + * @description Transaction index. + * @example 1 + */ + tx_index: number; + }; + }; + responses: { + /** @description Return the Proposal votes */ + 200: { + content: { + "application/json": components["schemas"]["proposal_details_votes"]; + }; + }; + 400: components["responses"]["400"]; + 403: components["responses"]["403"]; + 418: components["responses"]["418"]; + 429: components["responses"]["429"]; + 500: components["responses"]["500"]; + }; + }; + }; + "/governance/votes": { + /** + * xxx + * @description xxx + */ + get: { + responses: { + /** @description Return the voting parameters. */ + 200: { + content: never; + }; + 400: components["responses"]["400"]; + 403: components["responses"]["403"]; + 418: components["responses"]["418"]; + 429: components["responses"]["429"]; + 500: components["responses"]["500"]; + }; + }; + }; "/epochs/latest": { /** * Latest epoch @@ -4146,6 +4322,141 @@ export interface components { */ action: "registered" | "deregistered"; })[]; + /** + * @example [ + * { + * "tx_hash": "b302de601defdf11a5261ed31a263804dac4a582a888c998ce24dec5", + * "tx_index": 2, + * "voter_role": "spo", + * "committee_voter_hash": null, + * "vote": "yes" + * }, + * { + * "tx_hash": "b302de601defdf11a5261ed31a263804dac4a582a888c998ce24dec5", + * "tx_index": 3, + * "voter_role": "constitutional_committee", + * "committee_voter_hash": "53a42debdc7ffd90085ab7fd9800b63e6d1c9ac481ba6eb7b6a844e4", + * "vote": "abstain" + * } + * ] + */ + drep_votes: ({ + /** @description Hash of the transaction. */ + tx_hash: string; + /** @description Transaction index within the block. */ + tx_index: number; + /** + * @description The role of the voter. Can be one of ConstitutionalCommittee, DRep, SPO. + * @enum {string} + */ + voter_role: "constitutional_committee" | "drep" | "spo"; + committee_voter_hash: string | null; + /** + * @description The Vote. Can be one of yes, no, abstain. + * @enum {string} + */ + vote: "yes" | "no" | "abstain"; + })[]; + /** + * @example [ + * { + * "tx_hash": "2dd15e0ef6e6a17841cb9541c27724072ce4d4b79b91e58432fbaa32d9572531", + * "tx_index": 1, + * "governance_type": "TreasuryWithdrawals" + * }, + * { + * "tx_hash": "71317e951b20aa46e9fbf45a46a6e950d5723a481225519655bf6c60", + * "tx_index": 4, + * "governance_type": "NoConfidence" + * } + * ] + */ + proposal_content: { + /** @description Hash of the transaction. */ + tx_hash: string; + /** @description Transaction index within the block. */ + tx_index: number; + /** @description Type of proposal. */ + governance_type: string; + }[]; + /** + * @example [ + * { + * "tx_hash": "2dd15e0ef6e6a17841cb9541c27724072ce4d4b79b91e58432fbaa32d9572531", + * "tx_index": 1, + * "governance_type": "TreasuryWithdrawals", + * "deposit": 12000, + * "return_address": "stake_test1urd3hs7rlxwwdzthe6hj026dmyt3y0heuulctscyydh2kgck6nkmz", + * "description": "TreasuryWithdrawals (fromList [(RewardAcnt {getRwdNetwork = Testnet, getRwdCred = KeyHashObj (KeyHash \"71317e951b20aa46e9fbf45a46a6e950d5723a481225519655bf6c60\")},Coin 20000000)])", + * "ratified_epoch": null, + * "enacted_epoch": 123, + * "dropped_epoch": null, + * "expired_epoch": null, + * "expiration": 120, + * "anchor_url": "https://gist.github.com/123", + * "anchor_hash": "50b340624d49823720505e3f0095be0d6cd8f26501e094a6ab9068dd" + * } + * ] + */ + proposal_details_content: { + /** @description Hash of the transaction. */ + tx_hash: string; + /** @description Transaction index within the block. */ + tx_index: number; + /** @description Type of proposal. */ + governance_type: string; + /** @description A Text describing the content of this GovActionProposal in a readable way. */ + governance_description?: string; + /** @description The deposit amount paid for this proposal. */ + deposit: string; + /** @description Bech32 stake address of the reward address to receive the deposit when it is repaid. */ + return_address: string; + ratified_epoch: number | null; + enacted_epoch: number | null; + dropped_epoch: number | null; + expired_epoch: number | null; + /** @description Shows the epoch at which this governance action will expire. */ + expiration: number; + /** @description The URL of the offchain anchor data. */ + anchor_url: string | null; + /** @description The hash of the offchain anchor data. */ + anchor_hash: string | null; + }; + /** + * @example [ + * { + * "tx_hash": "b302de601defdf11a5261ed31a263804dac4a582a888c998ce24dec5", + * "tx_index": 2, + * "voter_role": "spo", + * "committee_voter_hash": null, + * "vote": "yes" + * }, + * { + * "tx_hash": "b302de601defdf11a5261ed31a263804dac4a582a888c998ce24dec5", + * "tx_index": 3, + * "voter_role": "constitutional_committee", + * "committee_voter_hash": "53a42debdc7ffd90085ab7fd9800b63e6d1c9ac481ba6eb7b6a844e4", + * "vote": "abstain" + * } + * ] + */ + proposal_details_votes: ({ + /** @description Hash of the transaction. */ + tx_hash?: string; + /** @description Transaction index within the block. */ + tx_index?: number; + /** + * @description The role of the voter. Can be one of ConstitutionalCommittee, DRep, SPO. + * @enum {string} + */ + voter_role?: "constitutional_committee" | "drep" | "spo"; + committee_voter_hash?: string | null; + /** + * @description The Vote. Can be one of yes, no, abstain. + * @enum {string} + */ + vote?: "yes" | "no" | "abstain"; + })[]; epoch_content: { /** * @description Epoch number diff --git a/src/paths/api/governance/dreps/index.yaml b/src/paths/api/governance/dreps/index.yaml index f82c79cd..d3d62fb9 100644 --- a/src/paths/api/governance/dreps/index.yaml +++ b/src/paths/api/governance/dreps/index.yaml @@ -34,19 +34,19 @@ get: not the page listing itself. By default, we return oldest first, newest last. Ordering in this case is based on the time of the first mint transaction. responses: - '200': + "200": description: Paginated array with the Delegate Representatives (DReps) data content: application/json: schema: $ref: ../../../../schemas/governance/drep_content.yaml - '400': + "400": $ref: ../../../../responses/errors/400.yaml - '403': + "403": $ref: ../../../../responses/errors/403.yaml - '429': + "429": $ref: ../../../../responses/errors/429.yaml - '418': + "418": $ref: ../../../../responses/errors/418.yaml - '500': + "500": $ref: ../../../../responses/errors/500.yaml diff --git a/src/paths/api/governance/dreps/{drep_id}/delegators.yaml b/src/paths/api/governance/dreps/{drep_id}/delegators.yaml index 484a5cd6..c34ccc0b 100644 --- a/src/paths/api/governance/dreps/{drep_id}/delegators.yaml +++ b/src/paths/api/governance/dreps/{drep_id}/delegators.yaml @@ -10,7 +10,7 @@ get: schema: type: string description: Bech32 or hexadecimal drep ID. - example: 'drep1mvdu8slennngja7w4un6knwezufra70887zuxpprd64jxfveahn' + example: "drep1mvdu8slennngja7w4un6knwezufra70887zuxpprd64jxfveahn" - in: query name: count required: false @@ -40,19 +40,19 @@ get: The ordering of items from the point of view of the blockchain, not the page listing itself. By default, we return oldest first, newest last. responses: - '200': + "200": description: Return the DRep delegations content: application/json: schema: $ref: ../../../../../schemas/governance/drep_delegators.yaml - '400': + "400": $ref: ../../../../../responses/errors/400.yaml - '403': + "403": $ref: ../../../../../responses/errors/403.yaml - '429': + "429": $ref: ../../../../../responses/errors/429.yaml - '418': + "418": $ref: ../../../../../responses/errors/418.yaml - '500': + "500": $ref: ../../../../../responses/errors/500.yaml diff --git a/src/paths/api/governance/dreps/{drep_id}/index.yaml b/src/paths/api/governance/dreps/{drep_id}/index.yaml index 2a3d0ad1..f2de4560 100644 --- a/src/paths/api/governance/dreps/{drep_id}/index.yaml +++ b/src/paths/api/governance/dreps/{drep_id}/index.yaml @@ -10,21 +10,21 @@ get: schema: type: string description: Bech32 or hexadecimal DRep ID. - example: 'drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc' + example: "drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc" responses: - '200': + "200": description: Return the DRep information content content: application/json: schema: $ref: ../../../../../schemas/governance/drep_details_content.yaml - '400': + "400": $ref: ../../../../../responses/errors/400.yaml - '403': + "403": $ref: ../../../../../responses/errors/403.yaml - '429': + "429": $ref: ../../../../../responses/errors/429.yaml - '418': + "418": $ref: ../../../../../responses/errors/418.yaml - '500': + "500": $ref: ../../../../../responses/errors/500.yaml diff --git a/src/paths/api/governance/dreps/{drep_id}/metadata.yaml b/src/paths/api/governance/dreps/{drep_id}/metadata.yaml index 195d407b..607cc233 100644 --- a/src/paths/api/governance/dreps/{drep_id}/metadata.yaml +++ b/src/paths/api/governance/dreps/{drep_id}/metadata.yaml @@ -10,21 +10,21 @@ get: schema: type: string description: Bech32 or hexadecimal DRep ID. - example: 'drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc' + example: "drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc" responses: - '200': + "200": description: Return the DRep metadata content. content: application/json: schema: $ref: ../../../../../schemas/governance/drep_metadata.yaml - '400': + "400": $ref: ../../../../../responses/errors/400.yaml - '403': + "403": $ref: ../../../../../responses/errors/403.yaml - '429': + "429": $ref: ../../../../../responses/errors/429.yaml - '418': + "418": $ref: ../../../../../responses/errors/418.yaml - '500': + "500": $ref: ../../../../../responses/errors/500.yaml diff --git a/src/paths/api/governance/dreps/{drep_id}/updates.yaml b/src/paths/api/governance/dreps/{drep_id}/updates.yaml index 33715fa2..d2085e21 100644 --- a/src/paths/api/governance/dreps/{drep_id}/updates.yaml +++ b/src/paths/api/governance/dreps/{drep_id}/updates.yaml @@ -10,7 +10,7 @@ get: schema: type: string description: Bech32 or hexadecimal DRep ID. - example: 'drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc' + example: "drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc" - in: query name: count required: false @@ -40,19 +40,19 @@ get: The ordering of items from the point of view of the blockchain, not the page listing itself. By default, we return oldest first, newest last. responses: - '200': + "200": description: Return the Drep updates history content: application/json: schema: $ref: ../../../../../schemas/governance/drep_updates.yaml - '400': + "400": $ref: ../../../../../responses/errors/400.yaml - '403': + "403": $ref: ../../../../../responses/errors/403.yaml - '429': + "429": $ref: ../../../../../responses/errors/429.yaml - '418': + "418": $ref: ../../../../../responses/errors/418.yaml - '500': + "500": $ref: ../../../../../responses/errors/500.yaml diff --git a/src/paths/api/governance/dreps/{drep_id}/votes.yaml b/src/paths/api/governance/dreps/{drep_id}/votes.yaml new file mode 100644 index 00000000..605578bf --- /dev/null +++ b/src/paths/api/governance/dreps/{drep_id}/votes.yaml @@ -0,0 +1,58 @@ +get: + tags: + - Cardano » Governance + summary: DRep votes + description: History of Drep votes. + parameters: + - in: path + name: drep_id + required: true + schema: + type: string + description: Bech32 or hexadecimal drep ID. + example: "drep1mvdu8slennngja7w4un6knwezufra70887zuxpprd64jxfveahn" + - in: query + name: count + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + default: 100 + description: The number of results displayed on one page. + - in: query + name: page + required: false + schema: + type: integer + minimum: 1 + maximum: 21474836 + default: 1 + description: The page number for listing the results. + - in: query + name: order + required: false + schema: + type: string + enum: [asc, desc] + default: asc + description: | + The ordering of items from the point of view of the blockchain, + not the page listing itself. By default, we return oldest first, newest last. + responses: + "200": + description: Return the DRep votes + content: + application/json: + schema: + $ref: ../../../../../schemas/governance/drep_votes.yaml + "400": + $ref: ../../../../../responses/errors/400.yaml + "403": + $ref: ../../../../../responses/errors/403.yaml + "429": + $ref: ../../../../../responses/errors/429.yaml + "418": + $ref: ../../../../../responses/errors/418.yaml + "500": + $ref: ../../../../../responses/errors/500.yaml diff --git a/src/paths/api/governance/proposals/index.yaml b/src/paths/api/governance/proposals/index.yaml index c8de2208..8216b2a3 100644 --- a/src/paths/api/governance/proposals/index.yaml +++ b/src/paths/api/governance/proposals/index.yaml @@ -1,15 +1,45 @@ get: tags: - Cardano » Governance - summary: xxx - description: xxx + summary: Proposals + description: Return the information about Proposals + parameters: + - in: query + name: count + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + default: 100 + description: The number of results displayed on one page. + - in: query + name: page + required: false + schema: + type: integer + minimum: 1 + maximum: 21474836 + default: 1 + description: The page number for listing the results. + - in: query + name: order + required: false + schema: + type: string + enum: [asc, desc] + default: asc + description: | + The ordering of items from the point of view of the blockchain, + not the page listing itself. By default, we return oldest first, newest last. + Ordering in this case is based on the time of the first mint transaction. responses: "200": - description: Return the proposal parameters. - # content: - # application/json: - # schema: - # $ref: ../../../schemas/xxx + description: Paginated array with the proposal data + content: + application/json: + schema: + $ref: ../../../../schemas/governance/proposal_content.yaml "400": $ref: ../../../../responses/errors/400.yaml "403": diff --git a/src/paths/api/governance/proposals/voting.yaml b/src/paths/api/governance/proposals/voting.yaml deleted file mode 100644 index ca77ac4b..00000000 --- a/src/paths/api/governance/proposals/voting.yaml +++ /dev/null @@ -1,22 +0,0 @@ -get: - tags: - - Cardano » Governance - summary: xxx - description: xxx - responses: - "200": - description: Return the voting parameters. - # content: - # application/json: - # schema: - # $ref: ../../../schemas/xxx - "400": - $ref: ../../../../responses/errors/400.yaml - "403": - $ref: ../../../../responses/errors/403.yaml - "429": - $ref: ../../../../responses/errors/429.yaml - "418": - $ref: ../../../../responses/errors/418.yaml - "500": - $ref: ../../../../responses/errors/500.yaml diff --git a/src/paths/api/governance/proposals/{tx_hash}/{tx_index}/index.yaml b/src/paths/api/governance/proposals/{tx_hash}/{tx_index}/index.yaml new file mode 100644 index 00000000..add29e3e --- /dev/null +++ b/src/paths/api/governance/proposals/{tx_hash}/{tx_index}/index.yaml @@ -0,0 +1,37 @@ +get: + tags: + - Cardano » Governance + summary: Specific proposal + description: Proposal information. + parameters: + - in: path + name: tx_hash + required: true + schema: + type: string + description: Transaction hash. + example: "drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc" + - in: path + name: tx_index + required: true + schema: + type: integer + description: Transaction index. + example: 1 + responses: + "200": + description: Return the proposal information content + content: + application/json: + schema: + $ref: ../../../../../../schemas/governance/proposal_details_content.yaml + "400": + $ref: ../../../../../../responses/errors/400.yaml + "403": + $ref: ../../../../../../responses/errors/403.yaml + "429": + $ref: ../../../../../../responses/errors/429.yaml + "418": + $ref: ../../../../../../responses/errors/418.yaml + "500": + $ref: ../../../../../../responses/errors/500.yaml diff --git a/src/paths/api/governance/proposals/{tx_hash}/{tx_index}/parameters.yaml b/src/paths/api/governance/proposals/{tx_hash}/{tx_index}/parameters.yaml new file mode 100644 index 00000000..f13ebb0b --- /dev/null +++ b/src/paths/api/governance/proposals/{tx_hash}/{tx_index}/parameters.yaml @@ -0,0 +1,37 @@ +get: + tags: + - Cardano » Governance + summary: Specific parameters proposal + description: Parameters proposal details. + parameters: + - in: path + name: tx_hash + required: true + schema: + type: string + description: Transaction hash. + example: "drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc" + - in: path + name: tx_index + required: true + schema: + type: integer + description: Transaction index. + example: 1 + responses: + "200": + description: Return the proposal parameters content + content: + application/json: + schema: + $ref: ../../../../../../schemas/governance/proposal_details_parameters.yaml + "400": + $ref: ../../../../../../responses/errors/400.yaml + "403": + $ref: ../../../../../../responses/errors/403.yaml + "429": + $ref: ../../../../../../responses/errors/429.yaml + "418": + $ref: ../../../../../../responses/errors/418.yaml + "500": + $ref: ../../../../../../responses/errors/500.yaml diff --git a/src/paths/api/governance/proposals/{tx_hash}/{tx_index}/votes.yaml b/src/paths/api/governance/proposals/{tx_hash}/{tx_index}/votes.yaml new file mode 100644 index 00000000..0886339c --- /dev/null +++ b/src/paths/api/governance/proposals/{tx_hash}/{tx_index}/votes.yaml @@ -0,0 +1,65 @@ +get: + tags: + - Cardano » Governance + summary: Proposal votes + description: History of Proposal votes. + parameters: + - in: path + name: tx_hash + required: true + schema: + type: string + description: Transaction hash. + example: "drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc" + - in: path + name: tx_index + required: true + schema: + type: integer + description: Transaction index. + example: 1 + - in: query + name: count + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + default: 100 + description: The number of results displayed on one page. + - in: query + name: page + required: false + schema: + type: integer + minimum: 1 + maximum: 21474836 + default: 1 + description: The page number for listing the results. + - in: query + name: order + required: false + schema: + type: string + enum: [asc, desc] + default: asc + description: | + The ordering of items from the point of view of the blockchain, + not the page listing itself. By default, we return oldest first, newest last. + responses: + "200": + description: Return the Proposal votes + content: + application/json: + schema: + $ref: ../../../../../../schemas/governance/proposal_details_votes.yaml + "400": + $ref: ../../../../../../responses/errors/400.yaml + "403": + $ref: ../../../../../../responses/errors/403.yaml + "429": + $ref: ../../../../../../responses/errors/429.yaml + "418": + $ref: ../../../../../../responses/errors/418.yaml + "500": + $ref: ../../../../../../responses/errors/500.yaml diff --git a/src/paths/api/governance/voting.yaml b/src/paths/api/governance/votes.yaml similarity index 100% rename from src/paths/api/governance/voting.yaml rename to src/paths/api/governance/votes.yaml diff --git a/src/paths/api/pools/{pool_id}/votes.yaml b/src/paths/api/pools/{pool_id}/votes.yaml new file mode 100644 index 00000000..7e123841 --- /dev/null +++ b/src/paths/api/pools/{pool_id}/votes.yaml @@ -0,0 +1,60 @@ +get: + tags: + - Cardano » Pools + summary: Stake pool votes + description: History of stake pools votes. + parameters: + - in: path + name: pool_id + required: true + schema: + type: string + description: Bech32 or hexadecimal pool ID. + example: "pool1pu5jlj4q9w9jlxeu370a3c9myx47md5j5m2str0naunn2q3lkdy" + - in: query + name: count + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + default: 100 + description: The number of results displayed on one page. + - in: query + name: page + required: false + schema: + type: integer + minimum: 1 + maximum: 21474836 + default: 1 + description: The page number for listing the results. + - in: query + name: order + required: false + schema: + type: string + enum: [asc, desc] + default: asc + description: | + The ordering of items from the point of view of the blockchain, + not the page listing itself. By default, we return oldest first, newest last. + responses: + "200": + description: Return the pool votes. + content: + application/json: + schema: + $ref: ../../../../schemas/pools/pool_votes.yaml + "400": + $ref: ../../../../responses/errors/400.yaml + "403": + $ref: ../../../../responses/errors/403.yaml + "404": + $ref: ../../../../responses/errors/404.yaml + "429": + $ref: ../../../../responses/errors/429.yaml + "418": + $ref: ../../../../responses/errors/418.yaml + "500": + $ref: ../../../../responses/errors/500.yaml diff --git a/src/schemas/governance/committee_content.yaml b/src/schemas/governance/committee_content.yaml new file mode 100644 index 00000000..01012cb6 --- /dev/null +++ b/src/schemas/governance/committee_content.yaml @@ -0,0 +1,18 @@ +type: array +items: + type: object + properties: + cold_key: + type: string + description: Hex cold key + hot_key: + type: string + description: Hex hot key + required: + - hot_key + - cold_key +example: + - cold_key: "5aea32cbcde22c8ba268d692c372901aaaafca4a335ffdca828089ec" + hot_key: "b41855e400020882ae44e868b341ffbad1c1b26cac70186d57387de4" + - cold_key: "5f1b4429fe3bda963a7b70ab81135112a785afcf55ccd695b122e794" + hot_key: "5aa349227e4068c85c03400396bcea13c7fd57d0ec78c604bc768fc5" diff --git a/src/schemas/governance/drep_content.yaml b/src/schemas/governance/drep_content.yaml index 328a1f18..2adba688 100644 --- a/src/schemas/governance/drep_content.yaml +++ b/src/schemas/governance/drep_content.yaml @@ -12,7 +12,7 @@ items: - drep_id - hex example: - - drep_id: 'drep1mvdu8slennngja7w4un6knwezufra70887zuxpprd64jxfveahn' - hex: 'db1bc3c3f99ce68977ceaf27ab4dd917123ef9e73f85c304236eab23' - - drep_id: 'drep1cxayn4fgy27yaucvhamsvqj3v6835mh3tjjx6x8hdnr4' - hex: 'c1ba49d52822bc4ef30cbf77060251668f1a6ef15ca46d18f76cc758' + - drep_id: "drep1mvdu8slennngja7w4un6knwezufra70887zuxpprd64jxfveahn" + hex: "db1bc3c3f99ce68977ceaf27ab4dd917123ef9e73f85c304236eab23" + - drep_id: "drep1cxayn4fgy27yaucvhamsvqj3v6835mh3tjjx6x8hdnr4" + hex: "c1ba49d52822bc4ef30cbf77060251668f1a6ef15ca46d18f76cc758" diff --git a/src/schemas/governance/drep_updates.yaml b/src/schemas/governance/drep_updates.yaml index 8e2796f4..50ac3dbb 100644 --- a/src/schemas/governance/drep_updates.yaml +++ b/src/schemas/governance/drep_updates.yaml @@ -23,4 +23,3 @@ example: - tx_hash: "dd3243af975be4b5bedce4e5f5b483b2386d5ad207d05e0289c1df0eb261447e" cert_index: 0 action: deregistered - diff --git a/src/schemas/governance/drep_votes.yaml b/src/schemas/governance/drep_votes.yaml new file mode 100644 index 00000000..481f3a91 --- /dev/null +++ b/src/schemas/governance/drep_votes.yaml @@ -0,0 +1,39 @@ +type: array +items: + type: object + properties: + tx_hash: + type: string + description: Hash of the transaction. + tx_index: + type: integer + description: Transaction index within the block. + voter_role: + type: string + enum: [constitutional_committee, drep, spo] + description: The role of the voter. Can be one of ConstitutionalCommittee, DRep, SPO. + committee_voter_hash: + type: string + nullable: true + vote: + type: string + enum: [yes, no, abstain] + description: The Vote. Can be one of yes, no, abstain. + + required: + - tx_hash + - tx_index + - voter_role + - committee_voter_hash + - vote +example: + - tx_hash: "b302de601defdf11a5261ed31a263804dac4a582a888c998ce24dec5" + tx_index: 2 + voter_role: "spo" + committee_voter_hash: null + vote: "yes" + - tx_hash: "b302de601defdf11a5261ed31a263804dac4a582a888c998ce24dec5" + tx_index: 3 + voter_role: "constitutional_committee" + committee_voter_hash: "53a42debdc7ffd90085ab7fd9800b63e6d1c9ac481ba6eb7b6a844e4" + vote: "abstain" diff --git a/src/schemas/governance/proposal_content.yaml b/src/schemas/governance/proposal_content.yaml new file mode 100644 index 00000000..9a3926f8 --- /dev/null +++ b/src/schemas/governance/proposal_content.yaml @@ -0,0 +1,27 @@ +type: array +items: + type: object + properties: + tx_hash: + type: string + description: Hash of the transaction. + tx_index: + type: integer + description: Transaction index within the block. + governance_type: + type: string + description: Type of proposal. + + required: + - tx_hash + - tx_index + - governance_type + +example: + - tx_hash: "2dd15e0ef6e6a17841cb9541c27724072ce4d4b79b91e58432fbaa32d9572531" + tx_index: 1 + governance_type: "TreasuryWithdrawals" + - tx_hash: "71317e951b20aa46e9fbf45a46a6e950d5723a481225519655bf6c60" + tx_index: 4 + governance_type: "NoConfidence" + diff --git a/src/schemas/governance/proposal_details_content.yaml b/src/schemas/governance/proposal_details_content.yaml new file mode 100644 index 00000000..623228e8 --- /dev/null +++ b/src/schemas/governance/proposal_details_content.yaml @@ -0,0 +1,73 @@ +type: object +properties: + tx_hash: + type: string + description: Hash of the transaction. + tx_index: + type: integer + description: Transaction index within the block. + governance_type: + type: string + description: Type of proposal. + governance_description: + type: string + description: A Text describing the content of this GovActionProposal in a readable way. + deposit: + type: string + description: The deposit amount paid for this proposal. + return_address: + type: string + description: Bech32 stake address of the reward address to receive the deposit when it is repaid. + ratified_epoch: + type: integer + nullable: true + enacted_epoch: + type: integer + nullable: true + dropped_epoch: + type: integer + nullable: true + expired_epoch: + type: integer + nullable: true + expiration: + type: integer + description: Shows the epoch at which this governance action will expire. + anchor_url: + type: string + nullable: true + description: The URL of the offchain anchor data. + anchor_hash: + type: string + nullable: true + description: The hash of the offchain anchor data. + +required: + - tx_hash + - tx_index + - governance_type + - deposit + - return_address + - description + - ratified_epoch + - enacted_epoch + - dropped_epoch + - expired_epoch + - expiration + - anchor_url + - anchor_hash + +example: + - tx_hash: "2dd15e0ef6e6a17841cb9541c27724072ce4d4b79b91e58432fbaa32d9572531" + tx_index: 1 + governance_type: "TreasuryWithdrawals" + deposit: 12000 + return_address: "stake_test1urd3hs7rlxwwdzthe6hj026dmyt3y0heuulctscyydh2kgck6nkmz" + description: 'TreasuryWithdrawals (fromList [(RewardAcnt {getRwdNetwork = Testnet, getRwdCred = KeyHashObj (KeyHash "71317e951b20aa46e9fbf45a46a6e950d5723a481225519655bf6c60")},Coin 20000000)])' + ratified_epoch: null + enacted_epoch: 123 + dropped_epoch: null + expired_epoch: null + expiration: 120 + anchor_url: "https://gist.github.com/123" + anchor_hash: "50b340624d49823720505e3f0095be0d6cd8f26501e094a6ab9068dd" diff --git a/src/schemas/governance/proposal_details_parameters.yaml b/src/schemas/governance/proposal_details_parameters.yaml new file mode 100644 index 00000000..8d227763 --- /dev/null +++ b/src/schemas/governance/proposal_details_parameters.yaml @@ -0,0 +1,275 @@ +type: object +properties: + epoch: + type: integer + example: 225 + description: Epoch number + min_fee_a: + type: integer + example: 44 + description: The linear factor for the minimum fee calculation for given epoch + min_fee_b: + type: integer + example: 155381 + description: The constant factor for the minimum fee calculation + max_block_size: + type: integer + example: 65536 + description: Maximum block body size in Bytes + max_tx_size: + type: integer + example: 16384 + description: Maximum transaction size + max_block_header_size: + type: integer + example: 1100 + description: Maximum block header size + key_deposit: + type: string + example: "2000000" + description: The amount of a key registration deposit in Lovelaces + pool_deposit: + type: string + example: "500000000" + description: The amount of a pool registration deposit in Lovelaces + e_max: + type: integer + example: 18 + description: Epoch bound on pool retirement + n_opt: + type: integer + example: 150 + description: Desired number of pools + a0: + type: number + example: 0.3 + description: Pool pledge influence + rho: + type: number + example: 0.003 + description: Monetary expansion + tau: + type: number + example: 0.2 + description: Treasury expansion + decentralisation_param: + type: number + example: 0.5 + description: Percentage of blocks produced by federated nodes + extra_entropy: + type: string + nullable: true + example: null + description: Seed for extra entropy + protocol_major_ver: + type: integer + example: 2 + description: Accepted protocol major version + protocol_minor_ver: + type: integer + example: 0 + description: Accepted protocol minor version + min_utxo: + type: string + example: "1000000" + description: Minimum UTXO value + min_pool_cost: + type: string + example: "340000000" + description: Minimum stake cost forced on the pool + nonce: + type: string + example: "1a3be38bcbb7911969283716ad7aa550250226b76a61fc51cc9a9a35d9276d81" + description: Epoch number only used once + cost_models: + additionalProperties: true + type: object + nullable: true + example: + PlutusV1: + addInteger-cpu-arguments-intercept: 197209 + addInteger-cpu-arguments-slope: 0 + PlutusV2: + addInteger-cpu-arguments-intercept: 197209 + addInteger-cpu-arguments-slope: 0 + description: Cost models parameters for Plutus Core scripts + price_mem: + type: number + nullable: true + example: 0.0577 + description: The per word cost of script memory usage + price_step: + type: number + nullable: true + example: 0.0000721 + description: The cost of script execution step usage + max_tx_ex_mem: + type: string + nullable: true + example: "10000000" + description: The maximum number of execution memory allowed to be used in a single transaction + max_tx_ex_steps: + type: string + nullable: true + example: "10000000000" + description: The maximum number of execution steps allowed to be used in a single transaction + max_block_ex_mem: + type: string + nullable: true + example: "50000000" + description: The maximum number of execution memory allowed to be used in a single block + max_block_ex_steps: + type: string + nullable: true + example: "40000000000" + description: The maximum number of execution steps allowed to be used in a single block + max_val_size: + type: string + nullable: true + example: "5000" + description: The maximum Val size + collateral_percent: + type: integer + nullable: true + example: 150 + description: The percentage of the transactions fee which must be provided as collateral when including non-native scripts + max_collateral_inputs: + type: integer + nullable: true + example: 3 + description: The maximum number of collateral inputs allowed in a transaction + coins_per_utxo_size: + type: string + nullable: true + example: "34482" + description: Cost per UTxO word for Alonzo. Cost per UTxO byte for Babbage and later. + coins_per_utxo_word: + type: string + nullable: true + example: "34482" + deprecated: true + description: Cost per UTxO word for Alonzo. Cost per UTxO byte for Babbage and later. + cost_model_id: + type: integer + format: int64 + description: The CostModel table index for the proposal. + pvt_motion_no_confidence: + type: number + description: Pool Voting threshold for motion of no-confidence. New in 13.2-Conway. + pvt_committee_normal: + type: number + description: Pool Voting threshold for new committee/threshold (normal state). New in 13.2-Conway. + pvt_committee_no_confidence: + type: number + description: Pool Voting threshold for new committee/threshold (state of no-confidence). New in 13.2-Conway. + pvt_hard_fork_initiation: + type: number + description: Pool Voting threshold for hard-fork initiation. New in 13.2-Conway. + dvt_motion_no_confidence: + type: number + description: DRep Vote threshold for motion of no-confidence. New in 13.2-Conway. + dvt_committee_normal: + type: number + description: DRep Vote threshold for new committee/threshold (normal state). New in 13.2-Conway. + dvt_committee_no_confidence: + type: number + description: DRep Vote threshold for new committee/threshold (state of no-confidence). New in 13.2-Conway. + dvt_update_to_constitution: + type: number + description: DRep Vote threshold for update to the Constitution. New in 13.2-Conway. + dvt_hard_fork_initiation: + type: number + description: DRep Vote threshold for hard-fork initiation. New in 13.2-Conway. + dvt_p_p_network_group: + type: number + description: DRep Vote threshold for protocol parameter changes, network group. New in 13.2-Conway. + dvt_p_p_economic_group: + type: number + description: DRep Vote threshold for protocol parameter changes, economic group. New in 13.2-Conway. + dvt_p_p_technical_group: + type: number + description: DRep Vote threshold for protocol parameter changes, technical group. New in 13.2-Conway. + dvt_p_p_gov_group: + type: number + description: DRep Vote threshold for protocol parameter changes, governance group. New in 13.2-Conway. + dvt_treasury_withdrawal: + type: number + description: DRep Vote threshold for treasury withdrawal. New in 13.2-Conway. + committee_min_size: + type: string + format: word64type + description: Minimal constitutional committee size. New in 13.2-Conway. + committee_max_term_length: + type: string + format: word64type + description: Constitutional committee term limits. New in 13.2-Conway. + gov_action_lifetime: + type: string + format: word64type + description: Governance action expiration. New in 13.2-Conway. + gov_action_deposit: + type: string + format: word64type + description: Governance action deposit. New in 13.2-Conway. + drep_deposit: + type: string + format: word64type + description: DRep deposit amount. New in 13.2-Conway. + drep_activity: + type: string + format: word64type + description: DRep activity period. New in 13.2-Conway. + +required: + - min_fee_a + - min_fee_b + - max_block_size + - max_tx_size + - max_block_header_size + - key_deposit + - pool_deposit + - e_max + - n_opt + - a0 + - rho + - tau + - decentralisation_param + - extra_entropy + - protocol_major_ver + - protocol_minor_ver + - min_utxo + - min_pool_cost + - nonce + - cost_models + - price_mem + - price_step + - max_tx_ex_mem + - max_tx_ex_steps + - max_block_ex_mem + - max_block_ex_steps + - max_val_size + - collateral_percent + - max_collateral_inputs + - coins_per_utxo_size + - coins_per_utxo_word + - cost_model_id + - pvt_motion_no_confidence + - pvt_committee_normal + - pvt_committee_no_confidence + - pvt_hard_fork_initiation + - dvt_motion_no_confidence + - dvt_committee_normal + - dvt_committee_no_confidence + - dvt_update_to_constitution + - dvt_hard_fork_initiation + - dvt_p_p_network_group + - dvt_p_p_economic_group + - dvt_p_p_technical_group + - dvt_p_p_gov_group + - dvt_treasury_withdrawal + - committee_min_size + - committee_max_term_length + - gov_action_lifetime + - gov_action_deposit + - drep_deposit + - drep_activity \ No newline at end of file diff --git a/src/schemas/governance/proposal_details_votes.yaml b/src/schemas/governance/proposal_details_votes.yaml new file mode 100644 index 00000000..84109d51 --- /dev/null +++ b/src/schemas/governance/proposal_details_votes.yaml @@ -0,0 +1,36 @@ +type: array +items: + type: object + properties: + tx_hash: + type: string + description: Hash of the transaction. + tx_index: + type: integer + description: Transaction index within the block. + voter_role: + type: string + enum: [constitutional_committee, drep, spo] + description: The role of the voter. Can be one of ConstitutionalCommittee, DRep, SPO. + committee_voter_hash: + type: string + nullable: true + vote: + type: string + enum: [yes, no, abstain] + description: The Vote. Can be one of yes, no, abstain. + + required: + - drep_id + - hex +example: + - tx_hash: "b302de601defdf11a5261ed31a263804dac4a582a888c998ce24dec5" + tx_index: 2 + voter_role: "spo" + committee_voter_hash: null + vote: "yes" + - tx_hash: "b302de601defdf11a5261ed31a263804dac4a582a888c998ce24dec5" + tx_index: 3 + voter_role: "constitutional_committee" + committee_voter_hash: "53a42debdc7ffd90085ab7fd9800b63e6d1c9ac481ba6eb7b6a844e4" + vote: "abstain" \ No newline at end of file diff --git a/src/schemas/pools/pool_votes.yaml b/src/schemas/pools/pool_votes.yaml new file mode 100644 index 00000000..41d1676f --- /dev/null +++ b/src/schemas/pools/pool_votes.yaml @@ -0,0 +1,36 @@ +type: array +items: + type: object + properties: + tx_hash: + type: string + description: Hash of the transaction. + tx_index: + type: integer + description: Transaction index within the block. + voter_role: + type: string + enum: [constitutional_committee, drep, spo] + description: The role of the voter. Can be one of ConstitutionalCommittee, DRep, SPO. + committee_voter_hash: + type: string + nullable: true + vote: + type: string + enum: [yes, no, abstain] + description: The Vote. Can be one of yes, no, abstain. + + required: + - drep_id + - hex +example: + - tx_hash: "b302de601defdf11a5261ed31a263804dac4a582a888c998ce24dec5" + tx_index: 2 + voter_role: "spo" + committee_voter_hash: null + vote: "yes" + - tx_hash: "b302de601defdf11a5261ed31a263804dac4a582a888c998ce24dec5" + tx_index: 3 + voter_role: "constitutional_committee" + committee_voter_hash: "53a42debdc7ffd90085ab7fd9800b63e6d1c9ac481ba6eb7b6a844e4" + vote: "abstain"