-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
would it provides balance changes response in rpc, simulateTransaction ? #18509
Comments
The |
Yes, It contains postBalance but no preBalance. The scenario is that: A account transfer to B two times. get B account balance (for pre balance) => the first tx confirmed => call simulateTransaction I will get the postBalance including the first and the second. I also try to improve this situation like get B account balance (for pre balance) => the first tx confirmed => call simulateTransaction => get B account balance again I check B balance is consist after I call simulateTransaction. |
Hi @mvines. Are there any updates? |
Got it. How about a new option to request "preAccounts" from simulateTranstion. The currently returned "accounts" are essentially "postAccounts" already. The "preAccounts" would allow the user to obtain the account balance and data at the time of the simulation. |
I think it works! Thank you. |
(this functionality is needed for one of advanced usages of #17796 ) |
Problem
I can't get the exact balance changes via rpc,
simulateTransaction
For now, I can only get it by twice rpc call. (getBalance and simulateTransaction)
It will cause a problem that I can't call those two rpc in the same context.
I have a chance to get result of
simulateTransaction
which contains one more confirmed block.Proposed Solution
add something like preBalance, postBalance or balance changes in simulateTransaction
or
make getBalance and simulateTransaction can run in the same context. (like specific slot)
The text was updated successfully, but these errors were encountered: