# Clients

A user can query the BlockX `x/vesting` module using the CLI, gRPC, or REST.

### CLI <a href="#cli" id="cli"></a>

Find below a list of `blockxd` commands added with the `x/vesting` module. You can obtain the full list by using the `blockxd -h` command.

#### Genesis <a href="#genesis" id="genesis"></a>

The genesis configuration commands allow users to configure the genesis `vesting` account state.

`add-genesis-account`

Allows users to set up clawback vesting accounts at genesis, funded with an allocation of tokens, subject to clawback. Must provide a lockup periods file (`--lockup`), a vesting periods file (`--vesting`), or both.

If both files are given, they must describe schedules for the same total amount. If one file is omitted, it will default to a schedule that immediately unlocks or vests the entire amount. The described amount of coins will be transferred from the --from address to the vesting account.&#x20;

Unvested coins may be "clawed back" by the funder with the clawback command. Coins may not be transferred out of the account if they are locked or unvested.

```bash
blockxd add-genesis-account [address_or_key_name] [coin][,[coin]] [flags]
```

#### Queries <a href="#queries" id="queries"></a>

The `query` commands allow users to query `vesting` account state.

**`balances`**

Allows users to query the locked, unvested and vested tokens for a given vesting account

```bash
blockxd query vesting balances [address] [flags]
```

#### Transactions <a href="#transactions" id="transactions"></a>

The `tx` commands allow users to create and clawback `vesting` account state.

**`create-clawback-vesting-account`**

Allows users to create a new vesting account funded with an allocation of tokens, subject to clawback. Must provide a lockup periods file (--lockup), a vesting periods file (--vesting), or both.

If both files are given, they must describe schedules for the same total amount. If one file is omitted, it will default to a schedule that immediately unlocks or vests the entire amount. The described amount of coins will be transferred from the --from address to the vesting account.&#x20;

Unvested coins may be "clawed back" by the funder with the clawback command. Coins may not be transferred out of the account if they are locked or unvested.

<pre class="language-bash"><code class="lang-bash"><strong>blockxd tx vesting create-clawback-vesting-account [to_address] [flags]
</strong></code></pre>

**`clawback`**

Allows users to create a transfer unvested amount out of a ClawbackVestingAccount. Must be requested by the original funder address (--from) and may provide a destination address (--dest), otherwise the coins return to the funder.&#x20;

Delegated or undelegating staking tokens will be transferred in the delegated (undelegating) state. The recipient is vulnerable to slashing, and must act to unbond the tokens if desired.

```bash
blockxd tx vesting clawback [address] [flags]
```

### gRPC <a href="#grpc" id="grpc"></a>

#### Queries <a href="#queries-2" id="queries-2"></a>

| Verb   | Method                                  | Description                            |
| ------ | --------------------------------------- | -------------------------------------- |
| `gRPC` | `blockx.vesting.v1.Query/Balances`      | Gets locked, unvested and vested coins |
| `GET`  | `/blockx/vesting/v1/balances/{address}` | Gets locked, unvested and vested coins |

#### Transactions <a href="#transactions-2" id="transactions-2"></a>

| Verb   | Method                                                  | Description                      |
| ------ | ------------------------------------------------------- | -------------------------------- |
| `gRPC` | `blockx.vesting.v1.Msg/CreateClawbackVestingAccount`    | Creates clawback vesting account |
| `gRPC` | `/blockx.vesting.v1.Msg/Clawback`                       | Performs clawback                |
| `GET`  | `/blockx/vesting/v1/tx/create_clawback_vesting_account` | Creates clawback vesting account |
| `GET`  | `/blockx/vesting/v1/tx/clawback`                        | Performs clawback                |
