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

v0.6.0: introduce v3 transactions #149

Merged
merged 4 commits into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
282 changes: 264 additions & 18 deletions api/starknet_api_openrpc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"openrpc": "1.0.0-rc1",
"info": {
"version": "0.5.0",
"version": "0.6.0",
"title": "StarkNet Node API",
"license": {}
},
Expand Down Expand Up @@ -1641,6 +1641,10 @@
{
"title": "Declare transaction V2",
"$ref": "#/components/schemas/DECLARE_TXN_V2"
},
{
"title": "Declare transaction V3",
"$ref": "#/components/schemas/DECLARE_TXN_V3"
}
]
},
Expand Down Expand Up @@ -1822,6 +1826,71 @@
}
]
},
"DECLARE_TXN_V3": {
"title": "Declare Transaction V3",
"description": "Declare Contract Transaction V3",
"allOf": [
{
"type": "object",
"title": "Declare txn v3",
"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"
},
"compiled_class_hash": {
"title": "Compiled class hash",
"description": "The hash of the Cairo assembly resulting from the Sierra compilation",
"$ref": "#/components/schemas/FELT"
},
"version": {
"title": "Version",
"description": "Version of the transaction scheme",
"type": "string",
"enum": [
"0x3"
]
},
"signature": {
"title": "Signature",
"$ref": "#/components/schemas/SIGNATURE"
},
"nonce": {
"title": "Nonce",
"$ref": "#/components/schemas/FELT"
},
"class_hash": {
"title": "Class hash",
"description": "The hash of the declared class",
"$ref": "#/components/schemas/FELT"
},
"l1_gas": {
"title": "L1 Gas",
"description": "The max amount and max price per unit of L1 gas used in this tx",
"$ref": "#/components/schemas/RESOURCE_LIMITS"
}
},
"required": [
"type",
"sender_address",
"compiled_class_hash",
"version",
"signature",
"nonce",
"class_hash",
"l1_gas"
]
}
]
},
"BROADCASTED_TXN": {
"oneOf": [
{
Expand All @@ -1837,16 +1906,7 @@
},
"BROADCASTED_INVOKE_TXN": {
"title": "Broadcasted invoke transaction",
"oneOf": [
{
"title": "Broadcasted invoke transaction V0",
"$ref": "#/components/schemas/INVOKE_TXN_V0"
},
{
"title": "Broadcasted invoke transaction V1",
"$ref": "#/components/schemas/INVOKE_TXN_V1"
}
]
"$ref": "#/components/schemas/INVOKE_TXN"
},
"BROADCASTED_DEPLOY_ACCOUNT_TXN": {
"title": "Broadcasted deploy account transaction",
Expand All @@ -1862,6 +1922,10 @@
{
"title": "Broadcasted declare transaction V2",
"$ref": "#/components/schemas/BROADCASTED_DECLARE_TXN_V2"
},
{
"title": "Broadcasted declare transaction V3",
"$ref": "#/components/schemas/BROADCASTED_DECLARE_TXN_V3"
}
]
},
Expand Down Expand Up @@ -1982,13 +2046,79 @@
}
]
},
"BROADCASTED_DECLARE_TXN_V3": {
"title": "Broadcasted declare Transaction V3",
"description": "Broadcasted declare Contract Transaction V3",
"allOf": [
{
"type": "object",
"title": "Declare txn v3",
"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"
},
"compiled_class_hash": {
"title": "Compiled class hash",
"description": "The hash of the Cairo assembly resulting from the Sierra compilation",
"$ref": "#/components/schemas/FELT"
},
"version": {
"title": "Version",
"description": "Version of the transaction scheme",
"$ref": "#/components/schemas/NUM_AS_HEX"
},
"signature": {
"title": "Signature",
"$ref": "#/components/schemas/SIGNATURE"
},
"nonce": {
"title": "Nonce",
"$ref": "#/components/schemas/FELT"
},
"contract_class": {
"title": "Contract class",
"description": "The class to be declared",
"$ref": "#/components/schemas/CONTRACT_CLASS"
},
"l1_gas": {
"title": "L1 Gas",
"description": "The max amount and max price per unit of L1 gas used in this tx",
"$ref": "#/components/schemas/RESOURCE_LIMITS"
}
},
"required": [
"type",
"sender_address",
"compiled_class_hash",
"version",
"signature",
"nonce",
"contract_class",
"l1_gas"
]
}
]
},
"DEPLOY_ACCOUNT_TXN": {
"title": "Deploy account transaction",
"description": "deploys a new account contract",
"oneOf": [
{
"title": "Deploy account V1",
"$ref": "#/components/schemas/DEPLOY_ACCOUNT_TXN_V1"
},
{
"title": "Deploy account V3",
"$ref": "#/components/schemas/DEPLOY_ACCOUNT_TXN_V3"
}
]
},
Expand Down Expand Up @@ -2051,6 +2181,65 @@
"class_hash"
]
},
"DEPLOY_ACCOUNT_TXN_V3": {
"title": "Deploy account transaction",
"description": "Deploys an account contract, charges fee from the pre-funded account addresses",
"properties": {
"type": {
"title": "Deploy account",
"type": "string",
"enum": [
"DEPLOY_ACCOUNT"
]
},
"version": {
"title": "Version",
"description": "Version of the transaction scheme",
"$ref": "#/components/schemas/NUM_AS_HEX"
},
"signature": {
"title": "Signature",
"$ref": "#/components/schemas/SIGNATURE"
},
"nonce": {
"title": "Nonce",
"$ref": "#/components/schemas/FELT"
},
"contract_address_salt": {
"title": "Contract address salt",
"description": "The salt for the address of the deployed contract",
"$ref": "#/components/schemas/FELT"
},
"constructor_calldata": {
"type": "array",
"description": "The parameters passed to the constructor",
"title": "Constructor calldata",
"items": {
"$ref": "#/components/schemas/FELT"
}
},
"class_hash": {
"title": "Class hash",
"description": "The hash of the deployed contract's class",
"$ref": "#/components/schemas/FELT"
},
"l1_gas": {
"title": "L1 Gas",
"description": "The max amount and max price per unit of L1 gas used in this tx",
"$ref": "#/components/schemas/RESOURCE_LIMITS"
}
},
"required": [
"version",
"signature",
"nonce",
"type",
"contract_address_salt",
"constructor_calldata",
"class_hash",
"l1_gas"
]
},
"DEPLOY_TXN": {
"title": "Deploy Contract Transaction",
"description": "The structure of a deploy transaction. Note that this transaction type is deprecated and will no longer be supported in future versions",
Expand Down Expand Up @@ -2212,6 +2401,63 @@
}
]
},
"INVOKE_TXN_V3": {
"title": "Invoke transaction V3",
"description": "initiates a transaction from a given account",
"allOf": [
{
"type": "object",
"properties": {
"type": {
"title": "Type",
"type": "string",
"enum": [
"INVOKE"
]
},
"sender_address": {
"title": "sender address",
"$ref": "#/components/schemas/ADDRESS"
},
"calldata": {
"type": "array",
"title": "calldata",
"description": "The data expected by the account's `execute` function (in most usecases, this includes the called contract address and a function selector)",
"items": {
"$ref": "#/components/schemas/FELT"
}
},
"version": {
"title": "Version",
"description": "Version of the transaction scheme",
"$ref": "#/components/schemas/NUM_AS_HEX"
},
"signature": {
"title": "Signature",
"$ref": "#/components/schemas/SIGNATURE"
},
"nonce": {
"title": "Nonce",
"$ref": "#/components/schemas/FELT"
},
"l1_gas": {
"title": "L1 Gas",
"description": "The max amount and max price per unit of L1 gas used in this tx",
"$ref": "#/components/schemas/RESOURCE_LIMITS"
}
},
"required": [
"type",
"sender_address",
"calldata",
"version",
"signature",
"nonce",
"l1_gas"
]
}
]
},
"INVOKE_TXN": {
"title": "Invoke transaction",
"description": "Initiate a transaction from an account",
Expand All @@ -2223,6 +2469,10 @@
{
"title": "Invoke transaction V1",
"$ref": "#/components/schemas/INVOKE_TXN_V1"
},
{
"title": "Invoke transaction V3",
"$ref": "#/components/schemas/INVOKE_TXN_V3"
}
]
},
Expand Down Expand Up @@ -2652,10 +2902,6 @@
"$ref": "#/components/schemas/FELT",
"description": "The fee that was charged by the sequencer"
},
"type": {
"title": "Transaction type",
"$ref": "#/components/schemas/TXN_TYPE"
},
"messages_sent": {
"type": "array",
"title": "Messages sent",
Expand Down Expand Up @@ -2698,7 +2944,6 @@
"required": [
"transaction_hash",
"actual_fee",
"type",
"messages_sent",
"events",
"finality_status",
Expand Down Expand Up @@ -3267,7 +3512,8 @@
}
},
"required": [
"price_in_wei"
"price_in_wei",
"price_in_strk"
]
},
"EXECUTION_RESOURCES": {
Expand Down Expand Up @@ -3392,4 +3638,4 @@
}
}
}
}
}
4 changes: 2 additions & 2 deletions api/starknet_trace_api_openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@
"order": {
"title": "order",
"description": "the order of the event within the transaction",
"type": "number"
"type": "integer"
}
}
},
Expand All @@ -420,7 +420,7 @@
"order": {
"title": "order",
"description": "the order of the message within the transaction",
"type": "number"
"type": "integer"
}
}
},
Expand Down