Comparing version 1.0.34 to 1.0.36
30
index.js
@@ -394,2 +394,11 @@ const CryptoJS = require('crypto-js') | ||
}, | ||
availableBalance: (account) => { | ||
if (!account.voteLock) | ||
return account.balance | ||
let newLock = 0 | ||
for (let v in account.proposalVotes) | ||
if (account.proposalVotes[v].end > new Date().getTime() && account.proposalVotes[v].amount - account.proposalVotes[v].bonus > newLock) | ||
newLock = account.proposalVotes[v].amount - account.proposalVotes[v].bonus | ||
return account.balance - newLock | ||
}, | ||
votingPower: (account) => { | ||
@@ -402,3 +411,3 @@ return new GrowInt(account.vt, { | ||
bandwidth: (account) => { | ||
return new GrowInt(account.bw, {growth:account.balance/(avalon.config.bwGrowth), max:256000}) | ||
return new GrowInt(account.bw, {growth: Math.max(account.baseBwGrowth || 0,account.balance)/(avalon.config.bwGrowth), max:256000}) | ||
.grow(new Date().getTime()).v | ||
@@ -429,3 +438,20 @@ }, | ||
SET_SIG_THRESHOLD: 21, | ||
SET_PASSWORD_WEIGHT: 22 | ||
SET_PASSWORD_WEIGHT: 22, | ||
UNSET_SIG_THRESHOLD: 23, | ||
NEW_ACCOUNT_WITH_BW: 24, | ||
PLAYLIST_JSON: 25, | ||
PLAYLIST_PUSH: 26, | ||
PLAYLIST_POP: 27, | ||
COMMENT_EDIT: 28, | ||
ACCOUNT_AUTHORIZE: 29, | ||
ACCOUNT_REVOKE: 30, | ||
FUND_REQUEST_CREATE: 31, | ||
FUND_REQUEST_CONTRIB: 32, | ||
FUND_REQUEST_WORK: 33, | ||
FUND_REQUEST_WORK_REVIEW: 34, | ||
PROPOSAL_VOTE: 35, | ||
PROPOSAL_EDIT: 36, | ||
CHAIN_UPDATE_CREATE: 37, | ||
MD_QUEUE: 38, | ||
MD_SIGN: 39 | ||
} | ||
@@ -432,0 +458,0 @@ } |
{ | ||
"name": "javalon", | ||
"version": "1.0.34", | ||
"version": "1.0.36", | ||
"description": "javascript api for the avalon blockchain", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1046081
524