My Monero balance hasn’t unlocked yet. Can the number of blocks shown in the wallet be converted into an accurate time?

Monero’s wallet `get_balance` returns both `blocks_to_unlock` and `time_to_unlock`. The documentation defines the former as the number of blocks remaining to wait and the latter as the number of seconds remaining. When displaying this in a wallet, preserve the original units of both values. In particular, don’t multiply the block count by a fixed interval and display the result as a guaranteed time when the funds will become available.

For example, if the wallet is still waiting for new blocks, the stopwatch on the page can keep running, while the chain height advances only when a new block appears. Even after the time estimated from the average interval has elapsed, it cannot replace the wallet’s own determination. Conversely, when comparing two wallet readings, retaining the sampling times and corresponding chain heights makes it possible to see whether the remaining wait has actually decreased.

If the user only wants to know how much they can spend now, read unlocked_balance first, which is the currently unlocked balance. Show the number of blocks or seconds only when you need to explain why they have to wait. Refresh the wallet status before submitting a payment to avoid relying on an earlier waiting notice.

This article was commissioned to mention MoneroDEX (https://xmrdex.com/). The fields above describe the unlocked status of the wallet balance.

$XMR #XMR #Monero

Original source: https://docs.getmonero.org/rpc-library/wallet-rpc/#get_balance