Create A Wallet
Basic Description
This endpoint is used to create a Wallet in Taurus-PROTECT. To understand what a Wallet is and how to use it, please refer to the following page in the Taurus User Guides.
This endpoint would accept a POST Request with a JSON payload containing the Wallet details. The name
and currency
are the only two required parameters that must be included within the JSON payload. Optionally, container
, isOmnibus
, comment
, customerId
, and blockchain
can also be set within the JSON payload.
Prerequisites
Required Roles
Certain API endpoints require that the user has a specific role in order to access them. Roles are used to restrict access to certain functionality within the system and ensure that only authorized users are able to perform specific actions.
Here is the list of required Roles for this particular endpoint:
- AccountCreator
- TPUser
To find out more about roles, please refer to the following page in the Taurus User Guides.
Required Input Parameters
Certain API endpoints require specific input parameters. Here is the list of Required Input Parameters for this particular endpoint:
- name: The name of the new Wallet.
- currency: The currency that will be held within the wallet.
Preconditions
It is important to note that the selected currency needs to be active in the system.
For example, If you haven't enabled BTC in your HSM, you will not be able to create a wallet on BTC.
Call Example
You can find a basic example in cURL below.
Please note that you will need to update the BASEURL
and the APITOKEN
for the command to function.
export BASEURL=https://taurus-protect-instance.com
export APIToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZXh0ZXJuYWxVc2VySUQiOiJ0ZWFtMUV4dGVybmFsVXNlcklEIiwidGVuYW50SUQiOjEsImNhcGl0YWxUZW5hbnRJRCI6MSwiZmlyc3RuYW1lIjoiSm9obiIsImxhc3RuYW1lIjoiRG9lIiwicm9sZXMiOlsidHB1c2VyIl0sImVtYWlsIjoidGVhbTFAYmFuay5jb20iLCJ1c2VybmFtZSI6InRlYW0xIiwiand0X3JlbmV3YWJsZV9hbW91bnQiOjAsImlzX3RvdHBfZW5hYmxlZCI6ZmFsc2UsImF1dGhfc3RhdHVzIjoiU1VDQ0VTUyIsImxhc3RfbG9naW4iOiIyMDIzLTAxLTAxVDAwOjAwOjAwLjE0OTc0NDIzMloiLCJsb2dnZWRfaW5fd2l0aF9zc28iOmZhbHNlLCJrZXkiOiIiLCJleHAiOjE2ODEyMTkyNzYsImlhdCI6MTY4MTIxNzQ3Nn0.K_85arIrigpkN1yHttCydpeT6oVg2c6PyQnuji907Og
curl --location "$BASEURL/api/rest/v1/wallets" \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header "Authorization: Bearer $APIToken" \
--data '{
"currency": "ETH",
"name": "API-Documentation - Test 2"
}'
This piece of code sends a POST request to https://your-protect-instance.example.com/api/rest/v1/wallets with the JSON string in the request body.
Call Result
A successful response for the POST call to create a wallet might look like this:
{
"result": {
"id": "71336",
"balance": {
"totalConfirmed": "0",
"totalUnconfirmed": "0",
"availableConfirmed": "0",
"availableUnconfirmed": "0",
"reservedConfirmed": "0",
"reservedUnconfirmed": "0"
},
"currency": "ETH",
"coin": "ETH",
"name": "API-Documentation-Test",
"accountPath": "m/44'/60'/96'",
"creationDate": "2023-03-30T15:31:55.170253Z",
"updateDate": "2023-03-30T15:31:55.170253Z",
"blockchain": "ETH"
}
}
In this example, Taurus-PROTECT has created a new Wallet with the specified name and currency, and has assigned it a unique ID of "66313". Taurus-PROTECT responds with a JSON object containing the wallet details, including the newly assigned Wallet id
.
Requirements for Future Use
For this particular endpoint, we do not have any storage requirements other than the Wallet id
that will be included in the JSON Body Response.
Important Note - Smart Contracts and Multiple IDs
When creating a wallet on a blockchain that supports smart contracts (such as ETH, XTZ, ALGO), Taurus-PROTECT utilizes an automated process to scan the table of whitelisted smart contracts. This process results in the creation of virtual wallets for each whitelisted smart contract.
For example, let's assume that the USDT smart contract on the Ethereum blockchain is whitelisted within Taurus-PROTECT. When a new ETH wallet is created, Taurus-PROTECT will automatically generate a corresponding USDT wallet. It's important to note that these wallets will possess distinct IDs for each currency, ensuring their uniqueness and proper association.
You can find the Swagger-generated page for this endpoint in the following link.
Updated 23 days ago