question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

getBalance() returns wrong value compared to GUI Wallet

See original GitHub issue

When I call cardano.getBalance() it does not show the same value as the Nami Wallet GUI shows. The Nami Wallet shows ADA 99.73 and the getBalance() returns ADA 101.114713.

Screen Shot 2021-12-06 at 14 48 55 Screen Shot 2021-12-06 at 14 49 40

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
alessandrokonradcommented, Dec 13, 2021

More info here: https://docs.cardano.org/native-tokens/minimum-ada-value-requirement

This is slightly outdated and hasn’t been updated yet. The correct calculation is here: https://github.com/input-output-hk/cardano-ledger/commit/cde55e2ea56e601b93efdfbe37a9e840cef3b37c?short_path=eaf902f#diff-eaf902fe87c85c82b9d85e8372752b929106785a2b5c7aed0a311ea1f8e9a578

MinUtxoValue is no protocol parameter anymore, you rather have now coinsPerUtxoWord

0reactions
dauta-toastcommented, Dec 12, 2021

Had to find a solution for this and what I ended up doing is use the min_ada_required function from Emurgo cardano-serialization-lib. Pass your balance Value object to that along with 1000000 (1 ada) which seems to be a network parameter, but is hardcoded in Nami for the moment. Please, correct me if what I’m doing is wrong. Thanks! More info here: https://docs.cardano.org/native-tokens/minimum-ada-value-requirement

Edit: Although, I get a different result when I do this. I get 1925924 vs 1793064 in Nami. So, I’m most likely doing something wrong.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nami wallet showing getBalance returning a NaN
How can I use cardano-serialization-lib in the browser to decode CBOR? 1 · Nami getBalance() returns wrong value compared to GUI Wallet. Related....
Read more >
Wallet RPC documentation | Monero
Analyzes a string to determine whether it is a valid monero wallet address and returns the result and the address specifications. Inputs: address...
Read more >
How to read the balance of your MetaMask wallet with web3.js
getAccounts();. This will return a list of addresses. The Ethereum address is the first 20 bytes of the SHA3 hashed public key. You...
Read more >
Wallet balance is not updated after sent transaction and fails ...
I have wallet (restored from 1 private key) that is not updating balance after sent transactions. Querying wallet balance: $ electrum getbalance.
Read more >
Working with the wallet - bitcoinj
The Wallet class is one of the most important classes in bitcoinj. It stores keys and the transactions that assign value to/from those...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found