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

fix receipt and pending receipt schema #195

Merged
merged 1 commit into from
Mar 3, 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
239 changes: 23 additions & 216 deletions api/starknet_api_openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -381,16 +381,8 @@
"result": {
"name": "result",
"schema": {
"oneOf": [
{
"title": "Transaction receipt",
"$ref": "#/components/schemas/TXN_RECEIPT"
},
{
"title": "Pending transaction receipt",
"$ref": "#/components/schemas/PENDING_TXN_RECEIPT"
}
]
"title": "Transaction receipt with block info",
"$ref": "#/components/schemas/TXN_RECEIPT_WITH_BLOCK_INFO"
}
},
"errors": [
Expand Down Expand Up @@ -1427,7 +1419,7 @@
},
"receipt": {
"title": "receipt",
"$ref": "#/components/schemas/TXN_RECEIPT_IN_BLOCK"
"$ref": "#/components/schemas/TXN_RECEIPT"
}
},
"required": [
Expand Down Expand Up @@ -2854,17 +2846,9 @@
},
"finality_status": {
"title": "Finality status",
"description": "finality status of the tx, which is ACCEPTED_ON_L2 when included in a pending receipt, and can be ACCEPTED_ON_L1 when part of a getBlockWithReceipts response",
"description": "finality status of the tx",
"$ref": "#/components/schemas/TXN_FINALITY_STATUS"
},
"block_hash": {
"title": "Block hash",
"$ref": "#/components/schemas/BLOCK_HASH"
},
"block_number": {
"title": "Block number",
"$ref": "#/components/schemas/BLOCK_NUMBER"
},
"messages_sent": {
"type": "array",
"title": "Messages sent",
Expand Down Expand Up @@ -2897,8 +2881,6 @@
"actual_fee",
"finality_status",
"execution_status",
"block_hash",
"block_number",
"messages_sent",
"events",
"execution_resources"
Expand Down Expand Up @@ -2929,31 +2911,6 @@
}
]
},
"PENDING_INVOKE_TXN_RECEIPT": {
"title": "Invoke Transaction Receipt",
"allOf": [
{
"title": "Type",
"type": "object",
"properties": {
"type": {
"title": "Type",
"type": "string",
"enum": [
"INVOKE"
]
}
},
"required": [
"type"
]
},
{
"title": "Common receipt properties",
"$ref": "#/components/schemas/PENDING_COMMON_RECEIPT_PROPERTIES"
}
]
},
"DECLARE_TXN_RECEIPT": {
"title": "Declare Transaction Receipt",
"allOf": [
Expand All @@ -2979,31 +2936,6 @@
}
]
},
"PENDING_DECLARE_TXN_RECEIPT": {
"title": "Declare Transaction Receipt",
"allOf": [
{
"title": "Declare txn receipt",
"type": "object",
"properties": {
"type": {
"title": "Declare",
"type": "string",
"enum": [
"DECLARE"
]
}
},
"required": [
"type"
]
},
{
"title": "Common receipt properties",
"$ref": "#/components/schemas/PENDING_COMMON_RECEIPT_PROPERTIES"
}
]
},
"DEPLOY_ACCOUNT_TXN_RECEIPT": {
"title": "Deploy Account Transaction Receipt",
"allOf": [
Expand Down Expand Up @@ -3035,37 +2967,6 @@
}
]
},
"PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT": {
"title": "Deploy Account Transaction Receipt",
"allOf": [
{
"title": "Common receipt properties",
"$ref": "#/components/schemas/PENDING_COMMON_RECEIPT_PROPERTIES"
},
{
"title": "DeployAccount txn receipt",
"type": "object",
"properties": {
"type": {
"title": "Deploy account",
"type": "string",
"enum": [
"DEPLOY_ACCOUNT"
]
},
"contract_address": {
"title": "Contract address",
"description": "The address of the deployed contract",
"$ref": "#/components/schemas/FELT"
}
},
"required": [
"type",
"contract_address"
]
}
]
},
"DEPLOY_TXN_RECEIPT": {
"title": "Deploy Transaction Receipt",
"allOf": [
Expand Down Expand Up @@ -3129,38 +3030,6 @@
}
]
},
"PENDING_L1_HANDLER_TXN_RECEIPT": {
"title": "L1 Handler Transaction Receipt",
"description": "receipt for l1 handler transaction",
"allOf": [
{
"title": "Transaction type",
"type": "object",
"properties": {
"type": {
"title": "type",
"type": "string",
"enum": [
"L1_HANDLER"
]
},
"message_hash": {
"title": "Message hash",
"description": "The message hash as it appears on the L1 core contract",
"$ref": "#/components/schemas/NUM_AS_HEX"
}
},
"required": [
"type",
"message_hash"
]
},
{
"title": "Common receipt properties",
"$ref": "#/components/schemas/PENDING_COMMON_RECEIPT_PROPERTIES"
}
]
},
"TXN_RECEIPT": {
"title": "Transaction Receipt",
"oneOf": [
Expand All @@ -3186,91 +3055,29 @@
}
]
},
"PENDING_TXN_RECEIPT": {
"title": "Transaction Receipt",
"oneOf": [
{
"title": "Pending Invoke transaction receipt",
"$ref": "#/components/schemas/PENDING_INVOKE_TXN_RECEIPT"
},
{
"title": "Pending L1 handler transaction receipt",
"$ref": "#/components/schemas/PENDING_L1_HANDLER_TXN_RECEIPT"
},
"TXN_RECEIPT_WITH_BLOCK_INFO": {
"title": "Transaction receipt with block info",
"allOf": [
{
"title": "Pending Declare transaction receipt",
"$ref": "#/components/schemas/PENDING_DECLARE_TXN_RECEIPT"
"title": "Transaction receipt",
"$ref": "#/components/schemas/TXN_RECEIPT"
},
{
"title": "Pending Deploy account transaction receipt",
"$ref": "#/components/schemas/PENDING_DEPLOY_ACCOUNT_TXN_RECEIPT"
}
]
},
"TXN_RECEIPT_IN_BLOCK": {
"title": "receipt in block",
"$ref": "#/components/schemas/PENDING_TXN_RECEIPT"
},
"PENDING_COMMON_RECEIPT_PROPERTIES": {
"title": "Pending common receipt properties",
"description": "Common properties for a pending transaction receipt",
"type": "object",
"properties": {
"transaction_hash": {
"title": "Transaction hash",
"$ref": "#/components/schemas/TXN_HASH",
"description": "The hash identifying the transaction"
},
"actual_fee": {
"title": "Actual fee",
"$ref": "#/components/schemas/FEE_PAYMENT",
"description": "The fee that was charged by the sequencer"
},
"messages_sent": {
"type": "array",
"title": "Messages sent",
"items": {
"$ref": "#/components/schemas/MSG_TO_L1"
}
},
"events": {
"description": "The events emitted as part of this transaction",
"title": "Events",
"type": "array",
"items": {
"$ref": "#/components/schemas/EVENT"
"type": "object",
"properties": {
"block_hash": {
"title": "Block hash",
"$ref": "#/components/schemas/BLOCK_HASH",
"description": "If this field is missing, it means the receipt belongs to the pending block"
},
"block_number": {
"title": "Block number",
"$ref": "#/components/schemas/BLOCK_NUMBER",
"description": "If this field is missing, it means the receipt belongs to the pending block"
}
}
},
"revert_reason": {
"title": "Revert reason",
"name": "revert reason",
"description": "the revert reason for the failed execution",
"type": "string"
},
"finality_status": {
"title": "Finality status",
"$ref": "#/components/schemas/TXN_FINALITY_STATUS"
},
"execution_status": {
"title": "Execution status",
"$ref": "#/components/schemas/TXN_EXECUTION_STATUS"
},
"execution_resources": {
"title": "Execution resources",
"description": "The resources consumed by the transaction",
"$ref": "#/components/schemas/EXECUTION_RESOURCES"
}
},
"required": [
"transaction_hash",
"actual_fee",
"messages_sent",
"events",
"finality_status",
"execution_status",
"execution_resources"
],
"additionalProperties": false
]
},
"MSG_TO_L1": {
"title": "Message to L1",
Expand Down Expand Up @@ -4124,4 +3931,4 @@
}
}
}
}
}
Loading