Voters

Get proposals count

POST https://dao.octusbridge.io/v1/voters/proposals/count

[
  {
    "voter": "0:99ea964906c807e89ff8e55ba96a86e4d85d8020c8365ded9428777aef4281cd",
    "count": 2
  },
  {
    "voter": "0:a381e2e2c8fc8b1a4da9b72d55c8600ba209ea5f01da01c7811d3f38a79204ea",
    "count": 2
  },
  {
    "voter": "0:e5623ad7084d054fb326afaa1eb41288b4ef1f6891d6f4053e09b87e501f03da",
    "count": 2
  }
]

This function returns the number of proposals each voter took a part in.

It can be used for displaying the voting activity of each specified user.

Request parameters

Required body parameters:

Response fields explanation

Example

app.post('/voters/proposals/count', (req, res) => {
 
    axios({
        method: 'post',
        url: `${apiUrl}/voters/proposals/count`,
        data: {
            voters: req.body.voters
        }
    })
    .then(function(response){
        res.send(response.data)
    })
    .catch(function(error){
        console.error(error)
        res.send('Error')
    })
  })

Get proposals count

POST https://dao.octusbridge.io/v1/voters/proposals/count/search

[
  {
    "voter": "0:99ea964906c807e89ff8e55ba96a86e4d85d8020c8365ded9428777aef4281cd",
    "count": 2
  },
  {
    "voter": "0:a381e2e2c8fc8b1a4da9b72d55c8600ba209ea5f01da01c7811d3f38a79204ea",
    "count": 2
  },
  {
    "voter": "0:e5623ad7084d054fb326afaa1eb41288b4ef1f6891d6f4053e09b87e501f03da",
    "count": 2
  }
]

This function returns ordered list of users with the number of proposals they took part in.

It can be used to show voter’s activity ordered by a specified column (i.e. createdAt) and the direction (ascending, descending).

Request parameters

Required body parameters:

Response fields explanation

Example

app.post('/voters/proposals/count/search', (req, res) => {
 
    axios({
        method: 'post',
        url: `${apiUrl}/voters/proposals/count/search`,
        data: {
            limit: req.body.limit,
            offset: req.body.offset,
            ordering: req.body.ordering,
            voters: req.body.voters
        }
    })
    .then(function(response){
        res.send(response.data)
    })
    .catch(function(error){
        console.error(error)
        res.send('Error')
    })
  })

Get proposals with votes data

POST https://dao.octusbridge.io/v1/voters/{voter}/search

{
  "proposalWithVotes": [
    {
      "vote": {
        "proposalId": 6,
        "voter": "0:99ea964906c807e89ff8e55ba96a86e4d85d8020c8365ded9428777aef4281cd",
        "support": true,
        "reason": "",
        "votes": "5061664014",
        "locked": false,
        "messageHash": "0275dde58e1a456e6dbba65aba2f295e2d33812353f0632c9728c084843a3678",
        "transactionHash": "3024c7309609b69cf8ad0f6efc686fb3bf91ccc257261e9063c5cee35ac6f7cf",
        "createdAt": 1654530320
      },
      "proposal": {
        "proposalId": 6,
        "proposalAddress": "0:b0719c636ebd7e5fde1b4c0374dfe1808b46ca47afd2999379fc23cc9ce1edbd",
        "proposer": "0:56629b68a5ac850b5513ec992998a24eb4330d03171db1db91d485133dbe88c2",
        "description": Increase Octusbridge vault limits ... ,
        "startTime": 1654361225,
        "endTime": 1654620425,
        "executionTime": 1654793225,
        "gracePeriod": 172800,
        "timeLock": 172800,
        "votingDelay": 172800,
        "forVotes": "607634505921299",
        "againstVotes": "0",
        "quorumVotes": "500000000000000",
        "messageHash": "530b6645278c64e8c72822f6bd29cb8d890b2196531404b1387fc403cb885d3c",
        "transactionHash": "eb4c542297509c1662e6e6f268e7ab6670605d454cf36628925a1817b644f24a",
        "actions": {
          "tonActions": [
            {
              "value": "1000000000",
              "target": "0:cb5f0cb869c91731da283f5546c42d3a3353e6e260dda170b4650970b62519b0",
              "payload": "te6ccgEBAgEAEQABCAMFmxgBABBBY2NlcHRlZA=="
            }
          ],
          "ethActions": []
        },
        "executed": true,
        "canceled": false,
        "queued": true,
        "executedAt": 1654796642,
        "canceledAt": null,
        "queuedAt": 1654650616,
        "createdAt": 1654188416,
        "state": "Executed"
      }
    }
  ],
  "totalCount": 1
}

This function returns details about certain proposals based on proposal address, id, proposer’s address, start and end time as well as the proposal’s status (Pending, Executed…).

It can be used for filtering proposals based on parameters such as proposal id, proposal’s address, proposer’s address, start and end time of the proposal, showing all the details about the searched proposal such as: description, state, information about the votes, execution time, grace period, quorum details, message and transaction hash, etc.

Request parameters

Required body parameters:

Response fields explanation

Example

app.post('/voters/:voter/search', (req, res) => {
 
    axios({
        method: 'post',
        url: `${apiUrl}/voters/${req.params.voter}/search`,
        data: {
            availableForUnlock: req.body.availableForUnlock,
            endTimeGe: req.body.endTimeGe,
            endTimeLe: req.body.endTimeLe,
            limit: req.body.limit,
            locked: req.body.locked,
            offset: req.body.offset,
            ordering: req.body.ordering,
            proposalAddress: req.body.proposalAddress,
            proposalId: req.body.proposalId,
            proposer: req.body.proposer,
            startTimeGe: req.body.startTimeGe,
            startTimeLe: req.body.startTimeLe,
            state: req.body.state,
            support: req.body.support
        }
    })
    .then(function(response){
        res.send(response.data)
    })
    .catch(function(error){
        console.error(error)
        res.send('Error')
    })
  })

Last updated