13 votes
Accepted

Is there a way to unset home domain and inflation destination options?

No, you can't. If we look at the XDR definition of setOptionsOp, we can see all the fields are optional, if a field is not None then the corresponding value will be set. So what can you do? Home ...
Francesco's user avatar
  • 1,386
12 votes
Accepted

How to close a stream event?

Call the returned object itself. In your case: channel();
mprom's user avatar
  • 301
10 votes
Accepted

Why is the memo hash different from the one I specify during tx building?

While I'm not sure why this happens, this is not a different hash, its just encoded in base64 >>> import base64 >>> base64.b64decode('jDOeFb2J5/jH1sdUuAFqICu6EqjNtKq+...
Ron Serruya's user avatar
9 votes
Accepted

How do I keep track of payments to an address with JS SDK?

The streaming API is good for that job, you could get the last token from the network just when the user sends the payment and open the stream channel using that token so it looks only for ...
Kuyawa's user avatar
  • 1,328
6 votes

How to get friendbot to fund my new account using a HTTP request?

In browser you can use Fetch API for this purpose: fetch('https://horizon-testnet.stellar.org/friendbot?addr=<account-address>') .then(res=>res.json()) .then(res=>console.log(res))
Orbit Lens's user avatar
  • 6,886
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 ...
Synesso's user avatar
  • 3,367
5 votes

How do I keep track of payments to an address with JS SDK?

Here's the process in action: https://github.com/shredding/stellar-bot/blob/master/src/stellar/index.js
shredding's user avatar
  • 316
5 votes
Accepted

How to control fees in stellar?

if you are using JS-Stellar-SDK, you may refer to this format: (for example, fee=478) var StellarSdk = require('stellar-sdk'); var server = new StellarSdk.Server('https://horizon-testnet.stellar.org')...
cesarm's user avatar
  • 1,527
5 votes
Accepted

How can I convert the built 'transaction' in XDR format?

Given transaction is a Transaction object then this will give you base64 encoded XDR: transaction.toEnvelope().toXDR().toString("base64")
Bartek Nowotarski's user avatar
5 votes

How to close a stream event?

As described in the docs, TransactionCallBuilder.stream returns a function you can call to close a stream: Returns: Type: function Close function. Run to close the connection and stop ...
Bartek Nowotarski's user avatar
5 votes
Accepted

Send Lumens and receive custom tokens in a single transaction?

const transaction = new Stellar.TransactionBuilder(loan) .addOperation(Stellar.Operation.payment({ destination: borrowerPublicKey, asset: Stellar.Asset.native(), amount })) ...
Orbit Lens's user avatar
  • 6,886
4 votes

Where to enter javascript SDK commands (to generate seed for example)

To use this commands you have to import the SDK in your javascript or java application and define the horizon-server you wanna use for javascript (nodejs) its like: var StellarSdk = require('...
nick0816's user avatar
  • 188
4 votes

Getting the 'offerId' on a new Offer and any documentation on 'xdr.ManageOfferOp'?

I had the same problem with offer id after the ManageOffer operation, and I came to the same solution. If you don't have a lot of orders and don't mind to make an extra request, you can also pull ...
Orbit Lens's user avatar
  • 6,886
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 ...
Orbit Lens's user avatar
  • 6,886
4 votes

Error: XDR Write Error: not an integer while issuing the asset in stellar network

fetchBaseFee is a promise, you have to await it. const fee = await server.fetchBaseFee();
sui's user avatar
  • 2,534
3 votes
Accepted

How to serialize, send over network, deserialize a transaction envelope for multiple signatures?

The first serialization can be done via: const base64str = transaction.toEnvelope().toXDR().toString('base64') Then you have a base64 encoded string that can be safely transmitted over the network. ...
phra's user avatar
  • 161
3 votes

Error in submitting the multisig transaction

The field result_xdr decodes to txBadSeq indicating that you've got a bad sequence number on that transaction.
Synesso's user avatar
  • 3,367
3 votes
Accepted

using stellar-sdk in angular

As others have mentioned, it sounds like a conflict rather than an import issue. That said, I'm fairly certain I've seen that error before, a long time ago, and I have not used node-crc. For Angular ...
Richard Dunn's user avatar
3 votes
Accepted

How do I locally manage sequence no of an account?

createAccount is an operation that you can include in a transaction. It works like a payment from your account to the account specified in the operation. But it has a side-effect of creating the ...
Synesso's user avatar
  • 3,367
3 votes
Accepted

Error when including 2 deps that both have stellar-base as a subdependency

I know that you got the answer on github, but for anyone else looking I'll link it here: https://github.com/stellar/js-stellar-sdk/issues/191 This is fixed in: [email protected] [email protected] ...
umbrel's user avatar
  • 938
3 votes

How do I get the public keys from a transaction javascript

I'd let the SDK decode the XDR for you, and take it from there. const tx = new StellarSdk.Transaction(tx_xdr); From here on you have the source accounts in tx.source and tx.operations[i].source, for ...
Johan Stén's user avatar
  • 1,947
3 votes

Key pairs don't match?

Each time your call the Wallet function it generates a new keypair. You should save the invocation result into a variable: var keypair = Wallet() console.log(keypair1.secret, keypair2.public) var ...
Orbit Lens's user avatar
  • 6,886
3 votes
Accepted

Stellar address prefix bitwise operator rationale

The strkey format is a base32 encoding given by RFC4648. The first output character of the encoding is determined by the top five bits of the first byte. So the value 6 is the value corresponding to ...
user3188445's user avatar
  • 1,221
3 votes
Accepted

Creating an account, adding a trust line and transferring the asset in a single transaction

1. Prepare keypairs for all participating accounts - source account and destination account. let source = StellarSdk.Keypair.fromSecret(sourceAccountSecretKey) let dest = StellarSdk.Keypair....
Orbit Lens's user avatar
  • 6,886
3 votes
Accepted

How can i decode and get relevant data from envelope_xdr

const transaction = new StellarSdk.Transaction(txenv); This will decode an transaction envelope XDR object to a Transaction object (https://github.com/stellar/js-stellar-base/blob/master/src/...
Johan Stén's user avatar
  • 1,947
3 votes

Example code on Ubuntu+node.js gives error re "await"

The error itself contains all the information you need for the troubleshooting. Probably you wrapped this code in some function (i.e. function testPayment() {...}). To make it work, add async ...
Orbit Lens's user avatar
  • 6,886
3 votes

How to post multiple transactions to the network without giving back the same `transaction_hash`?

For a transaction to be successful, it has to have a sequence number one greater than the current sequence number of the account funding the transaction. Therefore, if you want to submit 10 ...
ire_and_curses's user avatar
3 votes

Getting all offers for a particular Asset (pair)

Horizon provides an orderbook endpoint that takes buying and selling assets as arguments. You can use this to get all offers for any asset pair. Is there something I'm misunderstanding about your ...
ire_and_curses's user avatar
2 votes

How to close a stream event?

I am just trying to make it more clear for the future visitors, TransactionCallBuilder.stream returns the function to close the connection. // Opens the stream channel var streamChannel = server....
niksmac's user avatar
  • 243
2 votes

Error: no PRNG in Safari web workers

I think the issue is with the limitations of web workers in Safari. I already commented your issue in GitHub.
Bartek Nowotarski's user avatar

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