# Stratos-chain REST APIs

## Overview

Generally, all the APIs provided here could be grouped into HTTP `GET` and `POST` requests. We classified these APIs into sections based on their modules or their operations for an in-depth analysis.

**`GET` Request**

The response content type is `application/json`

**`POST` Request**

The response content type is `application/json`. If it has a request body, the request content is also in `application/json` format.

A `POST` request will return an **unsigned** transaction, which equals to its equivalent `stchaincli` command with a `--generate-only` flag.

Comparison between REST API and its equivalent `` stchaincli` `` command

Suppose a `send` transaction that transfers tokens from one account to another. The following comparison demonstrates we can get the same response in both methods.

**REST API**

Http `POST` request

```http
http://127.0.0.1:1317/bank/accounts/st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6/transfers
```

Request body

```json
{
  "base_req": {
    "from": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
    "memo": "Send Tx Example",
    "chain_id": "test-chain",
    "account_number": "0",
    "gas": "200000",
    "gas_adjustment": "1.2",
    "fees": [
      {
        "denom": "ustos",
        "amount": "100"
      }
    ],
    "simulate": false
  },
  "amount": [
    {
      "denom": "ustos",
      "amount": "1000000"
    }
  ]
}
```

Response

```json
{
    "type": "cosmos-sdk/StdTx",
    "value": {
        "msg": [
            {
                "type": "cosmos-sdk/MsgSend",
                "value": {
                    "from_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
                    "to_address": "st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6",
                    "amount": [
                        {
                            "denom": "ustos",
                            "amount": "1000000"
                        }
                    ]
                }
            }
        ],
        "fee": {
            "amount": [
                {
                    "denom": "ustos",
                    "amount": "100"
                }
            ],
            "gas": "200000"
        },
        "signatures": null,
        "memo": "Send Tx Example"
    }
}
```

**`stchaincli` command**

```shell
$ ./build/stchaincli tx send st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2 st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6 1000000ustos --fees 100ustos --chain-id=test-chain --keyring-backend=test --memo "Send Tx Example" --generate-only --gas=auto
```

Output

```json
{
    "type": "cosmos-sdk/StdTx",
    "value": {
        "msg": [
            {
                "type": "cosmos-sdk/MsgSend",
                "value": {
                    "from_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
                    "to_address": "st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6",
                    "amount": [
                        {
                            "denom": "ustos",
                            "amount": "1000000"
                        }
                    ]
                }
            }
        ],
        "fee": {
            "amount": [
                {
                    "denom": "ustos",
                    "amount": "100"
                }
            ],
            "gas": "200000"
        },
        "signatures": null,
        "memo": "Send Tx Example"
    }
}
```

<br>

## Stratos-chain REST APIs

As usual, for ease of use, these APIs have been classified by the following modules &#x20;

### Auth

## Get the account information on blockchain

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/auth/accounts/{address}`

Example: <http://127.0.0.1:1317/auth/accounts/st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s>

#### Path Parameters

| Name                                      | Type   | Description    |
| ----------------------------------------- | ------ | -------------- |
| address<mark style="color:red;">\*</mark> | String | wallet address |

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

```javascript
{
  "height": "2536",
  "result": {
    "type": "cosmos-sdk/Account",
    "value": {
      "address": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s",
      "coins": [
        {
          "denom": "ustos",
          "amount": "999500000000000"
        }
      ],
      "public_key": {
        "type": "tendermint/PubKeySecp256k1",
        "value": "A4oRGeSYDImfg5OhXPPOQ1p0Sepc5PkxhCV3sDe5uNao"
      },
      "account_number": "0",
      "sequence": "1"
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Bank

## Get the account balances

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/bank/balances/{address}`

Example:&#x20;

<http://127.0.0.1:1317/bank/balances/st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s>

#### Path Parameters

| Name                                      | Type   | Description    |
| ----------------------------------------- | ------ | -------------- |
| address<mark style="color:red;">\*</mark> | String | wallet address |

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

```javascript
{
    // Response
}{
  "height": "614",
  "result": [
    {
      "denom": "ustos",
      "amount": "999500000000000"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Send coins from one account to another

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:1317/bank/accounts/{address}/transfers`&#x20;

Example:&#x20;

<http://127.0.0.1:1317/bank/accounts/st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6/transfers>

#### Path Parameters

| Name                                      | Type   | Description    |
| ----------------------------------------- | ------ | -------------- |
| address<mark style="color:red;">\*</mark> | String | wallet address |

#### Request Body

