I use the code below to create a client using the purestake java API
String[] headers = {"X-API-Key"};
String[] values = {"B3SU4KcVKi94Jap2VXkK83xx38bsv95K5UZm2lab"};
algodClient=new AlgodClient("https://testnet-algorand.api.purestake.io/ps2", 443,PURESTAKE_API_KEY);
try {
NodeStatusResponse status = algodClient.GetStatus().execute(headers, values).body();
System.out.println("algod last round: " + status.lastRound);
} catch (Exception e) {
System.err.print("Failed to get algod status: " + e.getMessage());
e.printStackTrace();
}
and it successfully prints out the last round, but when I want to use the same algodClient to get an account balance using the code below, the accountInfo object returned is null
But this all works fine when I create the algodClient from the Hackathon Instance.
I also noticed that entering a wrong or right purestake API Key did not seem to make any observable difference. I have also tried swapping “B3SU4KcVKi94Jap2VXkK83xx38bsv95K5UZm2lab” for my Purestake API key in values for X-API-KEY and did not notice any difference too.
The issue is that you need to pass the arguments headers, values each time you call .execute. You do it with GetStatus(), but you don’t do it when you use .AccountInformation.