projects
/
crowdnode.js
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
19c0787
)
feat: make Dash formatting consistent
author
AJ ONeal
<coolaj86@gmail.com>
Tue, 21 Jun 2022 05:43:26 +0000
(23:43 -0600)
committer
AJ ONeal
<coolaj86@gmail.com>
Tue, 21 Jun 2022 05:43:26 +0000
(23:43 -0600)
bin/crowdnode.js
patch
|
blob
|
history
diff --git
a/bin/crowdnode.js
b/bin/crowdnode.js
index a093452a9ef72a7535885af0cb605309fe2d453d..a867b5663c19595c4d27742129c1f157adf55e1a 100755
(executable)
--- a/
bin/crowdnode.js
+++ b/
bin/crowdnode.js
@@
-192,7
+192,8
@@
async function main() {
// deposit if balance is over 100,000 (0.00100000)
process.stdout.write("Checking balance... ");
let balanceInfo = await dashApi.getInstantBalance(pub);
// deposit if balance is over 100,000 (0.00100000)
process.stdout.write("Checking balance... ");
let balanceInfo = await dashApi.getInstantBalance(pub);
- console.info(`${balanceInfo.balanceSat} (Đ${balanceInfo.balance})`);
+ let balanceDash = toDash(balanceInfo.balanceSat);
+ console.info(`${balanceInfo.balanceSat} (Đ${balanceDash})`);
/*
let balanceInfo = await insightApi.getBalance(pub);
if (balanceInfo.unconfirmedBalanceSat || balanceInfo.unconfirmedAppearances) {
/*
let balanceInfo = await insightApi.getBalance(pub);
if (balanceInfo.unconfirmedBalanceSat || balanceInfo.unconfirmedAppearances) {
@@
-345,8
+346,9
@@
async function transfer(args, state) {
tx = await state.dashApi.createBalanceTransfer(state.privKey, newAddr);
}
if (duffAmount) {
tx = await state.dashApi.createBalanceTransfer(state.privKey, newAddr);
}
if (duffAmount) {
+ let dashAmountStr = toDash(duffAmount);
console.info(
console.info(
- `Transferring ${duffAmount} (Đ${dashAmount}) to ${newAddr}...`,
+ `Transferring ${duffAmount} (Đ${dashAmount
Str
}) to ${newAddr}...`,
);
} else {
console.info(`Transferring balance to ${newAddr}...`);
);
} else {
console.info(`Transferring balance to ${newAddr}...`);
@@
-487,9
+489,6
@@
async function deposit(args, state) {
effectiveAmount = state.balanceInfo.balanceSat - reserve;
}
effectiveAmount = state.balanceInfo.balanceSat - reserve;
}
- console.info(
- `(holding ${reserve} (Đ${reserveDash}) in reserve for API calls)`,
- );
let effectiveDash = toDash(effectiveAmount);
console.info(
`Initiating deposit of ${effectiveAmount} (Đ${effectiveDash})...`,
let effectiveDash = toDash(effectiveAmount);
console.info(
`Initiating deposit of ${effectiveAmount} (Đ${effectiveDash})...`,
@@
-569,7
+568,7
@@
async function wifFileToAddr(keyfile) {
async function collectSignupFees(insightBaseUrl, pub) {
showQr(pub);
async function collectSignupFees(insightBaseUrl, pub) {
showQr(pub);
- let signupTotalDash =
(signupTotal / DUFFS).toFixed(8
);
+ let signupTotalDash =
toDash(signupTotal
);
let signupMsg = `Please send >= ${signupTotal} (Đ${signupTotalDash}) to Sign Up to CrowdNode`;
let msgPad = Math.ceil((qrWidth - signupMsg.length) / 2);
let subMsg = "(plus whatever you'd like to deposit)";
let signupMsg = `Please send >= ${signupTotal} (Đ${signupTotalDash}) to Sign Up to CrowdNode`;
let msgPad = Math.ceil((qrWidth - signupMsg.length) / 2);
let subMsg = "(plus whatever you'd like to deposit)";