Skip to main content
5 votes

Notify every new ledger

Just use Client.StreamLedgers method: client := DefaultPublicNetClient cursor := Cursor("now") // Call `cancel()` to stop streaming ctx, cancel := context.WithCancel(context.Background()) err := ...
Bartek Nowotarski's user avatar
3 votes

Muliti Signature with hash(x) in goLang SDK

It looks like the SignatureHint for hash(x) in your transaction is invalid. Signature hint for hash(x) is the 4 last bytes of the hash, not the preimage. Fix required around: Hint: xdr.SignatureHint(...
Bartek Nowotarski's user avatar
3 votes

What is the correct way to unmarshal an encoded transaction for signing

There is no support yet for building a txnbuild.Transaction object from a xdr.TransactionEnvelope in the Go SDK. However, you can still sign the transaction by using this work around: https://play....
poliha's user avatar
  • 116
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 *...
Johan Stén's user avatar
  • 1,947
3 votes
Accepted

How can I build a transaction with a dynamic list of mutators or operations using the Go SDK?

You could use the spread operator on an object of type []build.TransactionMutator that is passed into the build.Transaction method (on github.com/stellar/go/build). Here's a code sample: import ( ...
nikhils's user avatar
  • 1,080
2 votes

How to sign transaction offline with go sdk?

This is how i convert the XDR before the initial signature. trustTx, err := build.Transaction( build.SourceAccount{recipient.Address()}, build.AutoSequence{SequenceProvider: horizon....
Sharmilan's user avatar
  • 421
2 votes
Accepted

Setting Data with the Go SDK

I now understand that you have to build the transaction yourself using build. Example if anyone else gets stuck: import ( build "github.com/stellar/go/build" "github.com/stellar/go/clients/...
mecavity's user avatar
2 votes
Accepted

How to access the "All Operations" Horizon endpoint using the Go SDK?

The horizon internal package is not the right ones to use. It implements the server side. Like the js-stellar-sdk you will need to do an api call to horizon: curl "https://horizon-testnet.stellar.org/...
alpe1's user avatar
  • 1,300
2 votes
Accepted

Geting signer of a signature

I'm not user of go, but I think the logic is the same for every language. Here's how I do: I get the transaction sources accounts and compute the list of legit signers for this transaction, then I ...
Mister Ticot's user avatar
2 votes
Accepted

What is the correct way to unmarshal an encoded transaction for signing

Support for this has now been added to the SDK in txnbuild 1.4. Here's an example that produces the same output as the previous lower-level workaround: https://play.golang.org/p/5uXzCEK_bgc package ...
ire_and_curses's user avatar
1 vote

golang sdk; how can I check horizon.Error.Problem

"george" from the "Stellar Developers" discord #horizon chat answered me: you can use the horizonclient.GetError(err) helper to retrieve the Problem structure and inspect it. For ...
iateadonut's user avatar
1 vote
Accepted

How to decode stellar XDR

var txe xdr.Transaction err = xdr.SafeUnmarshalBase64(TDP.XDR, &txe) if err != nil { fmt.Println(err) } You can use above code to Unmarshal Base64 XDR. And using &txe you can retrieve ...
Sharmilan's user avatar
  • 421
1 vote

Problem installing bitbucket.org/ww/goautoneg for Stellar go using dep ensure -v

This has been resolved, I'm unsure whether this was just a timing issue (where I needed to be more patient) or if I needed to install mercurial. Steps I used for resolution brew install mercurial ...
John Whitton's user avatar
1 vote

How to Build transaction XDR before sign it

I have some examples for that in my kotlin library that wraps the java sdk. data class PreparedTransaction(val transactionHash: String, val transactionEnvelopeXdr: String) fun ...
Jilles van Gurp's user avatar
1 vote
Accepted

Dynamic amount of operation

I found the answer. Hopefully it will help someone in the future. muts := []build.TransactionMutator{ build.SourceAccount{recipient.Address()}, build.TestNetwork, build.AutoSequence{...
Sharmilan's user avatar
  • 421
1 vote
Accepted

How could I create an AutoSequence in a private testnet with the golang SDK?

I figured that I needed to implement my own SequenceProvider looking at https://github.com/stellar/go/blob/master/clients/horizon/main.go#L20 and https://github.com/stellar/go/blob/master/clients/...
ZeroGraviti's user avatar
1 vote

tx_bad_seq error when creating account with the root account of Stellar private network

The only thing that comes to my mind is that your node actually synced with the publicly available test network and applied the history. That's why the master account's (...
Bartek Nowotarski's user avatar

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