Skip to content

Commit

Permalink
fix receipt and pending receipt schema (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShahakShama committed Mar 3, 2024
1 parent 53c4e55 commit 7ae9e7b
Showing 1 changed file with 23 additions and 216 deletions.
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 @@ -2870,17 +2862,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 @@ -2913,8 +2897,6 @@
"actual_fee",
"finality_status",
"execution_status",
"block_hash",
"block_number",
"messages_sent",
"events",
"execution_resources"
Expand Down Expand Up @@ -2945,31 +2927,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 @@ -2995,31 +2952,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 @@ -3051,37 +2983,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 @@ -3145,38 +3046,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 @@ -3202,91 +3071,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 @@ -4140,4 +3947,4 @@
}
}
}
}
}

0 comments on commit 7ae9e7b

Please sign in to comment.