Questions tagged [javascript-sdk]
For questions specifically regarding the JavaScript Software Development Kit (SDK) for Stellar client applications.
86 questions
1
vote
0
answers
28
views
How to read data of contract storage from offchain?
I have read all the document https://developers.stellar.org/docs/learn/
but not found how to read storage data from client, such as JS client.
Can anyone show me some docs or example on read contract ...
2
votes
1
answer
100
views
Get Public key variable from Freighter Wallet
if (window.freighterApi.isConnected()) {
alert("User has Freighter!");
}
const retrievePublicKey = async () => {
let publicKey = "";
let error = "";
try {
...
0
votes
2
answers
61
views
Continuous Status 504
I have been developing a Multi-sig based project and keeps on getting the 504 status so many times when making transaction. I have checked out the testnet staus of Horizon network as well and it seems ...
1
vote
0
answers
35
views
How to update Account Sequence
I have to handle a concurrent activation of 2 accounts.
I am using a lock mechanism so that I can handle manually the sequence number.
I am using bumpSequence operation to try and update the sequence ...
1
vote
1
answer
71
views
How to pull memo from a public key's historical transactions and save to an array?
Using Stellar's Javascript SDK
Goal
Output an array containing all the memos:
['324567567', 'anotherMemo', '239210923', '2349028509']
This array will be used to check against a database and ...
1
vote
0
answers
36
views
interact with the private stellar network
I have started my own private stellar network using the below command.
docker run --rm -it -p "8000:8000" --name stellar stellar/quickstart --standalone
How do I interact with it? How can I create ...
0
votes
1
answer
83
views
TypeError: sourceAsset.isNative is not a function when calling strictSendPaths
I am trying to call a payment strict send path:
var server = new StellarSdk.Server("https://horizon.stellar.org", {
allowHttp: false,
appName: "Horizon",
appVersion: "0.23"
});
var ...
4
votes
1
answer
386
views
Stellar channel implementation is giving an error "this.source.sequenceNumber is not a function"
i am trying to implement stellar channel concept. i am following stellar channel link. I have created 6 channel accounts. Below is the programme i wrote
var destinationId = '...
-1
votes
1
answer
34
views
Friendbot bad request (400) invalid_field: "addr"
I am trying to create an account on the stellar Test Network. But whenever I make a request and pass in the public key, I always get this error:
I am using the Javascript documentation from here
1
vote
1
answer
151
views
How to generate public key using SDK in salesforce?
I want to integrate stellar with a Salesforce application. and I am stuck at generating a public key and secret key. I am a little confused regarding SDKs, how can I use an SDK in the apex? Can I ...
1
vote
2
answers
71
views
error when trying to use stellar-hd-wallet (Node.js)
Hi we are tying to use the node.js version of the stellar-hd-wallet in ionic-angular. However, calling the StellarHDWallet.generateMnemonic() gives the following error:
ERROR in ./node_modules/...
2
votes
1
answer
265
views
Error: XDR Write Error: not an integer while issuing the asset in stellar network
I am trying to issue an asset in stellar using the following code
var StellarSdk = require('stellar-sdk');
StellarSdk.Network.useTestNetwork();
var server = new StellarSdk.Server('https://horizon-...
-4
votes
4
answers
134
views
Example code on Ubuntu+node.js gives error re "await"
Updated: added full code below.
I'm trying to run the "Creating a payment transaction" example but the error I get is
const account = await server.loadAccount(sourcePublicKey);
^^^^^...
0
votes
1
answer
57
views
How to catch specific error code on JS SDK connecting to horizon
I use Javascript SDK to connect to Horizon. It works, but I also would like the specific error if it doesn't work. See my code below.
How can I access the specific code returned from horizon (e.g. ...
0
votes
1
answer
36
views
How do I just get specific fields when displaying transactions for a given account?
I'm using the Javascript SDK. My objective is to get the last 10 transactions for a given account (which is working), but just show specific fields (such as the amount of lumens, and perhaps the memo),...
1
vote
1
answer
102
views
Error "missing path" while running 'gulp test' in js-stellar-base
I cloned the js-stellar-base and then ran 'gulp test' and it returned the following error:
Using gulpfile /mnt/c/Users/Debchakra/Desktop/js-stellar-base/gulpfile.js
[00:01:03] Starting 'test'...
[00:...
2
votes
1
answer
584
views
How can i decode and get relevant data from envelope_xdr
I know that Stellar.xdr.TransactionEnvelope.fromXDR can decode data of a record called envelope_xdr. But what I do not understand is how I can get all data I need like memo, sourceAccount etc. Because ...
3
votes
1
answer
108
views
How to carry out compliance for transactions between customers using single compliance server?
I have set up an Anchor account and created a custom asset to have customers trade with. I want to set up some compliance for transactions sent from one customer to the other. All customers will be ...
2
votes
0
answers
49
views
How to filter only the most recent n number of operations of an account for only a specific Asset?
I had a function that returned the most recent 3 payment operations for an account. But I wante to change it so that it would only return the most recent 3 payment operations for only the asset being ...
2
votes
1
answer
538
views
Create an account on a private stellar network
I wish to create an account on a private stellar network.
The network was created using this docker image https://github.com/stellar/docker-stellar-core-horizon, with the --standalone flag.
When I ...
3
votes
1
answer
365
views
How to create and fund a stellar account on live network?
I have used the JS SDK to create a set of keys, and then send some money to it using friendbot cfr the docs to create an account (https://www.stellar.org/developers/guides/get-started/create-account....
5
votes
1
answer
191
views
Is there a way to watch for balance?
How can I programmatically watch for change in balance for a account or just new incoming transactions?
looking for js-stellar-sdk method
0
votes
1
answer
48
views
Key pairs don't match?
Im building a bot that connects Stellar with Telegram but when I generate a new set of key pairs them don't match when I sign in stellarterm.
Here is the code:
var StellarSdk = require('stellar-sdk'...
4
votes
1
answer
285
views
Is it possible to make a request to an account other than "Friendbot" to receive Lumens?
From the documentation you can make a request using Javascript to the "Friendbot" to receive test Lumens for an account:
// The SDK does not have tools for creating test accounts, so you'll have to
//...
3
votes
2
answers
217
views
How do I get the public keys from a transaction javascript
I am developing a site as college project and I cannot seem to understand how to implement StrKey to get the public key from a transaction.
I can decode the xdr but cannot seem to understand how to ...