Skip to content

Commit

Permalink
feat(governance): add new endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
1000101 committed Jan 20, 2024
1 parent 8fc2c36 commit 2cea670
Show file tree
Hide file tree
Showing 22 changed files with 782 additions and 79 deletions.
22 changes: 11 additions & 11 deletions src/definitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,6 @@ paths:

# governance

# /governance/actions:
# $ref: ./paths/api/governance/actions.yaml

/governance/dreps:
$ref: ./paths/api/governance/dreps/index.yaml

Expand All @@ -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/index.yaml

# epochs

Expand Down
12 changes: 6 additions & 6 deletions src/paths/api/governance/dreps/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 7 additions & 7 deletions src/paths/api/governance/dreps/{drep_id}/delegators.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ get:
schema:
type: string
description: Bech32 or hexadecimal drep ID.
example: 'drep1mvdu8slennngja7w4un6knwezufra70887zuxpprd64jxfveahn'
example: "drep1mvdu8slennngja7w4un6knwezufra70887zuxpprd64jxfveahn"
- in: query
name: count
required: false
Expand Down Expand Up @@ -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
14 changes: 7 additions & 7 deletions src/paths/api/governance/dreps/{drep_id}/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 7 additions & 7 deletions src/paths/api/governance/dreps/{drep_id}/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 7 additions & 7 deletions src/paths/api/governance/dreps/{drep_id}/updates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ get:
schema:
type: string
description: Bech32 or hexadecimal DRep ID.
example: 'drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc'
example: "drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc"
- in: query
name: count
required: false
Expand Down Expand Up @@ -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
58 changes: 58 additions & 0 deletions src/paths/api/governance/dreps/{drep_id}/votes.yaml
Original file line number Diff line number Diff line change
@@ -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
44 changes: 37 additions & 7 deletions src/paths/api/governance/proposals/index.yaml
Original file line number Diff line number Diff line change
@@ -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":
Expand Down
22 changes: 0 additions & 22 deletions src/paths/api/governance/proposals/voting.yaml

This file was deleted.

37 changes: 37 additions & 0 deletions src/paths/api/governance/proposals/{tx_hash}/{tx_index}/index.yaml
Original file line number Diff line number Diff line change
@@ -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
Loading

0 comments on commit 2cea670

Please sign in to comment.