From 0713a4d5b16b56e6133a7a993b94ae8d15aee679 Mon Sep 17 00:00:00 2001 From: rdlrt <3169068+rdlrt@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:14:17 +1000 Subject: [PATCH] Update specs (bump version, add proposal_voting_summary fields) Update indexes for stake_address and drep --- files/grest/rpc/02_indexes/13_3_00.sql | 2 -- files/grest/rpc/02_indexes/13_5_0_2.sql | 3 +++ files/grest/rpc/governance/voter_proposal_list.sql | 4 ++-- specs/results/koiosapi-guild.yaml | 14 ++++++++++++-- specs/results/koiosapi-mainnet.yaml | 14 ++++++++++++-- specs/results/koiosapi-preprod.yaml | 14 ++++++++++++-- specs/results/koiosapi-preview.yaml | 14 ++++++++++++-- specs/templates/1-api-info.yaml | 2 +- specs/templates/4-api-schemas.yaml | 12 +++++++++++- 9 files changed, 65 insertions(+), 14 deletions(-) create mode 100644 files/grest/rpc/02_indexes/13_5_0_2.sql diff --git a/files/grest/rpc/02_indexes/13_3_00.sql b/files/grest/rpc/02_indexes/13_3_00.sql index c4ee421..789ca69 100644 --- a/files/grest/rpc/02_indexes/13_3_00.sql +++ b/files/grest/rpc/02_indexes/13_3_00.sql @@ -1,6 +1,4 @@ CREATE INDEX IF NOT EXISTS pool_stat_pool_hash_id ON pool_stat(pool_hash_id); CREATE INDEX IF NOT EXISTS pool_stat_epoch_no ON pool_stat(epoch_no); --- CREATE INDEX IF NOT EXISTS idx_drep_hash_view ON drep_hash (view); -CREATE INDEX IF NOT EXISTS idx_drep_hash_raw ON drep_hash (raw); CREATE INDEX IF NOT EXISTS idx_reward_rest_addr_id ON reward_rest (addr_id); CREATE INDEX IF NOT EXISTS idx_reward_rest_spendable_epoch ON reward_rest (spendable_epoch); \ No newline at end of file diff --git a/files/grest/rpc/02_indexes/13_5_0_2.sql b/files/grest/rpc/02_indexes/13_5_0_2.sql new file mode 100644 index 0000000..9e26961 --- /dev/null +++ b/files/grest/rpc/02_indexes/13_5_0_2.sql @@ -0,0 +1,3 @@ +DROP INDEX IF EXISTS idx_stake_address_view; +CREATE INDEX IF NOT EXISTS idx_stake_address_hash_raw ON stake_address (hash_raw); +CREATE INDEX IF NOT EXISTS idx_drep_hash_raw ON drep_hash (raw); \ No newline at end of file diff --git a/files/grest/rpc/governance/voter_proposal_list.sql b/files/grest/rpc/governance/voter_proposal_list.sql index 46e575c..18b132c 100644 --- a/files/grest/rpc/governance/voter_proposal_list.sql +++ b/files/grest/rpc/governance/voter_proposal_list.sql @@ -63,7 +63,7 @@ BEGIN gap.type, gap.description, gap.deposit::text, - grest.cip5_hex_to_stake_addr(sa.hash_raw)::text, + grest.cip5_hex_to_stake_addr(sa.hash_raw)::varchar, b.epoch_no, gap.ratified_epoch, gap.enacted_epoch, @@ -81,7 +81,7 @@ BEGIN ELSE JSONB_BUILD_OBJECT( 'stake_address', ( - SELECT grest.cip5_hex_to_stake_addr(sa2.hash_raw)::text + SELECT grest.cip5_hex_to_stake_addr(sa2.hash_raw)::varchar FROM stake_address AS sa2 WHERE sa2.id = tw.stake_address_id ), diff --git a/specs/results/koiosapi-guild.yaml b/specs/results/koiosapi-guild.yaml index 22fb030..d79c3b6 100644 --- a/specs/results/koiosapi-guild.yaml +++ b/specs/results/koiosapi-guild.yaml @@ -8,7 +8,7 @@ info: license: name: Creative Commons Attribution 4.0 International url: https://github.com/cardano-community/koios-artifacts/blob/main/LICENSE - version: v1.2.0 + version: v1.2.1 description: | Koios is best described as a Decentralized and Elastic RESTful query layer for exploring data on Cardano blockchain to consume within applications/wallets/explorers/etc. This page not only provides an OpenAPI Spec for live implementation, but also ability to execute live demo from client browser against each endpoint with pre-filled examples. @@ -3061,7 +3061,7 @@ components: example: "31235800000" active_stake_pct: type: - - string + - number - 'null' description: Active stake for the pool, expressed as a percentage of total active stake on network example: 13.512182543475783 @@ -5494,6 +5494,10 @@ components: type: number description: Percentage of 'no' votes from dreps example: 39.28 + drep_abstain_votes_cast: + type: number + description: Percentage of 'abstain' votes from dreps + example: 5 pool_yes_votes_cast: type: number description: Number of 'yes' votes casted by pools @@ -5518,6 +5522,9 @@ components: type: number description: Percentage of 'no' votes from pools example: 0 + pool_abstain_votes_cast: + type: number + description: Percentage of 'abstain' votes from pools committee_yes_votes_cast: type: number description: Number of 'yes' votes casted by committee @@ -5534,6 +5541,9 @@ components: type: number description: Percentage of 'no' votes from committee example: 28.57 + committee_abstain_votes_cast: + type: number + description: Percentage of 'abstain' votes from committee proposal_votes: type: array description: List of all votes cast on specified governance action diff --git a/specs/results/koiosapi-mainnet.yaml b/specs/results/koiosapi-mainnet.yaml index ba0d62e..3fad91d 100644 --- a/specs/results/koiosapi-mainnet.yaml +++ b/specs/results/koiosapi-mainnet.yaml @@ -8,7 +8,7 @@ info: license: name: Creative Commons Attribution 4.0 International url: https://github.com/cardano-community/koios-artifacts/blob/main/LICENSE - version: v1.2.0 + version: v1.2.1 description: | Koios is best described as a Decentralized and Elastic RESTful query layer for exploring data on Cardano blockchain to consume within applications/wallets/explorers/etc. This page not only provides an OpenAPI Spec for live implementation, but also ability to execute live demo from client browser against each endpoint with pre-filled examples. @@ -3061,7 +3061,7 @@ components: example: "31235800000" active_stake_pct: type: - - string + - number - 'null' description: Active stake for the pool, expressed as a percentage of total active stake on network example: 13.512182543475783 @@ -5494,6 +5494,10 @@ components: type: number description: Percentage of 'no' votes from dreps example: 39.28 + drep_abstain_votes_cast: + type: number + description: Percentage of 'abstain' votes from dreps + example: 5 pool_yes_votes_cast: type: number description: Number of 'yes' votes casted by pools @@ -5518,6 +5522,9 @@ components: type: number description: Percentage of 'no' votes from pools example: 0 + pool_abstain_votes_cast: + type: number + description: Percentage of 'abstain' votes from pools committee_yes_votes_cast: type: number description: Number of 'yes' votes casted by committee @@ -5534,6 +5541,9 @@ components: type: number description: Percentage of 'no' votes from committee example: 28.57 + committee_abstain_votes_cast: + type: number + description: Percentage of 'abstain' votes from committee proposal_votes: type: array description: List of all votes cast on specified governance action diff --git a/specs/results/koiosapi-preprod.yaml b/specs/results/koiosapi-preprod.yaml index 11d29f4..6ac8bc4 100644 --- a/specs/results/koiosapi-preprod.yaml +++ b/specs/results/koiosapi-preprod.yaml @@ -8,7 +8,7 @@ info: license: name: Creative Commons Attribution 4.0 International url: https://github.com/cardano-community/koios-artifacts/blob/main/LICENSE - version: v1.2.0 + version: v1.2.1 description: | Koios is best described as a Decentralized and Elastic RESTful query layer for exploring data on Cardano blockchain to consume within applications/wallets/explorers/etc. This page not only provides an OpenAPI Spec for live implementation, but also ability to execute live demo from client browser against each endpoint with pre-filled examples. @@ -3061,7 +3061,7 @@ components: example: "31235800000" active_stake_pct: type: - - string + - number - 'null' description: Active stake for the pool, expressed as a percentage of total active stake on network example: 13.512182543475783 @@ -5494,6 +5494,10 @@ components: type: number description: Percentage of 'no' votes from dreps example: 39.28 + drep_abstain_votes_cast: + type: number + description: Percentage of 'abstain' votes from dreps + example: 5 pool_yes_votes_cast: type: number description: Number of 'yes' votes casted by pools @@ -5518,6 +5522,9 @@ components: type: number description: Percentage of 'no' votes from pools example: 0 + pool_abstain_votes_cast: + type: number + description: Percentage of 'abstain' votes from pools committee_yes_votes_cast: type: number description: Number of 'yes' votes casted by committee @@ -5534,6 +5541,9 @@ components: type: number description: Percentage of 'no' votes from committee example: 28.57 + committee_abstain_votes_cast: + type: number + description: Percentage of 'abstain' votes from committee proposal_votes: type: array description: List of all votes cast on specified governance action diff --git a/specs/results/koiosapi-preview.yaml b/specs/results/koiosapi-preview.yaml index 390ba1c..0c0ed67 100644 --- a/specs/results/koiosapi-preview.yaml +++ b/specs/results/koiosapi-preview.yaml @@ -8,7 +8,7 @@ info: license: name: Creative Commons Attribution 4.0 International url: https://github.com/cardano-community/koios-artifacts/blob/main/LICENSE - version: v1.2.0 + version: v1.2.1 description: | Koios is best described as a Decentralized and Elastic RESTful query layer for exploring data on Cardano blockchain to consume within applications/wallets/explorers/etc. This page not only provides an OpenAPI Spec for live implementation, but also ability to execute live demo from client browser against each endpoint with pre-filled examples. @@ -3061,7 +3061,7 @@ components: example: "31235800000" active_stake_pct: type: - - string + - number - 'null' description: Active stake for the pool, expressed as a percentage of total active stake on network example: 13.512182543475783 @@ -5494,6 +5494,10 @@ components: type: number description: Percentage of 'no' votes from dreps example: 39.28 + drep_abstain_votes_cast: + type: number + description: Percentage of 'abstain' votes from dreps + example: 5 pool_yes_votes_cast: type: number description: Number of 'yes' votes casted by pools @@ -5518,6 +5522,9 @@ components: type: number description: Percentage of 'no' votes from pools example: 0 + pool_abstain_votes_cast: + type: number + description: Percentage of 'abstain' votes from pools committee_yes_votes_cast: type: number description: Number of 'yes' votes casted by committee @@ -5534,6 +5541,9 @@ components: type: number description: Percentage of 'no' votes from committee example: 28.57 + committee_abstain_votes_cast: + type: number + description: Percentage of 'abstain' votes from committee proposal_votes: type: array description: List of all votes cast on specified governance action diff --git a/specs/templates/1-api-info.yaml b/specs/templates/1-api-info.yaml index 6e3bf50..de45e8c 100644 --- a/specs/templates/1-api-info.yaml +++ b/specs/templates/1-api-info.yaml @@ -7,7 +7,7 @@ info: license: name: Creative Commons Attribution 4.0 International url: https://github.com/cardano-community/koios-artifacts/blob/main/LICENSE - version: v1.2.0 + version: v1.2.1 description: | Koios is best described as a Decentralized and Elastic RESTful query layer for exploring data on Cardano blockchain to consume within applications/wallets/explorers/etc. This page not only provides an OpenAPI Spec for live implementation, but also ability to execute live demo from client browser against each endpoint with pre-filled examples. diff --git a/specs/templates/4-api-schemas.yaml b/specs/templates/4-api-schemas.yaml index a338603..8fbd794 100644 --- a/specs/templates/4-api-schemas.yaml +++ b/specs/templates/4-api-schemas.yaml @@ -226,7 +226,7 @@ schemas: example: "31235800000" active_stake_pct: type: - - string + - number - 'null' description: Active stake for the pool, expressed as a percentage of total active stake on network example: 13.512182543475783 @@ -2659,6 +2659,10 @@ schemas: type: number description: Percentage of 'no' votes from dreps example: 39.28 + drep_abstain_votes_cast: + type: number + description: Percentage of 'abstain' votes from dreps + example: 5 pool_yes_votes_cast: type: number description: Number of 'yes' votes casted by pools @@ -2683,6 +2687,9 @@ schemas: type: number description: Percentage of 'no' votes from pools example: 0 + pool_abstain_votes_cast: + type: number + description: Percentage of 'abstain' votes from pools committee_yes_votes_cast: type: number description: Number of 'yes' votes casted by committee @@ -2699,6 +2706,9 @@ schemas: type: number description: Percentage of 'no' votes from committee example: 28.57 + committee_abstain_votes_cast: + type: number + description: Percentage of 'abstain' votes from committee proposal_votes: type: array description: List of all votes cast on specified governance action