reaster / cardano_wallet_sdk

Targeting Flutter apps, the Cardano Wallet SDK is a high-level Dart library for managing cryptocurrency accounts & executing transactions on the blockchain.
Apache License 2.0
38 stars 18 forks source link

ADA amount returned should be a double #3

Closed mtkgeek closed 2 years ago

mtkgeek commented 2 years ago

The ada amount currently returned is an int(the coin class). What happens when a wallet has a balance of say 10.6 ada, how is that resolved?

reaster commented 2 years ago

All amounts are stored in lovelace (1,000,000 lovelace = 1 ADA) so there is no need for a decimal place. In Cardano apps, you'll generally only covert to ADA for display purposes (see the AdaFormattter). BTW, this SDK is an alpha, the production code will use a BigInt (the coin typedef is just a placeholder for this future change).