# Web3 pool API

### Claim

## Add a balance to the specified wallet

<mark style="color:green;">`POST`</mark> `/Claim/AddUserClaimable`&#x20;

#### Request Body

| Name                                          | Type            | Description         |
| --------------------------------------------- | --------------- | ------------------- |
| userAddress<mark style="color:red;">\*</mark> | String          | User Wallet         |
| token<mark style="color:red;">\*</mark>       | String          | Withdrawal currency |
| amount<mark style="color:red;">\*</mark>      | Number($double) | Withdrawal amount   |

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

```json
{
  "requestId": 0
}
```

{% endtab %}

{% tab title="400: Bad Request Bad Request" %}

```json
{
  "errors": {
    "additionalProp1": [
      "string"
    ],
    "additionalProp2": [
      "string"
    ],
    "additionalProp3": [
      "string"
    ]
  }
}
```

{% endtab %}
{% endtabs %}

## Reduce balance to the specified purse

<mark style="color:green;">`POST`</mark> `/Claim/DecreaseUserClaimable`

#### Request Body

| Name                                          | Type            | Description         |
| --------------------------------------------- | --------------- | ------------------- |
| userAddress<mark style="color:red;">\*</mark> | String          | User Wallet         |
| token<mark style="color:red;">\*</mark>       | String          | Withdrawal currency |
| amount<mark style="color:red;">\*</mark>      | Number($double) | Withdrawal amount   |

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

```json
{
  "requestId": 0
}
```

{% endtab %}

{% tab title="400: Bad Request Bad Request" %}

```json
{
  "errors": {
    "additionalProp1": [
      "string"
    ],
    "additionalProp2": [
      "string"
    ],
    "additionalProp3": [
      "string"
    ]
  }
}
```

{% endtab %}
{% endtabs %}

### ContractSettings

## Add a token to the contract whitelist

<mark style="color:green;">`POST`</mark> `/ContractSettings/AddTokenToWhitelist`

#### Request Body

| Name                                    | Type   | Description                  |
| --------------------------------------- | ------ | ---------------------------- |
| token<mark style="color:red;">\*</mark> | String | Currency to add to whitelist |

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

```json
{
  "requestId": 0
}
```

{% endtab %}

{% tab title="400: Bad Request Bad Request" %}

```json
{
  "errors": {
    "additionalProp1": [
      "string"
    ],
    "additionalProp2": [
      "string"
    ],
    "additionalProp3": [
      "string"
    ]
  }
}
```

{% endtab %}
{% endtabs %}

### Info

## Get information about the contract

<mark style="color:blue;">`GET`</mark> `/Info/Contract`

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

```json
{
  "address": "string",
  "feePercent": 0,
  "whiteListedTokens": [
    "string"
  ],
  "balances": [
    {
      "currency": "string",
      "total": 0,
      "reserved": 0,
      "free": 0,
      "fee": 0
    }
  ]
}
```

{% endtab %}

{% tab title="400: Bad Request Bad Request" %}

```json
{
  "errors": {
    "additionalProp1": [
      "string"
    ],
    "additionalProp2": [
      "string"
    ],
    "additionalProp3": [
      "string"
    ]
  }
}
```

{% endtab %}
{% endtabs %}

## List of supported tokens

<mark style="color:blue;">`GET`</mark> `/Info/SupportedTokens`

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

```json
[
  {
    "name": "string",
    "contract": "string"
  }
]
```

{% endtab %}
{% endtabs %}

### Queue

## Get request status

<mark style="color:blue;">`GET`</mark> `/Queue/Status/{queueId}`

#### Path Parameters

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

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

```json
{
  "error": "string",
  "status": "string"
}
```

{% endtab %}

{% tab title="400: Bad Request Bad Request" %}

```json
{
  "errors": {
    "additionalProp1": [
      "string"
    ],
    "additionalProp2": [
      "string"
    ],
    "additionalProp3": [
      "string"
    ]
  }
}
```

{% endtab %}
{% endtabs %}

### Withdraw

## Withdrawing available funds

<mark style="color:green;">`POST`</mark> `/Withdraw`

#### Request Body

| Name                                     | Type            | Description         |
| ---------------------------------------- | --------------- | ------------------- |
| wallet<mark style="color:red;">\*</mark> | string          | Recipient's wallet  |
| token<mark style="color:red;">\*</mark>  | string          | Withdrawal currency |
| amount<mark style="color:red;">\*</mark> | number($double) | Withdrawal amount   |

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

```json
{
  "requestId": 0
}
```

{% endtab %}

{% tab title="400: Bad Request Bad Request" %}

```json
{
  "errors": {
    "additionalProp1": [
      "string"
    ],
    "additionalProp2": [
      "string"
    ],
    "additionalProp3": [
      "string"
    ]
  }
}
```

{% endtab %}
{% endtabs %}

## Schemas

<details>

<summary><strong>AddTokenToWhitelistModel</strong></summary>

```javascript
{
userAddress*	string
User Wallet

token*	string
Withdrawal currency

amount*	number($double)
Withdrawal amount

}
```

</details>

<details>

<summary>AddUserClaimbleModel</summary>

```javascript
{
userAddress*	string
User Wallet

token*	string
Withdrawal currency

amount*	number($double)
Withdrawal amount

}
```

</details>

<details>

<summary>ApiBadRequestResponse</summary>

```javascript
{
errors	{...}
nullable: true
}
```

</details>

<details>

<summary>Bep20Contract</summary>

```javascript
{
name	string
nullable: true
contract	string
nullable: true
}
```

</details>

<details>

<summary>ContractBalanceModel</summary>

```javascript
{
currency	string
nullable: true
Currency

total	number($double)
Total contract balance

reserved	number($double)
Reserved for users

free	number($double)
Available balance for withdrawal or reservation

fee	number($double)
Commission from free balance

}
```

</details>

<details>

<summary>ContractInfoModel</summary>

```javascript
{
address	string
nullable: true
Contract Address

feePercent	number($double)
Commission

whiteListedTokens	[...]
balances	[...]
}
```

</details>

<details>

<summary>QueryResult</summary>

```javascript
{
requestId	integer($int32)
Request Id

}
```

</details>

<details>

<summary>QueueResult</summary>

```javascript
{
error	string
nullable: true
Error description

status	string
nullable: true
Request Status

}
```

</details>

<details>

<summary>WithdrawModel</summary>

```javascript
{
wallet*	string
Recipient's wallet

token*	string
Withdrawal currency

amount*	number($double)
minimum: 0
Withdrawal amount

}
```

</details>
