Skip to content

Commit

Permalink
Update specs (WIP)
Browse files Browse the repository at this point in the history
Add additional vote metadata fields to proposal_list
  • Loading branch information
rdlrt committed Jul 29, 2024
1 parent ad2274b commit f3d8b8b
Show file tree
Hide file tree
Showing 2 changed files with 205 additions and 2 deletions.
10 changes: 8 additions & 2 deletions files/grest/rpc/governance/proposal_list.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ RETURNS TABLE (
expiration integer,
meta_url text,
meta_hash text,
meta_json jsonb
meta_json jsonb,
comment text,
language text,
is_valid boolean
)
LANGUAGE sql STABLE
AS $$
Expand All @@ -33,7 +36,10 @@ AS $$
gap.expiration AS expiration,
va.url AS meta_url,
ENCODE(va.data_hash, 'hex') AS meta_hash,
ocvd.json AS meta_json
ocvd.json AS meta_json,
ocvd.comment AS comment,
ocvd.language AS language,
ocvd.is_valid AS is_valid
FROM public.gov_action_proposal AS gap
INNER JOIN public.tx ON gap.tx_id = tx.id
INNER JOIN public.block AS b ON tx.block_id = b.id
Expand Down
197 changes: 197 additions & 0 deletions specs/templates/api-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1155,6 +1155,180 @@ paths:
summary: Asset Transactions
description: Get the list of current or all asset transaction hashes (newest first)
operationId: asset_txs

/drep_list: #RPC
get:
tags:
- Governance
responses:
"200":
description: Success!!
content:
application/json:
schema:
$ref: "#/components/schemas/drep_list"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
summary: DReps List
description: List of all active delegated representatives (DReps)
operationId: drep_list
/drep_info: #RPC
post:
tags:
- Governance
requestBody:
$ref: "#/components/requestBodies/drep_id_bulk"
responses:
"200":
description: Success!!
content:
application/json:
schema:
$ref: "#/components/schemas/drep_info"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
summary: DReps Info
description: Get detailed information about requested delegated representatives (DReps)
operationId: drep_info
/drep_metadata: #RPC
post:
tags:
- Governance
requestBody:
$ref: "#/components/requestBodies/drep_id_bulk"
responses:
"200":
description: Success!!
content:
application/json:
schema:
$ref: "#/components/schemas/drep_metadata"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
summary: DReps Metadata
description: List metadata for requested delegated representatives (DReps)
operationId: drep_metadata
/drep_updates: #RPC
get:
tags:
- Governance
parameters:
- $ref: "#/components/parameters/_drep_id_optional"
responses:
"200":
description: Success!!
content:
application/json:
schema:
$ref: "#/components/schemas/drep_updates"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
summary: DReps Updates
description: List of updates for requested (or all) delegated representatives (DReps)
operationId: drep_updates
/drep_votes: #RPC
get:
tags:
- Governance
parameters:
- $ref: "#/components/parameters/_drep_id"
responses:
"200":
description: Success!!
content:
application/json:
schema:
$ref: "#/components/schemas/drep_votes"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
summary: DReps Votes
description: List of all votes casted by requested delegated representative (DRep)
operationId: drep_votes
/committee_votes: #RPC
get:
tags:
- Governance
parameters:
- $ref: "#/components/parameters/_committee_hash"
responses:
"200":
description: Success!!
content:
application/json:
schema:
$ref: "#/components/schemas/committee_votes"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
summary: Committee Votes
description: List of all votes casted by given committee member or collective
operationId: committee_votes
/proposal_list: #RPC
get:
tags:
- Governance
responses:
"200":
description: Success!!
content:
application/json:
schema:
$ref: "#/components/schemas/proposal_list"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
summary: Proposals List
description: List of all governance proposals
operationId: proposal_list
/proposal_votes: #RPC
get:
tags:
- Governance
parameters:
- $ref: "#/components/parameters/_tx_hash"
responses:
"200":
description: Success!!
content:
application/json:
schema:
$ref: "#/components/schemas/committee_votes"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
summary: Proposal Votes
description: List of all votes cast on specified governance action
operationId: proposal_votes

/pool_list: #RPC
get:
tags:
Expand Down Expand Up @@ -1400,6 +1574,28 @@ paths:
summary: Pool Relays
description: A list of registered relays for all pools
operationId: pool_relays
/pool_votes: #RPC
get:
tags:
- Governance
parameters:
- $ref: "#/components/parameters/_pool_bech32"
responses:
"200":
description: Success!!
content:
application/json:
schema:
$ref: "#/components/schemas/pool_votes"
"400":
$ref: "#/components/responses/BadRequest"
"401":
$ref: "#/components/responses/Unauthorized"
"404":
$ref: "#/components/responses/NotFound"
summary: Pool Votes
description: List of all votes casted by a pool
operationId: pool_votes
/pool_metadata: #RPC
post:
tags:
Expand Down Expand Up @@ -1552,6 +1748,7 @@ paths:
summary: Datum Information
description: List of datum information for given datum hashes
operationId: datum_info

/ogmios: #ogmios-api
post:
tags:
Expand Down

0 comments on commit f3d8b8b

Please sign in to comment.