Comparing version 1.0.28 to 1.0.29
58
index.js
@@ -65,3 +65,3 @@ var CryptoJS = require('crypto-js') | ||
getVotesByAccount: (name, lastTs, cb) => { | ||
fetch(avalon.randomNode()+'/votes/'+name+'/'+lastTs, { | ||
fetch(avalon.randomNode()+'/votes/all/'+name+'/'+lastTs, { | ||
method: 'get', | ||
@@ -78,2 +78,41 @@ headers: { | ||
}, | ||
getPendingVotesByAccount: (name, lastTs, cb) => { | ||
fetch(avalon.randomNode()+'/votes/pending/'+name+'/'+lastTs, { | ||
method: 'get', | ||
headers: { | ||
'Accept': 'application/json, text/plain, */*', | ||
'Content-Type': 'application/json' | ||
} | ||
}).then(res => res.json()).then(function(res) { | ||
cb(null, res) | ||
}).catch(function(error) { | ||
cb(error) | ||
}) | ||
}, | ||
getClaimableVotesByAccount: (name, lastTs, cb) => { | ||
fetch(avalon.randomNode()+'/votes/claimable/'+name+'/'+lastTs, { | ||
method: 'get', | ||
headers: { | ||
'Accept': 'application/json, text/plain, */*', | ||
'Content-Type': 'application/json' | ||
} | ||
}).then(res => res.json()).then(function(res) { | ||
cb(null, res) | ||
}).catch(function(error) { | ||
cb(error) | ||
}) | ||
}, | ||
getClaimedVotesByAccount: (name, lastTs, cb) => { | ||
fetch(avalon.randomNode()+'/votes/claimed/'+name+'/'+lastTs, { | ||
method: 'get', | ||
headers: { | ||
'Accept': 'application/json, text/plain, */*', | ||
'Content-Type': 'application/json' | ||
} | ||
}).then(res => res.json()).then(function(res) { | ||
cb(null, res) | ||
}).catch(function(error) { | ||
cb(error) | ||
}) | ||
}, | ||
getAccounts: (names, cb) => { | ||
@@ -131,3 +170,3 @@ fetch(avalon.randomNode()+'/accounts/'+names.join(','), { | ||
}, | ||
getRewardsPending: (name, cb) => { | ||
getPendingRewards: (name, cb) => { | ||
fetch(avalon.randomNode()+'/rewards/pending/'+name, { | ||
@@ -145,3 +184,3 @@ method: 'get', | ||
}, | ||
getRewardsClaimed: (name, cb) => { | ||
getClaimedRewards: (name, cb) => { | ||
fetch(avalon.randomNode()+'/rewards/claimed/'+name, { | ||
@@ -159,2 +198,15 @@ method: 'get', | ||
}, | ||
getClaimableRewards: (name, cb) => { | ||
fetch(avalon.randomNode()+'/rewards/claimable/'+name, { | ||
method: 'get', | ||
headers: { | ||
'Accept': 'application/json, text/plain, */*', | ||
'Content-Type': 'application/json' | ||
} | ||
}).then(res => res.json()).then(function(res) { | ||
cb(null, res) | ||
}).catch(function(err) { | ||
cb(err) | ||
}) | ||
}, | ||
generateCommentTree: (root, author, link) => { | ||
@@ -161,0 +213,0 @@ var replies = [] |
{ | ||
"name": "javalon", | ||
"version": "1.0.28", | ||
"version": "1.0.29", | ||
"description": "javascript api for the avalon blockchain", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -107,2 +107,51 @@ # Javalon | ||
### GET all votes by account | ||
``` | ||
javalon.getVotesByAccount('alice', 0, (err, votes) => { | ||
console.log(err, votes) | ||
}) | ||
``` | ||
### GET pending votes by account | ||
``` | ||
javalon.getPendingVotesByAccount('alice', 0, (err, votes) => { | ||
console.log(err, votes) | ||
}) | ||
``` | ||
### GET claimable votes by account | ||
``` | ||
javalon.getClaimableVotesByAccount('alice', 0, (err, votes) => { | ||
console.log(err, votes) | ||
}) | ||
``` | ||
### GET claimed votes by account | ||
``` | ||
javalon.getClaimedVotesByAccount('alice', 0, (err, votes) => { | ||
console.log(err, votes) | ||
}) | ||
``` | ||
### GET pending rewards by account | ||
``` | ||
javalon.getPendingRewards('alice', (err, votes) => { | ||
console.log(err, votes) | ||
}) | ||
``` | ||
### GET claimed rewards by account | ||
``` | ||
javalon.getClaimedRewards('alice', (err, votes) => { | ||
console.log(err, votes) | ||
}) | ||
``` | ||
### GET claimable rewards by account | ||
``` | ||
javalon.getClaimableRewards('alice', (err, votes) => { | ||
console.log(err, votes) | ||
}) | ||
``` | ||
## POST API | ||
@@ -109,0 +158,0 @@ |
Sorry, the diff of this file is too big to display
519417
744
202
33