forc-wallet icon indicating copy to clipboard operation
forc-wallet copied to clipboard

Convert asset balance to human readable format

Open Braqzen opened this issue 2 years ago • 2 comments

After creating a new account and getting funds from the beta-4 faucet the balance on my account 0.5 ETH.

Running the command

forc wallet account 0 balance

The balance of the 0th account is shown as seen in the attached image. The asset is 0x00... and the displayed balance is 500000000 instead of something like 0.500000...

1

In the following code snippet we should perform a check and format the value instead of iterating and directly displaying the value to the user.

https://github.com/FuelLabs/forc-wallet/blob/d6a4798f7159e807b9227f5a49f97179d9d2d0a7/src/account.rs#L259-L266

Braqzen avatar Nov 06 '23 20:11 Braqzen

Hi there, I've also noticed this problem, thanks for raising it. I would add:

  • A unit should be given for the amount, for example Gwei, microETH or ETH.
  • Asset ID should provide more clarity, not just 64 '0's. Maybe it should be Asset Name so the user understand what the asset is.
  • Is there any point in having Asset ID?

I would also suggest that this is a bug, not an enhancement.

HoTandy avatar Feb 20 '24 10:02 HoTandy

@luizstacio is this, or should it be, classed as Edge? Users see this as they're stepping through the Online Guides.

HoTandy avatar Mar 19 '24 09:03 HoTandy