-
Notifications
You must be signed in to change notification settings - Fork 673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AccountView should return computed balance as balance #1811
Comments
When client be able to read config trough RPC, then it'll be able to compute spendable balance on |
Talked to our customers that requested this feature, they actually suggested to compute the real balance on the front-end side. Also, @frol had a concern that if we expose this through RPC it will create an intense RPC traffic, because real balance will be changing every second and so front-ends will be querying it frequently. Closing this issue in favor of #2007 |
I don't fully agree with reasoning that ppl will keep calling RPC for recent balance in case if it is computed. They will keep calling it whenever they needed. We still should return the lazy computed balance to allow frontends to compute the current balance at any block in the future (which is just an approximation always, as money can be added or sent from another place). Also we should add issues tracking to nearlib and near she'll to show current balance if we are deciding to compute it on the front end. |
Ok, what if instead of changing of the meaning of the |
In any case, let me first finish #2007 (the PR will be ready today), which will make genesis and runtime configs available in jsonrpc. |
This is blocked on the decision for #2272. |
Closed due to #2272 |
Currently returned
balance
from RPC doesn't account for non subtracted yet storage rent.We should rename that into something like
onchain_balance
and makebalance
=onchain_balance - storage_price * storage_usage * (height - storage_last_updated_at)
.See section 4.3 of https://near.ai/economics for details on storage rent and
charge_rent
for actual function of how rent is updated.CC: @kcole16
The text was updated successfully, but these errors were encountered: