Skip to content

Commit

Permalink
drafting ws api
Browse files Browse the repository at this point in the history
  • Loading branch information
amanusk authored and ArielElp committed Sep 19, 2024
1 parent 2ef59c0 commit 997b7f4
Show file tree
Hide file tree
Showing 6 changed files with 862 additions and 531 deletions.
159 changes: 86 additions & 73 deletions api/starknet_api_openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -239,24 +239,7 @@
"result": {
"name": "result",
"schema": {
"title": "Transaction status",
"type": "object",
"properties": {
"finality_status": {
"title": "finality status",
"$ref": "#/components/schemas/TXN_STATUS"
},
"execution_status": {
"title": "execution status",
"$ref": "#/components/schemas/TXN_EXECUTION_STATUS"
},
"failure_reason": {
"title": "failure reason",
"description": "the failure reason, only appears if finality_status is REJECTED or execution_status is REVERTED",
"type": "string"
}
},
"required": ["finality_status"]
"$ref": "#/components/schemas/TXN_STATUS_RESULT"
}
},
"errors": [
Expand All @@ -266,50 +249,50 @@
]
},
{
"name": "starknet_getMessagesStatus",
"summary": "Given an l1 tx hash, returns the associated l1_handler tx hashes and statuses for all L1 -> L2 messages sent by the l1 ransaction, ordered by the l1 tx sending order",
"paramStructure": "by-name",
"params": [
{
"name": "transaction_hash",
"summary": "The hash of the L1 transaction that sent L1->L2 messages",
"required": true,
"schema": {
"title": "Transaction hash",
"$ref": "#/components/schemas/L1_TXN_HASH"
}
}
],
"result": {
"name": "result",
"schema": {
"type": "array",
"items": {
"type": "object",
"title": "status",
"properties": {
"transaction_hash": {
"$ref": "#/components/schemas/TXN_HASH"
},
"finality_status": {
"title": "finality status",
"$ref": "#/components/schemas/TXN_STATUS"
},
"failure_reason": {
"title": "failure reason",
"description": "the failure reason, only appears if finality_status is REJECTED",
"type": "string"
}
},
"required": ["transaction_hash", "finality_status"]
}
}
},
"errors": [
{
"$ref": "#/components/errors/TXN_HASH_NOT_FOUND"
}
]
"name": "starknet_getMessagesStatus",
"summary": "Given an l1 tx hash, returns the associated l1_handler tx hashes and statuses for all L1 -> L2 messages sent by the l1 ransaction, ordered by the l1 tx sending order",
"paramStructure": "by-name",
"params": [
{
"name": "transaction_hash",
"summary": "The hash of the L1 transaction that sent L1->L2 messages",
"required": true,
"schema": {
"title": "Transaction hash",
"$ref": "#/components/schemas/L1_TXN_HASH"
}
}
],
"result": {
"name": "result",
"schema": {
"type": "array",
"items": {
"type": "object",
"title": "status",
"properties": {
"transaction_hash": {
"$ref": "#/components/schemas/TXN_HASH"
},
"finality_status": {
"title": "finality status",
"$ref": "#/components/schemas/TXN_STATUS"
},
"failure_reason": {
"title": "failure reason",
"description": "the failure reason, only appears if finality_status is REJECTED",
"type": "string"
}
},
"required": ["transaction_hash", "finality_status"]
}
}
},
"errors": [
{
"$ref": "#/components/errors/TXN_HASH_NOT_FOUND"
}
]
},
{
"name": "starknet_getTransactionByHash",
Expand Down Expand Up @@ -1113,6 +1096,19 @@
},
"required": ["keys", "data"]
},
"EVENT_KEYS": {
"title": "Keys",
"description": "The keys to filter over",
"type": "array",
"items": {
"title": "Keys",
"description": "Per key (by position), designate the possible values to be matched for events to be returned. Empty array designates 'any' value",
"type": "array",
"items": {
"$ref": "#/components/schemas/FELT"
}
}
},
"EVENT_FILTER": {
"title": "Event filter",
"description": "An event filter/query",
Expand All @@ -1131,17 +1127,10 @@
"$ref": "#/components/schemas/ADDRESS"
},
"keys": {
"title": "Keys",
"description": "The values used to filter the events",
"type": "array",
"items": {
"title": "Keys",
"description": "Per key (by position), designate the possible values to be matched for events to be returned. Empty array designates 'any' value",
"type": "array",
"items": {
"$ref": "#/components/schemas/FELT"
}
}
"title": "event keys",
"description": "The keys to filter over",
"$ref": "#/components/schemas/EVENT_KEYS"

}
},
"required": []
Expand Down Expand Up @@ -3106,6 +3095,30 @@
},
"required": ["from_address", "to_address", "payload", "entry_point_selector"]
},
"TXN_STATUS_RESULT": {
"title": "Transaction status result",
"description": "Transaction status result, including finality status and execution status",
"schema": {
"title": "Transaction status result",
"type": "object",
"properties": {
"finality_status": {
"title": "finality status",
"$ref": "#/components/schemas/TXN_STATUS"
},
"execution_status": {
"title": "execution status",
"$ref": "#/components/schemas/TXN_EXECUTION_STATUS"
},
"failure_reason": {
"title": "failure reason",
"description": "the failure reason, only appears if finality_status is REJECTED or execution_status is REVERTED",
"type": "string"
}
},
"required": ["finality_status"]
}
},
"TXN_STATUS": {
"title": "Transaction status",
"type": "string",
Expand Down
16 changes: 8 additions & 8 deletions api/starknet_trace_api_openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"description": "Returns the execution trace of the transaction designated by the input hash",
"params": [
{
"name": "transaction_hash",
"name": "transaction_hash",
"summary": "The hash of the transaction to trace",
"required": true,
"schema": {
"$ref": "./starknet_api_openrpc.json#/components/schemas/TXN_HASH"
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/TXN_HASH"
}
}
],
Expand Down Expand Up @@ -421,22 +421,22 @@
]
},
"FELT": {
"$ref": "./starknet_api_openrpc.json#/components/schemas/FELT"
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/FELT"
},
"FUNCTION_CALL": {
"$ref": "./starknet_api_openrpc.json#/components/schemas/FUNCTION_CALL"
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/FUNCTION_CALL"
},
"EVENT": {
"$ref": "./starknet_api_openrpc.json#/components/schemas/EVENT_CONTENT"
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/EVENT_CONTENT"
},
"MSG_TO_L1": {
"$ref": "./starknet_api_openrpc.json#/components/schemas/MSG_TO_L1"
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/MSG_TO_L1"
},
"BLOCK_ID": {
"$ref": "./starknet_api_openrpc.json#/components/schemas/BLOCK_ID"
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/BLOCK_ID"
},
"FEE_ESTIMATE": {
"$ref": "./starknet_api_openrpc.json#/components/schemas/FEE_ESTIMATE"
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/FEE_ESTIMATE"
},
"BROADCASTED_TXN": {
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/BROADCASTED_TXN"
Expand Down
8 changes: 4 additions & 4 deletions api/starknet_write_api.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,13 @@
"pattern": "^0x[a-fA-F0-9]+$"
},
"SIGNATURE": {
"$ref": "./starknet_api_openrpc.json#/components/schemas/SIGNATURE"
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/SIGNATURE"
},
"FELT": {
"$ref": "./starknet_api_openrpc.json#/components/schemas/FELT"
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/FELT"
},
"TXN_HASH": {
"$ref": "./starknet_api_openrpc.json#/components/schemas/TXN_HASH"
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/TXN_HASH"
},
"BROADCASTED_INVOKE_TXN": {
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/BROADCASTED_INVOKE_TXN"
Expand All @@ -224,7 +224,7 @@
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/BROADCASTED_DEPLOY_ACCOUNT_TXN"
},
"FUNCTION_CALL": {
"$ref": "./starknet_api_openrpc.json#/components/schemas/FUNCTION_CALL"
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/FUNCTION_CALL"
}
},
"errors": {
Expand Down
Loading

0 comments on commit 997b7f4

Please sign in to comment.