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 27, 2023
1 parent 27e29cd commit b006d92
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 63 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 @@ -1782,6 +1769,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 @@ -1817,10 +1825,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 @@ -1875,10 +1880,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 @@ -2104,10 +2106,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 @@ -3065,4 +3064,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": "./starknet_api_openrpc.json#/components/schemas/FEE_ESTIMATE"
},
"INVOKE_TXN": {
"$ref": "./starknet_api_openrpc.json#/components/schemas/INVOKE_TXN"
},
"DECLARE_TXN": {
"$ref": "./starknet_api_openrpc.json#/components/schemas/DECLARE_TXN"
},
"BROADCASTED_DECLARE_TXN": {
"$ref": "./starknet_api_openrpc.json#/components/schemas/BROADCASTED_DECLARE_TXN"
},
"DEPLOY_ACCOUNT_TXN": {
"$ref": "./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 @@
}
}
}
}
}
28 changes: 18 additions & 10 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 All @@ -31,7 +31,9 @@
"$ref": "#/components/schemas/TXN_HASH"
}
},
"required": ["transaction_hash"]
"required": [
"transaction_hash"
]
}
},
"errors": [
Expand Down Expand Up @@ -90,7 +92,10 @@
"$ref": "#/components/schemas/FELT"
}
},
"required": ["transaction_hash", "class_hash"]
"required": [
"transaction_hash",
"class_hash"
]
}
},
"errors": [
Expand Down Expand Up @@ -144,7 +149,7 @@
"description": "The deploy account transaction",
"required": true,
"schema": {
"$ref": "#/components/schemas/DEPLOY_ACCOUNT_TXN"
"$ref": "#/components/schemas/BROADCASTED_DEPLOY_ACCOUNT_TXN"
}
}
],
Expand All @@ -163,7 +168,10 @@
"$ref": "#/components/schemas/FELT"
}
},
"required": ["transaction_hash", "contract_address"]
"required": [
"transaction_hash",
"contract_address"
]
}
},
"errors": [
Expand Down Expand Up @@ -214,14 +222,14 @@
"TXN_HASH": {
"$ref": "./starknet_api_openrpc.json#/components/schemas/TXN_HASH"
},
"INVOKE_TXN_V1": {
"$ref": "./starknet_api_openrpc.json#/components/schemas/INVOKE_TXN_V1"
"BROADCASTED_INVOKE_TXN": {
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/BROADCASTED_INVOKE_TXN"
},
"DECLARE_TXN": {
"$ref": "./starknet_api_openrpc.json#/components/schemas/DECLARE_TXN"
},
"DEPLOY_ACCOUNT_TXN": {
"$ref": "./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": "./starknet_api_openrpc.json#/components/schemas/FUNCTION_CALL"
Expand Down Expand Up @@ -287,4 +295,4 @@
}
}
}
}
}

0 comments on commit b006d92

Please sign in to comment.