REST APIs
Projects and Forks can be managed through API.
Access Token
The request is in HTTP POST with an access key embedded in the header. The Access key
used in the API is shown in the Account Settings of the Dashboard.
The Project ID
and Fork ID
can be obtained from the API response or viewed in the Fork Panel.
Request and Response
The requested data is packed in the data
field of the body. The response is in JSON format, with the following common structure.
code
:Integer
. Error code.0
: No error.other
: Error occurs.
message
:String
If the
code
is not 0, this field denotes the detailed error information.
data
:JSON
This is the detailed response data.
Managing Forks of a Project
Users can create their Forks under a project; each fork must belong to a project. After registering, a default project named 'default' will be created. Subsequently, users can create additional projects of their own. Each user can have a maximum of 20 projects.
Project-related APIs
Create a Project
This API is used to create a Project.
Create a Project
POST
https://api.phalcon.blocksec.com/v1/project
Headers
Name | Type | Description |
---|---|---|
Access-Key* | String | Access Key |
Content-Type | String | application/json |
Request Body
Name | Type | Description |
---|---|---|
data* | JSON | Request data |
Request
name
:String
. The name of the project.
Response
projectId:
String
. The id of the created Project. This id is used to manipulate a Project (e.g., delete a Project/Create a Fork in this project).name
:String
. The name of the Project. It should be the same as thename
passed in the request.createTime
:String
. The time of the project was created.
Query Project List
This API is used to retrieve a list of Projects.
Query Project List
GET
https://api.phalcon.blocksec.com/v1/projects
Headers
Name | Type | Description |
---|---|---|
Access-Key* | String | Access Key |
Content-Type | String | application/json |
Request Body
Name | Type | Description |
---|---|---|
data* | JSON | Request data |
Response
projectId
:String
. The id of the created Project. This id is used to manipulate a Project (e.g., delete a Project/Create a Fork in this project).name
:String
. The name of the Project.createTime
:String
. The time of the project was created.
Query a Project's Detail
This API is used to query a Project's detail.
Query a Project's Detail
GET
https://api.phalcon.xyz/v1/project/$projectId
Delete a Fork
Headers
Name | Type | Description |
---|---|---|
Access-Key* | String | Access Key |
Content-Type | String | application/json |
Request Body
Name | Type | Description |
---|---|---|
data | JSON | Request data |
Request
projectId:
String
. The id of the Project that is to be query.
Response
projectId
:String
. The id of the created Project. This id is used to manipulate a Project (e.g., delete a Project/Create a Fork in this project).name
:String
. The name of the Project.createTime
:String
. The time of the project was created.stats
:Json
. The statistics of the simulated transactions for this project.dailyTransactionQuantity
:Integer.
Daily usage statistics (UTC)monthlyTransactionQuantity
:Integer
.Monthly usage statistics from 1st of the month until now)."
fokDetail
:Json
. The detailed information of this project's forks.forkId
:String
. The id of the created Fork. This id is used to manipulate a Fork (e.g., delete a Fork).chainId
:Integer
. The id of the chain that is forked. It should be the same as thechainId
passed in the request.name
:String
. The name of the Fork. It should be the same as thename
passed in the request.rpc
:String
. The RPC of this Fork.
collaboratorDetail
:Json
. The detailed information of this project's collaborator.collaboratorNum
:Integer.
The number of collaboratorscollaborators
:Json
. The collaborator information includes their nickname and email address
Delete a Project
This API is used to delete a Project.
Delete a Project
DELETE
https://api.phalcon.blocksec.com/v1/project/delete/$projectId
Delete a Fork
Headers
Name | Type | Description |
---|---|---|
Access-Key* | String | Access Key |
Content-Type | String | application/json |
Request Body
Name | Type | Description |
---|---|---|
data | JSON | Request data |
Request
projectId:
String
. The id of the Project that is to be deleted.
Fork-related APIs
Create a Fork
This API is used to create a Fork, and please note that a Fork needs to belong to a specific project.
Create a Fork
POST
https://api.phalcon.blocksec.com/v1/project/$projectId/fork
Headers
Name | Type | Description |
---|---|---|
Access-Key* | String | Access Key |
Content-Type | String | application/json |
Request Body
Name | Type | Description |
---|---|---|
data* | JSON | Request data |
Request
chainId
:Integer
. Following the IDs used in this website.height
: It specifies the block height that the chain is forked from. It accepts the following options.HEX String
- an integer block numberString "safe"
- for the latest safe head block
position
:Integer
. The position in the block (specified byheight
) that the Forked chain starts.name
:String
. The name of the created Fork.`antiReplay`:
Boolean
. It specifies whether the anti-replay feature is enabled for this Fork.
Response
forkId
:String
. The id of the created Fork. This id is used to manipulate a Fork (e.g., delete a Fork).chainId
:Integer
. The id of the chain that is forked. It should be the same as thechainId
passed in the request.name
:String
. The name of the Fork. It should be the same as thename
passed in the request.snapshotId
:String
. The id of the default snapshot of this Fork.rpc
:String
. The RPC of this Fork.
Delete a Fork
This API is used to delete a Fork.
Delete a Fork
DELETE
https://api.phalcon.blocksec.com/v1/project/$projectId/fork/$forkId
Delete a Fork
Headers
Name | Type | Description |
---|---|---|
Access-Key* | String | Access Key |
Content-Type | String | application/json |
Request Body
Name | Type | Description |
---|---|---|
data | JSON | Request data |
Request
forkId
:String
. The id of the Fork that is to be deleted.
Query Fork List
This API is used to retrieve a list of Forks.
Query Fork List
GET
https://api.phalcon.blocksec.com/v1/project/$projectId/forks
Headers
Name | Type | Description |
---|---|---|
Access-Key* | String | Access Key |
Content-Type | String | application/json |
Request Body
Name | Type | Description |
---|---|---|
data* | JSON | Request data |
Response
forkId
:String
. The id of the created Fork. This id is used to manipulate a Fork (e.g., delete a Fork).chainId
:Integer
. The id of the chain that is forked. It should be the same as thechainId
passed in the request.name
:String
. The name of the Fork. It should be the same as thename
passed in the request.rpc
:String
. The RPC of this Fork.
Query Fork Usage Status
This API is used to retrieve the usage status of a Fork.
Query Fork Usage Status
GET
https://api.phalcon.blocksec.com/v1/project/$projectId/fork/$forkId
Delete a Fork
Headers
Name | Type | Description |
---|---|---|
Access-Key* | String | Access Key |
Content-Type | String | application/json |
Request Body
Name | Type | Description |
---|---|---|
data | JSON | Request data |
Response
forkId
:String
. The id of the created Fork. This id is used to manipulate a Fork (e.g., delete a Fork).chainId
:Integer
. The id of the chain that is forked. It should be the same as thechainId
passed in the request.name
:String
. The name of the Fork. It should be the same as thename
passed in the request.rpc
:String
. The RPC of this Fork.
Last updated