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

Add getBlockWithReceipts method #189

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions api/starknet_api_openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,43 @@
}
]
},
{
"name": "starknet_getBlockWithReceipts",
"summary": "Get block information with full transactions and receipts given the block id",
"params": [
{
"name": "block_id",
"description": "The hash of the requested block, or number (height) of the requested block, or a block tag",
"required": true,
"schema": {
"title": "Block id",
"$ref": "#/components/schemas/BLOCK_ID"
}
}
],
"result": {
"name": "result",
"description": "The resulting block information with full transactions",
"schema": {
"title": "Starknet get block with txs and receipts result",
"oneOf": [
{
"title": "Block with transactions",
"$ref": "#/components/schemas/BLOCK_WITH_RECEIPTS"
},
{
"title": "Pending block with transactions",
"$ref": "#/components/schemas/PENDING_BLOCK_WITH_RECEIPTS"
}
]
}
},
"errors": [
{
"$ref": "#/components/errors/BLOCK_NOT_FOUND"
}
]
},
{
"name": "starknet_getStateUpdate",
"summary": "Get the information about the result of executing the requested block",
Expand Down Expand Up @@ -1372,6 +1409,42 @@
"transactions"
]
},
"BLOCK_BODY_WITH_RECEIPTS": {
"title": "Block body with transactions and receipts",
"type": "object",
"properties": {
"transactions": {
"title": "Transactions",
"description": "The transactions in this block",
"type": "array",
"items": {
"title": "transactions in block",
"type": "object",
"allOf": [
{
"title": "transaction",
"$ref": "#/components/schemas/TXN"
},
{
"type": "object",
"properties": {
"receipt": {
"title": "receipt",
"$ref": "#/components/schemas/TXN_RECEIPT"
}
},
"required": [
"receipt"
]
}
]
}
}
},
"required": [
"transactions"
]
},
"BLOCK_HEADER": {
"title": "Block header",
"type": "object",
Expand Down Expand Up @@ -1528,6 +1601,33 @@
}
]
},
"BLOCK_WITH_RECEIPTS": {
"title": "Block with transactions and receipts",
"description": "The block object",
"allOf": [
{
"title": "block with txs",
"type": "object",
"properties": {
"status": {
"title": "Status",
"$ref": "#/components/schemas/BLOCK_STATUS"
}
},
"required": [
"status"
]
},
{
"title": "Block header",
"$ref": "#/components/schemas/BLOCK_HEADER"
},
{
"title": "Block body with transactions and receipts",
"$ref": "#/components/schemas/BLOCK_BODY_WITH_RECEIPTS"
}
]
},
"PENDING_BLOCK_WITH_TX_HASHES": {
"title": "Pending block with transaction hashes",
"description": "The dynamic block being constructed by the sequencer. Note that this object will be deprecated upon decentralization.",
Expand Down Expand Up @@ -1556,6 +1656,20 @@
}
]
},
"PENDING_BLOCK_WITH_RECEIPTS": {
"title": "Pending block with transactions and receipts",
"description": "The dynamic block being constructed by the sequencer. Note that this object will be deprecated upon decentralization.",
"allOf": [
{
"title": "Block body with transactions and receipts",
"$ref": "#/components/schemas/BLOCK_BODY_WITH_RECEIPTS"
},
{
"title": "Pending block header",
"$ref": "#/components/schemas/PENDING_BLOCK_HEADER"
}
]
},
"DEPLOYED_CONTRACT_ITEM": {
"title": "Deployed contract item",
"type": "object",
Expand Down
Loading