How would a wallet read an account’s current reserve, so it can show how much MON is actually sendable?
The wallet application would do an eth_call to the 0x1001 precompile using the GET_RESERVE_BALANCE selector with the wallet address as the parameter. Sendability would then depend on current balance, in-flight transactions (gas reserved in consensus) and specified reserve balance (i.e. DEFAULT_RESERVE or a set value).
Could a dapp ask a user to sign a reserve change? If so, it seems worth flagging clearly in the signing prompt, since a very high reserve could stop someone from sending their MON.
Yes, since it’s essentially a normal transaction. Wallet applications would be expected to:
- support setting a custom reserve balance, in which case the user would be made aware of what they are signing
- not support setting a custom reserve balance, in which case the user would not be allowed to sign the transaction