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
com.algorand.algosdk.v2.client.model.Account accountInfo = null;
try {
accountInfo = algodClient.AccountInformation(
new Address("LL2ZGXSHW7FJGOOVSV76RRZ6IGU5ZF4DPCHQ23G7ZLIWCB4WEMIATDBTLY"))
.execute().body();
System.out.println("Account Balance: "+ accountInfo.amount+" microAlgos");
} catch (Exception e) {
System.out.println(e.getMessage());
e.printStackTrace();
}
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.
Please any help is appreciated @rfustino @ryanRfox @JasonW
Thanks