Skip to content

Commit 5a5655f

Browse files
Merge pull request #403 from blockfrost/chore/blocks-txs-cbor
chore: /blocks/:hash_or_number/txs/cbor
2 parents 70ee53a + 9576150 commit 5a5655f

11 files changed

Lines changed: 633 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ Unreleased changes are in the `master` branch.
99

1010
## [Unreleased]
1111

12+
### Added
13+
14+
- `/blocks/:hash_or_number/txs/cbor` endpoint
15+
1216
## [0.1.74] - 2025-03-13
1317

1418
### Added

blockfrost-openapi.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,71 @@ paths:
796796
$ref: '#/components/responses/429'
797797
'500':
798798
$ref: '#/components/responses/500'
799+
/blocks/{hash_or_number}/txs/cbor:
800+
get:
801+
tags:
802+
- Cardano » Blocks
803+
summary: Block transactions with CBOR data
804+
description: Return the transactions within the block, including CBOR representations.
805+
parameters:
806+
- in: path
807+
name: hash_or_number
808+
required: true
809+
schema:
810+
type: string
811+
format: 64-character case-sensitive hexadecimal string or block number.
812+
description: Hash of the requested block.
813+
example: '4873401'
814+
- in: query
815+
name: count
816+
required: false
817+
schema:
818+
type: integer
819+
minimum: 1
820+
maximum: 100
821+
default: 100
822+
description: The number of results displayed on one page.
823+
- in: query
824+
name: page
825+
required: false
826+
schema:
827+
type: integer
828+
minimum: 1
829+
maximum: 21474836
830+
default: 1
831+
description: The page number for listing the results.
832+
- in: query
833+
name: order
834+
required: false
835+
schema:
836+
type: string
837+
enum:
838+
- asc
839+
- desc
840+
default: asc
841+
description: |
842+
Ordered by tx index in the block.
843+
The ordering of items from the point of view of the blockchain,
844+
not the page listing itself. By default, we return oldest first, newest last.
845+
responses:
846+
'200':
847+
description: Return the contents of the block with CBOR data
848+
content:
849+
application/json:
850+
schema:
851+
$ref: '#/components/schemas/block_content_txs_cbor'
852+
'400':
853+
$ref: '#/components/responses/400'
854+
'403':
855+
$ref: '#/components/responses/403'
856+
'404':
857+
$ref: '#/components/responses/404'
858+
'418':
859+
$ref: '#/components/responses/418'
860+
'429':
861+
$ref: '#/components/responses/429'
862+
'500':
863+
$ref: '#/components/responses/500'
799864
/blocks/{hash_or_number}/addresses:
800865
get:
801866
tags:

docs/blockfrost-openapi.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,76 @@ paths:
884884
$ref: '#/components/responses/429'
885885
'500':
886886
$ref: '#/components/responses/500'
887+
'/blocks/{hash_or_number}/txs/cbor':
888+
get:
889+
tags:
890+
- Cardano » Blocks
891+
summary: Block transactions with CBOR data
892+
description: >-
893+
Return the transactions within the block, including CBOR
894+
representations.
895+
parameters:
896+
- in: path
897+
name: hash_or_number
898+
required: true
899+
schema:
900+
type: string
901+
format: 64-character case-sensitive hexadecimal string or block number.
902+
description: Hash of the requested block.
903+
example: '4873401'
904+
- in: query
905+
name: count
906+
required: false
907+
schema:
908+
type: integer
909+
minimum: 1
910+
maximum: 100
911+
default: 100
912+
description: The number of results displayed on one page.
913+
- in: query
914+
name: page
915+
required: false
916+
schema:
917+
type: integer
918+
minimum: 1
919+
maximum: 21474836
920+
default: 1
921+
description: The page number for listing the results.
922+
- in: query
923+
name: order
924+
required: false
925+
schema:
926+
type: string
927+
enum:
928+
- asc
929+
- desc
930+
default: asc
931+
description: >
932+
Ordered by tx index in the block.
933+
934+
The ordering of items from the point of view of the blockchain,
935+
936+
not the page listing itself. By default, we return oldest first,
937+
newest last.
938+
responses:
939+
'200':
940+
description: Return the contents of the block with CBOR data
941+
content:
942+
application/json:
943+
schema:
944+
$ref: '#/components/schemas/block_content_txs_cbor'
945+
'400':
946+
$ref: '#/components/responses/400'
947+
'403':
948+
$ref: '#/components/responses/403'
949+
'404':
950+
$ref: '#/components/responses/404'
951+
'418':
952+
$ref: '#/components/responses/418'
953+
'429':
954+
$ref: '#/components/responses/429'
955+
'500':
956+
$ref: '#/components/responses/500'
887957
'/blocks/{hash_or_number}/addresses':
888958
get:
889959
tags:

json-schema.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

