The Stack Overflow podcast is back! Listen to an interview with our new CEO.
6

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


5

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 JavaScript SDK provides instructions to deserialise the Base 64 XDR into JSON. If you can use the Scala SDK you can call SignedTransaction.decodeXDR(base64)(...


5

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. Because there aren't very many step-by-step examples out there, I'll try to "solve" this for you. Starting with the Asset. Assuming you correctly issued an asset,...


5

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 to be the number n encoded as an unsigned integer (as described above), and followed by the n bytes of the string. Byte m of the string always ...


4

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 you want to delete an existing offer. So, you could loop through your open orders and update the amount to 0 (cancelling them). The code below assumes that ...


4

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 still exists? Yes, that's the only way so far. Effects Offer Created, Offer Updated, Offer Removed are described in API docs, but not yielded by the Horizon. ...


4

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) { Server server = new Server("https://horizon.stellar.org"); try { KeyPair account = KeyPair.fromAccountId("...


4

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 install anything on your smartphone/laptop), easier to support (single implementation for all modern browsers), and you can safely forget about versions hell (users ...


4

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 suspect the transaction was successful. To be certain, you should check the ResultXDR from the result. response = server.submitTransaction(transaction); ...


3

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#addTimeBounds-org.stellar.sdk.TimeBounds- Here's an example for transaction 3: SetOptionsOperation setOptionsOperation = new SetOptionsOperation.Builder() ....


3

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 *TransactionBuilder) Sign(signers ...string) (TransactionEnvelopeBuilder, error) { var result TransactionEnvelopeBuilder err := result.Mutate(b) if err != nil { ...


3

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 can check it here). Consider switching to Java 8, they made TLSv1.2 the default SSL protocol starting with Java 8, it was TLSv1.0 in Java 7. Or you can use -...


3

Against version 0.2.0 with Java 8 I have run: public static void main(String[] args) throws Exception { String clientPk = "GBKVT7EO462QUCQVBNBWI47J6NQ6UKQUXLJOAWC7ZSIZKATMIDTK32X6"; Server server = new Server("https://horizon-testnet.stellar.org"); KeyPair destination = KeyPair.fromAccountId(clientPk); while (true) { try { ...


3

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 better because transaction response contains XDR from which all related operations can be deserialized, while the second variant requires additional horizon ...


3

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 in one transaction. I included a script that does exactly this, first it retrieves the first page of offers you have open and creates a transaction to cancel ...


3

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 immediate counterpart on the orderbook it will behave like a market order (take liquidity). If you make an offer that doesn't have an immediate counterpart in ...


3

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


2

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 above doesn't work with Java SDK. The alternative approach requires two calls instead of one, but it was battle-tested and guaranteed to work. Prepare request ...


2

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 custom asset in the Stellar network is described by code and issuer public key. Actually, there is also an asset type (AlphaNum4 or AlphaNum12), but the ...


2

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 returns AssetTypeCreditAlphaNum4 casted to an abstract parent class, something like AssetTypeCreditAlphaNum. In general, asset descriptor should be identical and ...


2

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 that library as a dependency. so when i rebuild the application, android studio sees these libraries as double dependencies hence it throws the multi dex error. ...


2

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 a transaction itself does not transfer any funds. Think of it as a batch (unit of work) that contains one or more operations. Read more about transaction and ...


2

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


2

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. In order to find a bottleneck, you can analyze query performance with built-in PostgreSQL tools.


2

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

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-L29 The values for code and issuer will be the same as the values you provided as parameters. I suspect the reason you cannot access these values on the ...


2

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


1

I found the answer. such a simple thing: Transaction.fromEnvelopeXdr(...)


1

I am able to run a modified version of your code successfully on testnet: Network.useTestNetwork(); Server server = new Server("https://horizon-testnet.stellar.org/"); KeyPair source = KeyPair.fromSecretSeed("SBKL5C3CZ5OURFFSAVTVFFGDPLXPOBIAM2IHETXMERNUG3U5VHH34HWA"); KeyPair destination = KeyPair.fromAccountId("...


1

If you have the Transaction XDR encoded as a base64 string, you can use Transaction.fromEnvelopeXdr(string) to get a Transaction object back.


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