Mendapatkan penghitungan pengajuan
POST
https://dao.octusbridge.io/v1/voters/proposals/count
200: OK Successful request
Copy [
{
"voter": "0:99ea964906c807e89ff8e55ba96a86e4d85d8020c8365ded9428777aef4281cd",
"count": 2
},
{
"voter": "0:a381e2e2c8fc8b1a4da9b72d55c8600ba209ea5f01da01c7811d3f38a79204ea",
"count": 2
},
{
"voter": "0:e5623ad7084d054fb326afaa1eb41288b4ef1f6891d6f4053e09b87e501f03da",
"count": 2
}
]
Fungsi ini mengembalikan jumlah pengajuan yang diikuti oleh setiap pemilih.
Dapat digunakan untuk menampilkan aktivitas pemungutan suara dari setiap pengguna yang ditentukan.
Parameter permintaan
Parameter tubuh yang diperlukan:
Penjelasan bidang respons
Contoh
Copy 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' )
})
})
Mendapatkan penghitungan pengajuan
POST
https://dao.octusbridge.io/v1/voters/proposals/count/search
200: OK Successful request
Copy [
{
"voter": "0:99ea964906c807e89ff8e55ba96a86e4d85d8020c8365ded9428777aef4281cd",
"count": 2
},
{
"voter": "0:a381e2e2c8fc8b1a4da9b72d55c8600ba209ea5f01da01c7811d3f38a79204ea",
"count": 2
},
{
"voter": "0:e5623ad7084d054fb326afaa1eb41288b4ef1f6891d6f4053e09b87e501f03da",
"count": 2
}
]
Fungsi ini mengembalikan daftar pengguna yang diurutkan dengan jumlah pengajuan yang mereka ikuti.
Dapat digunakan untuk menunjukkan aktivitas pemilih yang diurutkan berdasarkan kolom tertentu (yaitu, CreatedAt) dan arah (naik, turun).
Parameter permintaan
Parameter tubuh yang diperlukan:
Penjelasan bidang respons
Contoh
Copy 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' )
})
})
Mendapatkan pengajuan dengan data suara
POST
https://dao.octusbridge.io/v1/voters/{voter}/search
200: OK Successful request
Copy {
"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
}
Fungsi ini mengembalikan detail tentang pengajuan tertentu berdasarkan alamat pengajuan, id, alamat pengusul, waktu mulai dan berakhir serta status pengajuan (Tertunda, Dieksekusi…).
Dapat digunakan untuk memfilter pengajuan berdasarkan parameter seperti id pengajuan, alamat pengajuan, alamat pengusul, waktu mulai dan berakhirnya pengajuan, menampilkan semua detail tentang pengajuan yang dicari seperti: deskripsi, status, informasi tentang suara, eksekusi waktu, masa tenggang, detail kuorum, hash pesan dan transaksi, dll.
Parameter permintaan
Parameter tubuh yang diperlukan:
Penjelasan bidang respons
Contoh
Copy 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' )
})
})