0

I written one java code which for ClaimClaimableBalanceOperation but after submitting the transaction it returns nothing, only null even not error code. I have created the accounts and Claim on Stellar Test Network. Here is the complete code.

   Network network = new Network("Test SDF Network ; September 2015");
    Server server = new Server("https://horizon-testnet.stellar.org");
    AccountResponse sourceAccount;
    try
    {
        String balanceid="0000000027f60160736d03f0f65e18149d5da64adacf40f2dd4ab06b18e8d7b04804fc3e";
        sourceAccount = server.accounts().account("GB4TWRVEYWTOJEL42JR3YBAOGDPK2JKWFL7Q6SYAYPPANVVOOFH7V6TL");
        ClaimClaimableBalanceOperation balanceOperation=new ClaimClaimableBalanceOperation.Builder(balanceid).build();
        Transaction transaction=new Transaction.Builder(sourceAccount, network).addOperation(balanceOperation).setBaseFee(200).setTimeout(Transaction.MIN_BASE_FEE).build();
        transaction.sign(KeyPair.fromSecretSeed("SAKG5IY6HVQZPGJA44L6YW6UBR5SBFQSLRQTSC23XWJNFNF4Y3EGIXXW"));
        SubmitTransactionResponse response = server.submitTransaction(transaction);
          if(response.isSuccess()){
           System.out.println("Success!");
           
          }
          else
          {
              System.out.println(response.getExtras().getResultCodes().getOperationsResultCodes());
               System.out.println(response.getExtras().getResultCodes().getTransactionResultCode());
               
               
              
          }
          
    }
    catch(Exception e)
    {
        e.printStackTrace();
    }

After running this code I am getting NullPointer for below line,so transaction not being submitted to the network.

"System.out.println(response.getExtras().getResultCodes().getOperationsResultCodes());"

My Sponsered Account:- Public Key GAI4XKUCFFBYQEBDYTWIIL57MIEB6EPL53UBOYFDGVHTPGU7UPLLAJDP

My Claimant Account:- Public Key GB4TWRVEYWTOJEL42JR3YBAOGDPK2JKWFL7Q6SYAYPPANVVOOFH7V6TL

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.