# Cast Vote

### /cast/vote/transactions

<mark style="color:blue;">`GET`</mark> `http://localhost:4003/api/cast/vote/transactions`&#x20;

Returns all Cast Vote Transactions

#### Query Parameters

| Name      | Type    | Description                                                                  |
| --------- | ------- | ---------------------------------------------------------------------------- |
| page      | integer | The number of page to be returned                                            |
| limit     | integer | The number of transaction per page                                           |
| orderBy   | string  | <p>Orders by specific parameter (asc or desc)<br>Example: orderBy=id:asc</p> |
| transform | boolean | Transforms to raw response                                                   |

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

```javascript
{
  "meta": {
    "totalCountIsEstimate": true,
    "count": 4,
    "pageCount": 1,
    "totalCount": 4,
    "next": null,
    "previous": null,
    "self": "/voting/cast/vote/transactions?transform=true&page=1&limit=100",
    "first": "/voting/cast/vote/transactions?transform=true&page=1&limit=100",
    "last": "/voting/cast/vote/transactions?transform=true&page=1&limit=100"
  },
  "data": [
    {
      "id": "4ce88923c7d961fc29dd6a5111979cb2767df947bf9f3b0f791a841a21d675de",
      "senderPublicKey": "03287bfebba4c7881a0509717e71b34b63f31e40021c321f89ae04f84be6d6ac37",
      "proposalId": "c8f3fff0df73f1125d15a467b4f9401a7967e2915c93612737b7761cde7ada29",
      "decision": "yes",
      "timestamp": {
        "epoch": 136819968,
        "unix": 1626921168,
        "human": "2021-07-22T02:32:48.000Z"
      }
    },
    {
      "id": "4498ecbc765e38f289761f1d04a9dfb2e062d87239d8e5af55c77e4c6e842b53",
      "senderPublicKey": "02def27da9336e7fbf63131b8d7e5c9f45b296235db035f1f4242c507398f0f21d",
      "proposalId": "fe8419bda6525ef0074e733dbd3e8b671267c6c8d51b025fd7ae0812947cec30",
      "decision": "no",
      "timestamp": {
        "epoch": 142719936,
        "unix": 1632821136,
        "human": "2021-09-28T09:25:36.000Z"
      }
    },
   ...
  ]
}
```

{% endtab %}
{% endtabs %}

#### Curl Example

```bash
curl http://localhost:4003/api/cast/vote/transactions
```

###

### /cast/vote/transactions/:id

<mark style="color:blue;">`GET`</mark> `http://localhost:4003/api/cast/vote/transactions/:id`&#x20;

Returns Cast Vote Transaction by id.

#### Path Parameters

| Name | Type   | Description    |
| ---- | ------ | -------------- |
| id   | string | Transaction Id |

#### Query Parameters

| Name      | Type    | Description                |
| --------- | ------- | -------------------------- |
| transform | boolean | Transforms to raw response |

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

```javascript
{
  "data": {
    "id": "4ce88923c7d961fc29dd6a5111979cb2767df947bf9f3b0f791a841a21d675de",
    "senderPublicKey": "03287bfebba4c7881a0509717e71b34b63f31e40021c321f89ae04f84be6d6ac37",
    "proposalId": "c8f3fff0df73f1125d15a467b4f9401a7967e2915c93612737b7761cde7ada29",
    "decision": "yes",
    "timestamp": {
      "epoch": 136819968,
      "unix": 1626921168,
      "human": "2021-07-22T02:32:48.000Z"
    }
  }
}
```

{% endtab %}

{% tab title="404 " %}

```javascript
{
  "statusCode": 404,
  "error": "Not Found",
  "message": "Transaction not found!"
}
```

{% endtab %}

{% tab title="422 " %}

```javascript
{
  "statusCode": 422,
  "error": "Unprocessable Entity",
  "message": "\"id\" length must be 64 characters long"
}
```

{% endtab %}
{% endtabs %}

#### Curl Example

```bash
curl http://localhost:4003/api/cast/vote/transactions/4ce88923c7d961fc29dd6a5111979cb2767df947bf9f3b0f791a841a21d675de
```

### /cast/vote/:id/wallet

<mark style="color:blue;">`GET`</mark> `http://localhost:4003/api/cast/vote/:id/wallet` &#x20;

Returns wallet by Cast Vote transaction id

#### Path Parameters

| Name | Type   | Description              |
| ---- | ------ | ------------------------ |
| id   | string | Cast Vote transaction id |

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

```javascript
{
  "data": {
    "address": "ANBkoGqWeTSiaEVgVzSKZd3jS7UWzv9PSo",
    "senderPublicKey": "03287bfebba4c7881a0509717e71b34b63f31e40021c321f89ae04f84be6d6ac37",
    "nonce": "37",
    "balance": "244813000000000",
    "proposals": {
      "8ba1411eb769c3ba7d04b7e353d5c78240705597ee254100164ee77b9999234b": {
        "proposal": {
          "duration": {
            "blockHeight": 123456
          },
          "content": "qwertz"
        },
        "agree": [],
        "disagree": []
      },
      "c8f3fff0df73f1125d15a467b4f9401a7967e2915c93612737b7761cde7ada29": {
        "proposal": {
          "duration": {
            "blockHeight": 123456
          },
          "content": "qwertz"
        },
        "agree": [
          "03287bfebba4c7881a0509717e71b34b63f31e40021c321f89ae04f84be6d6ac37"
        ],
        "disagree": []
      },
      "9268a2dba346f7a9673877755061b5ba0bd14f72beeced37b877022aca2aed92": {
        "proposal": {
          "duration": {
            "blockHeight": 123456
          },
          "content": "QmPfdpTRbhGVZZWKZDzNT5T4NB6C7fFo5wM9Xe8qmLCXWt"
        },
        "agree": [],
        "disagree": []
      },
      "fe8419bda6525ef0074e733dbd3e8b671267c6c8d51b025fd7ae0812947cec30": {
        "proposal": {
          "duration": {
            "blockHeight": 123456
          },
          "content": "QmPfdpTRbhGVZZWKZDzNT5T4NB6C7fFo5wM9Xe8qmLCXWt"
        },
        "agree": [
          "03287bfebba4c7881a0509717e71b34b63f31e40021c321f89ae04f84be6d6ac37",
          "038082dad560a22ea003022015e3136b21ef1ffd9f2fd50049026cbe8e2258ca17"
        ],
        "disagree": [
          "02def27da9336e7fbf63131b8d7e5c9f45b296235db035f1f4242c507398f0f21d"
        ]
      }
    }
  }
}
```

{% endtab %}

{% tab title="404 " %}

```javascript
{
  "statusCode": 404,
  "error": "Not Found",
  "message": "Wallet not found!"
}
```

{% endtab %}

{% tab title="422 " %}

```javascript
{
  "statusCode": 422,
  "error": "Unprocessable Entity",
  "message": "\"id\" length must be 64 characters long"
}
```

{% endtab %}
{% endtabs %}

#### Curl Example

```bash
curl http://localhost:4003/api/cast/vote/4ce88923c7d961fc29dd6a5111979cb2767df947bf9f3b0f791a841a21d675de/wallet
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.protokol.com/developers/sdk/voting/api-endpoints/cast-vote.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
