Skip to content

Commit

Permalink
Merge pull request #120 from starkware-libs/add_declare_v0
Browse files Browse the repository at this point in the history
add declare v0 (#120)

Co-Authored-By: Ariel Elperin <ariel@Ariels-MacBook-Pro.local>
  • Loading branch information
ArielElp and Ariel Elperin authored Aug 7, 2023
2 parents ede9d37 + 1d1cdbf commit 6fadca1
Show file tree
Hide file tree
Showing 2 changed files with 117 additions and 9 deletions.
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 @@ -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"
Expand All @@ -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",
Expand Down Expand Up @@ -1661,7 +1747,10 @@
"description": "The class to be declared",
"$ref": "#/components/schemas/DEPRECATED_CONTRACT_CLASS"
}
}
},
"required": [
"contract_class"
]
},
{
"type": "object",
Expand All @@ -1673,7 +1762,10 @@
"description": "The hash of the declared class",
"$ref": "#/components/schemas/FELT"
}
}
},
"required": [
"class_hash"
]
}
]
}
Expand Down Expand Up @@ -1748,7 +1840,10 @@
"description": "The class to be declared",
"$ref": "#/components/schemas/CONTRACT_CLASS"
}
}
},
"required": [
"countract_class"
]
},
{
"type": "object",
Expand All @@ -1760,7 +1855,10 @@
"description": "The hash of the declared class",
"$ref": "#/components/schemas/FELT"
}
}
},
"required": [
"class_hash"
]
}
]
}
Expand Down Expand Up @@ -2924,4 +3022,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

0 comments on commit 6fadca1

Please sign in to comment.