3

I'm playing with the Stellar java SDK and I'm trying to send to send some Lumens from a fully funded account to an other account on the testnet.

Once the transaction is complete I get back a response with all the field being null expect the "extra" field which has all its field to null except the "envelopeXdr" which is equal to

AAAAAPQl3 LgGzmS98AbidI2Pf5iG6/Y5JjjA8qGFcCFlAnlAAAAZABnH7IAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAACzKntDKAeTf87abUrrUsJAEPQPEfc7EEcKXsrnaAG2RAAAAAAAAAAAGjneAAAAAAAAAAAGFlAnlAAAAQDYKf5r5BqDRGHm 9K0zTfPQ0nSKMZxwKblhnW/GHV1gbXcm4NOfmBNBowjW9xHtY2p9 4MBPLRJUjYVeR2t3Qw=

How can I know what went wrong ?

EDIT:

Code:

        Network.useTestNetwork();
        Server server = new Server("https://horizon-testnet.stellar.org");
        KeyPair source = KeyPar.fromSecredSeed("...")
        KeyPair destination = KeyPair.fromAccountId("...");
        AccountResponse sourceAccount = server.accounts().account(source);
        Transaction transaction = new Transaction.Builder(sourceAccount)
            .addOperation(new PaymentOperation.Builder(destination, new AssetTypeNative(), "1000").build())
            .addMemo("")
            .build();
        transaction.sign(source);
        SubmitTransactionResponse response = server.submitTransaction(transaction);

I have taken the transcationXdr and input it in the Stellar laboratory to make a transaction and it worked....

This leads to the Java sdk having an issue when making the request, maybe some issue in the way it sets the "tx" in the post params

EDIT2 Yes it was, I had modified the source and messed around the encoding

  • Is your envelopXdr valid? Seems there are some new line – Nekrataal Jan 20 '18 at 14:53
  • What API endpoint / SDK method are you using to submit the transaction? – David M. Jan 20 '18 at 14:57
  • If the xdr works with laboratory, it means that problem is related to java sdk. Better for you to open a detailed issue on github github.com/stellar/java-stellar-sdk/issues – Nekrataal Jan 20 '18 at 16:00
6

Need to remove newline from your posted xdr

Using xdr viewer on stellar laboratory, your transaction result success

Ps: select PaymentResult as XDR type

Check here

  • 1
    +1 for link to XDR viewer page, very handy for debugging requests/responses in the Stellar API – David M. Jan 20 '18 at 14:58
  • That is odd though.. because the account still has a balance of 10'000 and the response.isSuccess is false – Johny19 Jan 20 '18 at 15:15

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.