diff --git a/api/starknet_api_openrpc.json b/api/starknet_api_openrpc.json index 9cabca7..d144a5a 100644 --- a/api/starknet_api_openrpc.json +++ b/api/starknet_api_openrpc.json @@ -813,7 +813,7 @@ ], "result": { "name": "result", - "description": "The last nonce used for the given contract.", + "description": "The contract's nonce at the requested state", "schema": { "title": "Field element", "$ref": "#/components/schemas/FELT" @@ -1588,6 +1588,10 @@ "DECLARE_TXN": { "title": "Declare transaction", "oneOf": [ + { + "title": "Declare transaction V0", + "$ref": "#/components/schemas/DECLARE_TXN_V0" + }, { "title": "Declare transaction V1", "$ref": "#/components/schemas/DECLARE_TXN_V1" @@ -1598,6 +1602,88 @@ } ] }, + "DECLARE_TXN_V0": { + "title": "Declare Contract Transaction V0", + "description": "Declare Contract Transaction V0", + "allOf": [ + { + "type": "object", + "title": "Declare txn v0", + "properties": { + "type": { + "title": "Declare", + "type": "string", + "enum": [ + "DECLARE" + ] + }, + "sender_address": { + "title": "Sender address", + "description": "The address of the account contract sending the declaration transaction", + "$ref": "#/components/schemas/ADDRESS" + }, + "max_fee": { + "title": "Max fee", + "$ref": "#/components/schemas/FELT", + "description": "The maximal fee that can be charged for including the transaction" + }, + "version": { + "title": "Version", + "description": "Version of the transaction scheme", + "type": "string", + "enum": [ + "0x0" + ] + }, + "signature": { + "title": "Signature", + "$ref": "#/components/schemas/SIGNATURE" + } + }, + "required": [ + "type", + "sender_address", + "max_fee", + "version", + "signature" + ] + }, + { + "oneOf": [ + { + "type": "object", + "title": "ContractClass", + "description": "The class to be declared. Expected to be included for all methods involving execution (estimateFee, simulateTransactions)", + "properties": { + "contract_class": { + "title": "Contract class", + "description": "The class to be declared", + "$ref": "#/components/schemas/DEPRECATED_CONTRACT_CLASS" + } + }, + "required": [ + "contract_class" + ] + }, + { + "type": "object", + "title": "ClassHash", + "description": "The hash of the declared class. Responses to getBlock and getTransaction are expected to include the hash rather than the full definition", + "properties": { + "class_hash": { + "title": "Class hash", + "description": "The hash of the declared class", + "$ref": "#/components/schemas/FELT" + } + }, + "required": [ + "class_hash" + ] + } + ] + } + ] + }, "DECLARE_TXN_V1": { "title": "Declare Contract Transaction V1", "description": "Declare Contract Transaction V1", @@ -1661,7 +1747,10 @@ "description": "The class to be declared", "$ref": "#/components/schemas/DEPRECATED_CONTRACT_CLASS" } - } + }, + "required": [ + "contract_class" + ] }, { "type": "object", @@ -1673,7 +1762,10 @@ "description": "The hash of the declared class", "$ref": "#/components/schemas/FELT" } - } + }, + "required": [ + "class_hash" + ] } ] } @@ -1748,7 +1840,10 @@ "description": "The class to be declared", "$ref": "#/components/schemas/CONTRACT_CLASS" } - } + }, + "required": [ + "countract_class" + ] }, { "type": "object", @@ -1760,7 +1855,10 @@ "description": "The hash of the declared class", "$ref": "#/components/schemas/FELT" } - } + }, + "required": [ + "class_hash" + ] } ] } @@ -2924,4 +3022,4 @@ } } } -} +} \ No newline at end of file diff --git a/api/starknet_write_api.json b/api/starknet_write_api.json index 53c8307..3afc574 100644 --- a/api/starknet_write_api.json +++ b/api/starknet_write_api.json @@ -70,7 +70,14 @@ "required": true, "schema": { "title": "Declare transaction", - "$ref": "#/components/schemas/DECLARE_TXN" + "oneOf": [ + { + "$ref": "#/components/schemas/DECLARE_TXN_V1" + }, + { + "$ref": "#/components/schemas/DECLARE_TXN_V2" + } + ] } } ], @@ -214,8 +221,11 @@ "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" + "DECLARE_TXN_V1": { + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/DECLARE_TXN_V1" + }, + "DECLARE_TXN_V2": { + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/DECLARE_TXN_V2" }, "DEPLOY_ACCOUNT_TXN": { "$ref": "./api/starknet_api_openrpc.json#/components/schemas/DEPLOY_ACCOUNT_TXN"