Skip to content

Commit

Permalink
chore(dreps): update
Browse files Browse the repository at this point in the history
  • Loading branch information
1000101 committed Dec 10, 2023
1 parent a38a3ce commit 60bb81e
Show file tree
Hide file tree
Showing 9 changed files with 312 additions and 37 deletions.
74 changes: 72 additions & 2 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -998,6 +998,42 @@
}
}
},
"/governance/dreps/{hash}/delegators": {
"get": {
"tags": [
"Cardano » Governance"
],
"summary": "xxx",
"description": "xxx",
"responses": {
"200": {
"description": "xxx",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/drep_delegators"
}
}
}
},
"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/dreps/{hash}/distribution": {
"get": {
"tags": [
Expand All @@ -1011,7 +1047,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/drep_distribution_content"
"$ref": "#/components/schemas/drep_distribution"
}
}
}
Expand Down Expand Up @@ -7659,7 +7695,41 @@
}
]
},
"drep_distribution_content": {
"drep_delegators": {
"type": "array",
"items": {
"type": "object",
"properties": {
"address": {
"type": "string",
"description": "Bech32 encoded stake addresses"
},
"amount": {
"type": "string",
"description": "Currently delegated amount"
}
},
"required": [
"address",
"amount"
]
},
"example": [
{
"address": "stake1ux4vspfvwuus9uwyp5p3f0ky7a30jq5j80jxse0fr7pa56sgn8kha",
"amount": "1137959159981411"
},
{
"address": "stake1uylayej7esmarzd4mk4aru37zh9yz0luj3g9fsvgpfaxulq564r5u",
"amount": "16958865648"
},
{
"address": "stake1u8lr2pnrgf8f7vrs9lt79hc3sxm8s2w4rwvgpncks3axx6q93d4ck",
"amount": "18605647"
}
]
},
"drep_distribution": {
"type": "array",
"items": {
"type": "object",
Expand Down
48 changes: 46 additions & 2 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,29 @@ paths:
$ref: '#/components/responses/429'
'500':
$ref: '#/components/responses/500'
/governance/dreps/{hash}/delegators:
get:
tags:
- Cardano » Governance
summary: xxx
description: xxx
responses:
'200':
description: xxx
content:
application/json:
schema:
$ref: '#/components/schemas/drep_delegators'
'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/dreps/{hash}/distribution:
get:
tags:
Expand All @@ -904,7 +927,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/drep_distribution_content'
$ref: '#/components/schemas/drep_distribution'
'400':
$ref: '#/components/responses/400'
'403':
Expand Down Expand Up @@ -5615,7 +5638,28 @@ components:
amount: '2000000'
is_registered: true
has_script: true
drep_distribution_content:
drep_delegators:
type: array
items:
type: object
properties:
address:
type: string
description: Bech32 encoded stake addresses
amount:
type: string
description: Currently delegated amount
required:
- address
- amount
example:
- address: stake1ux4vspfvwuus9uwyp5p3f0ky7a30jq5j80jxse0fr7pa56sgn8kha
amount: '1137959159981411'
- address: stake1uylayej7esmarzd4mk4aru37zh9yz0luj3g9fsvgpfaxulq564r5u
amount: '16958865648'
- address: stake1u8lr2pnrgf8f7vrs9lt79hc3sxm8s2w4rwvgpncks3axx6q93d4ck
amount: '18605647'
drep_distribution:
type: array
items:
type: object
Expand Down
10 changes: 8 additions & 2 deletions src/definitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,14 @@ paths:
/governance/dreps/{hash}:
$ref: ./paths/api/governance/dreps/{hash}/index.yaml

/governance/dreps/{hash}/distribution:
$ref: ./paths/api/governance/dreps/{hash}/distribution.yaml
/governance/dreps/{hash}/delegators:
$ref: ./paths/api/governance/dreps/{hash}/delegators.yaml

/governance/dreps/{hash}/metadata:
$ref: ./paths/api/governance/dreps/{hash}/metadata.yaml

/governance/dreps/{hash}/updates:
$ref: ./paths/api/governance/dreps/{hash}/updates.yaml

# /governance/proposals:
# $ref: ./paths/api/governance/proposals/index.yaml
Expand Down
47 changes: 45 additions & 2 deletions src/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,27 @@ export interface paths {
};
};
};
"/governance/dreps/{hash}/delegators": {
/**
* xxx
* @description xxx
*/
get: {
responses: {
/** @description xxx */
200: {
content: {
"application/json": components["schemas"]["drep_delegators"];
};
};
400: components["responses"]["400"];
403: components["responses"]["403"];
418: components["responses"]["418"];
429: components["responses"]["429"];
500: components["responses"]["500"];
};
};
};
"/governance/dreps/{hash}/distribution": {
/**
* xxx
Expand All @@ -486,7 +507,7 @@ export interface paths {
/** @description xxx */
200: {
content: {
"application/json": components["schemas"]["drep_distribution_content"];
"application/json": components["schemas"]["drep_distribution"];
};
};
400: components["responses"]["400"];
Expand Down Expand Up @@ -3939,6 +3960,28 @@ export interface components {
/** @description Flag which shows if this DRep credentials are a script hash */
has_script: boolean;
}[];
/**
* @example [
* {
* "address": "stake1ux4vspfvwuus9uwyp5p3f0ky7a30jq5j80jxse0fr7pa56sgn8kha",
* "amount": "1137959159981411"
* },
* {
* "address": "stake1uylayej7esmarzd4mk4aru37zh9yz0luj3g9fsvgpfaxulq564r5u",
* "amount": "16958865648"
* },
* {
* "address": "stake1u8lr2pnrgf8f7vrs9lt79hc3sxm8s2w4rwvgpncks3axx6q93d4ck",
* "amount": "18605647"
* }
* ]
*/
drep_delegators: {
/** @description Bech32 encoded stake addresses */
address: string;
/** @description Currently delegated amount */
amount: string;
}[];
/**
* @example [
* {
Expand All @@ -3951,7 +3994,7 @@ export interface components {
* }
* ]
*/
drep_distribution_content: ({
drep_distribution: ({
/** @description The total amount of voting power this DRep is delegated. */
amount: string;
/** @description The epoch no this distribution is about. */
Expand Down
58 changes: 58 additions & 0 deletions src/paths/api/governance/dreps/{hash}/delegators.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
get:
tags:
- Cardano » Governance
summary: DRep pool delegators
description: List of Drep delegators.
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 delegations
content:
application/json:
schema:
$ref: ../../../../../schemas/governance/drep_delegators.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
14 changes: 11 additions & 3 deletions src/paths/api/governance/dreps/{hash}/index.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
get:
tags:
- Cardano » Governance
summary: xxx
description: xxx
summary: Specific DRep
description: DRep information.
parameters:
- in: path
name: drep_id
required: true
schema:
type: string
description: Bech32 or hexadecimal DRep ID.
example: "drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc"
responses:
"200":
description: xxx
description: Return the DRep information content
content:
application/json:
schema:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
get:
tags:
- Cardano » Governance
summary: xxx
description: xxx
summary: Specific DRep
description: DRep information.
parameters:
- in: path
name: drep_id
required: true
schema:
type: string
description: Bech32 or hexadecimal DRep ID.
example: "drep15cfxz9exyn5rx0807zvxfrvslrjqfchrd4d47kv9e0f46uedqtc"
responses:
"200":
description: xxx
description: Return the DRep metadata content.
content:
application/json:
schema:
$ref: ../../../../../schemas/governance/drep_distribution_content.yaml
$ref: ../../../../../schemas/governance/drep_metadata.yaml
"400":
$ref: ../../../../../responses/errors/400.yaml
"403":
Expand Down
Loading

0 comments on commit 60bb81e

Please sign in to comment.