Create New Wallet
API Documentation: Create New Wallet
Overview
This API endpoint allows you to create a new MPC wallet for a particular account
- HTTP Method: POST
- Endpoint:
/api/<VERSION>/account/create
Request Body Parameters
expireDate
(optional): The expiration date for the JWT token generated from the response.
Example Request Body
{
"expireDate": "2024-10-02"
}
Request
Request Headers
Authorization
(required): JWT token which was generated when user login and do not have an MPC wallet.x-client-secret
(required): Client secret which was generated when register in Xellar Embedded Wallet API Service Dashboard.
Example Request Syntax
curl -X POST -H "Content-Type: application/json" -H "x-client-secret: $YOUR_CLIENT_SECRET" -H "Authorization: Bearer $YOUR_ACCESS_TOKEN" -d '{
"expireDate": "2024-10-02"
}' <BASE_URL>/api/<VERSION>/account/create
Response
The response will include a JSON object with the following properties:
status
(number): The HTTP status code of the response (e.g., 200 for success).message
(string): A message providing additional information about the operation.data
(object): An object containing the user access token, secret0, secret0Link & wallet address.- walletToken : JWT token used to access the Wallet Operation endpoint.
- secret0 : The encrypted secret that user’s need to save in order to recover their wallet if user lose access to the account.
- secret0Link : Temporary link to download recovery file. The value is same as secret0 value, but it is already saved in .xellar file. The link will be expired in 5 minutes after being created.
- address : User’s MPC wallet address.
Example Response
V1
{
"status": 200,
"message": "Create wallet successfully",
"data": {
"walletToken": "your_wallet_token_here",
"secret0": "your_secret_here",
"secret0Link": "temporary_link_to_download_secret0_file",
"address": "your_address"
}
}
V2
📝
This response only works on v2
{
"status": 200,
"message": "Create wallet successfully",
"data": {
"walletToken": "your_wallet_token_here",
"refreshToken": "your_refresh_token_here",
"secret0": "your_secret_here",
"secret0Link": "temporary_link_to_download_secret0_file",
"address": "your_address"
}
}
⚠️
Remember to save secret0 value from response data to file with file extension .xellar. This file will be useful if user want to recover their wallet to new account.