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 ...
12
votes
Accepted
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+...
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 ...
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))
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 ...
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
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')...
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")
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 ...
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
}))
...
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('...
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 ...
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 ...
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();
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.
...
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.
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 ...
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 ...
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]
...
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 ...
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 ...
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 ...
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....
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/...
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 ...
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 ...
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 ...
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....
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.
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
javascript-sdk × 86transactions × 19
horizon × 16
stellar-sdk × 16
accounts × 10
stellar-core × 8
operations × 8
xdr × 7
assets × 5
java-sdk × 3
payments × 3
stellar-laboratory × 3
trustline × 3
wallets × 2
testnet × 2
nodes × 2
multi-sig × 2
memo × 2
manageofferoperation × 2
offer × 2
new-developer × 2
sequence-number × 2
stream × 2
channel × 2
xlm × 1