diff --git a/api/starknet_api_openrpc.json b/api/starknet_api_openrpc.json index b69a70d..245bdd1 100644 --- a/api/starknet_api_openrpc.json +++ b/api/starknet_api_openrpc.json @@ -189,7 +189,23 @@ "name": "result", "schema": { "title": "Transaction", - "$ref": "#/components/schemas/TXN" + "allOf": [ + { + "$ref": "#/components/schemas/TXN" + }, + { + "type": "object", + "properties": { + "transaction_hash": { + "title": "transaction hash", + "$ref": "#/components/schemas/TXN_HASH" + } + }, + "required": [ + "transaction_hash" + ] + } + ] } }, "errors": [ @@ -227,7 +243,23 @@ "name": "transactionResult", "schema": { "title": "Transaction", - "$ref": "#/components/schemas/TXN" + "allOf": [ + { + "$ref": "#/components/schemas/TXN" + }, + { + "type": "object", + "properties": { + "transaction_hash": { + "title": "transaction hash", + "$ref": "#/components/schemas/TXN_HASH" + } + }, + "required": [ + "transaction_hash" + ] + } + ] } }, "errors": [ @@ -664,7 +696,23 @@ "type": "array", "title": "Pending Transactions", "items": { - "$ref": "#/components/schemas/TXN" + "allOf": [ + { + "$ref": "#/components/schemas/TXN" + }, + { + "type": "object", + "properties": { + "transaction_hash": { + "title": "transaction hash", + "$ref": "#/components/schemas/TXN_HASH" + } + }, + "required": [ + "transaction_hash" + ] + } + ] } } } @@ -1644,6 +1692,11 @@ "description": "The address of the account contract sending the declaration transaction", "$ref": "#/components/schemas/ADDRESS" }, + "compiled_class_hash": { + "title": "Compiled class hash", + "description": "The hash of the Cairo assembly resulting from the Sierra compilation", + "$ref": "#/components/schemas/FELT" + }, "max_fee": { "title": "Max fee", "$ref": "#/components/schemas/FELT", @@ -1666,6 +1719,7 @@ "required": [ "type", "sender_address", + "compiled_class_hash", "max_fee", "version", "signature", @@ -1814,6 +1868,13 @@ "title": "Invoke transaction V0", "description": "invokes a specific function in the desired contract (not necessarily an account)", "properties": { + "type": { + "title": "Type", + "type": "string", + "enum": [ + "INVOKE" + ] + }, "max_fee": { "title": "Max fee", "$ref": "#/components/schemas/FELT", @@ -1846,6 +1907,7 @@ } }, "required": [ + "type", "contract_address", "entry_point_selector", "calldata", @@ -1861,6 +1923,13 @@ { "type": "object", "properties": { + "type": { + "title": "Type", + "type": "string", + "enum": [ + "INVOKE" + ] + }, "sender_address": { "title": "sender address", "$ref": "#/components/schemas/ADDRESS" @@ -1893,6 +1962,7 @@ } }, "required": [ + "type", "sender_address", "calldata", "max_fee", @@ -1906,35 +1976,14 @@ "INVOKE_TXN": { "title": "Invoke transaction", "description": "Initiate a transaction from an account", - "allOf": [ + "oneOf": [ { - "type": "object", - "title": "Type", - "properties": { - "type": { - "title": "Type", - "type": "string", - "enum": [ - "INVOKE" - ] - } - }, - "required": [ - "type" - ] + "title": "Invoke transaction V0", + "$ref": "#/components/schemas/INVOKE_TXN_V0" }, { - "title": "Invoke transaction properties", - "oneOf": [ - { - "title": "Invoke transaction V0", - "$ref": "#/components/schemas/INVOKE_TXN_V0" - }, - { - "title": "Invoke transaction V1", - "$ref": "#/components/schemas/INVOKE_TXN_V1" - } - ] + "title": "Invoke transaction V1", + "$ref": "#/components/schemas/INVOKE_TXN_V1" } ] }, @@ -1946,11 +1995,6 @@ "title": "L1 handler transaction", "description": "a call to an l1_handler on an L2 contract induced by a message from L1", "properties": { - "transaction_hash": { - "title": "Transaction hash", - "$ref": "#/components/schemas/TXN_HASH", - "description": "The hash identifying the transaction" - }, "version": { "title": "Version", "description": "Version of the transaction scheme", @@ -1970,7 +2014,6 @@ } }, "required": [ - "transaction_hash", "version", "type", "nonce" diff --git a/api/starknet_write_api.json b/api/starknet_write_api.json index 50c5276..d036807 100644 --- a/api/starknet_write_api.json +++ b/api/starknet_write_api.json @@ -16,7 +16,7 @@ "description": "The information needed to invoke the function (or account, for version 1 transactions)", "required": true, "schema": { - "$ref": "#/components/schemas/INVOKE_TXN" + "$ref": "#/components/schemas/INVOKE_TXN_V1" } } ], @@ -33,7 +33,29 @@ } } }, - "errors": [] + "errors": [ + { + "$ref": "#/components/errors/INSUFFICIENT_ACCOUNT_BALANCE" + }, + { + "$ref": "#/components/errors/INSUFFICIENT_MAX_FEE" + }, + { + "$ref": "#/components/errors/INVALID_TRANSACTION_NONCE" + }, + { + "$ref": "#/components/errors/VALIDATION_FAILURE" + }, + { + "$ref": "#/components/errors/NON_ACCOUNT" + }, + { + "$ref": "#/components/errors/CLASS_HASH_NOT_FOUND" + }, + { + "$ref": "#/components/errors/DUPLICATE_TX" + } + ] }, { "name": "starknet_addDeclareTransaction", @@ -68,10 +90,37 @@ }, "errors": [ { - "$ref": "#/components/errors/INVALID_CONTRACT_CLASS" + "$ref": "#/components/errors/CLASS_ALREADY_DECLARED" }, { - "$ref": "#/components/errors/CLASS_ALREADY_DECLARED" + "$ref": "#/components/errors/COMPILATION_FAILED" + }, + { + "$ref": "#/components/errors/COMPILED_CLASS_HASH_MISMATCH" + }, + { + "$ref": "#/components/errors/INSUFFICIENT_ACCOUNT_BALANCE" + }, + { + "$ref": "#/components/errors/INSUFFICIENT_MAX_FEE" + }, + { + "$ref": "#/components/errors/INVALID_TRANSACTION_NONCE" + }, + { + "$ref": "#/components/errors/VALIDATION_FAILURE" + }, + { + "$ref": "#/components/errors/NON_ACCOUNT" + }, + { + "$ref": "#/components/errors/CLASS_HASH_NOT_FOUND" + }, + { + "$ref": "#/components/errors/DUPLICATE_TX" + }, + { + "$ref": "#/components/errors/CONTRACT_BYTECODE_SIZE_IS_TOO_LARGE" } ] }, @@ -106,8 +155,26 @@ } }, "errors": [ + { + "$ref": "#/components/errors/INSUFFICIENT_ACCOUNT_BALANCE" + }, + { + "$ref": "#/components/errors/INSUFFICIENT_MAX_FEE" + }, + { + "$ref": "#/components/errors/INVALID_TRANSACTION_NONCE" + }, + { + "$ref": "#/components/errors/VALIDATION_FAILURE" + }, + { + "$ref": "#/components/errors/NON_ACCOUNT" + }, { "$ref": "#/components/errors/CLASS_HASH_NOT_FOUND" + }, + { + "$ref": "#/components/errors/DUPLICATE_TX" } ] } @@ -129,8 +196,8 @@ "TXN_HASH": { "$ref": "./api/starknet_api_openrpc.json#/components/schemas/TXN_HASH" }, - "INVOKE_TXN": { - "$ref": "./api/starknet_api_openrpc.json#/components/schemas/INVOKE_TXN" + "INVOKE_TXN_V1": { + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/INVOKE_TXN_V1" }, "DECLARE_TXN": { "$ref": "./api/starknet_api_openrpc.json#/components/schemas/DECLARE_TXN" @@ -143,10 +210,6 @@ } }, "errors": { - "INVALID_CONTRACT_CLASS": { - "code": 50, - "message": "Invalid contract class" - }, "CLASS_HASH_NOT_FOUND": { "code": 28, "message": "Class hash not found" @@ -175,7 +238,7 @@ "code": 56, "message": "Compilation failed" }, - "CONTRACT_BYTECODE_SIZE_TOO_LARGE": { + "CONTRACT_BYTECODE_SIZE_IS_TOO_LARGE": { "code": 57, "message": "Contract bytecode size it too large" }, @@ -186,6 +249,10 @@ "DUPLICATE_TX": { "code": 59, "message": "A transaction with the same hash already exists in the mempool" + }, + "COMPILED_CLASS_HASH_MISMATCH": { + "code": 60, + "message": "the compiled class hash did not match the one supplied in the transaction" } } }