Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

algod: Add API Endpoint to fetch TxIDs from block #5611

Merged
merged 12 commits into from
Aug 9, 2023
76 changes: 76 additions & 0 deletions daemon/algod/api/algod.oas2.json
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,64 @@
}
]
},
"/v2/blocks/{round}/txids": {
"get": {
"tags": [
"public",
"nonparticipating"
],
"produces": [
"application/json"
],
"schemes": [
"http"
],
"summary": "Get the top level transaction IDs for the block on the given round.",
"operationId": "GetBlockTxids",
"parameters": [
{
"minimum": 0,
"type": "integer",
"description": "The round from which to fetch block transaction IDs.",
"name": "round",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/BlockTxidsResponse"
},
"400": {
"description": "Bad Request - Non integer number",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"401": {
"description": "Invalid API Token",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"404": {
"description": "Non existing block",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"500": {
"description": "Internal Error",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"default": {
"description": "Unknown Error"
}
}
}
},
"/v2/blocks/{round}/hash": {
"get": {
"tags": [
Expand Down Expand Up @@ -4350,6 +4408,24 @@
}
}
},
"BlockTxidsResponse": {
"description": "Top level transaction IDs in a block.",
"schema": {
"type": "object",
"required": [
"blockTxids"
],
"properties": {
"blockTxids": {
"description": "Block transaction IDs.",
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"BlockHashResponse": {
"description": "Hash of a block header.",
"schema": {
Expand Down
112 changes: 112 additions & 0 deletions daemon/algod/api/algod.oas3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,28 @@
},
"description": "Encoded block object."
},
"BlockTxidsResponse": {
"content": {
"application/json": {
"schema": {
"properties": {
"blockTxids": {
"description": "Block transaction IDs.",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"blockTxids"
],
"type": "object"
}
}
},
"description": "Top level transaction IDs in a block."
},
"BoxResponse": {
"content": {
"application/json": {
Expand Down Expand Up @@ -3817,6 +3839,96 @@
]
}
},
"/v2/blocks/{round}/txids": {
"get": {
"operationId": "GetBlockTxids",
"parameters": [
{
"description": "The round from which to fetch block transaction IDs.",
"in": "path",
"name": "round",
"required": true,
"schema": {
"minimum": 0,
"type": "integer"
}
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"blockTxids": {
"description": "Block transaction IDs.",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"blockTxids"
],
"type": "object"
}
}
},
"description": "Top level transaction IDs in a block."
},
"400": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Bad Request - Non integer number"
},
"401": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Invalid API Token"
},
"404": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Non existing block"
},
"500": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ErrorResponse"
}
}
},
"description": "Internal Error"
},
"default": {
"content": {},
"description": "Unknown Error"
}
},
"summary": "Get the top level transaction IDs for the block on the given round.",
"tags": [
"public",
"nonparticipating"
]
}
},
"/v2/catchup/{catchpoint}": {
"delete": {
"description": "Given a catchpoint, it aborts catching up to this catchpoint",
Expand Down