Skip to content

Commit

Permalink
Remove option for pending from all subsriptions (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
amanusk authored Jan 28, 2025
1 parent 28ad3f5 commit 64f3c16
Showing 1 changed file with 40 additions and 12 deletions.
52 changes: 40 additions & 12 deletions api/starknet_ws_api.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"summary": "The block to get notifications from, default is latest, limited to 1024 blocks back",
"required": false,
"schema": {
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/BLOCK_ID"
"$ref": "#/components/schemas/SUBSCRIPTION_BLOCK_ID"
}
}
],
Expand All @@ -32,9 +32,6 @@
},
{
"$ref": "./api/starknet_api_openrpc.json#/components/errors/BLOCK_NOT_FOUND"
},
{
"$ref": "#/components/errors/CALL_ON_PENDING"
}
]
},
Expand Down Expand Up @@ -85,7 +82,7 @@
"summary": "The block to get notifications from, default is latest, limited to 1024 blocks back",
"required": false,
"schema": {
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/BLOCK_ID"
"$ref": "#/components/schemas/SUBSCRIPTION_BLOCK_ID"
}
}
],
Expand All @@ -104,9 +101,6 @@
},
{
"$ref": "./api/starknet_api_openrpc.json#/components/errors/BLOCK_NOT_FOUND"
},
{
"$ref": "#/components/errors/CALL_ON_PENDING"
}
]
},
Expand Down Expand Up @@ -313,6 +307,44 @@
"type": "integer"
}
},
"SUBSCRIPTION_BLOCK_ID": {
"title": "Subscription Block id",
"description": "Block hash, number or tag, same as BLOCK_ID, but without 'pending'",
"oneOf": [
{
"title": "Block hash",
"type": "object",
"properties": {
"block_hash": {
"title": "Block hash",
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/BLOCK_HASH"
}
},
"required": ["block_hash"]
},
{
"title": "Block number",
"type": "object",
"properties": {
"block_number": {
"title": "Block number",
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/BLOCK_NUMBER"
}
},
"required": ["block_number"]
},
{
"title": "Block tag",
"$ref": "#/components/schemas/SUBSCRIPTION_BLOCK_TAG"
}
]
},
"SUBSCRIPTION_BLOCK_TAG": {
"title": "Subscription Block tag",
"type": "string",
"description": "Same as BLOCK_TAG, but without 'pending'",
"enum": ["latest"]
},
"REORG_DATA": {
"name": "Reorg Data",
"description": "Data about reorganized blocks, starting and ending block number and hash",
Expand Down Expand Up @@ -353,10 +385,6 @@
"TOO_MANY_BLOCKS_BACK": {
"code": 68,
"message": "Cannot go back more than 1024 blocks"
},
"CALL_ON_PENDING": {
"code": 69,
"message": "This method does not support being called on the pending block"
}
}
}
Expand Down

0 comments on commit 64f3c16

Please sign in to comment.