dashhive / crowdnode-cli

Earn ~6% Interest on Dash via CrowdNode - CLI for Mac, Linux, and Windows
https://github.com/dashhive/crowdnode-cli
MIT License
4 stars 1 forks source link

`crowdnode status` displays excessive precision #19

Closed riongull closed 2 years ago

riongull commented 2 years ago

@coolaj86, it looks like crowdnode status displays excessive precision.

CrowdNode Stake: 400307268 (Đ4.0030726763)

It should only have 8 digits after the decimal.

Originally posted by @riongull in https://github.com/dashhive/crowdnode-cli/issues/16#issuecomment-1178475830

coolaj86 commented 2 years ago

This is a bug in the CrowdNode API, but we can fix it on our side as a workaround:

let crowdNodeBalance = await CrowdNode.http.GetBalance(addr);
console.log(crowdNodeBalance.TotalBalance); // shows exactly what CrowdNode gives us

Could you try your key against the CrowdNode API directly to confirm?

my_addr="YOUR_KEY_GOES_HERE"

curl -fsSL "https://app.crowdnode.io/odata/apifundings/GetBalance(address='${my_addr}')"
coolaj86 commented 2 years ago

Also, the time has too much precision:

"UpdatedOn": "2022-07-02T15:29:55.8533333"

I really don't care if it's been 1/3 of a millisecond... :)

coolaj86 commented 2 years ago

This is fixed as part of https://github.com/dashhive/crowdnode.js/pull/35