| Name                               | Type | Description                                                                                                                                                                                                                                                                                                                        |
| ---------------------------------- | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <mark style="color:red;">\*</mark> | json | { "base\_req": { "from": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2", "memo": "Send Tx Example", "chain\_id": "test-chain", "account\_number": "0", "gas": "200000", "gas\_adjustment": "1.2", "fees": \[ { "denom": "ustos", "amount": "100" } ], "simulate": false }, "amount": \[ { "denom": "ustos", "amount": "1000000" } ] } |

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

```javascript
{
  "type": "cosmos-sdk/StdTx",
  "value": {
    "msg": [
      {
        "type": "cosmos-sdk/MsgSend",
        "value": {
          "from_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
          "to_address": "st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6",
          "amount": [
            {
              "denom": "ustos",
              "amount": "1000000"
            }
          ]
        }
      }
    ],
    "fee": {
      "amount": [
        {
          "denom": "ustos",
          "amount": "100"
        }
      ],
      "gas": "200000"
    },
    "signatures": null,
    "memo": "Send Tx Example"
  }
}
```

{% endtab %}
{% endtabs %}

### Distribution

## Get the total rewards balance from all delegations

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/distribution/delegators/{delegatorAddr}/rewards`&#x20;

Example:

<http://127.0.0.1:1317/bank/accounts/st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6/transfers>

#### Path Parameters

| Name                                            | Type   | Description       |
| ----------------------------------------------- | ------ | ----------------- |
| delegatorAddr<mark style="color:red;">\*</mark> | String | delegator address |

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

```javascript
{
  "height": "2267",
  "result": {
    "rewards": [
      {
        "validator_address": "stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm",
        "reward": [
          {
            "denom": "ustos",
            "amount": "41192446491.504000000000000000"
          }
        ]
      }
    ],
    "total": [
      {
        "denom": "ustos",
        "amount": "41192446491.504000000000000000"
      }
    ]
  }
} 
```

{% endtab %}
{% endtabs %}

## Query a delegation reward

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/distribution/delegators/{delegatorAddr}/rewards/{validatorAddr}`

Example:

<http://127.0.0.1:1317/distribution/delegators/st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s/rewards/stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm>

#### Path Parameters

| Name                                            | Type   | Description       |
| ----------------------------------------------- | ------ | ----------------- |
| delegatorAddr<mark style="color:red;">\*</mark> | String | delegator address |
| validatorAddr<mark style="color:red;">\*</mark> | String | validator address |

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

```javascript
{
    "height": "2304",
    "result": [
        {
            "denom": "ustos",
            "amount": "41864892292.314000000000000000"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Get the rewards withdrawal address

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/distribution/delegators/{delegatorAddr}/withdraw_address`

Example:

<http://127.0.0.1:1317/distribution/delegators/st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s/withdraw\\_address>

#### Path Parameters

| Name                                            | Type   | Description       |
| ----------------------------------------------- | ------ | ----------------- |
| delegatorAddr<mark style="color:red;">\*</mark> | String | delegator address |

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

```javascript
{
    "height": "2327",
    "result": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s"
}
```

{% endtab %}
{% endtabs %}

## Get validator distribution information

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/distribution/validators/{validatorAddr}`

Example:

<http://127.0.0.1:1317/distribution/validators/stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm>

#### Path Parameters

| Name                                            | Type   | Description       |
| ----------------------------------------------- | ------ | ----------------- |
| validatorAddr<mark style="color:red;">\*</mark> | String | validator address |

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

```javascript
{
    "height": "2368",
    "result": {
        "operator_address": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s",
        "self_bond_rewards": [
            {
                "denom": "ustos",
                "amount": "43028052291.252000000000000000"
            }
        ],
        "val_commission": [
            {
                "denom": "ustos",
                "amount": "4780894699.028000000000000000"
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

## Fee distribution outstanding rewards of a single validator

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/distribution/validators/{validatorAddr}/outstanding_rewards`

Example:

<http://127.0.0.1:1317/distribution/validators/stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm/outstanding\\_rewards>

#### Path Parameters

| Name                                            | Type   | Description       |
| ----------------------------------------------- | ------ | ----------------- |
| validatorAddr<mark style="color:red;">\*</mark> | String | validator address |

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

```javascript
{
    "height": "2392",
    "result": [
        {
            "denom": "ustos",
            "amount": "48293600804.120000000000000000"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Commission and self-delegation rewards of a single validator

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/distribution/validators/{validatorAddr}/rewards`

Example:

<http://127.0.0.1:1317/distribution/validators/stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm/rewards>

#### Path Parameters

| Name                                            | Type   | Description       |
| ----------------------------------------------- | ------ | ----------------- |
| validatorAddr<mark style="color:red;">\*</mark> | String | validator address |

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

```javascript
{
    "height": "2445",
    "result": [
        {
            "denom": "ustos",
            "amount": "44427496811.796000000000000000"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Community pool parameters

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/distribution/community_pool`

Example:

<http://127.0.0.1:1317/distribution/community\\_pool{> "height": "2479", "result": \[ { "denom": "ustos", "amount": "1021438537.140000000000000000" } ] }\
`GET /distribution/community_pool`       Community pool parameters

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

```javascript
{
    "height": "2479",
    "result": [
        {
            "denom": "ustos",
            "amount": "1021438537.140000000000000000"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Fee distribution parameters

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/distribution/parameters`

Example:

<http://127.0.0.1:1317/distribution/parameters>

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

```javascript
{
    "height": "2496",
    "result": {
        "community_tax": "0.020000000000000000",
        "base_proposer_reward": "0.010000000000000000",
        "bonus_proposer_reward": "0.040000000000000000",
        "withdraw_addr_enabled": true
    }
}
```

{% endtab %}
{% endtabs %}

## Withdraw all the delegator's delegation rewards

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:1317/distribution/delegators/{delegatorAddr}/rewards`

Example:

<http://127.0.0.1:1317/distribution/delegators/st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2/rewards>

#### Path Parameters

| Name                                            | Type   | Description       |
| ----------------------------------------------- | ------ | ----------------- |
| delegatorAddr<mark style="color:red;">\*</mark> | String | delegator address |

#### Request Body

| Name                               | Type | Description                                                                                                                                                                                                                                                                           |
| ---------------------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <mark style="color:red;">\*</mark> | json | { "base\_req": { "from": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2", "memo": "Withdraw Rewards Tx Example", "chain\_id": "test-chain", "account\_number": "0", "gas": "200000", "gas\_adjustment": "1.2", "fees": \[ { "denom": "ustos", "amount": "1000" } ], "simulate": false } } |

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

```javascript
{
    "type": "cosmos-sdk/StdTx",
    "value": {
        "msg": [
            {
                "type": "cosmos-sdk/MsgWithdrawDelegationReward",
                "value": {
                    "delegator_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
                    "validator_address": "stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p"
                }
            }
        ],
        "fee": {
            "amount": [
                {
                    "denom": "ustos",
                    "amount": "1000"
                }
            ],
            "gas": "200000"
        },
        "signatures": null,
        "memo": "Withdraw Rewards Tx Example"
    }
}
```

{% endtab %}
{% endtabs %}

## Withdraw a delegator's delegation reward from a single validator

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:1317/distribution/delegators/{delegatorAddr}/rewards/{validatorAddr}`

Example:

<http://127.0.0.1:1317/distribution/delegators/st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2/rewards/stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p>

#### Path Parameters

| Name                                            | Type   | Description       |
| ----------------------------------------------- | ------ | ----------------- |
| delegatorAddr<mark style="color:red;">\*</mark> | String | delegator address |
| validatorAddr<mark style="color:red;">\*</mark> | String | validator address |

#### Request Body

| Name                               | Type | Description                                                                                                                                                                                                                                                                                                  |
| ---------------------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <mark style="color:red;">\*</mark> | json | { "base\_req": { "from": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2", "memo": "Withdraw Rewards From a Single Validator Tx Example", "chain\_id": "test-chain", "account\_number": "0", "gas": "200000", "gas\_adjustment": "1.2", "fees": \[ { "denom": "ustos", "amount": "100" } ], "simulate": false } } |

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

```javascript
{
    "type": "cosmos-sdk/StdTx",
    "value": {
        "msg": [
            {
                "type": "cosmos-sdk/MsgWithdrawDelegationReward",
                "value": {
                    "delegator_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
                    "validator_address": "stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p"
                }
            }
        ],
        "fee": {
            "amount": [
                {
                    "denom": "ustos",
                    "amount": "100"
                }
            ],
            "gas": "200000"
        },
        "signatures": null,
        "memo": "Withdraw Rewards From a Single Validator Tx Example"
    }
}
```

{% endtab %}
{% endtabs %}

## Replace the delegations' rewards withdrawal address for a new one

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:1317/distribution/delegators/{delegatorAddr}/withdraw_address`

Example:

<http://127.0.0.1:1317/distribution/delegators/st1wkya79c9dvqrwc7um4n9vljc0duds3z5y56j7f/withdraw\\_address>

#### Path Parameters

| Name                                            | Type   | Description                                                                                                                                                                                                                                                                                                                                                                  |
| ----------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| delegatorAddr<mark style="color:red;">\*</mark> | String | delegator address                                                                                                                                                                                                                                                                                                                                                            |
| <mark style="color:red;">\*</mark>              | json   | { "base\_req": { "from": "st1wkya79c9dvqrwc7um4n9vljc0duds3z5y56j7f", "memo": "Replace the Rewards Withdrawal Address Tx Example", "chain\_id": "test-chain", "account\_number": "0", "gas": "200000", "gas\_adjustment": "1.2", "fees": \[ { "denom": "ustos", "amount": "100" } ], "simulate": false }, "withdraw\_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2" } |

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

```javascript
{
    "type": "cosmos-sdk/StdTx",
    "value": {
        "msg": [
            {
                "type": "cosmos-sdk/MsgModifyWithdrawAddress",
                "value": {
                    "delegator_address": "st1wkya79c9dvqrwc7um4n9vljc0duds3z5y56j7f",
                    "withdraw_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2"
                }
            }
        ],
        "fee": {
            "amount": [
                {
                    "denom": "ustos",
                    "amount": "100"
                }
            ],
            "gas": "200000"
        },
        "signatures": null,
        "memo": "Replace the Rewards Withdrawal Address Tx Example"
    }
}
```

{% endtab %}
{% endtabs %}

## Withdraw the validator's self-delegation and commissions rewards

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:1317/distribution/validators/{validatorAddr}/rewards`

Example:

<http://127.0.0.1:1317/distribution/validators/stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p/rewards>

#### Path Parameters

| Name                                            | Type   | Description       |
| ----------------------------------------------- | ------ | ----------------- |
| validatorAddr<mark style="color:red;">\*</mark> | String | validator address |

#### Request Body

| Name                               | Type | Description                                                                                                                                                                                                                                                                                          |
| ---------------------------------- | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <mark style="color:red;">\*</mark> | json | { "base\_req": { "from": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2", "memo": "Withdraw the Validator's Rewards Tx Example", "chain\_id": "test-chain", "account\_number": "0", "gas": "200000", "gas\_adjustment": "1.2", "fees": \[ { "denom": "ustos", "amount": "100" } ], "simulate": false } } |

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

```javascript
{
    "type": "cosmos-sdk/StdTx",
    "value": {
        "msg": [
            {
                "type": "cosmos-sdk/MsgWithdrawValidatorCommission",
                "value": {
                    "validator_address": "stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p"
                }
            },
            {
                "type": "cosmos-sdk/MsgWithdrawDelegationReward",
                "value": {
                    "delegator_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
                    "validator_address": "stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p"
                }
            }
        ],
        "fee": {
            "amount": [
                {
                    "denom": "ustos",
                    "amount": "100"
                }
            ],
            "gas": "200000"
        },
        "signatures": null,
        "memo": "Withdraw the Validator's Rewards Tx Example"
    }
}
```

{% endtab %}
{% endtabs %}

***

### Gov

## &#x20;Query proposals information with parameters

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/gov/proposals`

Example:

<http://127.0.0.1:1317/gov/proposals?status=passed>

#### Query Parameters

| Name         | Type   | Description                                                                              |
| ------------ | ------ | ---------------------------------------------------------------------------------------- |
| voter        | String | voter address                                                                            |
| depositor    | String | depositor address                                                                        |
| status       | String | proposal status, valid values: "deposit\_period", "voting\_period", "passed", "rejected" |
| page         | int    | page number                                                                              |
| limit        | int    | maximum number of items per page                                                         |
| tx.minheight | int64  | transactions on blocks with height greater or equal this value                           |
| tx.maxheight | int64  | transactions on blocks with height less than or equal this value                         |

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

```javascript
{
  "height": "42",
  "result": [
    {
      "content": {
        "type": "cosmos-sdk/ParameterChangeProposal",
        "value": {
          "title": "Param-Change Staking MaxValidators to 100",
          "description": "This is a test to update MaxValidators to 100 in staking Module",
          "changes": [
            {
              "subspace": "staking",
              "key": "MaxValidators",
              "value": "100"
            }
          ]
        }
      },
      "id": "1",
      "proposal_status": "Passed",
      "final_tally_result": {
        "yes": "500000000000",
        "abstain": "0",
        "no": "0",
        "no_with_veto": "0"
      },
      "submit_time": "2021-08-05T20:09:08.402925192Z",
      "deposit_end_time": "2021-08-05T20:10:48.402925192Z",
      "total_deposit": [
        {
          "denom": "ustos",
          "amount": "12010000"
        }
      ],
      "voting_start_time": "2021-08-05T20:09:43.640293657Z",
      "voting_end_time": "2021-08-05T20:11:23.640293657Z"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Query a proposal by id

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/gov/proposals/{proposalId}`

Example:

<http://127.0.0.1:1317/gov/proposals/1>

#### Path Parameters

| Name                                         | Type | Description   |
| -------------------------------------------- | ---- | ------------- |
| proposalId<mark style="color:red;">\*</mark> | int  | `proposal Id` |

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

```javascript
{
  "height": "57",
  "result": {
    "content": {
      "type": "cosmos-sdk/ParameterChangeProposal",
      "value": {
        "title": "Param-Change Staking MaxValidators to 100",
        "description": "This is a test to update MaxValidators to 100 in staking Module",
        "changes": [
          {
            "subspace": "staking",
            "key": "MaxValidators",
            "value": "100"
          }
        ]
      }
    },
    "id": "1",
    "proposal_status": "Passed",
    "final_tally_result": {
      "yes": "500000000000",
      "abstain": "0",
      "no": "0",
      "no_with_veto": "0"
    },
    "submit_time": "2021-08-05T20:09:08.402925192Z",
    "deposit_end_time": "2021-08-05T20:10:48.402925192Z",
    "total_deposit": [
      {
        "denom": "ustos",
        "amount": "12010000"
      }
    ],
    "voting_start_time": "2021-08-05T20:09:43.640293657Z",
    "voting_end_time": "2021-08-05T20:11:23.640293657Z"
  }
}
```

{% endtab %}
{% endtabs %}

## Query for the proposer for a proposal

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/gov/proposals/{proposalId}/proposer`

Example:

<http://127.0.0.1:1317/gov/proposals/1/proposer>

#### Path Parameters

| Name       | Type | Description   |
| ---------- | ---- | ------------- |
| proposalId | int  | `proposal Id` |

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

```javascript
{
    "height": "0",
    "result": {
        "proposal_id": "1",
        "proposer": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2"
    }
}
```

{% endtab %}
{% endtabs %}

## Query deposits by proposal-id

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/gov/proposals/{proposalId}/deposits`

Example:

<http://127.0.0.1:1317/gov/proposals/1/deposits>

#### Path Parameters

| Name       | Type | Description   |
| ---------- | ---- | ------------- |
| proposalId | int  | `proposal Id` |

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

```javascript
{
  "height": "0",
  "result": [
    {
      "proposal_id": "1",
      "depositor": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
      "amount": [
        {
          "denom": "ustos",
          "amount": "12000000"
        }
      ]
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Query deposit by proposal-id and depositor address

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/gov/proposals/{proposalId}/deposits/{depositor}`

Example:

<http://127.0.0.1:1317/gov/proposals/1/deposits/st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2>

#### Path Parameters

| Name                                         | Type   | Description         |
| -------------------------------------------- | ------ | ------------------- |
| proposalId<mark style="color:red;">\*</mark> | int    | `proposal Id`       |
| depositor<mark style="color:red;">\*</mark>  | String | `depositor address` |

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

```javascript
{
    "height": "0",
    "result": {
        "proposal_id": "1",
        "depositor": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
        "amount": [
            {
                "denom": "ustos",
                "amount": "12000000"
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

## Query voters information by proposal-id

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/gov/proposals/{proposalId}/votes`

Example:

<http://127.0.0.1:1317/gov/proposals/1/votes>

#### Path Parameters

| Name                                         | Type | Description   |
| -------------------------------------------- | ---- | ------------- |
| proposalId<mark style="color:red;">\*</mark> | int  | `proposal Id` |

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

```javascript
{
    "height": "0",
    "result": []
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
Reported bug:

* The Governance API for votes(/gov/proposals/{proposalId}/votes) on a proposal returns null after voting period closes.
* This bug has been reported [here](https://github.com/cosmos/cosmos-sdk/issues/2879). A workaround is to use `/gov/proposals/{proposalId}.`
* Block log:&#x20;

\[2021-08-12|21:35:59.001] Served RPC HTTP response module=rest-server  method=GET url=/gov/proposals/1/votes status=200 duration=2 remoteAddr=127.0.0.1:55878
{% endhint %}

## Query vote information by proposal Id and voter address

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/gov/proposals/{proposalId}/votes/{voter}`

Example:

<http://127.0.0.1:1317/gov/proposals/1/votes/st12adksjsd7gcsn23h5jmvdygzx2lfw5q4kgq5zh>

#### Path Parameters

| Name                                         | Type   | Description     |
| -------------------------------------------- | ------ | --------------- |
| proposalId<mark style="color:red;">\*</mark> | int    | `proposal Id`   |
| voter<mark style="color:red;">\*</mark>      | String | `voter address` |

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

```javascript
{
    "error": "'' is not a valid vote option"
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
Reported bug:

* The Governance API for voter(/gov/proposals/{proposalId}/votes/{voter}) on a proposal Always return "'' is not a valid vote option" after voting period closes.
* This bug has been reported [here](https://github.com/cosmos/cosmos-sdk/issues/3204). A workaround is to use `/gov/proposals/{proposalId}`
* Block log

\[2021-08-12|21:35:45.288] Served RPC HTTP response module=rest-server method=GET url=/gov/proposals/1/votes/st12adksjsd7gcsn23h5jmvdygzx2lfw5q4kgq5zh status=400 duration=1 remoteAddr=127.0.0.1:55872
{% endhint %}

## &#x20;Get a proposal's tally result at the current time

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/gov/proposals/{proposalId}/tally`

Example:

<http://127.0.0.1:1317/gov/proposals/1/tally>

#### Path Parameters

| Name                                         | Type | Description |
| -------------------------------------------- | ---- | ----------- |
| proposalId<mark style="color:red;">\*</mark> | int  | proposal Id |

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

```javascript
{
  "height": "211",
  "result": {
    "yes": "500000000000",
    "abstain": "0",
    "no": "0",
    "no_with_veto": "0"
  }
} 
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
If the proposal is pending deposits (i.e status 'DepositPeriod') it returns an empty tally result
{% endhint %}

## Query gov deposit parameters

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/gov/parameters/deposit`

Example:

<http://127.0.0.1:1317/gov/parameters/deposit>

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

```javascript
{
  "height": "217",
  "result": {
    "min_deposit": [
      {
        "denom": "ustos",
        "amount": "10000000"
      }
    ],
    "max_deposit_period": "100000000000"
  }
}
```

{% endtab %}
{% endtabs %}

## Query governance tally parameters

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/gov/parameters/tallying`

Example:

<http://127.0.0.1:1317/gov/parameters/tallying>

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

```javascript
{
  "height": "222",
  "result": {
    "quorum": "0.334000000000000000",
    "threshold": "0.500000000000000000",
    "veto": "0.334000000000000000"
  }
}
```

{% endtab %}
{% endtabs %}

## Query governance voting parameters

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/gov/parameters/voting`

Example:

<http://127.0.0.1:1317/gov/parameters/voting>

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

```javascript
{
  "height": "227",
  "result": {
    "voting_period": "100000000000"
  }
}
```

{% endtab %}
{% endtabs %}

## Send transaction to submit a proposal

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:1317/gov/proposals`

Example:

<http://127.0.0.1:1317/gov/proposals>

#### Request Body

| Name                               | Type | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ---------------------------------- | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <mark style="color:red;">\*</mark> | json | { "base\_req": { "from": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr", "memo": "Submit Proposal Tx Example", "chain\_id": "test-chain", "gas": "200000", "gas\_adjustment": "1.2", "fees": \[ { "denom": "ustos", "amount": "100" } ], "simulate": false }, "title": "Text Proposal", "description": "This is a text proposal example", "proposal\_type": "text", "proposer": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr", "initial\_deposit": \[ { "denom": "ustos", "amount": "1000000" } ] } |

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

```javascript
{
  "type": "cosmos-sdk/StdTx",
  "value": {
    "msg": [
      {
        "type": "cosmos-sdk/MsgSubmitProposal",
        "value": {
          "content": {
            "type": "cosmos-sdk/TextProposal",
            "value": {
              "title": "Text Proposal",
              "description": "This is a text proposal example"
            }
          },
          "initial_deposit": [
            {
              "denom": "ustos",
              "amount": "1000000"
            }
          ],
          "proposer": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr"
        }
      }
    ],
    "fee": {
      "amount": [
        {
          "denom": "ustos",
          "amount": "100"
        }
      ],
      "gas": "200000"
    },
    "signatures": null,
    "memo": "Submit Proposal Tx Example"
  }
}
```

{% endtab %}
{% endtabs %}

## Generate a parameter change proposal transaction

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:1317/gov/proposals/param_change`

Example:

<http://127.0.0.1:1317/gov/proposals/param\\_change>

#### Request Body

| Name                               | Type | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ---------------------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <mark style="color:red;">\*</mark> | json | { "base\_req": { "from": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr", "memo": "Generate a parameter-change proposal Tx Example", "chain\_id": "test-chain", "gas": "200000", "gas\_adjustment": "1.2", "fees": \[ { "denom": "ustos", "amount": "100" } ], "simulate": false }, "title": "Param-Change Staking MaxValidators to 100", "description": "This is a test to update MaxValidators to 100 in staking Module", "proposer": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr", "deposit": \[ { "denom": "ustos", "amount": "10000000" } ], "changes": \[ { "subspace": "staking", "key": "MaxValidators", "value": 100 } ] } |

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

```javascript
{
    "type": "cosmos-sdk/StdTx",
    "value": {
        "msg": [
            {
                "type": "cosmos-sdk/MsgSubmitProposal",
                "value": {
                    "content": {
                        "type": "cosmos-sdk/ParameterChangeProposal",
                        "value": {
                            "title": "Param-Change Staking MaxValidators to 100",
                            "description": "This is a test to update MaxValidators to 100 in staking Module",
                            "changes": [
                                {
                                    "subspace": "staking",
                                    "key": "MaxValidators",
                                    "value": "100"
                                }
                            ]
                        }
                    },
                    "initial_deposit": [
                        {
                            "denom": "ustos",
                            "amount": "10000000"
                        }
                    ],
                    "proposer": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr"
                }
            }
        ],
        "fee": {
            "amount": [
                {
                    "denom": "ustos",
                    "amount": "100"
                }
            ],
            "gas": "200000"
        },
        "signatures": null,
        "memo": "Generate a parameter-change proposal Tx Example"
    }
}
```

{% endtab %}
{% endtabs %}

## Deposit tokens to a proposal

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:1317/gov/proposals/{proposalId}/deposits`

Example:

<http://127.0.0.1:1317/gov/proposals/1/deposits>

#### Path Parameters

| Name                                         | Type | Description |
| -------------------------------------------- | ---- | ----------- |
| proposalId<mark style="color:red;">\*</mark> | int  | proposal Id |

#### Request Body

| Name                               | Type | Description                                                                                                                                                                                                                                                                                                                                                                                   |
| ---------------------------------- | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <mark style="color:red;">\*</mark> | json | { "base\_req": { "from": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr", "memo": "Deposit tokens to Proposal 1 Tx Example", "chain\_id": "test-chain", "gas": "200000", "gas\_adjustment": "1.2", "fees": \[ { "denom": "ustos", "amount": "100" } ], "simulate": false }, "depositor": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr", "amount": \[ { "denom": "ustos", "amount": "10000000" } ] } |

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

```javascript
{
    "type": "cosmos-sdk/StdTx",
    "value": {
        "msg": [
            {
                "type": "cosmos-sdk/MsgDeposit",
                "value": {
                    "proposal_id": "1",
                    "depositor": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr",
                    "amount": [
                        {
                            "denom": "ustos",
                            "amount": "10000000"
                        }
                    ]
                }
            }
        ],
        "fee": {
            "amount": [
                {
                    "denom": "ustos",
                    "amount": "100"
                }
            ],
            "gas": "200000"
        },
        "signatures": null,
        "memo": "Deposit tokens to Proposal 1 Tx Example"
    }
}
```

{% endtab %}
{% endtabs %}

## Send transaction to vote a proposal

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:1317/gov/proposals/{proposalId}/votes`

Example:

<http://127.0.0.1:1317/gov/proposals/1/votes>

#### Path Parameters

| Name                                         | Type | Description |
| -------------------------------------------- | ---- | ----------- |
| proposalId<mark style="color:red;">\*</mark> | int  | proposal Id |

#### Request Body

| Name                               | Type | Description                                                                                                                                                                                                                                                                                                                        |
| ---------------------------------- | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <mark style="color:red;">\*</mark> | json | { "base\_req": { "from": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr", "memo": "Vote Proposal 1 Tx Example", "chain\_id": "test-chain", "gas": "200000", "gas\_adjustment": "1.2", "fees": \[ { "denom": "ustos", "amount": "100" } ], "simulate": false }, "voter": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr", "option": "yes" } |

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

```javascript
{
    "type": "cosmos-sdk/StdTx",
    "value": {
        "msg": [
            {
                "type": "cosmos-sdk/MsgVote",
                "value": {
                    "proposal_id": "1",
                    "voter": "st1g3saypgcxzfzpsx94lmr30gzk0rrfc892guayr",
                    "option": "Yes"
                }
            }
        ],
        "fee": {
            "amount": [
                {
                    "denom": "ustos",
                    "amount": "100"
                }
            ],
            "gas": "200000"
        },
        "signatures": null,
        "memo": "Vote Proposal 1 Tx Example"
    }
}
```

{% endtab %}
{% endtabs %}

### Mint

## Get mint module parameters

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/minting/parameters`

Example:

<http://127.0.0.1:1317/minting/inflation>

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

```javascript
{
  "height": "783",
  "result": {
    "mint_denom": "ustos",
    "inflation_rate_change": "0.130000000000000000",
    "inflation_max": "0.200000000000000000",
    "inflation_min": "0.070000000000000000",
    "goal_bonded": "0.670000000000000000",
    "blocks_per_year": "6311520"
  }
}
```

{% endtab %}
{% endtabs %}

## Get current minting inflation value

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/minting/inflation`

Example:

<http://127.0.0.1:1317/minting/inflation>

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

```javascript
{
  "height": "800",
  "result": "0.130016465508894587"
}
```

{% endtab %}
{% endtabs %}

## Get current minting annual provisions value

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317 /minting/annual-provisions`

Example:

<http://127.0.0.1:1317/minting/annual-provisions>

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

```javascript
{
  "height": "818",
  "result": "130019024060848.545708142618272810"
}
```

{% endtab %}
{% endtabs %}

### Slashing

## Get signing info of all validators

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/slashing/signing_infos`

Example:

<http://127.0.0.1:1317/slashing/signing\\_infos>

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

```javascript
{
  "height": "1379",
  "result": [
    {
      "address": "stvalcons18vm93nhrl8rx6ve22k5jqm9xzxk82fthchs2u0",
      "start_height": "0",
      "index_offset": "1378",
      "jailed_until": "1970-01-01T00:00:00Z",
      "tombstoned": false,
      "missed_blocks_counter": "0"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Get the current slashing parameters

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/slashing/parameters`

Example:

<http://127.0.0.1:1317/slashing/parameters>

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

```javascript
{
  "height": "1398",
  "result": {
    "signed_blocks_window": "100",
    "min_signed_per_window": "0.500000000000000000",
    "downtime_jail_duration": "600000000000",
    "slash_fraction_double_sign": "0.050000000000000000",
    "slash_fraction_downtime": "0.010000000000000000"
  }
}
```

{% endtab %}
{% endtabs %}

## Send transaction to unjail a jailed validator

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:1317/slashing/validators/{validatorAddr}/unjail`

Example:

<http://127.0.0.1:1317/slashing/validators/stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p/unjail>

#### Path Parameters

| Name                                            | Type  | Description       |
| ----------------------------------------------- | ----- | ----------------- |
| validatorAddr<mark style="color:red;">\*</mark> | Sring | validator address |

#### Request Body

| Name                               | Type | Description                                                                                                                                                                                                                                                           |
| ---------------------------------- | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <mark style="color:red;">\*</mark> | json | { "base\_req": { "from": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2", "memo": "Unjail a Jailed Validator Tx Example", "chain\_id": "test-chain", "gas": "200000", "gas\_adjustment": "1.2", "fees": \[ { "denom": "ustos", "amount": "100" } ], "simulate": false } } |

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

```javascript
{
  "type": "cosmos-sdk/StdTx",
  "value": {
    "msg": [
      {
        "type": "cosmos-sdk/MsgUnjail",
        "value": {
          "address": "stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p"
        }
      }
    ],
    "fee": {
      "amount": [
        {
          "denom": "ustos",
          "amount": "100"
        }
      ],
      "gas": "200000"
    },
    "signatures": null,
    "memo": "Unjail a Jailed Validator Tx Example"
  }
}
```

{% endtab %}
{% endtabs %}

### Staking

## Get all delegations from a delegator

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/staking/delegators/{delegatorAddr}/delegations`

Example:

<http://127.0.0.1:1317/staking/delegators/st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s/delegations>

#### Path Parameters

| Name                                            | Type   | Description       |
| ----------------------------------------------- | ------ | ----------------- |
| delegatorAddr<mark style="color:red;">\*</mark> | String | delegator address |

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

```javascript
{
  "height": "1441",
  "result": [
    {
      "delegator_address": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s",
      "validator_address": "stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm",
      "shares": "500000000000.000000000000000000",
      "balance": {
        "denom": "ustos",
        "amount": "500000000000"
      }
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Query the current delegation between a delegator and a validator

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/staking/delegators/{delegatorAddr}/delegations/{validatorAddr}`

Example:

<http://127.0.0.1:1317/staking/delegators/st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s/delegations/stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm>

#### Path Parameters

| Name                                            | Type   | Description       |
| ----------------------------------------------- | ------ | ----------------- |
| delegatorAddr<mark style="color:red;">\*</mark> | String | delegator address |
| validatorAddr<mark style="color:red;">\*</mark> | String | validator address |

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

```javascript
{
  "height": "1556",
  "result": {
    "delegator_address": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s",
    "validator_address": "stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm",
    "shares": "500000000000.000000000000000000",
    "balance": {
      "denom": "ustos",
      "amount": "500000000000"
    }
  }
}
```

{% endtab %}
{% endtabs %}

## Get all redelegations

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/staking/redelegations`

Example:

<http://127.0.0.1:1318/staking/redelegations>

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

```javascript
{
  "height": "2823",
  "result": [
    {
      "delegator_address": "st15xlpwafgnvvs5hdk8938dp2ve6cjmy4vcf4l76",
      "validator_src_address": "stvaloper1gamc7ajhzukp08nle9z9asyfx4u4dlz53dquzj",
      "validator_dst_address": "stvaloper1zgqhnz69jppcwg9z27vtq3zq9r3du5v6vjqvpq",
      "entries": [
        {
          "creation_height": 1909,
          "completion_time": "2021-09-02T19:33:26.890343914Z",
          "initial_balance": "10000",
          "shares_dst": "10000.000000000000000000",
          "balance": "10000"
        }
      ]
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Get all unbonding delegations from a delegator

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/staking/delegators/{delegatorAddr}/unbonding_delegations`

Example:

<http://127.0.0.1:1317/staking/delegators/st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2/unbonding\\_delegations>

#### Path Parameters

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| delegatorAddr<mark style="color:red;">\*</mark> | String | `delegator address` |

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

```javascript
{
  "height": "6033",
  "result": [
    {
      "delegator_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
      "validator_address": "stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p",
      "entries": [
        {
          "creation_height": "5805",
          "completion_time": "2021-08-30T19:53:31.144199109Z",
          "initial_balance": "10000",
          "balance": "10000"
        }
      ]
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Query all unbonding delegations between a delegator and a validator

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/staking/delegators/{delegatorAddr}/unbonding_delegations/{validatorAddr}`

Example:

<http://127.0.0.1:1317/staking/delegators/st12adksjsd7gcsn23h5jmvdygzx2lfw5q4kgq5zh/unbonding\\_delegations/stvaloper12adksjsd7gcsn23h5jmvdygzx2lfw5q4pyf57u>

#### Path Parameters

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| delegatorAddr<mark style="color:red;">\*</mark> | String | `delegator address` |
| validatorAddr<mark style="color:red;">\*</mark> | String | `validator address` |

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

```javascript
{
    "height": "2742",
    "result": {
        "delegator_address": "st12adksjsd7gcsn23h5jmvdygzx2lfw5q4kgq5zh",
        "validator_address": "stvaloper12adksjsd7gcsn23h5jmvdygzx2lfw5q4pyf57u",
        "entries": [
            {
                "creation_height": "2739",
                "completion_time": "2021-09-03T00:26:44.825391686Z",
                "initial_balance": "10000",
                "balance": "10000"
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

## Query all validators that a delegator is bonded to

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/staking/delegators/{delegatorAddr}/validators`

Example:

<http://127.0.0.1:1317/staking/delegators/st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s/validators>

#### Path Parameters

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| delegatorAddr<mark style="color:red;">\*</mark> | String | `delegator address` |

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

```javascript
{
  "height": "1739",
  "result": [
    {
      "operator_address": "stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm",
      "consensus_pubkey": "stvalconspub1zcjduepq4j7xcu0uyakxyalnxxufv6s4895f48c7u4hrfg5d8zdgy4h4k4usg4zy96",
      "jailed": false,
      "status": 2,
      "tokens": "500000000000",
      "delegator_shares": "500000000000.000000000000000000",
      "description": {
        "moniker": "node",
        "identity": "",
        "website": "",
        "security_contact": "",
        "details": ""
      },
      "unbonding_height": "0",
      "unbonding_time": "1970-01-01T00:00:00Z",
      "commission": {
        "commission_rates": {
          "rate": "0.100000000000000000",
          "max_rate": "0.200000000000000000",
          "max_change_rate": "0.010000000000000000"
        },
        "update_time": "2021-08-03T18:57:24.382040932Z"
      },
      "min_self_delegation": "1"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Query a validator that a delegator is bonded to

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/staking/delegators/{delegatorAddr}/validators/{validatorAddr}`

Example:

<http://127.0.0.1:1317/staking/delegators/st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s/validators/stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm>

#### Path Parameters

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| delegatorAddr<mark style="color:red;">\*</mark> | String | `delegator address` |
| validatorAddr<mark style="color:red;">\*</mark> | String | `validator address` |

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

```javascript
{
  "height": "1937",
  "result": {
    "operator_address": "stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm",
    "consensus_pubkey": "stvalconspub1zcjduepq4j7xcu0uyakxyalnxxufv6s4895f48c7u4hrfg5d8zdgy4h4k4usg4zy96",
    "jailed": false,
    "status": 2,
    "tokens": "500000000000",
    "delegator_shares": "500000000000.000000000000000000",
    "description": {
      "moniker": "node",
      "identity": "",
      "website": "",
      "security_contact": "",
      "details": ""
    },
    "unbonding_height": "0",
    "unbonding_time": "1970-01-01T00:00:00Z",
    "commission": {
      "commission_rates": {
        "rate": "0.100000000000000000",
        "max_rate": "0.200000000000000000",
        "max_change_rate": "0.010000000000000000"
      },
      "update_time": "2021-08-03T18:57:24.382040932Z"
    },
    "min_self_delegation": "1"
  }
}
```

{% endtab %}
{% endtabs %}

## Get all validator candidates

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/staking/validators`

Example:

<http://127.0.0.1:1317/staking/validators>

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

```javascript
{
  "height": "1523",
  "result": [
    {
      "operator_address": "stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm",
      "consensus_pubkey": "stvalconspub1zcjduepq4j7xcu0uyakxyalnxxufv6s4895f48c7u4hrfg5d8zdgy4h4k4usg4zy96",
      "jailed": false,
      "status": 2,
      "tokens": "500000000000",
      "delegator_shares": "500000000000.000000000000000000",
      "description": {
        "moniker": "node",
        "identity": "",
        "website": "",
        "security_contact": "",
        "details": ""
      },
      "unbonding_height": "0",
      "unbonding_time": "1970-01-01T00:00:00Z",
      "commission": {
        "commission_rates": {
          "rate": "0.100000000000000000",
          "max_rate": "0.200000000000000000",
          "max_change_rate": "0.010000000000000000"
        },
        "update_time": "2021-08-03T18:57:24.382040932Z"
      },
      "min_self_delegation": "1"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
By default it returns only the bonded validators
{% endhint %}

## Query the information from a single validator

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/staking/validators/{validatorAddr}`

Example:

<http://127.0.0.1:1317/staking/validators/stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm>

#### Path Parameters

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| validatorAddr<mark style="color:red;">\*</mark> | String | `validator address` |

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

```javascript
{
  "height": "1974",
  "result": {
    "operator_address": "stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm",
    "consensus_pubkey": "stvalconspub1zcjduepq4j7xcu0uyakxyalnxxufv6s4895f48c7u4hrfg5d8zdgy4h4k4usg4zy96",
    "jailed": false,
    "status": 2,
    "tokens": "500000000000",
    "delegator_shares": "500000000000.000000000000000000",
    "description": {
      "moniker": "node",
      "identity": "",
      "website": "",
      "security_contact": "",
      "details": ""
    },
    "unbonding_height": "0",
    "unbonding_time": "1970-01-01T00:00:00Z",
    "commission": {
      "commission_rates": {
        "rate": "0.100000000000000000",
        "max_rate": "0.200000000000000000",
        "max_change_rate": "0.010000000000000000"
      },
      "update_time": "2021-08-03T18:57:24.382040932Z"
    },
    "min_self_delegation": "1"
  }
}
```

{% endtab %}
{% endtabs %}

## Get all delegations from a validator

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/staking/validators/{validatorAddr}/delegations`

Example:

<http://127.0.0.1:1317/staking/validators/stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm/delegations>

#### Path Parameters

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| validatorAddr<mark style="color:red;">\*</mark> | String | `validator address` |

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

```javascript
{
  "height": "2040",
  "result": [
    {
      "delegator_address": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s",
      "validator_address": "stvaloper1l76s0ukw0r77fydhqtqpexax8m64mzaqcew3nm",
      "shares": "500000000000.000000000000000000",
      "balance": {
        "denom": "ustos",
        "amount": "500000000000"
      }
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Get all unbonding delegations from a validator

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/staking/validators/{validatorAddr}/unbonding_delegations`

Example:

<http://127.0.0.1:1318/staking/validators/stvaloper12adksjsd7gcsn23h5jmvdygzx2lfw5q4pyf57u/unbonding\\_delegations>

#### Path Parameters

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| validatorAddr<mark style="color:red;">\*</mark> | String | `validator address` |

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

```javascript
{
  "height": "2920",
  "result": [
    {
      "delegator_address": "st12adksjsd7gcsn23h5jmvdygzx2lfw5q4kgq5zh",
      "validator_address": "stvaloper12adksjsd7gcsn23h5jmvdygzx2lfw5q4pyf57u",
      "entries": [
        {
          "creation_height": "2739",
          "completion_time": "2021-09-03T00:26:44.825391686Z",
          "initial_balance": "10000",
          "balance": "10000"
        }
      ]
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Get the current state of the staking pool

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/staking/pool`

Example:

<http://127.0.0.1:1317/staking/pool>

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

```javascript
 {
  "height": "2070",
  "result": {
    "not_bonded_tokens": "0",
    "bonded_tokens": "500000000000"
  }
}
```

{% endtab %}
{% endtabs %}

## Get the current staking parameter values

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/staking/parameters`

Example:

<http://127.0.0.1:1317/staking/parameters>

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

```javascript
{
  "height": "2108",
  "result": {
    "unbonding_time": "1814400000000000",
    "max_validators": 100,
    "max_entries": 7,
    "historical_entries": 0,
    "bond_denom": "ustos"
  }
}
```

{% endtab %}
{% endtabs %}

## Submit a delegation from a delegator

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:1317/staking/delegators/{delegatorAddr}/delegations`

Example:

<http://127.0.0.1:1317/staking/delegators/st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2/delegations>

#### Path Parameters

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| delegatorAddr<mark style="color:red;">\*</mark> | String | `delegator address` |

#### Request Body

| Name                               | Type | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ---------------------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <mark style="color:red;">\*</mark> | json | { "base\_req": { "from": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2", "memo": "Submit Delegation Tx Example", "chain\_id": "test-chain", "account\_number": "0", "gas": "200000", "gas\_adjustment": "1.2", "fees": \[ { "denom": "ustos", "amount": "100" } ], "simulate": false }, "delegator\_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2", "validator\_address": "stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p", "amount": { "denom": "ustos", "amount": "10000" } } |

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

```javascript
{
    "type": "cosmos-sdk/StdTx",
    "value": {
        "msg": [
            {
                "type": "cosmos-sdk/MsgDelegate",
                "value": {
                    "delegator_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
                    "validator_address": "stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p",
                    "amount": {
                        "denom": "ustos",
                        "amount": "10000"
                    }
                }
            }
        ],
        "fee": {
            "amount": [
                {
                    "denom": "ustos",
                    "amount": "100"
                }
            ],
            "gas": "200000"
        },
        "signatures": null,
        "memo": "Submit Delegation Tx Example"
    }
}
```

{% endtab %}
{% endtabs %}

## Submit an unbonding delegation

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:1317/staking/delegators/{delegatorAddr}/unbonding_delegations`

Example:

<http://127.0.0.1:1317/staking/delegators/st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2/unbonding\\_delegations>

#### Path Parameters

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| delegatorAddr<mark style="color:red;">\*</mark> | String | `delegator address` |

#### Request Body

| Name                               | Type | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ---------------------------------- | ---- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <mark style="color:red;">\*</mark> | json | { "base\_req": { "from": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2", "memo": "Submit Unbonding-delegation Tx Example", "chain\_id": "test-chain", "account\_number": "0", "gas": "200000", "gas\_adjustment": "1.2", "fees": \[ { "denom": "ustos", "amount": "100" } ], "simulate": false }, "delegator\_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2", "validator\_address": "stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p", "amount": { "denom": "ustos", "amount": "10000" } } |

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

```javascript
{
    "type": "cosmos-sdk/StdTx",
    "value": {
        "msg": [
            {
                "type": "cosmos-sdk/MsgUndelegate",
                "value": {
                    "delegator_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
                    "validator_address": "stvaloper1xnhfx7c0nev9me835409efjj7whd672x8ky28p",
                    "amount": {
                        "denom": "ustos",
                        "amount": "10000"
                    }
                }
            }
        ],
        "fee": {
            "amount": [
                {
                    "denom": "ustos",
                    "amount": "100"
                }
            ],
            "gas": "200000"
        },
        "signatures": null,
        "memo": "Submit Unbonding-delegation Tx Example"
    }
}
```

{% endtab %}
{% endtabs %}

## Submit a redelegation

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:1317/staking/delegators/{delegatorAddr}/redelegations`

Example:

<http://127.0.0.1:1318/staking/delegators/st15xlpwafgnvvs5hdk8938dp2ve6cjmy4vcf4l76/redelegations>

#### Path Parameters

| Name                                            | Type   | Description         |
| ----------------------------------------------- | ------ | ------------------- |
| delegatorAddr<mark style="color:red;">\*</mark> | String | `delegator address` |

#### Request Body

| Name                               | Type | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ---------------------------------- | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <mark style="color:red;">\*</mark> | json | { "base\_req": { "from": "st15xlpwafgnvvs5hdk8938dp2ve6cjmy4vcf4l76", "memo": "Submit Re-delegation Tx Example", "chain\_id": "test-chain", "account\_number": "0", "gas": "200000", "gas\_adjustment": "1.2", "fees": \[ { "denom": "ustos", "amount": "100" } ], "simulate": false }, "delegator\_address": "st15xlpwafgnvvs5hdk8938dp2ve6cjmy4vcf4l76", "validator\_src\_address": "stvaloper1gamc7ajhzukp08nle9z9asyfx4u4dlz53dquzj", "validator\_dst\_address": "stvaloper1zgqhnz69jppcwg9z27vtq3zq9r3du5v6vjqvpq", "amount": { "denom": "ustos", "amount": "10000" } } |

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

```javascript
{
  "type": "cosmos-sdk/StdTx",
  "value": {
    "msg": [
      {
        "type": "cosmos-sdk/MsgBeginRedelegate",
        "value": {
          "delegator_address": "st15xlpwafgnvvs5hdk8938dp2ve6cjmy4vcf4l76",
          "validator_src_address": "stvaloper1gamc7ajhzukp08nle9z9asyfx4u4dlz53dquzj",
          "validator_dst_address": "stvaloper1zgqhnz69jppcwg9z27vtq3zq9r3du5v6vjqvpq",
          "amount": {
            "denom": "ustos",
            "amount": "10000"
          }
        }
      }
    ],
    "fee": {
      "amount": [
        {
          "denom": "ustos",
          "amount": "100"
        }
      ],
      "gas": "200000"
    },
    "signatures": null,
    "memo": "Submit Re-delegation Tx Example"
  }
}
```

{% endtab %}
{% endtabs %}

### Supply

## Get total supply of coins in the chain

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/supply/total`

Example:

<http://127.0.0.1:1317/supply/total>

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

```javascript
{
  "height": "670",
  "result": [
    {
      "denom": "ustos",
      "amount": "1000013800990024"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Get total supply of a single coin denomination

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/supply/total/{denomination}`

Example:

<http://127.0.0.1:1317/supply/total/ustos>

#### Path Parameters

| Name                                           | Type   | Description |
| ---------------------------------------------- | ------ | ----------- |
| denomination<mark style="color:red;">\*</mark> | String | coin demon  |

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

```javascript
{
  "height": "696",
  "result": "1000014336584175"
}
```

{% endtab %}
{% endtabs %}

### Register

## Query total staking state of all registered resource nodes and indexing nodes

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/register/staking`

Example:

<http://127.0.0.1:1317/register/staking>

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

```javascript
{
    "height": "89",
    "result": {
        "TotalStakeOfResourceNodes": {
            "denom": "ustos",
            "amount": "200000000000"
        },
        "TotalStakeOfIndexingNodes": {
            "denom": "ustos",
            "amount": "200000000000"
        },
        "TotalBondedStake": {
            "denom": "ustos",
            "amount": "400000000000"
        },
        "TotalUnbondedStake": {
            "denom": "ustos",
            "amount": "0"
        },
        "TotalUnbondingStake": {
            "denom": "ustos",
            "amount": "0"
        }
    }
}
```

{% endtab %}
{% endtabs %}

## Get params of registered module

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/register/params`

Example:

<http://127.0.0.1:1317/register/params>

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

```javascript
{
    "height": "157",
    "result": {
        "bond_denom": "ustos",
        "unbonding_threashold_time": "15552000000000000",
        "unbonding_completion_time": "1209600000000000",
        "max_entries": 16
    }
}
```

{% endtab %}
{% endtabs %}

## Get info of all registered resource nodes

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/register/resource-nodes`

Example:

<http://127.0.0.1:1317/register/resource-nodes>

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

```javascript
{
    "height": "69",
    "result": [
        {
            "network_id": "sdm://resourceNode_2@54.212.112.93:8888",
            "pubkey": {
                "type": "tendermint/PubKeySecp256k1",
                "value": "A/Ho01msKWRpFV9217nd/3k6Bt5OA3DZ4pNhbKKK3SEW"
            },
            "suspend": false,
            "status": 2,
            "tokens": "100000000000",
            "owner_address": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
            "description": {
                "moniker": "resourceNode_2",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "node_type": "7",
            "creation_time": "0001-01-01T00:00:00Z"
        },
        {
            "network_id": "sdm://resourceNode_1@54.212.112.93:8888",
            "pubkey": {
                "type": "tendermint/PubKeyEd25519",
                "value": "mAaIUxt077UhHvGNEiL2gd9kW8puqIj4+qhh7nf40mA="
            },
            "suspend": false,
            "status": 2,
            "tokens": "100000000000",
            "owner_address": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
            "description": {
                "moniker": "resourceNode_1",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "node_type": "4",
            "creation_time": "0001-01-01T00:00:00Z"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Get info of all registered indexing nodes

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/register/indexing-nodes`

Example:

<http://127.0.0.1:1317/register/indexing-nodes>

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

```javascript
{
    "height": "79",
    "result": [
        {
            "network_id": "sdm://indexingNode_1@54.212.112.93:8888",
            "pubkey": {
                "type": "tendermint/PubKeyEd25519",
                "value": "CFAvlMr4y3bw7AFDqRjk1oyYCqOw9Cv/m+uFXmw6aGo="
            },
            "suspend": false,
            "status": 2,
            "tokens": "100000000000",
            "owner_address": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
            "description": {
                "moniker": "indexingNode_1",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "creation_time": "0001-01-01T00:00:00Z"
        },
        {
            "network_id": "sdm://stsdsp2p1rxus8f86eqmssqu8vlpj50gd7pqe0r5y6ss923@54.212.112.93:8888",
            "pubkey": {
                "type": "tendermint/PubKeyEd25519",
                "value": "RHK84zZvN8VNe8iAOtLtUcrgyNAGWqKn5vQ4tOY4JAM="
            },
            "suspend": false,
            "status": 2,
            "tokens": "100000000000",
            "owner_address": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
            "description": {
                "moniker": "stratos-foundation",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "creation_time": "0001-01-01T00:00:00Z"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Get staking info of a specific node

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/register/staking/address/{nodeAddress}`

Example:

<http://127.0.0.1:1317/register/staking/address/st162xm62m75cjv2529p7yydkxmqfwhknsl60cmu4>

#### Path Parameters

| Name                                          | Type   | Description    |
| --------------------------------------------- | ------ | -------------- |
| nodeAddress<mark style="color:red;">\*</mark> | String | `node address` |

#### Query Parameters

| Name        | Type  | Description       |
| ----------- | ----- | ----------------- |
| query\_type | int64 | query type number |

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

```javascript
{
    "height": "125",
    "result": {
        "network_id": "sdm://resourceNode_1@54.212.112.93:8888",
        "pub_key": {
            "type": "tendermint/PubKeyEd25519",
            "value": "mAaIUxt077UhHvGNEiL2gd9kW8puqIj4+qhh7nf40mA="
        },
        "suspend": false,
        "status": 2,
        "tokens": "100000000000",
        "owner_address": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
        "description": {
            "moniker": "resourceNode_1",
            "identity": "",
            "website": "",
            "security_contact": "",
            "details": ""
        },
        "node_type": "4",
        "creation_time": "0001-01-01T00:00:00Z",
        "bonded_stake": {
            "denom": "ustos",
            "amount": "100000000000"
        },
        "un_bonding_stake": {
            "denom": "ustos",
            "amount": "0"
        },
        "un_bonded_stake": {
            "denom": "ustos",
            "amount": "0"
        }
    }
}
```

{% endtab %}
{% endtabs %}

## Get all staking info of a specific owner

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/register/staking/owner/{ownerAddress}`

Example:

<http://127.0.0.1:1317/register/staking/owner/st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua>

#### Path Parameters

| Name                                           | Type   | Description     |
| ---------------------------------------------- | ------ | --------------- |
| ownerAddress<mark style="color:red;">\*</mark> | String | `owner address` |

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

```javascript
{
    "height": "145",
    "result": [
        {
            "network_id": "sdm://indexingNode_1@54.212.112.93:8888",
            "pub_key": {
                "type": "tendermint/PubKeyEd25519",
                "value": "CFAvlMr4y3bw7AFDqRjk1oyYCqOw9Cv/m+uFXmw6aGo="
            },
            "suspend": false,
            "status": 2,
            "tokens": "100000000000",
            "owner_address": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
            "description": {
                "moniker": "indexingNode_1",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "node_type": "SP",
            "creation_time": "0001-01-01T00:00:00Z",
            "bonded_stake": {
                "denom": "ustos",
                "amount": "100000000000"
            },
            "un_bonding_stake": {
                "denom": "ustos",
                "amount": "0"
            },
            "un_bonded_stake": {
                "denom": "ustos",
                "amount": "0"
            }
        },
        {
            "network_id": "sdm://stsdsp2p1rxus8f86eqmssqu8vlpj50gd7pqe0r5y6ss923@54.212.112.93:8888",
            "pub_key": {
                "type": "tendermint/PubKeyEd25519",
                "value": "RHK84zZvN8VNe8iAOtLtUcrgyNAGWqKn5vQ4tOY4JAM="
            },
            "suspend": false,
            "status": 2,
            "tokens": "100000000000",
            "owner_address": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
            "description": {
                "moniker": "stratos-foundation",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "node_type": "SP",
            "creation_time": "0001-01-01T00:00:00Z",
            "bonded_stake": {
                "denom": "ustos",
                "amount": "100000000000"
            },
            "un_bonding_stake": {
                "denom": "ustos",
                "amount": "0"
            },
            "un_bonded_stake": {
                "denom": "ustos",
                "amount": "0"
            }
        },
        {
            "network_id": "sdm://resourceNode_2@54.212.112.93:8888",
            "pub_key": {
                "type": "tendermint/PubKeySecp256k1",
                "value": "A/Ho01msKWRpFV9217nd/3k6Bt5OA3DZ4pNhbKKK3SEW"
            },
            "suspend": false,
            "status": 2,
            "tokens": "100000000000",
            "owner_address": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
            "description": {
                "moniker": "resourceNode_2",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "node_type": "7",
            "creation_time": "0001-01-01T00:00:00Z",
            "bonded_stake": {
                "denom": "ustos",
                "amount": "100000000000"
            },
            "un_bonding_stake": {
                "denom": "ustos",
                "amount": "0"
            },
            "un_bonded_stake": {
                "denom": "ustos",
                "amount": "0"
            }
        },
        {
            "network_id": "sdm://resourceNode_1@54.212.112.93:8888",
            "pub_key": {
                "type": "tendermint/PubKeyEd25519",
                "value": "mAaIUxt077UhHvGNEiL2gd9kW8puqIj4+qhh7nf40mA="
            },
            "suspend": false,
            "status": 2,
            "tokens": "100000000000",
            "owner_address": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
            "description": {
                "moniker": "resourceNode_1",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "node_type": "4",
            "creation_time": "0001-01-01T00:00:00Z",
            "bonded_stake": {
                "denom": "ustos",
                "amount": "100000000000"
            },
            "un_bonding_stake": {
                "denom": "ustos",
                "amount": "0"
            },
            "un_bonded_stake": {
                "denom": "ustos",
                "amount": "0"
            }
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### Proof of Traffic (PoT)

## Query Pot rewards info of all wallet addresses at a specific epoch

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/pot/rewards/epoch/{epoch}`

Example:

<http://127.0.0.1:1317/pot/rewards/epoch/1>

#### Path Parameters

| Name                                    | Type  | Description  |
| --------------------------------------- | ----- | ------------ |
| epoch<mark style="color:red;">\*</mark> | int64 | epoch number |

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

```javascript
{
    "height": "15",
    "result": [
        {
            "wallet_address": "st19nsx80gtknyukzy6p8z8009c3xptftgy2drxaz",
            "reward_from_mining_pool": "24000000000",
            "reward_from_traffic_pool": "18900288"
        },
        {
            "wallet_address": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
            "reward_from_mining_pool": "23111111108",
            "reward_from_traffic_pool": "18200276"
        },
        {
            "wallet_address": "st1se0hwymfz353xqj4nmxhrqz6g3qzeng5d9mjf4",
            "reward_from_mining_pool": "24000000000",
            "reward_from_traffic_pool": "18900288"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Query Pot rewards info of a wallet\_address at a specific epoch

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/pot/rewards/epoch/{epoch}`

Example:

<http://127.0.0.1:1317/pot/rewards/epoch/1?wallet\\_address=st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua>

#### Path Parameters

| Name                                    | Type  | Description  |
| --------------------------------------- | ----- | ------------ |
| epoch<mark style="color:red;">\*</mark> | int64 | epoch number |

#### Query Parameters

| Name            | Type   | Description      |
| --------------- | ------ | ---------------- |
| wallet\_address | String | `wallet address` |

{% tabs %}
{% tab title="200: OK with wallet\_address" %}

```javascript
{
    "height": "18",
    "result": [
        {
            "wallet_address": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
            "reward_from_mining_pool": "23111111108",
            "reward_from_traffic_pool": "18200276"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Query owner's Pot rewards info at a specific height

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/pot/rewards/wallet/{walletAddress}`

Example:

<http://127.0.0.1:1317/pot/rewards/wallet/st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua?height=218>

#### Path Parameters

| Name                                            | Type   | Description            |
| ----------------------------------------------- | ------ | ---------------------- |
| walletAddress<mark style="color:red;">\*</mark> | String | owner's wallet address |

#### Query Parameters

| Name   | Type  | Description                                |
| ------ | ----- | ------------------------------------------ |
| height | int64 | block search height/default: latest height |

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

```javascript
{
    "height": "218",
    "result": {
        "WalletAddress": "st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua",
        "MatureTotalReward": {
            "denom": "reward",
            "amount": "23129311384"
        },
        "ImmatureTotalReward": {
            "denom": "reward",
            "amount": "23129311372"
        }
    }
}
```

{% endtab %}
{% endtabs %}

### SDS

## Get a simulated prepay result

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/sds/simulatePrepay/{amtToPrepay}`

Example:

<http://127.0.0.1:1317/sds/simulatePrepay/8000000000>

#### Path Parameters

| Name                                          | Type  | Description   |
| --------------------------------------------- | ----- | ------------- |
| amtToPrepay<mark style="color:red;">\*</mark> | int64 | prepay amount |

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

```javascript
{
    "height": "194",
    "result": "126972073"
}
```

{% endtab %}
{% endtabs %}

## Get current uozPrice

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/sds/uozPrice`

Example:

<http://127.0.0.1:1317/sds/uozPrice>

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

```javascript
{
    "height": "174",
    "result": "63.000960466897594981"
}
```

{% endtab %}
{% endtabs %}

## Get current uozSupply

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317sds/uozSupply`

Example:

<http://127.0.0.1:1317/sds/uozSupply>

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

```javascript
{
    "height": "183",
    "result": {
        "Remaining": "1593625498008",
        "Total": "-1"
    }
}
```

{% endtab %}
{% endtabs %}

### Tendermint RPC

Tendermint APIs, such as query blocks, transactions and validator set

## Get information about the connected node

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/node_info`

Example:

<http://127.0.0.1:1317/node_info>

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

```javascript
{
    "node_info": {
        "protocol_version": {
            "p2p": "7",
            "block": "10",
            "app": "0"
        },
        "id": "eacd50530e1ded18b556e230f45e04c9d7dd60bb",
        "listen_addr": "tcp://0.0.0.0:26656",
        "network": "test-chain",
        "version": "0.33.9",
        "channels": "4020212223303800",
        "moniker": "node",
        "other": {
            "tx_index": "on",
            "rpc_address": "tcp://127.0.0.1:26657"
        }
    },
    "application_version": {
        "name": "",
        "server_name": "<appd>",
        "client_name": "<appcli>",
        "version": "v0.3.0",
        "commit": "",
        "build_tags": "",
        "go": "go version go1.15.11 linux/amd64",
        "build_deps": [
            "github.com/99designs/keyring@v1.1.6",
            "github.com/ChainSafe/go-schnorrkel@v0.0.0-20200405005733-88cbf1b4c40d",
            "github.com/Workiva/go-datastructures@v1.0.52",
            "..."
        ]
    }
}
```

{% endtab %}
{% endtabs %}

## Get a block at a specific {height | latest}

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/blocks/{height | latest}`

Example:

<http://127.0.0.1:1317/blocks/latest>

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

```javascript
{
    "block_id": {
        "hash": "962CA04FCF30EB1C9E1D13DEA62D6001FA19585E80F1E1C52719EBABD138C998",
        "parts": {
            "total": "1",
            "hash": "6FA93CE6D82B772EBA62278B33D9731C87A31271636442900EB87A48F14D7F23"
        }
    },
    "block": {
        "header": {
            "version": {
                "block": "10",
                "app": "0"
            },
            "chain_id": "test-chain",
            "height": "141",
            "time": "2021-08-04T17:47:23.200191253Z",
            "last_block_id": {
                "hash": "1B438DB7C3F558D0130FFBEE622A9898FDFE01BBE6FF1CD42C91FCCE4D19B33C",
                "parts": {
                    "total": "1",
                    "hash": "494E4EBF671133F9E4B0ED0588951FE98F5F1C17795E015F728AFEA0E3FF23A9"
                }
            },
            "last_commit_hash": "E9C54C235CE0608D877F4B9563196A9209069224A9F2FF3CE3A8E5D9CEBE9C85",
            "data_hash": "",
            "validators_hash": "1D91595E4BC95AF074614D180AA4FEC18E914712AB4CA78CE7819F735BB9C45D",
            "next_validators_hash": "1D91595E4BC95AF074614D180AA4FEC18E914712AB4CA78CE7819F735BB9C45D",
            "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F",
            "app_hash": "6009E75DC5210BB09BABF7B9F1F8A9207A65CC9E83E0167F33C1749A0547EEB9",
            "last_results_hash": "",
            "evidence_hash": "",
            "proposer_address": "3B3658CEE3F9C66D332A55A9206CA611AC752577"
        },
        "data": {
            "txs": null
        },
        "evidence": {
            "evidence": null
        },
        "last_commit": {
            "height": "140",
            "round": "0",
            "block_id": {
                "hash": "1B438DB7C3F558D0130FFBEE622A9898FDFE01BBE6FF1CD42C91FCCE4D19B33C",
                "parts": {
                    "total": "1",
                    "hash": "494E4EBF671133F9E4B0ED0588951FE98F5F1C17795E015F728AFEA0E3FF23A9"
                }
            },
            "signatures": [
                {
                    "block_id_flag": 2,
                    "validator_address": "3B3658CEE3F9C66D332A55A9206CA611AC752577",
                    "timestamp": "2021-08-04T17:47:23.200191253Z",
                    "signature": "W8JjwsGOvjJD8T4iH/L7kvTP5PNzbCPKXWTqtn80uSOKEppKPmG5AerUOZ0D6F1QSjWlQS9EqVQnUbvPAYSQBw=="
                }
            ]
        }
    }
}
```

{% endtab %}
{% endtabs %}

## Get validator set at certain {height | latest}

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/validatorsets/{height | latest}`

Example:

<http://127.0.0.1:1317/validatorsets/28>

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

```javascript
{
  "height": "0",
  "result": {
    "block_height": "28",
    "validators": [
      {
        "address": "stvalcons18vm93nhrl8rx6ve22k5jqm9xzxk82fthchs2u0",
        "pub_key": "stvalconspub1zcjduepq4j7xcu0uyakxyalnxxufv6s4895f48c7u4hrfg5d8zdgy4h4k4usg4zy96",
        "proposer_priority": "0",
        "voting_power": "500000"
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

## Syncing state of node

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/syncing`

Example:

<http://127.0.0.1:1317/syncing>

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

```javascript
{
  "syncing": false
}
```

{% endtab %}
{% endtabs %}

### Transactions

Search, encode, or broadcast transactions.

## Retrieve a transaction using its hash

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/txs/{hash}`

Example:

<http://127.0.0.1:1317/txs/0CA946EBB823903004056BEA3CFAFE4F184EF616D72F38433763006534AA0E2E>

#### Path Parameters

| Name                                   | Type        | Description |
| -------------------------------------- | ----------- | ----------- |
| hash<mark style="color:red;">\*</mark> | Hash String | tx hash     |

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

```javascript
{
  "height": "18",
  "txhash": "0CA946EBB823903004056BEA3CFAFE4F184EF616D72F38433763006534AA0E2E",
  "raw_log": "[{\"msg_index\":0,\"log\":\"\",\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"send\"},{\"key\":\"sender\",\"value\":\"st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s\"},{\"key\":\"module\",\"value\":\"bank\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"st1rw6xln8xaa532key7dmcznwlv62lvs54h96h6h\"},{\"key\":\"sender\",\"value\":\"st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s\"},{\"key\":\"amount\",\"value\":\"1000000ustos\"}]}]}]",
  "logs": [
    {
      "msg_index": 0,
      "log": "",
      "events": [
        {
          "type": "message",
          "attributes": [
            {
              "key": "action",
              "value": "send"
            },
            {
              "key": "sender",
              "value": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s"
            },
            {
              "key": "module",
              "value": "bank"
            }
          ]
        },
        {
          "type": "transfer",
          "attributes": [
            {
              "key": "recipient",
              "value": "st1rw6xln8xaa532key7dmcznwlv62lvs54h96h6h"
            },
            {
              "key": "sender",
              "value": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s"
            },
            {
              "key": "amount",
              "value": "1000000ustos"
            }
          ]
        }
      ]
    }
  ],
  "gas_wanted": "200000",
  "gas_used": "65927",
  "tx": {
    "type": "cosmos-sdk/StdTx",
    "value": {
      "msg": [
        {
          "type": "cosmos-sdk/MsgSend",
          "value": {
            "from_address": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s",
            "to_address": "st1rw6xln8xaa532key7dmcznwlv62lvs54h96h6h",
            "amount": [
              {
                "denom": "ustos",
                "amount": "1000000"
              }
            ]
          }
        }
      ],
      "fee": {
        "amount": [
          {
            "denom": "ustos",
            "amount": "100"
          }
        ],
        "gas": "200000"
      },
      "signatures": [
        {
          "pub_key": {
            "type": "tendermint/PubKeySecp256k1",
            "value": "A4oRGeSYDImfg5OhXPPOQ1p0Sepc5PkxhCV3sDe5uNao"
          },
          "signature": "0NOxqgG7s7v54lnwkRJfDGV2SZrWhmE7M2A2lQs4T2le3WOnYrdF8LXrVGR06uwhBRNcwQE4kZxxHeYbZjUXhQ=="
        }
      ],
      "memo": ""
    }
  },
  "timestamp": "2021-08-05T03:16:39Z"
}
```

{% endtab %}
{% endtabs %}

## Search transactions using params

<mark style="color:blue;">`GET`</mark> `http://127.0.0.1:1317/txs`

Example:

<http://127.0.0.1:1317/txs?message.action=send\\&message.sender=st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s>

#### Query Parameters

| Name           | Type   | Description                                                      |
| -------------- | ------ | ---------------------------------------------------------------- |
| message.action | String | message action type('send')                                      |
| message.sender | String | message sender address                                           |
| page           | int    | page number                                                      |
| limit          | int    | maximum number of items per page                                 |
| tx.minheight   | int64  | transactions on blocks with height greater or equal this value   |
| tx.maxheight   | int64  | transactions on blocks with height less than or equal this value |

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

```javascript
{
  "total_count": "1",
  "count": "1",
  "page_number": "1",
  "page_total": "1",
  "limit": "30",
  "txs": [
    {
      "height": "18",
      "txhash": "0CA946EBB823903004056BEA3CFAFE4F184EF616D72F38433763006534AA0E2E",
      "raw_log": "[{\"msg_index\":0,\"log\":\"\",\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"send\"},{\"key\":\"sender\",\"value\":\"st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s\"},{\"key\":\"module\",\"value\":\"bank\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"st1rw6xln8xaa532key7dmcznwlv62lvs54h96h6h\"},{\"key\":\"sender\",\"value\":\"st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s\"},{\"key\":\"amount\",\"value\":\"1000000ustos\"}]}]}]",
      "logs": [
        {
          "msg_index": 0,
          "log": "",
          "events": [
            {
              "type": "message",
              "attributes": [
                {
                  "key": "action",
                  "value": "send"
                },
                {
                  "key": "sender",
                  "value": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s"
                },
                {
                  "key": "module",
                  "value": "bank"
                }
              ]
            },
            {
              "type": "transfer",
              "attributes": [
                {
                  "key": "recipient",
                  "value": "st1rw6xln8xaa532key7dmcznwlv62lvs54h96h6h"
                },
                {
                  "key": "sender",
                  "value": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s"
                },
                {
                  "key": "amount",
                  "value": "1000000ustos"
                }
              ]
            }
          ]
        }
      ],
      "gas_wanted": "200000",
      "gas_used": "65927",
      "tx": {
        "type": "cosmos-sdk/StdTx",
        "value": {
          "msg": [
            {
              "type": "cosmos-sdk/MsgSend",
              "value": {
                "from_address": "st1l76s0ukw0r77fydhqtqpexax8m64mzaq04830s",
                "to_address": "st1rw6xln8xaa532key7dmcznwlv62lvs54h96h6h",
                "amount": [
                  {
                    "denom": "ustos",
                    "amount": "1000000"
                  }
                ]
              }
            }
          ],
          "fee": {
            "amount": [
              {
                "denom": "ustos",
                "amount": "100"
              }
            ],
            "gas": "200000"
          },
          "signatures": [
            {
              "pub_key": {
                "type": "tendermint/PubKeySecp256k1",
                "value": "A4oRGeSYDImfg5OhXPPOQ1p0Sepc5PkxhCV3sDe5uNao"
              },
              "signature": "0NOxqgG7s7v54lnwkRJfDGV2SZrWhmE7M2A2lQs4T2le3WOnYrdF8LXrVGR06uwhBRNcwQE4kZxxHeYbZjUXhQ=="
            }
          ],
          "memo": ""
        }
      },
      "timestamp": "2021-08-05T03:16:39Z"
    }
  ]
}
```

{% endtab %}
{% endtabs %}

## Broadcast a signed tx to a full node

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:1317/txs`

Example:

<http://127.0.0.1:1317/txs>

#### Request Body

| Name                               | Type | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ---------------------------------- | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <mark style="color:red;">\*</mark> | json | { "tx": { "msg": \[ { "type": "cosmos-sdk/MsgSend", "value": { "from\_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2", "to\_address": "st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6", "amount": \[ { "denom": "ustos", "amount": "2000000" } ] } } ], "fee": { "amount": \[ { "denom": "ustos", "amount": "100" } ], "gas": "200000" }, "signatures": \[ { "pub\_key": { "type": "tendermint/PubKeySecp256k1", "value": "AolrbtnyTqnxmIjQJTmQfo/Gb2LlN9XPO/Qb2tSI/eRh" }, "signature": "THrgfsKFIVlZvwzI7rHh3nRdC2VXJhaPDMyolZEsWklDmkxI7ecEA4bQgmkgXDpS7suKGvApsUIxeG4Um0vzWw==" } ], "memo": "Send Tx Example" }, "mode": "block" } |

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

```javascript
{
    "height": "3495",
    "txhash": "3F96F021622ED95820D425522319FBE9C4510200FB18A2E18D75A209ABF05323",
    "raw_log": "[{\"msg_index\":0,\"log\":\"\",\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"send\"},{\"key\":\"sender\",\"value\":\"st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2\"},{\"key\":\"module\",\"value\":\"bank\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6\"},{\"key\":\"sender\",\"value\":\"st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2\"},{\"key\":\"amount\",\"value\":\"2000000ustos\"}]}]}]",
    "logs": [
        {
            "msg_index": 0,
            "log": "",
            "events": [
                {
                    "type": "message",
                    "attributes": [
                        {
                            "key": "action",
                            "value": "send"
                        },
                        {
                            "key": "sender",
                            "value": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2"
                        },
                        {
                            "key": "module",
                            "value": "bank"
                        }
                    ]
                },
                {
                    "type": "transfer",
                    "attributes": [
                        {
                            "key": "recipient",
                            "value": "st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6"
                        },
                        {
                            "key": "sender",
                            "value": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2"
                        },
                        {
                            "key": "amount",
                            "value": "2000000ustos"
                        }
                    ]
                }
            ]
        }
    ],
    "gas_wanted": "200000",
    "gas_used": "63379"
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
The tx must be a signed StdTx. The supported broadcast modes include "block"(return after tx commit), "sync"(return after CheckTx) and "async"(return right away)
{% endhint %}

Block log

```shell
I[2021-08-08|14:53:19.215] Executed block                               module=state height=3495 validTxs=1 invalidTxs=0
I[2021-08-08|14:53:19.220] Committed state                              module=state height=3495 txs=1 appHash=FA3D11545126DED06F31890C4B0E83B985AEB54DE7FC2
```

Check this Tx

```http
http://127.0.0.1:1317/txs/3F96F021622ED95820D425522319FBE9C4510200FB18A2E18D75A209ABF05323
```

Response

```json
{
    "height": "3495",
    "txhash": "3F96F021622ED95820D425522319FBE9C4510200FB18A2E18D75A209ABF05323",
    "raw_log": "[{\"msg_index\":0,\"log\":\"\",\"events\":[{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"send\"},{\"key\":\"sender\",\"value\":\"st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2\"},{\"key\":\"module\",\"value\":\"bank\"}]},{\"type\":\"transfer\",\"attributes\":[{\"key\":\"recipient\",\"value\":\"st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6\"},{\"key\":\"sender\",\"value\":\"st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2\"},{\"key\":\"amount\",\"value\":\"2000000ustos\"}]}]}]",
    "logs": [
        {
            "msg_index": 0,
            "log": "",
            "events": [
                {
                    "type": "message",
                    "attributes": [
                        {
                            "key": "action",
                            "value": "send"
                        },
                        {
                            "key": "sender",
                            "value": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2"
                        },
                        {
                            "key": "module",
                            "value": "bank"
                        }
                    ]
                },
                {
                    "type": "transfer",
                    "attributes": [
                        {
                            "key": "recipient",
                            "value": "st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6"
                        },
                        {
                            "key": "sender",
                            "value": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2"
                        },
                        {
                            "key": "amount",
                            "value": "2000000ustos"
                        }
                    ]
                }
            ]
        }
    ],
    "gas_wanted": "200000",
    "gas_used": "63379",
    "tx": {
        "type": "cosmos-sdk/StdTx",
        "value": {
            "msg": [
                {
                    "type": "cosmos-sdk/MsgSend",
                    "value": {
                        "from_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
                        "to_address": "st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6",
                        "amount": [
                            {
                                "denom": "ustos",
                                "amount": "2000000"
                            }
                        ]
                    }
                }
            ],
            "fee": {
                "amount": [
                    {
                        "denom": "ustos",
                        "amount": "100"
                    }
                ],
                "gas": "200000"
            },
            "signatures": [
                {
                    "pub_key": {
                        "type": "tendermint/PubKeySecp256k1",
                        "value": "AolrbtnyTqnxmIjQJTmQfo/Gb2LlN9XPO/Qb2tSI/eRh"
                    },
                    "signature": "THrgfsKFIVlZvwzI7rHh3nRdC2VXJhaPDMyolZEsWklDmkxI7ecEA4bQgmkgXDpS7suKGvApsUIxeG4Um0vzWw=="
                }
            ],
            "memo": "Send Tx Example"
        }
    },
    "timestamp": "2021-08-08T18:53:14Z"
}
```

Check this block

```http
http://127.0.0.1:1317/blocks/3495
```

Response

```json
{
    "block_id": {
        "hash": "082FD6C7397FD7F298D36289678242F0CDE2737DB4D9630B1AE62919A08057D0",
        "parts": {
            "total": "1",
            "hash": "DFB4268FAB528270752EB30FC3A8FFD67BB87B46856B3596A57057E01254A2DF"
        }
    },
    "block": {
        "header": {
            "version": {
                "block": "10",
                "app": "0"
            },
            "chain_id": "test-chain",
            "height": "3495",
            "time": "2021-08-08T18:53:14.172144192Z",
            "last_block_id": {
                "hash": "AE9834662BBEE22FC3C5E4F10CEEC64564AB9401A950BCC3AA795EA42F7612C0",
                "parts": {
                    "total": "1",
                    "hash": "AA0A15014CAE1BC085E104EEEDB06399205932B2E82551477EB10D8BF33190FE"
                }
            },
            "last_commit_hash": "EBB097637FF021777AAAA233064FE0E2B3F5BF1E63FF2D92DC06C8422F6441E6",
            "data_hash": "86B32C45FDF5B55C1B4BD6B943AE7BA86B1D03E4B7220280A51918389B6CD097",
            "validators_hash": "46DA95672ADBB099305219FB1C2B4A07A536984F94B9FD800DE0E3216ED375E5",
            "next_validators_hash": "46DA95672ADBB099305219FB1C2B4A07A536984F94B9FD800DE0E3216ED375E5",
            "consensus_hash": "048091BC7DDC283F77BFBF91D73C44DA58C3DF8A9CBC867405D8B7F3DAADA22F",
            "app_hash": "5FFFD8BD063FBFDD6F3C30D75212AC4E13527948E757F491BF1488E396B5E217",
            "last_results_hash": "",
            "evidence_hash": "",
            "proposer_address": "38DD39B8E028C18399B21BD8CE78B433D3B61C0D"
        },
        "data": {
            "txs": [
                "2QEoKBapCkKoo2GaChQ07pN7D55YXeTxpV5cplLzrt15RhIUklkfkbrzqcI4RHfgxEybfe5YA/waEAoFdXN0b3MSBzIwMDAwMDASEgoMCgV1c3RvcxIDMTAwEMCaDBpqCibrWumHIQKJa27Z8k6p8ZiI0CU5kH6Pxm9i5TfVzzv0G9rUiP3kYRJATHrgfsKFIVlZvwzI7rHh3nRdC2VXJhaPDMyolZEsWklDmkxI7ecEA4bQgmkgXDpS7suKGvApsUIxeG4Um0vzWyIPU2VuZCBUeCBFeGFtcGxl"
            ]
        },
        "evidence": {
            "evidence": null
        },
        "last_commit": {
            "height": "3494",
            "round": "0",
            "block_id": {
                "hash": "AE9834662BBEE22FC3C5E4F10CEEC64564AB9401A950BCC3AA795EA42F7612C0",
                "parts": {
                    "total": "1",
                    "hash": "AA0A15014CAE1BC085E104EEEDB06399205932B2E82551477EB10D8BF33190FE"
                }
            },
            "signatures": [
                {
                    "block_id_flag": 2,
                    "validator_address": "38DD39B8E028C18399B21BD8CE78B433D3B61C0D",
                    "timestamp": "2021-08-08T18:53:14.172144192Z",
                    "signature": "MSNnYWdyczRWkYGuuoiD4G2XaezOzJZfsfNQsh/yfEI+ky191BSDj/Avn1gGEJIZ9k66lHCy+krqp8YyUX9LAw=="
                }
            ]
        }
    }
}
```

## Decode a transaction from the Amino wire format

<mark style="color:green;">`POST`</mark> `http://127.0.0.1:1317/txs/decode`

Example:

<http://127.0.0.1:1317/txs/decode>

#### Request Body

| Name                               | Type | Description                                                                                                                                                                                                                                                                                                           |
| ---------------------------------- | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <mark style="color:red;">\*</mark> | json | {"tx":"3QEoKBapCkKoo2GaChQ07pN7D55YXeTxpV5cplLzrt15RhIUklkfkbrzqcI4RHfgxEybfe5YA/waEAoFdXN0b3MSBzIwMDAwMDASEgoMCgV1c3RvcxIDMTAwEMCaDBpqCibrWumHIQKJa27Z8k6p8ZiI0CU5kH6Pxm9i5TfVzzv0G9rUiP3kYRJATHrgfsKFIVlZvwzI7rHh3nRdC2VXJhaPDMyolZEsWklDmkxI7ecEA4bQgmkgXDpS7suKGvApsUIxeG4Um0vzWyITRW5jb2RpbmcgVHggRXhhbXBsZQ=="} |

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

```javascript
{
  "height": "0",
  "result": {
    "msg": [
      {
        "type": "cosmos-sdk/MsgSend",
        "value": {
          "from_address": "st1xnhfx7c0nev9me835409efjj7whd672xs6d2m2",
          "to_address": "st1jfv3lyd67w5uywzywlsvgnym0hh9sqlujrw5l6",
          "amount": [
            {
              "denom": "ustos",
              "amount": "2000000"
            }
          ]
        }
      }
    ],
    "fee": {
      "amount": [
        {
          "denom": "ustos",
          "amount": "100"
        }
      ],
      "gas": "200000"
    },
    "signatures": [
      {
        "pub_key": {
          "type": "tendermint/PubKeySecp256k1",
          "value": "AolrbtnyTqnxmIjQJTmQfo/Gb2LlN9XPO/Qb2tSI/eRh"
        },
        "signature": "THrgfsKFIVlZvwzI7rHh3nRdC2VXJhaPDMyolZEsWklDmkxI7ecEA4bQgmkgXDpS7suKGvApsUIxeG4Um0vzWw=="
      }
    ],
    "memo": "Encoding Tx Example"
  }
}
```

{% endtab %}
{% endtabs %}
