Cast Vote
Voting Cast Vote API Endpoints.
/cast/vote/transactions
GET
http://localhost:4003/api/cast/vote/transactions
Returns all Cast Vote Transactions
Query Parameters
Name | Type | Description |
---|
| | The number of page to be returned |
| | The number of transaction per page |
| | Orders by specific parameter (asc or desc)
Example: orderBy=id:asc |
| | Transforms to raw response |
{
"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"
}
},
...
]
}
Curl Example
curl http://localhost:4003/api/cast/vote/transactions
/cast/vote/transactions/:id
GET
http://localhost:4003/api/cast/vote/transactions/:id
Returns Cast Vote Transaction by id.
Path Parameters
Query Parameters
Name | Type | Description |
---|
| | Transforms to raw response |
{
"data": {
"id": "4ce88923c7d961fc29dd6a5111979cb2767df947bf9f3b0f791a841a21d675de",
"senderPublicKey": "03287bfebba4c7881a0509717e71b34b63f31e40021c321f89ae04f84be6d6ac37",
"proposalId": "c8f3fff0df73f1125d15a467b4f9401a7967e2915c93612737b7761cde7ada29",
"decision": "yes",
"timestamp": {
"epoch": 136819968,
"unix": 1626921168,
"human": "2021-07-22T02:32:48.000Z"
}
}
}
{
"statusCode": 404,
"error": "Not Found",
"message": "Transaction not found!"
}
{
"statusCode": 422,
"error": "Unprocessable Entity",
"message": "\"id\" length must be 64 characters long"
}
Curl Example
curl http://localhost:4003/api/cast/vote/transactions/4ce88923c7d961fc29dd6a5111979cb2767df947bf9f3b0f791a841a21d675de
/cast/vote/:id/wallet
GET
http://localhost:4003/api/cast/vote/:id/wallet
Returns wallet by Cast Vote transaction id
Path Parameters
{
"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"
]
}
}
}
}
{
"statusCode": 404,
"error": "Not Found",
"message": "Wallet not found!"
}
{
"statusCode": 422,
"error": "Unprocessable Entity",
"message": "\"id\" length must be 64 characters long"
}
Curl Example
curl http://localhost:4003/api/cast/vote/4ce88923c7d961fc29dd6a5111979cb2767df947bf9f3b0f791a841a21d675de/wallet