Skip to content
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

JsonDecodingException on getAccountInfo() #135

Open
avin-sharma opened this issue Nov 30, 2023 · 0 comments
Open

JsonDecodingException on getAccountInfo() #135

avin-sharma opened this issue Nov 30, 2023 · 0 comments

Comments

@avin-sharma
Copy link

I am running into JsonDecodingException when I try to get account info.

kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 226: Failed to parse type 'long' for input '18446744073709551615'
JSON input: .....ntEpoch":18446744073709551615,"space":0}},"id":"693dcd28-e7e.....

Here is what my code looks like, I copy/pasted from the readme and just swapped the public key with a variable:

                val endPoint = RPCEndpoint.devnetSolana
                val network = HttpNetworkingRouter(endPoint)
                val solana = Solana(network)
                val fetchedBalance = solana.api.getBalance(publicKey).getOrElse {
                    balanceFetchedSuccessfully = false
                    0L
                }
                balance = fetchedBalance / 1000000000.0

                // This part fails, copy/pasted from the readme.
                val serializer = AccountInfoSerializer(BorshAsBase64JsonArraySerializer((AccountInfoData.serializer())))
                val account = solana.api.getAccountInfo(serializer, publicKey).getOrThrow()

                if (account != null) {
                    isExecutable = account.executable
                }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant