Skip to content

Commit

Permalink
add deploy_account transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
ArielElp committed Oct 2, 2022
1 parent 01832d3 commit 77de96e
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 4 deletions.
62 changes: 59 additions & 3 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.44.0",
"version": "0.45.0",
"title": "StarkNet Node API",
"license": {}
},
Expand Down Expand Up @@ -619,7 +619,7 @@
{
"$ref": "#/components/errors/BLOCK_NOT_FOUND"
}
]
]
},
{
"name": "starknet_getNonce",
Expand Down Expand Up @@ -1129,6 +1129,9 @@
},
{
"$ref": "#/components/schemas/DEPLOY_TXN"
},
{
"ref": "#/components/schemas/DEPLOY_ACCOUNT_TXN"
}
]
},
Expand All @@ -1144,6 +1147,9 @@
},
{
"$ref": "#/components/schemas/BROADCASTED_DEPLOY_TXN"
},
{
"$ref": "#/components/schemas/BROADCASTED_DEPLOY_ACCOUNT_TXN"
}
]
},
Expand Down Expand Up @@ -1237,6 +1243,49 @@
}
]
},
"DEPLOY_ACCOUNT_TXN": {
"title": "Deploy Account Transaction",
"description": "Deploys an account contract, charges fee from the pre-funded account addresses",
"allOf": [
{
"$ref": "#/components/schemas/COMMON_TXN_PROPERTIES"
},
{
"$ref": "#/components/schemas/DEPLOY_ACCOUNT_TXN_PROPERTIES"
}
]
},
"BROADCASTED_DEPLOY_ACCOUNT_TXN": {
"description": "Mempool representation of a deploy account transaction",
"allOf": [
{
"$ref": "#/components/schemas/BROADCASTED_TXN_COMMON_PROPERTIES"
},
{
"$ref": "#/components/schemas/DEPLOY_ACCOUNT_TXN_PROPERTIES"
}
]
},
"DEPLOY_ACCOUNT_TXN_PROPERTIES": {
"type": "object",
"properties": {
"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",
"items": {
"$ref": "#/components/schemas/FELT"
}
},
"class_hash": {
"description": "The hash of the deployed contract's class",
"$ref": "#/components/schemas/FELT"
}
}
},
"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 @@ -1429,7 +1478,7 @@
"$ref": "#/components/schemas/EVENT"
}
}
},
},
"required": [
"transaction_hash",
"actual_fee",
Expand All @@ -1449,6 +1498,10 @@
"title": "Declare Transaction Receipt",
"$ref": "#/components/schemas/COMMON_RECEIPT_PROPERTIES"
},
"DEPLOY_ACCOUNT_TXN_RECEIPT": {
"title": "Deploy Account Transaction Receipt",
"$ref": "#/components/schemas/DEPLOY_TXN_RECEIPT"
},
"DEPLOY_TXN_RECEIPT": {
"title": "Deploy Transaction Receipt",
"allOf": [
Expand Down Expand Up @@ -1484,6 +1537,9 @@
{
"$ref": "#/components/schemas/DEPLOY_TXN_RECEIPT"
},
{
"$ref": "#/components/schemas/DEPLOY_ACCOUNT_TXN_RECEIPT"
},
{
"$ref": "#/components/schemas/PENDING_TXN_RECEIPT"
}
Expand Down
43 changes: 42 additions & 1 deletion api/starknet_write_api.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"params": [
{
"name": "deploy_transaction",
"description": "The salt used for calculting the contract address",
"description": "The deploy transaction",
"schema": {
"$ref": "#/components/schemas/BROADCASTED_DEPLOY_TXN"
}
Expand Down Expand Up @@ -103,6 +103,41 @@
"$ref": "#/components/errors/INVALID_CONTRACT_CLASS"
}
]
},
{
"name": "starknet_addDeployAccountTransaction",
"summary": "Submit a new deploy account transaction",
"params": [
{
"name": "deploy_account_transaction",
"description": "The deploy account transaction",
"schema": {
"$ref": "#/components/schemas/BROADCASTED_DEPLOY_ACCOUNT_TXN"
}
}
],
"result": {
"name": "result",
"description": "The result of the transaction submission",
"schema": {
"type": "object",
"properties": {
"transaction_hash": {
"title": "The hash of the deploy transaction",
"$ref": "#/components/schemas/TXN_HASH"
},
"contract_address": {
"title": "The address of the new contract",
"$ref": "#/components/schemas/FELT"
}
}
}
},
"errors": [
{
"$ref": "#/components/errors/CLASS_HASH_NOT_FOUND"
}
]
}
],
"components": {
Expand Down Expand Up @@ -134,6 +169,9 @@
"BROADCASTED_DEPLOY_TXN": {
"$ref": "./api/starknet_api_openrpc.json#/components/schemas/BROADCASTED_DEPLOY_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 All @@ -142,6 +180,9 @@
"INVALID_CONTRACT_CLASS": {
"code": 50,
"message": "Invalid contract class"
},
"CLASS_HASH_NOT_FOUND": {
"$ref": "./api/starknet_api_openrpc.json#/components/errors/CLASS_HASH_NOT_FOUND"
}
}
}
Expand Down

0 comments on commit 77de96e

Please sign in to comment.