Skip to content
On this page

Voters ​


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:

NameExample valueComment
voters0:99ea964906c807e89ff8e55ba96a86e4d85d8020c8365ded9428777aef4281cdList of voters’ addresses

Response fields explanation ​

NameExample valueComment
voter0:99ea964906c807e89ff8e55ba96a86e4d85d8020c8365ded9428777aef4281cdVoter’s address
count2Number of proposals for which certain voter raised a vote

Example ​

java
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')
    })
  })

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:

NameExample valueComment
limit5Maximum number of proposals to be retrieved
offsetOffset
orderingSet of parameters based on which the retrieved proposals will be ordered
columncountOrder by given column name (i.e. createdAt)
directionASCOrder by given direction (ascending or descending)
voters0:99ea964906c807e89ff8e55ba96a86e4d85d8020c8365ded9428777aef4281cdList of voters’ addresses

Response fields explanation ​

NameExample valueComment
voter0:99ea964906c807e89ff8e55ba96a86e4d85d8020c8365ded9428777aef4281cdVoter’s address
count2Number of proposals for which certain voter raised a vote

Example ​

java
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')
    })
  })

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 ​

NameExample valueComment
voter0:99ea964906c807e89ff8e55ba96a86e4d85d8020c8365ded9428777aef4281cdrepresents address of a specific voter

Required body parameters:

NameExample valueComment
voter0:99ea964906c807e89ff8e55ba96a86e4d85d8020c8365ded9428777aef4281cdrepresents address of a specific voter
availableForUnlocktrueTrue if vote is available for unlock, false if not
endTimeGe1625747869Proposals that ended after or during the given time (in UNIX format)
endTimeLe1688819869Proposals that ended before or during the given time (in UNIX format)
limit10Maximum number of proposals to be retrieved
lockedfalseTrue if locked, false if not
offset0Offset
orderingSet of parameters based on which the retrieved proposals will be ordered
columncreatedAtOrder by given column name (i.e. createdAt)
directionASCOrder by given direction (ascending or descending)
proposalAddress0:b0719c636ebd7e5fde1b4c0374dfe1808b46ca47afd2999379fc23cc9ce1edbdAddress of the desired proposal
proposalId6Id of the desired proposal
proposer0:56629b68a5ac850b5513ec992998a24eb4330d03171db1db91d485133dbe88c2Address of the user that created the proposal
startTimeGe1625747869Proposals that started after or during the given time (in UNIX format)
startTimeLe1688819869Proposals that started before or during the given time (in UNIX format)
stateExecutedState of the proposal (Executed, pending…)
supporttrueTrue if voted for, false if voted against the proposal

Response fields explanation ​

NameExample valueComment
proposalWithVotesList of proposals with votes of the certain voter
proposalDetails about the proposal
actionsDetails about ethereum and everscale actions
ethActionslist of all the actions arrived from Everscale with following data:
- callData"string"Additional call data
- chainId0Id of the chain where the action happened
- signature"string"Relay’s signature
- target"string"Target address
- value"string"Amount of tokens
tonActionslist of all the actions arrived from ethereum side:
- payloadte6ccgEBAgEAEQABCAMFmxgBABBBY2NlcHRlZA==Payload data
- target0:cb5f0cb869c91731da283f5546c42d3a3353e6e260dda170b4650970b62519b0Target address
- value1000000000Amount of tokens
againstVotes0Number of votes against proposal
canceledfalseTrue if proposal is canceled, false if not
canceledAtnullDate time of canceling event in UNIX format
createdAt1654188416Date time of proposal’s creation in UNIX format
descriptionIncrease Octusbridge vault limits ...Description of proposal’s motive
endTime1654620425Date time of the end of voting in UNIX format
executedtrueTrue if proposal is executed, false if not
executedAt1654796642Date time of proposal’s actual execution
executionTime1654793225Predicted execution time in UNIX format
forVotes607634505921299Number of votes supporting the proposal
gracePeriod172800Timespan in days for how long will the proposal be in the grace period
messageHash0275dde58e1a456e6dbba65aba2f295e2d33812353f0632c9728c084843a3678Hash code of the message
proposalAddress0:b0719c636ebd7e5fde1b4c0374dfe1808b46ca47afd2999379fc23cc9ce1edbdAddress of the proposal’s contract
proposalId6Id of the proposal
proposer0:56629b68a5ac850b5513ec992998a24eb4330d03171db1db91d485133dbe88c2Address of the user that created the proposal
queuedtrueTrue if the proposal is queued, false if not
queuedAt1654650616Date of queuing the proposal
quorumVotes500000000000000Number of votes for reaching the quorum
startTime1654361225Date time of the start of voting
stateExecutedState of the proposal (Executed, Pending…)
timeLock172800Timespan of the lock of proposal (grace period)
transactionHasheb4c542297509c1662e6e6f268e7ab6670605d454cf36628925a1817b644f24aHash code of the transaction
votingDelay172800Timespan of the voting delay (grace period)
votecreatedAt
createdAt1654530320Date time when the vote was raised
lockedfalseTrue if vote is locked, false if not
messageHash530b6645278c64e8c72822f6bd29cb8d890b2196531404b1387fc403cb885d3cHash code of the message
proposalId6Id of the proposal voted for
reason"string"Reason for voting
supporttrueTrue if the vote is for, false if it’s against
transactionHasheb4c542297509c1662e6e6f268e7ab6670605d454cf36628925a1817b644f24aHash code of the transaction
voter0:99ea964906c807e89ff8e55ba96a86e4d85d8020c8365ded9428777aef4281cdVoter’s address
votes5061664014Number of votes given
totalCount1Total number of proposals retrieved

Example ​

java
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')
    })
  })