Would be kind of useful to have a max button when trading / withdrawing i.e. I don’t want to be switching back and forth to copy and paste amounts.
Not possible, since the DApp never knows how much you have in your wallet.
Okay, but the desktop app knows, it doesn’t have to inform the dapp does it?
That the desktop app(wallet) knows doesn’t matter. The DApp never knows how much you have.
The DApp simply proposes a transaction to the wallet for you to approve/reject.
I dunno. I’m not convinced. A macro / UI placeholder doesn’t have to reveal data to a dapp if the wallet is filling it in. The dapp simply triggers the UI.
That’s currently not possible. Right now, by default, apps are allowed to query the blockchain info. They can also create txs, but each tx should be approved by the user.
We can add a method for app shaders to discover user balance, kind of like with MetaMask where you have to sign a message to allow the DApp to see your balance and suggest transactions.
Apps with enough privilege level (i.e. approved by the user) will be able to call it and use it to compute the amounts for components such as the (25%, 50%, 75%, ‘MAX’) amount button.
The problem with this is that DApps that are not ran locally inside the wallet, but hosted on a server(like BeamAssets), could map your wallet holdings to your IP.
Of course by default apps won’t be able to query user balance, unless user explicitly allows.
I agree, not good for dapps to track things like balance, even with user permission because people can be negatively influenced / incentivized.
I’m not sure how beam dapps are constructed but are you suggesting, for example, that a js page could query page data to obtain the balance? In which case, hmmm, I don’t know how that could be overcome.
Yes, that’s exactly what I’m saying.
It would take nothing more than a simple document.getElementById