-
Notifications
You must be signed in to change notification settings - Fork 242
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
Subscripting a transaction's pre_token_balances and post_token_balances returns the same object? #365
Comments
I believe this is a Solana JSON RPC API issue. We don't have control over what the Solana Node returns back. Might want to ask someone at @solana-labs |
I'm saying that the received object is correct, but when you subscript into
the OBJECT, A wrong value is returned.
as if:
```
obj = {
'1': 'one',
'2', 'two'
}
print(obj['1'])
'two'
```
…On Wed, Jun 14, 2023 at 6:33 PM Michael Huang ***@***.***> wrote:
I believe this is a Solana JSON RPC API issue. We don't have control over
what the Solana Node returns back. Might want to ask someone at
@solana-labs <https://github.com/solana-labs>
—
Reply to this email directly, view it on GitHub
<#365 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACFY5BLZQPV7MIT6PD6RFLDXLHKU7ANCNFSM6AAAAAAZF2QA6Q>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Are you using the latest solana-py? This should be fixed by kevinheavey/solders#59 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So let's say i fetch a transaction:
Then I print the transaction meta and I get:
then I do this:
They both return the pre balances value
I had to turn meta into a dict using
loads(response.transaction.meta.to_json())
and only then could I access the proper token balances.Even if I print the objects directly they print the same value, and even if I do
response.transaction.meta.post_token_balances == response.transaction.meta.pre_token_balances it returns True
Am I tripping?
The text was updated successfully, but these errors were encountered: