6 votes
Accepted

minTime must be >= maxTime ? Java SDK

Thanks for catching this. It's a bug in Java SDK, please upgrade to 0.3.1 and it should be fixed.
6 votes
Accepted

Convert XDR to text

XDR is a binary encoding of structured data. It is represented as a base 64 encoded String in transaction responses. Some options: You can decode base 64 encoded XDR using the laboratory. The ...
  • 3,367
5 votes
Accepted

How to use the ManageOfferOperation with Assets in the Java SDK?

It sounds to me like you are unfamiliar with the available methods in the SDK. In addition to what Orbit Lens said, you'll need to create a transaction, sign it, and then submit it to the network. ...
  • 296
5 votes
Accepted

Extra 0 byte at end of MemoText String

I believe that is the extra padding bytes set so that the length is a multiple of 4. From the RFC 4506 (a.k.a. the XDR Spec): The standard defines a string of n (numbered 0 through n-1) ASCII bytes ...
  • 1,386
4 votes
Accepted

How do you cancel all open trades for a Stellar account?

There isn't method for bulk cancelling. Stellar cancels offers by setting the Amount parameter to 0. From the site Manage Offer: Parameters [...] Amount: Amount of selling being sold. Set to 0 if ...
  • 296
4 votes
Accepted

Monitoring if offers are filled

The OffersRequestBuilder seems like it only displays active offers. So once an order is "filled" it simply disappears. Do I need to store the offer ID and loop through active offers to check if it ...
  • 6,876
4 votes
Accepted

How to parse current offers with the Java SDK

package org.stellar.sdk; import org.stellar.sdk.responses.OfferResponse; import org.stellar.sdk.responses.Page; public class GetOffersForAccount { public static void main(String[] args) { ...
4 votes
Accepted

Python vs Java(script) for stellar apps. Is it worth learning a new language?

Stellar JavaScript SDK features one undeniable advantage – it gives an ability to create a Stellar app that will work directly in a browser. Browser-based apps are easier to promote (no need to ...
  • 6,876
4 votes
Accepted

TimeBounds won't execute?

If you'd like a transaction executed at a precise time, you need to submit it at that time. The unix timestamp 1534239756 is in the past at the time you wrote this question (by about 10 minutes?). I ...
  • 3,367
3 votes

How to setup time bounds for an escrow account?

Time bounds are part of the transaction itself, and are added in the Java SDK using the addTimeBounds method. https://stellar.github.io/java-stellar-sdk/org/stellar/sdk/Transaction.Builder.html#...
  • 1,174
3 votes

Issue with Submit Transaction

It looks like your problem is related to the SSL protocol versions mismatch. Stellar official Testnet Horizon instance has only TLSv1.2 enabled, while TLSv1.1, TLSv1.0, SSLv3, SSLv2 are disabled (you ...
  • 6,876
3 votes

java sdk leaking threads; my fault or bug?

Against version 0.2.0 with Java 8 I have run: public static void main(String[] args) throws Exception { String clientPk = "GBKVT7EO462QUCQVBNBWI47J6NQ6UKQUXLJOAWC7ZSIZKATMIDTK32X6"; Server ...
  • 3,367
3 votes
Accepted

Using Java api, how to find out the memo attached to a payment operation?

Memo can only be attached to a transaction, not operation. So you should rather listen to transactions stream or load a corresponding transaction by hash once a payment received. The first option is ...
  • 6,876
3 votes

How do you cancel all open trades for a Stellar account?

Since there is no method for canceling all your offers in one go, you need to submit many manageOfferOp together, one for each offer. The good news is that you can submit up to 100 of this operations ...
  • 1,386
3 votes
Accepted

How to Build transaction XDR before sign it

I'm just going to guess here, since I don't do golang, but if you look at what Sign does, can't you just copy that implementation yourself, and skip the signing part? I.e., func (b *...
  • 1,947
3 votes

ManageOfferOperation - Not taking the price I set

The price you set with manageOffer is the maximum price when buying and the minimum price when selling. So it will match the best available price in the orderbook. If you make an offer that has an ...
3 votes
Accepted

Stellar Java Sdk key validation?

You can use StrKey.decodeStellarAccountId() wrapped with a try-catch block. If the expression throws an exception, the account id is invalid.
  • 6,876
3 votes
Accepted

Receiving BaseEncodingException when signing transaction using TestNet : Invalid Input Length

You need to pass the account id encoding of the public key to the PaymentOperation builder. In other words, instead of passing destination.getPublicKey().toString() to the builder you should be ...
3 votes

How to get result of successfully submitted transaction?

Answering my own question in case it is useful to someone else in future. You seem to need to use the classes from package org.stellar.sdk.xdr even though that package is undocumented in the Java SDK. ...
2 votes

How to listen to a third party account for stellar transactions from now?

Not 100% sure about Java SDK, but JavaScript SDK allows to specify "now" as a cursor to be notified of payments happening starting from when this script runs. Edit: Looks like the method mentioned ...
  • 6,876
2 votes

How to use the ManageOfferOperation with Assets in the Java SDK?

Have you checked the Java SDK docs? But createNonNativeAsset requires an KeyPair object. So, I'll need to find the issuing public ID of whatever asset I want to trade, and make a KeyPair? Yes, any ...
  • 6,876
2 votes

best way to store and retrieve an Asset

What SDK are you using? Java, C#? First of all, you are creating them differently. In the first case with a static method, in the second – with class constructor. I bet that the static method ...
  • 6,876
2 votes

Multiple dex files define Lokio/AsyncTimeout$Watchdog;

After days of searching i found the solution. Let me explain , the stellar-sdk.jar uses this library as a dependency com.squareup.okio and com.google.firebase:firebase-firestore:11.8.0 also use ...
  • 31
2 votes
Accepted

How to get Transaction amount from API?

In this particular case you should use server.payments().forAccount(destination2) (if you want to track only payments) or server.operations().forAccount(destination2) (for all operation types) because ...
  • 6,876
2 votes

TimeBounds won't execute?

Timebounds only tell the system when a transaction should be valid, it does nothing to submit things at a certain time.
  • 1,947
2 votes

Retrieving operations for a transaction unexpectedly slow?

My best guess is that your PostgreSQL db works inefficiently with indexes on a large collection. Usually it means that your server has not enough RAM and is unable to keep indexes and cache in memory. ...
  • 6,876
2 votes

Retrieving operations for a transaction unexpectedly slow?

If you need all operations per ledger you can use the Operations for Ledger endpoint. It won't necessarily be more performant per request but should reduce the number of requests you make.
2 votes
Accepted

How to access AssetResponse properties of a newly created asset? C# or Java

Asset.CreateNonNativeAsset is a simple factory method to create an Asset instance of the right subtype. https://github.com/elucidsoft/dotnet-stellar-sdk/blob/master/stellar-dotnet-sdk/Asset.cs#L19-...
  • 3,367
2 votes

How to set managed data on an account

Check out the Java API documentation. Here's the relevant ManageDataOperation builder.
2 votes

Network.usePublicNetwork(); showing syntax error

I've tracked down the reason for this. The following is taken from the description for the 0.8.0 SDK release: "Configure network at the transaction and server level rather than using a singleton to ...

Only top scored, non community-wiki answers of a minimum length are eligible