X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=lib%2Fcrowdnode.js;h=eec0f6180eec928b28106ffb194ddb29a4d84404;hb=5dbccedf943f0f768d80a9da1bffff061a5cef3e;hp=977c022e1d8af2aea2859731168a2626ce4db37c;hpb=6ce248d1710d2e5d132989b733eab25730efd491;p=crowdnode.js%2F.git diff --git a/lib/crowdnode.js b/lib/crowdnode.js index 977c022..eec0f61 100644 --- a/lib/crowdnode.js +++ b/lib/crowdnode.js @@ -31,6 +31,7 @@ CrowdNode._baseUrl = CrowdNode.main.baseUrl; CrowdNode.offset = 20000; CrowdNode.duffs = 100000000; CrowdNode.depositMinimum = 10000; +CrowdNode.stakeMinimum = toDuff(0.5); /** * @type {Record} @@ -201,7 +202,7 @@ CrowdNode.accept = async function (wif, hotwallet) { /** * @param {String} wif * @param {String} hotwallet - * @param {Number} amount + * @param {Number} amount - Duffs (1/100000000 Dash) */ CrowdNode.deposit = async function (wif, hotwallet, amount) { // Send Request Message @@ -229,7 +230,7 @@ CrowdNode.deposit = async function (wif, hotwallet, amount) { /** * @param {String} wif * @param {String} hotwallet - * @param {Number} permil - 1/1000 (percent, but per thousand) + * @param {Number} permil - 1/1000 (1/10 of a percent) 500 permille = 50.0 percent */ CrowdNode.withdrawal = async function (wif, hotwallet, permil) { let valid = permil > 0 && permil <= 1000; @@ -499,3 +500,7 @@ if (require.main === module) { console.error(err); }); } + +function toDuff(dash) { + return Math.round(parseFloat(dash) * DUFFS); +}