You can call this operation to create an account on a blockchain in Ant Blockchain by automatically generating a pair of public key and private key.
Debugging
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| Account | String | Yes | accountname |
The name of the account to create. |
| AntChainId | String | Yes | 1q8B5R9p |
The ID of the blockchain on which you want to create the account. |
| Password | String | Yes | password |
The password of the account to create. |
| Action | String | No | CreateAntChainAccountWithKeyPairAutoCreation |
The operation that you want to perform. Set the value to CreateAntChainAccountWithKeyPairAutoCreation. |
| RegionId | String | No | cn-hangzhou |
The ID of the region where Ant Blockchain is used. |
Response parameters
| Parameter | Type | Example | Description |
|---|---|---|---|
| RequestId | String | 5F058BB4-3043-4638-86D4-EED84AD1AE54 |
The ID of the request. |
| Result |
The result of the operation. |
||
| Account | String | accountname |
The name of the created account. |
| AccountPrivateKey | String | -----BEGIN ENCRYPTED PRIVATE KEY-----\nM***8=\n-----END ENCRYPTED PRIVATE KEY-----\n |
The private key automatically generated for the created account. |
| AccountPublicKey | String | b***7 |
The public key automatically generated for the created account. |
| AccountRecoverPrivateKey | String | -----BEGIN ENCRYPTED PRIVATE KEY-----\nM***Io=\n-----END ENCRYPTED PRIVATE KEY-----\n |
The recovery private key used to reset the private key when the private key is lost. |
| AccountRecoverPublicKey | String | d***b |
The recovery public key used to check whether the recovery private key is used. |
| AntChainId | String | 1q8B5R9p |
The ID of the blockchain on which the account was created. |
Examples
Sample requests
http(s)://[Endpoint]/? Action=CreateAntChainAccountWithKeyPairAutoCreation
&<Common request parameters>
Sample success responses
JSON format
{
"successResponse":true,
"requestId":"5F058BB4-3043-4638-86D4-EED84AD1AE54",
"data":{
"Result":{
"AccountRecoverPrivateKey":"-----BEGIN ENCRYPTED PRIVATE KEY-----\nM***Io=\n-----END ENCRYPTED PRIVATE KEY-----\n",
"AccountPublicKey":"b***7",
"AccountRecoverPublicKey":"d***b",
"AccountPrivateKey":"-----BEGIN ENCRYPTED PRIVATE KEY-----\nM***8=\n-----END ENCRYPTED PRIVATE KEY-----\n",
"Account":"accountname",
"AntChainId":"1q8B5R9p"
},
"RequestId":"5F058BB4-3043-4638-86D4-EED84AD1AE54"
},
"code":"200"
}
Error codes
For a list of error codes, visit the API Error Center.