openapi.json

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,96 @@
850850
}
851851
}
852852
},
853+
"/blocks/{hash_or_number}/txs/cbor": {
854+
"get": {
855+
"tags": [
856+
"Cardano » Blocks"
857+
],
858+
"summary": "Block transactions with CBOR data",
859+
"description": "Return the transactions within the block, including CBOR representations.",
860+
"parameters": [
861+
{
862+
"in": "path",
863+
"name": "hash_or_number",
864+
"required": true,
865+
"schema": {
866+
"type": "string",
867+
"format": "64-character case-sensitive hexadecimal string or block number."
868+
},
869+
"description": "Hash of the requested block.",
870+
"example": "4873401"
871+
},
872+
{
873+
"in": "query",
874+
"name": "count",
875+
"required": false,
876+
"schema": {
877+
"type": "integer",
878+
"minimum": 1,
879+
"maximum": 100,
880+
"default": 100
881+
},
882+
"description": "The number of results displayed on one page."
883+
},
884+
{
885+
"in": "query",
886+
"name": "page",
887+
"required": false,
888+
"schema": {
889+
"type": "integer",
890+
"minimum": 1,
891+
"maximum": 21474836,
892+
"default": 1
893+
},
894+
"description": "The page number for listing the results."
895+
},
896+
{
897+
"in": "query",
898+
"name": "order",
899+
"required": false,
900+
"schema": {
901+
"type": "string",
902+
"enum": [
903+
"asc",
904+
"desc"
905+
],
906+
"default": "asc"
907+
},
908+
"description": "Ordered by tx index in the block.\nThe ordering of items from the point of view of the blockchain,\nnot the page listing itself. By default, we return oldest first, newest last.\n"
909+
}
910+
],
911+
"responses": {
912+
"200": {
913+
"description": "Return the contents of the block with CBOR data",
914+
"content": {
915+
"application/json": {
916+
"schema": {
917+
"$ref": "#/components/schemas/block_content_txs_cbor"
918+
}
919+
}
920+
}
921+
},
922+
"400": {
923+
"$ref": "#/components/responses/400"
924+
},
925+
"403": {
926+
"$ref": "#/components/responses/403"
927+
},
928+
"404": {
929+
"$ref": "#/components/responses/404"
930+
},
931+
"418": {
932+
"$ref": "#/components/responses/418"
933+
},
934+
"429": {
935+
"$ref": "#/components/responses/429"
936+
},
937+
"500": {
938+
"$ref": "#/components/responses/500"
939+
}
940+
}
941+
}
942+
},
853943
"/blocks/{hash_or_number}/addresses": {
854944
"get": {
855945
"tags": [

openapi.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,76 @@ paths:
884884
$ref: '#/components/responses/429'
885885
'500':
886886
$ref: '#/components/responses/500'
887+
'/blocks/{hash_or_number}/txs/cbor':
888+
get:
889+
tags:
890+
- Cardano » Blocks
891+
summary: Block transactions with CBOR data
892+
description: >-
893+
Return the transactions within the block, including CBOR
894+
representations.
895+
parameters:
896+
- in: path
897+
name: hash_or_number
898+
required: true
899+
schema:
900+
type: string
901+
format: 64-character case-sensitive hexadecimal string or block number.
902+
description: Hash of the requested block.
903+
example: '4873401'
904+
- in: query
905+
name: count
906+
required: false
907+
schema:
908+
type: integer
909+
minimum: 1
910+
maximum: 100
911+
default: 100
912+
description: The number of results displayed on one page.
913+
- in: query
914+
name: page
915+
required: false
916+
schema:
917+
type: integer
918+
minimum: 1
919+
maximum: 21474836
920+
default: 1
921+
description: The page number for listing the results.
922+
- in: query
923+
name: order
924+
required: false
925+
schema:
926+
type: string
927+
enum:
928+
- asc
929+
- desc
930+
default: asc
931+
description: >
932+
Ordered by tx index in the block.
933+
934+
The ordering of items from the point of view of the blockchain,
935+
936+
not the page listing itself. By default, we return oldest first,
937+
newest last.
938+
responses:
939+
'200':
940+
description: Return the contents of the block with CBOR data
941+
content:
942+
application/json:
943+
schema:
944+
$ref: '#/components/schemas/block_content_txs_cbor'
945+
'400':
946+
$ref: '#/components/responses/400'
947+
'403':
948+
$ref: '#/components/responses/403'
949+
'404':
950+
$ref: '#/components/responses/404'
951+
'418':
952+
$ref: '#/components/responses/418'
953+
'429':
954+
$ref: '#/components/responses/429'
955+
'500':
956+
$ref: '#/components/responses/500'
887957
'/blocks/{hash_or_number}/addresses':
888958
get:
889959
tags:

src/definitions.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,10 @@ paths:
331331
$ref: ./paths/api/blocks/epoch/{epoch_number}/slot/{slot_number}/index.yaml
332332

333333
/blocks/{hash_or_number}/txs:
334-
$ref: ./paths/api/blocks/txs/index.yaml
334+
$ref: ./paths/api/blocks/{hash_or_number}/txs/index.yaml
335+
336+
/blocks/{hash_or_number}/txs/cbor:
337+
$ref: ./paths/api/blocks/{hash_or_number}/txs/cbor.yaml
335338

336339
/blocks/{hash_or_number}/addresses:
337340
$ref: ./paths/api/blocks/addresses/index.yaml

0 commit comments

Comments
 (0)