> For the complete documentation index, see [llms.txt](https://docs.relysia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.relysia.com/wallets/wallets.md).

# Wallets

How to create your first Blockchain Wallet.

#### Wallets

Once you created a new account, you first need to create a wallet. Since Relysia allows you to pick between multiple wallet types, we rather leave the wallet choice to the user on their setup. Lets explore how to set up your first wallet.&#x20;

#### Types of Wallets

As the name already indicates, the `createWallet()` adds a new wallet straight to your user account. There is no limit to the number of wallets you can have in a single account. Lets first explore the most simple **standard wallet** case, before exploring the extended version. Using the `walletTitle: 'default'` tag, will create a wallet with deterministic path id `0000-00000000-00000` .

```javascript
var parameters = {
    walletTitle: 'default'
}

const response = await relysia.wallet.v1.createWallet(parameters);
```

{% hint style="info" %}
in most endpoints you see a **walletId** input, if you create a default wallet, you can leave the field open and the API will automatically access the default wallet for the operation.
{% endhint %}

The standard wallet will do the trick for most wallet applications in terms of encryption and usability. For extended functionality, such as password protection or escrow wallets, use the following synthax.

```javascript
var parameters = {
    walletTitle: 'required',
    serviceId: 'optional',
    type: 'optional',
    walletLogo: 'optional',
    walletPassword: 'optional',
}

const response = await relysia.wallet.v1.createWallet(parameters);
```

## Create a wallet.

<mark style="color:blue;">`GET`</mark> `https://api.relysia.com/v1/createWallet`

Create a HD wallet of choice in your user account. You can select between standard, secure, escrow and shared wallets (see docs.relysia.com).

#### Headers

| Name                                          | Type    | Description |
| --------------------------------------------- | ------- | ----------- |
| walletTitle<mark style="color:red;">\*</mark> | string  |             |
| mnemonicPhrase                                | string  |             |
| paymail                                       | string  |             |
| paymailActivate                               | boolean |             |
| type                                          | string  |             |
| walletLogo                                    | string  |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
  "statusCode": 200,
  "data": {
    "status": "success",
    "msg": "wallet created successfully",
    "walletID": "58c4e3e0-c4d3-413e-a8b9-3b30508e8c83"
  }
}
```

{% endtab %}
{% endtabs %}

{% hint style="success" %}
There are 4 wallet types: ***Standard Wallets*** have a base encryption, ***Secure Wallets*** are additionally password protected, unencrypted ***Escrow Wallets*** and ***Multi Party Wallets*** (that make use of multi-sig schemes). Each type has very specific use cases that depend on your applications needs
{% endhint %}

#### List All Wallets&#x20;

The wallets endpoint returns you a list of all the wallets associated with your Relysia account. The response details include: **walletID**, **walletTitle** and a link to your **walletLogo**.

```javascript
var parameters = {
    oauth: 'optional',
    serviceId: 'optional',
}

const response = await relysia.wallet.v1.wallets(parameters);
```

## List of available user wallets.

<mark style="color:blue;">`GET`</mark> `https://api.relysia.com/v1/wallets`

The endpoint provides the user with a list of all active wallets on their account. Depending on your service requirements, you might have one or multiple wallets.

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
  "statusCode": 200,
  "data": {
    "status": "success",
    "msg": "Operation completed successfully",
    "wallets": [
      {
        "walletID": "58c4e3e0-c4d3-413e-a8b9-3b30508e8c83",
        "walletTitle": "Relysia production wallet",
        "walletLogo": null
      },
      {
        "walletID": "ec4ae905-c5ef-41bd-adfb-4db361093245",
        "walletTitle": "Relysia secondary wallet",
        "walletLogo": null
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

#### Delete Specific Wallet

To delete any specific wallet from your account, you can use this endpoint. You need to pass your **walletID** that you received from [#list-all-wallets](#list-all-wallets "mention")endpoint.

## Delete specific wallet

<mark style="color:red;">`DELETE`</mark> `https://api.relysia.com/v1/wallet`

To delete a wallet, this api will delete your wallet and related data of that walletId

#### Headers

| Name                                       | Type   | Description |
| ------------------------------------------ | ------ | ----------- |
| walletID<mark style="color:red;">\*</mark> | string |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
  statusCode: 200,
  data: {
    status: 'success',
    msg: 'wallet deleted successfully !',
    walletId: '58c4e3e0-c4d3-413e-a8b9-3b30508e8c83'
  }
}
```

{% endtab %}
{% endtabs %}

#### Delete All Wallets

## Delete all wallets of account

<mark style="color:red;">`DELETE`</mark> `https://api.relysia.com/v1/wallets`

To delete all wallet, this api will delete all wallets at once

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
  statusCode: 200,
  data: { status: 'success', msg: 'wallets deleted successfully !' }
}
```

{% endtab %}
{% endtabs %}
