From 0d799c875377f0f6f5d6c59fc9003f323657bcf3 Mon Sep 17 00:00:00 2001 From: rdlrt <3169068+rdlrt@users.noreply.github.com> Date: Tue, 4 Jun 2024 16:26:09 +1000 Subject: [PATCH 1/2] Fix collateral_tx_out to not map against multi asset but use it's own multi_assets_descr field --- files/grest/rpc/blocks/block_tx_info.sql | 21 ++++----------------- files/grest/rpc/transactions/tx_info.sql | 21 ++++----------------- 2 files changed, 8 insertions(+), 34 deletions(-) diff --git a/files/grest/rpc/blocks/block_tx_info.sql b/files/grest/rpc/blocks/block_tx_info.sql index f03ebcbd..05bd3bb4 100644 --- a/files/grest/rpc/blocks/block_tx_info.sql +++ b/files/grest/rpc/blocks/block_tx_info.sql @@ -260,17 +260,6 @@ BEGIN tx_out.index AS tx_index, tx_out.value::text AS value, ENCODE(tx_out.data_hash, 'hex') AS datum_hash, - (CASE WHEN ma.policy IS NULL THEN NULL - ELSE - JSONB_BUILD_OBJECT( - 'policy_id', ENCODE(ma.policy, 'hex'), - 'asset_name', ENCODE(ma.name, 'hex'), - 'fingerprint', ma.fingerprint, - 'decimals', aic.decimals, - 'quantity', mto.quantity::text - ) - END - ) AS asset_list, (CASE WHEN tx_out.inline_datum_id IS NULL THEN NULL ELSE JSONB_BUILD_OBJECT( @@ -289,14 +278,12 @@ BEGIN 'size', script.serialised_size ) END - ) AS reference_script + ) AS reference_script, + REPLACE(multi_assets_descr,'fromList ','') AS asset_descr FROM collateral_tx_out AS tx_out INNER JOIN tx ON tx_out.tx_id = tx.id LEFT JOIN stake_address AS sa ON tx_out.stake_address_id = sa.id - LEFT JOIN ma_tx_out AS mto ON _assets IS TRUE AND mto.tx_out_id = tx_out.id - LEFT JOIN multi_asset AS ma ON _assets IS TRUE AND ma.id = mto.ident - LEFT JOIN grest.asset_info_cache AS aic ON _assets IS TRUE AND aic.asset_id = ma.id LEFT JOIN datum ON _scripts IS TRUE AND datum.id = tx_out.inline_datum_id LEFT JOIN script ON _scripts IS TRUE AND script.id = tx_out.reference_script_id WHERE _scripts IS TRUE @@ -760,11 +747,11 @@ BEGIN 'datum_hash', datum_hash, 'inline_datum', inline_datum, 'reference_script', reference_script, - 'asset_list', COALESCE(JSONB_AGG(asset_list) FILTER (WHERE asset_list IS NOT NULL), JSONB_BUILD_ARRAY()) + 'asset_list', asset_descr ) AS tx_collateral_outputs FROM _all_collateral_outputs AS aco WHERE _scripts IS TRUE AND aco.tx_id = atx.id - GROUP BY payment_addr_bech32, payment_addr_cred, stake_addr, aco.tx_hash, tx_index, value, datum_hash, inline_datum, reference_script + GROUP BY payment_addr_bech32, payment_addr_cred, stake_addr, aco.tx_hash, tx_index, value, datum_hash, inline_datum, reference_script, asset_descr LIMIT 1 -- there can only be one collateral output ), COALESCE(( diff --git a/files/grest/rpc/transactions/tx_info.sql b/files/grest/rpc/transactions/tx_info.sql index 9dfb82e4..71f329e1 100644 --- a/files/grest/rpc/transactions/tx_info.sql +++ b/files/grest/rpc/transactions/tx_info.sql @@ -243,17 +243,6 @@ BEGIN tx_out.index AS tx_index, tx_out.value::text AS value, ENCODE(tx_out.data_hash, 'hex') AS datum_hash, - (CASE WHEN ma.policy IS NULL THEN NULL - ELSE - JSONB_BUILD_OBJECT( - 'policy_id', ENCODE(ma.policy, 'hex'), - 'asset_name', ENCODE(ma.name, 'hex'), - 'fingerprint', ma.fingerprint, - 'decimals', aic.decimals, - 'quantity', mto.quantity::text - ) - END - ) AS asset_list, (CASE WHEN tx_out.inline_datum_id IS NULL THEN NULL ELSE JSONB_BUILD_OBJECT( @@ -272,14 +261,12 @@ BEGIN 'size', script.serialised_size ) END - ) AS reference_script + ) AS reference_script, + REPLACE(multi_assets_descr,'fromList ','') AS asset_descr FROM collateral_tx_out AS tx_out INNER JOIN tx ON tx_out.tx_id = tx.id LEFT JOIN stake_address AS sa ON tx_out.stake_address_id = sa.id - LEFT JOIN ma_tx_out AS mto ON mto.tx_out_id = tx_out.id - LEFT JOIN multi_asset AS ma ON ma.id = mto.ident - LEFT JOIN grest.asset_info_cache AS aic ON aic.asset_id = ma.id LEFT JOIN datum ON datum.id = tx_out.inline_datum_id LEFT JOIN script ON script.id = tx_out.reference_script_id WHERE @@ -789,11 +776,11 @@ BEGIN 'datum_hash', datum_hash, 'inline_datum', inline_datum, 'reference_script', reference_script, - 'asset_list', COALESCE(JSONB_AGG(asset_list) FILTER (WHERE asset_list IS NOT NULL), JSONB_BUILD_ARRAY()) + 'asset_list', asset_descr ) AS tx_collateral_outputs FROM _all_collateral_outputs AS aco WHERE aco.tx_id = atx.id - GROUP BY payment_addr_bech32, payment_addr_cred, stake_addr, aco.tx_hash, tx_index, value, datum_hash, inline_datum, reference_script + GROUP BY payment_addr_bech32, payment_addr_cred, stake_addr, aco.tx_hash, tx_index, value, datum_hash, inline_datum, reference_script, asset_descr LIMIT 1 -- there can only be one collateral output ), COALESCE(( From 647978ee6a994953090e68b46e7e96bcfdae335e Mon Sep 17 00:00:00 2001 From: rdlrt <3169068+rdlrt@users.noreply.github.com> Date: Tue, 4 Jun 2024 17:15:51 +1000 Subject: [PATCH 2/2] Update specs and bump version in specs --- specs/results/koiosapi-guild.yaml | 34 ++++++++++++++++++++++++----- specs/results/koiosapi-mainnet.yaml | 34 ++++++++++++++++++++++++----- specs/results/koiosapi-preprod.yaml | 34 ++++++++++++++++++++++++----- specs/results/koiosapi-preview.yaml | 34 ++++++++++++++++++++++++----- specs/templates/1-api-info.yaml | 4 ++-- specs/templates/4-api-schemas.yaml | 25 ++++++++++++++++++--- specs/templates/api-main.yaml | 5 +++++ 7 files changed, 145 insertions(+), 25 deletions(-) diff --git a/specs/results/koiosapi-guild.yaml b/specs/results/koiosapi-guild.yaml index a3c3bc38..469673bb 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.1.2 + version: v1.1.3 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. @@ -130,7 +130,7 @@ info: - Burst Limit: A single IP can query an endpoint up to 100 times within 10 seconds (that's about 8.64 million requests within a day). The sleep time if a limit is crossed is minimal (60 seconds) for that IP - during which, the monitoring layer will return HTTP Status `429 - Too many requests`. - Pagination/Limits: Any query results fetched will be paginated by 1000 records (you can reduce limit and or control pagination offsets on URL itself, see API > Pagination section for more details). - Query timeout: If a query from server takes more than 30 seconds, it will return a HTTP Status of `504 - Gateway timeout`. This is because we would want to ensure you're using the queries optimally, and more often than not - it would indicate that particular endpoint is not optimised (or the network connectivity is not optimal between servers). - - Payload size limit: Koios supports sending bulk objects to reduce networking costs as well as number of calls users spent. However, this can also become an easy attack surface. Thus, we've had to add a strict limit for request body size to be limited to 5kb. + - Payload size limit: Koios supports sending bulk objects to reduce networking costs as well as number of calls users spent. However, this can also become an easy attack surface. Thus, we've had to add a strict limit for request body size to be limited to 1kb for public and 5kb for registered tiers. Yet, there may be cases where the above restrictions may need exceptions (for example, an explorer or a wallet might need more connections than above - going beyond the Burst Limit). For such cases, it is best to approach the team and we can work towards a solution. @@ -147,9 +147,13 @@ info: url: "https://api.koios.rest/images/koios.png" servers: - url: https://api.koios.rest/api/v1 + description: Mainnet - url: https://guild.koios.rest/api/v1 + description: Guildnet - url: https://preview.koios.rest/api/v1 + description: Preview Network - url: https://preprod.koios.rest/api/v1 + description: Preprod Network paths: /tip: #RPC @@ -3828,9 +3832,28 @@ components: - $ref: "#/components/schemas/tx_info/items/properties/outputs" collateral_output: description: A collateral output for change if the smart contract fails to execute and collateral inputs are spent. (CIP-40) - anyOf: - - type: 'null' - - $ref: "#/components/schemas/tx_info/items/properties/outputs/items" + type: array + items: + properties: + payment_addr: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/payment_addr" + stake_addr: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/stake_addr" + tx_hash: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/tx_hash" + tx_index: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/tx_index" + value: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/value" + datum_hash: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/datum_hash" + inline_datum: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/inline_datum" + reference_script: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/reference_script" + asset_list: + type: array + description: Brief asset description from ledger reference_inputs: description: An array of reference inputs. A reference input allows looking at an output without spending it. (CIP-31) anyOf: @@ -4636,4 +4659,5 @@ tags: - [evaluateTransaction](https://ogmios.dev/mini-protocols/local-tx-submission/#evaluating-transactions) x-tag-expanded: true security: + - [] - bearerAuth: [] diff --git a/specs/results/koiosapi-mainnet.yaml b/specs/results/koiosapi-mainnet.yaml index 75574ee7..f8e8caa1 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.1.2 + version: v1.1.3 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. @@ -130,7 +130,7 @@ info: - Burst Limit: A single IP can query an endpoint up to 100 times within 10 seconds (that's about 8.64 million requests within a day). The sleep time if a limit is crossed is minimal (60 seconds) for that IP - during which, the monitoring layer will return HTTP Status `429 - Too many requests`. - Pagination/Limits: Any query results fetched will be paginated by 1000 records (you can reduce limit and or control pagination offsets on URL itself, see API > Pagination section for more details). - Query timeout: If a query from server takes more than 30 seconds, it will return a HTTP Status of `504 - Gateway timeout`. This is because we would want to ensure you're using the queries optimally, and more often than not - it would indicate that particular endpoint is not optimised (or the network connectivity is not optimal between servers). - - Payload size limit: Koios supports sending bulk objects to reduce networking costs as well as number of calls users spent. However, this can also become an easy attack surface. Thus, we've had to add a strict limit for request body size to be limited to 5kb. + - Payload size limit: Koios supports sending bulk objects to reduce networking costs as well as number of calls users spent. However, this can also become an easy attack surface. Thus, we've had to add a strict limit for request body size to be limited to 1kb for public and 5kb for registered tiers. Yet, there may be cases where the above restrictions may need exceptions (for example, an explorer or a wallet might need more connections than above - going beyond the Burst Limit). For such cases, it is best to approach the team and we can work towards a solution. @@ -147,9 +147,13 @@ info: url: "https://api.koios.rest/images/koios.png" servers: - url: https://api.koios.rest/api/v1 + description: Mainnet - url: https://guild.koios.rest/api/v1 + description: Guildnet - url: https://preview.koios.rest/api/v1 + description: Preview Network - url: https://preprod.koios.rest/api/v1 + description: Preprod Network paths: /tip: #RPC @@ -3828,9 +3832,28 @@ components: - $ref: "#/components/schemas/tx_info/items/properties/outputs" collateral_output: description: A collateral output for change if the smart contract fails to execute and collateral inputs are spent. (CIP-40) - anyOf: - - type: 'null' - - $ref: "#/components/schemas/tx_info/items/properties/outputs/items" + type: array + items: + properties: + payment_addr: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/payment_addr" + stake_addr: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/stake_addr" + tx_hash: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/tx_hash" + tx_index: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/tx_index" + value: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/value" + datum_hash: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/datum_hash" + inline_datum: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/inline_datum" + reference_script: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/reference_script" + asset_list: + type: array + description: Brief asset description from ledger reference_inputs: description: An array of reference inputs. A reference input allows looking at an output without spending it. (CIP-31) anyOf: @@ -4636,4 +4659,5 @@ tags: - [evaluateTransaction](https://ogmios.dev/mini-protocols/local-tx-submission/#evaluating-transactions) x-tag-expanded: true security: + - [] - bearerAuth: [] diff --git a/specs/results/koiosapi-preprod.yaml b/specs/results/koiosapi-preprod.yaml index ba8040bd..0162a0b3 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.1.2 + version: v1.1.3 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. @@ -130,7 +130,7 @@ info: - Burst Limit: A single IP can query an endpoint up to 100 times within 10 seconds (that's about 8.64 million requests within a day). The sleep time if a limit is crossed is minimal (60 seconds) for that IP - during which, the monitoring layer will return HTTP Status `429 - Too many requests`. - Pagination/Limits: Any query results fetched will be paginated by 1000 records (you can reduce limit and or control pagination offsets on URL itself, see API > Pagination section for more details). - Query timeout: If a query from server takes more than 30 seconds, it will return a HTTP Status of `504 - Gateway timeout`. This is because we would want to ensure you're using the queries optimally, and more often than not - it would indicate that particular endpoint is not optimised (or the network connectivity is not optimal between servers). - - Payload size limit: Koios supports sending bulk objects to reduce networking costs as well as number of calls users spent. However, this can also become an easy attack surface. Thus, we've had to add a strict limit for request body size to be limited to 5kb. + - Payload size limit: Koios supports sending bulk objects to reduce networking costs as well as number of calls users spent. However, this can also become an easy attack surface. Thus, we've had to add a strict limit for request body size to be limited to 1kb for public and 5kb for registered tiers. Yet, there may be cases where the above restrictions may need exceptions (for example, an explorer or a wallet might need more connections than above - going beyond the Burst Limit). For such cases, it is best to approach the team and we can work towards a solution. @@ -147,9 +147,13 @@ info: url: "https://api.koios.rest/images/koios.png" servers: - url: https://api.koios.rest/api/v1 + description: Mainnet - url: https://guild.koios.rest/api/v1 + description: Guildnet - url: https://preview.koios.rest/api/v1 + description: Preview Network - url: https://preprod.koios.rest/api/v1 + description: Preprod Network paths: /tip: #RPC @@ -3828,9 +3832,28 @@ components: - $ref: "#/components/schemas/tx_info/items/properties/outputs" collateral_output: description: A collateral output for change if the smart contract fails to execute and collateral inputs are spent. (CIP-40) - anyOf: - - type: 'null' - - $ref: "#/components/schemas/tx_info/items/properties/outputs/items" + type: array + items: + properties: + payment_addr: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/payment_addr" + stake_addr: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/stake_addr" + tx_hash: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/tx_hash" + tx_index: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/tx_index" + value: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/value" + datum_hash: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/datum_hash" + inline_datum: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/inline_datum" + reference_script: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/reference_script" + asset_list: + type: array + description: Brief asset description from ledger reference_inputs: description: An array of reference inputs. A reference input allows looking at an output without spending it. (CIP-31) anyOf: @@ -4636,4 +4659,5 @@ tags: - [evaluateTransaction](https://ogmios.dev/mini-protocols/local-tx-submission/#evaluating-transactions) x-tag-expanded: true security: + - [] - bearerAuth: [] diff --git a/specs/results/koiosapi-preview.yaml b/specs/results/koiosapi-preview.yaml index 2df64d56..c7fa6044 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.1.2 + version: v1.1.3 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. @@ -130,7 +130,7 @@ info: - Burst Limit: A single IP can query an endpoint up to 100 times within 10 seconds (that's about 8.64 million requests within a day). The sleep time if a limit is crossed is minimal (60 seconds) for that IP - during which, the monitoring layer will return HTTP Status `429 - Too many requests`. - Pagination/Limits: Any query results fetched will be paginated by 1000 records (you can reduce limit and or control pagination offsets on URL itself, see API > Pagination section for more details). - Query timeout: If a query from server takes more than 30 seconds, it will return a HTTP Status of `504 - Gateway timeout`. This is because we would want to ensure you're using the queries optimally, and more often than not - it would indicate that particular endpoint is not optimised (or the network connectivity is not optimal between servers). - - Payload size limit: Koios supports sending bulk objects to reduce networking costs as well as number of calls users spent. However, this can also become an easy attack surface. Thus, we've had to add a strict limit for request body size to be limited to 5kb. + - Payload size limit: Koios supports sending bulk objects to reduce networking costs as well as number of calls users spent. However, this can also become an easy attack surface. Thus, we've had to add a strict limit for request body size to be limited to 1kb for public and 5kb for registered tiers. Yet, there may be cases where the above restrictions may need exceptions (for example, an explorer or a wallet might need more connections than above - going beyond the Burst Limit). For such cases, it is best to approach the team and we can work towards a solution. @@ -147,9 +147,13 @@ info: url: "https://api.koios.rest/images/koios.png" servers: - url: https://api.koios.rest/api/v1 + description: Mainnet - url: https://guild.koios.rest/api/v1 + description: Guildnet - url: https://preview.koios.rest/api/v1 + description: Preview Network - url: https://preprod.koios.rest/api/v1 + description: Preprod Network paths: /tip: #RPC @@ -3828,9 +3832,28 @@ components: - $ref: "#/components/schemas/tx_info/items/properties/outputs" collateral_output: description: A collateral output for change if the smart contract fails to execute and collateral inputs are spent. (CIP-40) - anyOf: - - type: 'null' - - $ref: "#/components/schemas/tx_info/items/properties/outputs/items" + type: array + items: + properties: + payment_addr: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/payment_addr" + stake_addr: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/stake_addr" + tx_hash: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/tx_hash" + tx_index: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/tx_index" + value: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/value" + datum_hash: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/datum_hash" + inline_datum: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/inline_datum" + reference_script: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/reference_script" + asset_list: + type: array + description: Brief asset description from ledger reference_inputs: description: An array of reference inputs. A reference input allows looking at an output without spending it. (CIP-31) anyOf: @@ -4636,4 +4659,5 @@ tags: - [evaluateTransaction](https://ogmios.dev/mini-protocols/local-tx-submission/#evaluating-transactions) x-tag-expanded: true security: + - [] - bearerAuth: [] diff --git a/specs/templates/1-api-info.yaml b/specs/templates/1-api-info.yaml index d8a9efd6..7f1afd42 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.1.2 + version: v1.1.3 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. @@ -129,7 +129,7 @@ info: - Burst Limit: A single IP can query an endpoint up to 100 times within 10 seconds (that's about 8.64 million requests within a day). The sleep time if a limit is crossed is minimal (60 seconds) for that IP - during which, the monitoring layer will return HTTP Status `429 - Too many requests`. - Pagination/Limits: Any query results fetched will be paginated by 1000 records (you can reduce limit and or control pagination offsets on URL itself, see API > Pagination section for more details). - Query timeout: If a query from server takes more than 30 seconds, it will return a HTTP Status of `504 - Gateway timeout`. This is because we would want to ensure you're using the queries optimally, and more often than not - it would indicate that particular endpoint is not optimised (or the network connectivity is not optimal between servers). - - Payload size limit: Koios supports sending bulk objects to reduce networking costs as well as number of calls users spent. However, this can also become an easy attack surface. Thus, we've had to add a strict limit for request body size to be limited to 5kb. + - Payload size limit: Koios supports sending bulk objects to reduce networking costs as well as number of calls users spent. However, this can also become an easy attack surface. Thus, we've had to add a strict limit for request body size to be limited to 1kb for public and 5kb for registered tiers. Yet, there may be cases where the above restrictions may need exceptions (for example, an explorer or a wallet might need more connections than above - going beyond the Burst Limit). For such cases, it is best to approach the team and we can work towards a solution. diff --git a/specs/templates/4-api-schemas.yaml b/specs/templates/4-api-schemas.yaml index 5efd7665..6baa856b 100644 --- a/specs/templates/4-api-schemas.yaml +++ b/specs/templates/4-api-schemas.yaml @@ -1467,9 +1467,28 @@ schemas: - $ref: "#/components/schemas/tx_info/items/properties/outputs" collateral_output: description: A collateral output for change if the smart contract fails to execute and collateral inputs are spent. (CIP-40) - anyOf: - - type: 'null' - - $ref: "#/components/schemas/tx_info/items/properties/outputs/items" + type: array + items: + properties: + payment_addr: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/payment_addr" + stake_addr: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/stake_addr" + tx_hash: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/tx_hash" + tx_index: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/tx_index" + value: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/value" + datum_hash: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/datum_hash" + inline_datum: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/inline_datum" + reference_script: + $ref: "#/components/schemas/tx_info/items/properties/outputs/items/properties/reference_script" + asset_list: + type: array + description: Brief asset description from ledger reference_inputs: description: An array of reference inputs. A reference input allows looking at an output without spending it. (CIP-31) anyOf: diff --git a/specs/templates/api-main.yaml b/specs/templates/api-main.yaml index 59101003..caadb6e5 100644 --- a/specs/templates/api-main.yaml +++ b/specs/templates/api-main.yaml @@ -2,9 +2,13 @@ openapi: 3.1.0 #!info!# servers: - url: https://api.koios.rest/api/v1 + description: Mainnet - url: https://guild.koios.rest/api/v1 + description: Guildnet - url: https://preview.koios.rest/api/v1 + description: Preview Network - url: https://preprod.koios.rest/api/v1 + description: Preprod Network paths: /tip: #RPC @@ -1627,4 +1631,5 @@ tags: - [evaluateTransaction](https://ogmios.dev/mini-protocols/local-tx-submission/#evaluating-transactions) x-tag-expanded: true security: + - [] - bearerAuth: []