Skip to content

Commit

Permalink
add broadcasted txn & allow query version
Browse files Browse the repository at this point in the history
  • Loading branch information
ArielElp committed Aug 17, 2023
1 parent 0e859ff commit a3a9124
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 60 deletions.
53 changes: 26 additions & 27 deletions api/starknet_api_openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -529,20 +529,7 @@
"description": "a sequence of transactions to estimate, running each transaction on the state resulting from applying all the previous ones",
"title": "Transaction",
"items": {
"oneOf": [
{
"title": "Declare transaction",
"$ref": "#/components/schemas/BROADCASTED_DECLARE_TXN"
},
{
"title": "Invoke transaction",
"$ref": "#/components/schemas/INVOKE_TXN"
},
{
"title": "Deploy account transaction",
"$ref": "#/components/schemas/DEPLOY_ACCOUNT_TXN"
}
]
"$ref": "#/components/schemas/BROADCASTED_TXN"
}
},
"required": true
Expand Down Expand Up @@ -1780,6 +1767,27 @@
}
]
},
"BROADCASTED_TXN": {
"oneOf": [
{
"$ref": "#/components/schemas/BROADCASTED_INVOKE_TXN"
},
{
"$ref": "#/components/schemas/BROADCASTED_DECLARE_TXN"
},
{
"$ref": "#/components/schemas/BROADCASTED_DEPLOY_ACCOUNT_TXN"
}
]
},
"BROADCASTED_INVOKE_TXN": {
"title": "Broadcasted invoke transaction",
"$ref": "#/components/schemas/INVOKE_TXN_V1"
},
"BROADCASTED_DEPLOY_ACCOUNT_TXN": {
"title": "Broadcasted deploy account transaction",
"$ref": "#/components/schemas/DEPLOY_ACCOUNT_TXN"
},
"BROADCASTED_DECLARE_TXN": {
"title": "Broadcasted declare transaction",
"oneOf": [
Expand Down Expand Up @@ -1815,10 +1823,7 @@
"version": {
"title": "Version",
"description": "Version of the transaction scheme",
"type": "string",
"enum": [
"0x1"
]
"$ref": "#/components/schemas/NUM_AS_HEX"
},
"signature": {
"title": "Signature",
Expand Down Expand Up @@ -1873,10 +1878,7 @@
"version": {
"title": "Version",
"description": "Version of the transaction scheme",
"type": "string",
"enum": [
"0x2"
]
"$ref": "#/components/schemas/NUM_AS_HEX"
},
"signature": {
"title": "Signature",
Expand Down Expand Up @@ -2102,10 +2104,7 @@
"version": {
"title": "Version",
"description": "Version of the transaction scheme",
"type": "string",
"enum": [
"0x1"
]
"$ref": "#/components/schemas/NUM_AS_HEX"
},
"signature": {
"title": "Signature",
Expand Down Expand Up @@ -3063,4 +3062,4 @@
}
}
}
}
}
30 changes: 4 additions & 26 deletions api/starknet_trace_api_openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,7 @@
"type": "array",
"description": "a sequence of transactions to simulate, running each transaction on the state resulting from applying all the previous ones",
"items": {
"oneOf": [
{
"title": "Declare transaction",
"$ref": "#/components/schemas/BROADCASTED_DECLARE_TXN"
},
{
"title": "Invoke transaction",
"$ref": "#/components/schemas/INVOKE_TXN"
},
{
"title": "Deploy account transaction",
"$ref": "#/components/schemas/DEPLOY_ACCOUNT_TXN"
}
]
"$ref": "#/components/schemas/BROADCASTED_TXN"
}
}
},
Expand Down Expand Up @@ -346,17 +333,8 @@
"FEE_ESTIMATE": {
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/FEE_ESTIMATE"
},
"INVOKE_TXN": {
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/INVOKE_TXN"
},
"DECLARE_TXN": {
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/DECLARE_TXN"
},
"BROADCASTED_DECLARE_TXN": {
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/BROADCASTED_DECLARE_TXN"
},
"DEPLOY_ACCOUNT_TXN": {
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/DEPLOY_ACCOUNT_TXN"
"BROADCASTED_TXN": {
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/BROADCASTED_TXN"
}
},
"errors": {
Expand Down Expand Up @@ -399,4 +377,4 @@
}
}
}
}
}
14 changes: 7 additions & 7 deletions api/starknet_write_api.json
Original file line number Diff line number Diff line change
Expand Up @@ -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_V1"
"$ref": "#/components/schemas/BROADCASTED_INVOKE_TXN"
}
}
],
Expand Down Expand Up @@ -142,7 +142,7 @@
"description": "The deploy account transaction",
"required": true,
"schema": {
"$ref": "#/components/schemas/DEPLOY_ACCOUNT_TXN"
"$ref": "#/components/schemas/BROADCASTED_DEPLOY_ACCOUNT_TXN"
}
}
],
Expand Down Expand Up @@ -211,14 +211,14 @@
"TXN_HASH": {
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/TXN_HASH"
},
"INVOKE_TXN_V1": {
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/INVOKE_TXN_V1"
"BROADCASTED_INVOKE_TXN": {
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/BROADCASTED_INVOKE_TXN"
},
"BROADCASTED_DECLARE_TXN": {
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/BROADCASTED_DECLARE_TXN"
},
"DEPLOY_ACCOUNT_TXN": {
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/DEPLOY_ACCOUNT_TXN"
"BROADCASTED_DEPLOY_ACCOUNT_TXN": {
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/BROADCASTED_DEPLOY_ACCOUNT_TXN"
},
"FUNCTION_CALL": {
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/FUNCTION_CALL"
Expand Down Expand Up @@ -284,4 +284,4 @@
}
}
}
}
}

0 comments on commit a3a9124

Please sign in to comment.