I received XDR envelope of a transaction. I need to sign it and submit using Java SDK. I am able to decode the XDR, but need help on how to sign and submit.

  • What sort of help do you need? If you can give us an idea of where your problem lies, we may be better able to help. – Chenmunka May 3 at 14:51
  • i am trying to write a code that will receive xdr and able to sign and submit to stellar. i can able to decode the xdr and see the details through java sdk. But cannot able to sign and submit it. JS sdk has constructor for that where we can import xdr (var transaction = new Transaction(envelope);). Iam looking for similar kind of think in java – Sharmilan May 4 at 4:39

You can find an example in the official Stellar guide.

Make sure that to choose "Java" in code preview.

Java switch

See also basic examples for account creation here.

  • The question is how to sign a XDR envelop and submit. not submitting the transaction – Sharmilan May 4 at 4:35
  • In JS StellarSDK the Transaction object has a public constructor that accepts transaction envelope XDR. So you can easily reconstruct a Transaction. But Java SDK lacks this functionality, so I even don't know where to start here. – Orbit Lens May 4 at 8:22
  • Yeah can do this in js. Do you know any ways to do it in go. As i saw we can create a blob using a xdr and submit to the server. But i don't know how to sign that xdr before submit – Sharmilan May 4 at 10:07

Have a look at my kotlin wrapper. It uses the official sdk and I have lots of tests that do things like creating assets, trustlines, doing payments, and placing offers.

Intended for kotlin users but should be usable from Java as well.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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