diff --git a/api/starknet_api_openrpc.json b/api/starknet_api_openrpc.json index fdbedc8..731ebe9 100644 --- a/api/starknet_api_openrpc.json +++ b/api/starknet_api_openrpc.json @@ -907,141 +907,136 @@ ] }, { - "name": "starknet_getStorageProof", - "summary": "Get merkle paths in one of the state tries: global state, classes, individual contract. A single request can query for any mix of the three types of storage proofs (classes, contracts, and storage).", - "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" - } - }, - { - "name": "class_hashes", - "description": "a list of the class hashes for which we want to prove membership in the classes trie", - "required": false, - "schema": { - "title": "classes", - "type": "array", - "items": { - "$ref": "#/components/schemas/FELT" - } - } - }, - { - "name": "contract_addresses", - "description": "a list of contracts for which we want to prove membership in the global state trie", - "required": false, - "schema": { - "title": "contracts", - "type": "array", - "items": { - "$ref": "#/components/schemas/ADDRESS" - } - } - }, - { - "name": "contracts_storage_keys", - "description": "a list of (contract_address, storage_keys) pairs", - "required": false, - "schema": { - "type": "array", - "items": { - "type": "object", - "properties": { - "contract_address": { - "$ref": "#/components/schemas/ADDRESS" - }, - "storage_keys": { - "type": "array", - "items": { - "$ref": "#/components/schemas/FELT" - } - } - }, - "required": ["contract_address", "storage_keys"] - } - } + "name": "starknet_getStorageProof", + "summary": "Get merkle paths in one of the state tries: global state, classes, individual contract. A single request can query for any mix of the three types of storage proofs (classes, contracts, and storage).", + "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" + } + }, + { + "name": "class_hashes", + "description": "a list of the class hashes for which we want to prove membership in the classes trie", + "required": false, + "schema": { + "title": "classes", + "type": "array", + "items": { + "$ref": "#/components/schemas/FELT" } - ], - "result": { - "name": "result", - "description": "The requested storage proofs. Note that if a requested leaf has the default value, the path to it may end in an edge node whose path is not a prefix of the requested leaf, thus effecitvely proving non-membership", + } + }, + { + "name": "contract_addresses", + "description": "a list of contracts for which we want to prove membership in the global state trie", + "required": false, "schema": { - "type": "object", - "properties": { - "classes_proof": { - "$ref": "#/components/schemas/NODE_HASH_TO_NODE_MAPPING" - }, - "contracts_proof": { - "type": "object", - "properties": { - "nodes": { - "description": "The nodes in the union of the paths from the contracts tree root to the requested leaves", - "$ref": "#/components/schemas/NODE_HASH_TO_NODE_MAPPING" - }, - "contract_leaves_data": { - "type": "array", - "items": { - "description": "The nonce and class hash for each requested contract address, in the order in which they appear in the request. These values are needed to construct the associated leaf node", - "type": "object", - "properties": { - "nonce": { - "$ref": "#/components/schemas/FELT" - }, - "class_hash": { - "$ref": "#/components/schemas/FELT" - } - }, - "required": ["nonce", "class_hash"] - } - } + "title": "contracts", + "type": "array", + "items": { + "$ref": "#/components/schemas/ADDRESS" + } + } + }, + { + "name": "contracts_storage_keys", + "description": "a list of (contract_address, storage_keys) pairs", + "required": false, + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "contract_address": { + "$ref": "#/components/schemas/ADDRESS" }, - "required": ["nodes", "contract_leaves_data"] - }, - "contracts_storage_proofs": { - "type": "array", - "items": { - "$ref": "#/components/schemas/NODE_HASH_TO_NODE_MAPPING" + "storage_keys": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FELT" + } } }, - "global_roots": { - "type": "object", - "properties": { - "contracts_tree_root": { + "required": ["contract_address", "storage_keys"] + } + } + } + ], + "result": { + "name": "result", + "description": "The requested storage proofs. Note that if a requested leaf has the default value, the path to it may end in an edge node whose path is not a prefix of the requested leaf, thus effecitvely proving non-membership", + "schema": { + "type": "object", + "properties": { + "classes_proof": { + "$ref": "#/components/schemas/NODE_HASH_TO_NODE_MAPPING" + }, + "contracts_proof": { + "type": "object", + "properties": { + "nodes": { + "description": "The nodes in the union of the paths from the contracts tree root to the requested leaves", + "$ref": "#/components/schemas/NODE_HASH_TO_NODE_MAPPING" + }, + "contract_leaves_data": { + "type": "array", + "items": { + "description": "The nonce and class hash for each requested contract address, in the order in which they appear in the request. These values are needed to construct the associated leaf node", + "type": "object", + "properties": { + "nonce": { "$ref": "#/components/schemas/FELT" - }, - "classes_tree_root": { + }, + "class_hash": { "$ref": "#/components/schemas/FELT" + } }, - "block_hash": { - "description": "the associated block hash (needed in case the caller used a block tag for the block_id parameter)", - "$ref": "#/components/schemas/FELT" - } - }, - "required": ["contracts_tree_root", "classes_tree_root", "block_hash"] - } + "required": ["nonce", "class_hash"] + } + } + }, + "required": ["nodes", "contract_leaves_data"] }, - "required": [ - "classes_proof", - "contracts_proof", - "contracts_storage_proofs", - "global_roots" - ] - }, - "errors": [ - { - "$ref": "#/components/errors/BLOCK_NOT_FOUND" + "contracts_storage_proofs": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NODE_HASH_TO_NODE_MAPPING" + } }, - { - "$ref": "#/components/errors/STORAGE_PROOF_NOT_SUPPORTED" + "global_roots": { + "type": "object", + "properties": { + "contracts_tree_root": { + "$ref": "#/components/schemas/FELT" + }, + "classes_tree_root": { + "$ref": "#/components/schemas/FELT" + }, + "block_hash": { + "description": "the associated block hash (needed in case the caller used a block tag for the block_id parameter)", + "$ref": "#/components/schemas/FELT" + } + }, + "required": ["contracts_tree_root", "classes_tree_root", "block_hash"] } - ] + }, + "required": ["classes_proof", "contracts_proof", "contracts_storage_proofs", "global_roots"] } - } + }, + "errors": [ + { + "$ref": "#/components/errors/BLOCK_NOT_FOUND" + }, + { + "$ref": "#/components/errors/STORAGE_PROOF_NOT_SUPPORTED" + } + ] + } ], "components": { "contentDescriptors": {}, @@ -1193,7 +1188,6 @@ "title": "event keys", "description": "The keys to filter over", "$ref": "#/components/schemas/EVENT_KEYS" - } }, "required": [] @@ -3179,9 +3173,9 @@ "$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" + "title": "failure reason", + "description": "the failure reason, only appears if finality_status is REJECTED or execution_status is REVERTED", + "type": "string" } }, "required": ["finality_status"] @@ -3701,26 +3695,26 @@ "title": "MP node", "description": "a node in the Merkle-Patricia tree, can be a leaf, binary node, or an edge node", "oneOf": [ - { - "$ref": "#/components/schemas/BINARY_NODE" - }, - { - "$ref": "#/components/schemas/EDGE_NODE" - } + { + "$ref": "#/components/schemas/BINARY_NODE" + }, + { + "$ref": "#/components/schemas/EDGE_NODE" + } ] }, "BINARY_NODE": { "type": "object", "description": "an internal node whose both children are non-zero", "properties": { - "left": { - "description": "the hash of the left child", - "$ref": "#/components/schemas/FELT" - }, - "right": { - "description": "the hash of the right child", - "$ref": "#/components/schemas/FELT" - } + "left": { + "description": "the hash of the left child", + "$ref": "#/components/schemas/FELT" + }, + "right": { + "description": "the hash of the right child", + "$ref": "#/components/schemas/FELT" + } }, "required": ["left", "right"] }, @@ -3728,18 +3722,18 @@ "type": "object", "description": "represents a path to the highest non-zero descendant node", "properties": { - "path": { - "description": "an integer whose binary representation represents the path from the current node to its highest non-zero descendant (bounded by 2^251)", - "$ref": "#/components/schemas/NUM_AS_HEX" - }, - "length": { - "description": "the length of the path (bounded by 251)", - "type": "integer" - }, - "child": { - "description": "the hash of the unique non-zero maximal-height descendant node", - "$ref": "#/components/schemas/FELT" - } + "path": { + "description": "an integer whose binary representation represents the path from the current node to its highest non-zero descendant (bounded by 2^251)", + "$ref": "#/components/schemas/NUM_AS_HEX" + }, + "length": { + "description": "the length of the path (bounded by 251)", + "type": "integer" + }, + "child": { + "description": "the hash of the unique non-zero maximal-height descendant node", + "$ref": "#/components/schemas/FELT" + } }, "required": ["path", "length", "child"] }, @@ -3756,20 +3750,20 @@ "$ref": "#/components/schemas/MERKLE_NODE" } }, - "required": [ - "node_hash", - "node" - ] + "required": ["node_hash", "node"] } - }, - "CONTRACT_EXECUTION_ERROR": { + }, + "CONTRACT_EXECUTION_ERROR": { + "description": "structured error that can later be processed by wallets or sdks", + "title": "contract execution error", + "$ref": "#/components/schemas/CONTRACT_EXECUTION_ERROR_INNER" + }, + "CONTRACT_EXECUTION_ERROR_INNER": { "description": "structured error that can later be processed by wallets or sdks", "title": "contract execution error", "oneOf": [ { "type": "object", - "title": "inner call", - "description": "error frame", "properties": { "contract_address": { "$ref": "#/components/schemas/ADDRESS" @@ -3878,4 +3872,4 @@ } } } -} +} \ No newline at end of file diff --git a/api/starknet_trace_api_openrpc.json b/api/starknet_trace_api_openrpc.json index e397966..7e312aa 100644 --- a/api/starknet_trace_api_openrpc.json +++ b/api/starknet_trace_api_openrpc.json @@ -30,7 +30,7 @@ }, "errors": [ { - "$ref": "#/components/errors/TXN_HASH_NOT_FOUND" + "$ref": "./api/starknet_api_openrpc.json#/components/errors/TXN_HASH_NOT_FOUND" }, { "$ref": "#/components/errors/NO_TRACE_AVAILABLE" @@ -97,10 +97,10 @@ }, "errors": [ { - "$ref": "#/components/errors/BLOCK_NOT_FOUND" + "$ref": "./api/starknet_api_openrpc.json#/components/errors/BLOCK_NOT_FOUND" }, { - "$ref": "#/components/errors/TRANSACTION_EXECUTION_ERROR" + "$ref": "./api/starknet_api_openrpc.json#/components/errors/TRANSACTION_EXECUTION_ERROR" } ] }, @@ -139,7 +139,7 @@ }, "errors": [ { - "$ref": "#/components/errors/BLOCK_NOT_FOUND" + "$ref": "./api/starknet_api_openrpc.json#/components/errors/BLOCK_NOT_FOUND" } ] } @@ -480,15 +480,6 @@ } } } - }, - "TXN_HASH_NOT_FOUND": { - "$ref": "./api/starknet_api_openrpc.json#/components/errors/TXN_HASH_NOT_FOUND" - }, - "BLOCK_NOT_FOUND": { - "$ref": "./api/starknet_api_openrpc.json#/components/errors/BLOCK_NOT_FOUND" - }, - "TRANSACTION_EXECUTION_ERROR": { - "$ref": "./api/starknet_api_openrpc.json#/components/errors/TRANSACTION_EXECUTION_ERROR" } } } diff --git a/api/starknet_ws_api.json b/api/starknet_ws_api.json index 109fb1e..9e7ef37 100644 --- a/api/starknet_ws_api.json +++ b/api/starknet_ws_api.json @@ -31,7 +31,7 @@ "$ref": "#/components/errors/TOO_MANY_BLOCKS_BACK" }, { - "$ref": "./api/starknet_api_openrpc.json#/components/schemas/BLOCK_NOT_FOUND" + "$ref": "./api/starknet_api_openrpc.json#/components/errors/BLOCK_NOT_FOUND" } ] }, @@ -100,7 +100,7 @@ "$ref": "#/components/errors/TOO_MANY_BLOCKS_BACK" }, { - "$ref": "./api/starknet_api_openrpc.json#/components/schemas/BLOCK_NOT_FOUND" + "$ref": "./api/starknet_api_openrpc.json#/components/errors/BLOCK_NOT_FOUND" } ] }, @@ -157,7 +157,7 @@ "$ref": "#/components/errors/TOO_MANY_BLOCKS_BACK" }, { - "$ref": "./api/starknet_api_openrpc.json#/components/schemas/BLOCK_NOT_FOUND" + "$ref": "./api/starknet_api_openrpc.json#/components/errors/BLOCK_NOT_FOUND" } ] }, @@ -364,4 +364,4 @@ } } } -} +} \ No newline at end of file diff --git a/validate.js b/validate.js index 9e8b873..de3f6da 100755 --- a/validate.js +++ b/validate.js @@ -59,6 +59,7 @@ function fixRefs(dereffer) { async function derefAll(doc) { let allSchemas = doc.components.schemas; let refCacheWithRecursiveRef = { + "#/components/schemas/CONTRACT_EXECUTION_ERROR": allSchemas["CONTRACT_EXECUTION_ERROR"], "#/components/schemas/NESTED_CALL": allSchemas["NESTED_CALL"], }; let dereferencerOptions = {