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

add declare v0 #120

Merged
merged 3 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
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
110 changes: 104 additions & 6 deletions api/starknet_api_openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -1584,6 +1584,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"
Expand All @@ -1594,6 +1598,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",
Expand Down Expand Up @@ -1657,7 +1743,10 @@
"description": "The class to be declared",
"$ref": "#/components/schemas/DEPRECATED_CONTRACT_CLASS"
}
}
},
"required": [
"contract_class"
]
},
{
"type": "object",
Expand All @@ -1669,7 +1758,10 @@
"description": "The hash of the declared class",
"$ref": "#/components/schemas/FELT"
}
}
},
"required": [
"class_hash"
]
}
]
}
Expand Down Expand Up @@ -1744,7 +1836,10 @@
"description": "The class to be declared",
"$ref": "#/components/schemas/CONTRACT_CLASS"
}
}
},
"required": [
"countract_class"
]
},
{
"type": "object",
Expand All @@ -1756,7 +1851,10 @@
"description": "The hash of the declared class",
"$ref": "#/components/schemas/FELT"
}
}
},
"required": [
"class_hash"
]
}
]
}
Expand Down Expand Up @@ -2920,4 +3018,4 @@
}
}
}
}
}
16 changes: 13 additions & 3 deletions api/starknet_write_api.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
}
],
Expand Down Expand Up @@ -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"
Expand Down