stellar / js-soroban-client

Main Soroban client library for the Javascript language
https://stellar.github.io/js-soroban-client/
Apache License 2.0
22 stars 17 forks source link

server.getAccount returns error: Cannot unmarshal key value #105

Closed Spxc closed 1 year ago

Spxc commented 1 year ago

Describe the bug Trying to fetch account ledger returns error.

What version are you on? 0.8.1

To Reproduce Steps to reproduce the behavior:

  1. Start a node/expo/RN project
  2. Install Soroban Client
  3. Add shim
  4. Import shim.js

Example

const SorobanClient = require('soroban-client');
const server = new SorobanClient.Server('https://rpc-futurenet.stellar.org', { allowHttp: true })

// This works 
const keypair = SorobanClient.Keypair.fromSecret("SB42OYSI5NRMACBT6U3A6E2ZAIHXGK7433RVFIJXDY6CLJJAA6E56PYT");

//This fails
const account = await server.getAccount("GCDU6USHPKLZGIBYNLCZM7KRUVWLCUUHTTAS7YJWJ5MXFVWZNKTNH3WX");

Expected behavior Calling the Soroban RPC (connecting) seems to work, but any interaction with the RPC (using ex getAccount) returns an error like this:

{"code":-32602,"message":"cannot unmarshal key value 0,0,0,0,0,0,0,0,135,79,82,71,122,151,147,32,56,106,197,150,125,81,165,108,177,82,135,156,193,47,225,54,79,89,114,214,217,106,166,211 at index 0"}

Additional context Tried using RN/Expo & NodeJS using the official public SDF RPC

Shaptic commented 1 year ago

I believe that this was fixed in the later versions of Soroban RPC.