feat: update to 'micro' (quad-block) QR terminal output
[crowdnode.js/.git] / bin / crowdnode.js
index 47357e2d264f2d769df89fef6b605f5b81b3dd69..d8697d95594b95dfdae417e12cba0b8f909953fa 100755 (executable)
@@ -331,12 +331,13 @@ async function initCrowdNode(insightBaseUrl) {
  * @param {Number} duffs - 1/100000000 of a DASH
  */
 function showQr(addr, duffs = 0) {
+  let dashAmount = toDash(duffs);
   let dashUri = `dash://${addr}`;
   if (duffs) {
-    dashUri += `?amount=${duffs}`;
+    dashUri += `?amount=${dashAmount}`;
   }
 
-  let dashQr = Qr.ascii(dashUri, { indent: 4 });
+  let dashQr = Qr.ascii(dashUri, { indent: 4, size: "micro" });
   let addrPad = Math.ceil((qrWidth - dashUri.length) / 2);
 
   console.info(dashQr);