Questions tagged [javascript-sdk]

For questions specifically regarding the JavaScript Software Development Kit (SDK) for Stellar client applications.

Filter by
Sorted by
Tagged with
0 votes
0 answers
57 views

How can I check the balance for each account using node.js and mongo.db

Can I use MongoDB's public key to check the account's balance? SignUp function module. exports.signUp= async(req,res)=>{ const {pseudo,email,password}= req.body try{ const pair ...
Sophia's user avatar
  • 1
1 vote
1 answer
29 views

How do I find out the date and time a specific offer was created?

The "Offer" object only contains a "last_modified_time" field, not when it actually was created, and no information about the transaction ID or ledger number.
kipadip0001's user avatar
2 votes
1 answer
58 views

Get Public key variable from Freighter Wallet

if (window.freighterApi.isConnected()) { alert("User has Freighter!"); } const retrievePublicKey = async () => { let publicKey = ""; let error = ""; try { ...
nocodestellar's user avatar
0 votes
1 answer
46 views

Get Original value from Memo.Hash

I used a Hash input in the Memo.Hash and submitted the transaction. How can i read the memo field back? input memo: ec8186367ee56880f7c48d4ae28ecd6cdafa455e8e49d35a691f41d95bcf95e6 trxn "memo&...
saurav2799's user avatar
0 votes
2 answers
53 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 ...
Mohinish Teja's user avatar
0 votes
1 answer
86 views

Cannot install via npm for node on Windows

I'm trying to download the stellar SDK for my angular project but the npm install fails.
Harrish Selvarajah's user avatar
1 vote
0 answers
30 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 ...
GioGio's user avatar
  • 173
1 vote
1 answer
117 views

Stellar horizon server - still 'waiting for ingestion'

I am using the IONOS server and I created the Stellar horizon server but I faced this issue: INFO[2020-12-17T21:18:54.302Z] waiting for ingestion system catchup pid=35554 service=ingest ...
Blockchain Pod Lead's user avatar
1 vote
1 answer
68 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 ...
newdev's user avatar
  • 13
3 votes
1 answer
139 views

How can I decode the address from XDR envelope

I am trying to write a page to show all the transaction history of an account, I use StellarSdk.xdr.TransactionEnvelope.fromXDR(page.records[0].envelope_xdr, 'base64') to get the transaction envelope, ...
iDler's user avatar
  • 33
1 vote
0 answers
34 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 ...
prajna's user avatar
  • 11
1 vote
1 answer
142 views

How to submit a signed transaction that has been XDR enveloped?

Hi I was working with Stellar on Javascript for offline signing and to keep the QR code after signing short I enveloped the transaction and converted it to XDR. Using, const signedTx = await ...
coder123's user avatar
  • 133
0 votes
1 answer
65 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 ...
J R's user avatar
  • 157
1 vote
1 answer
187 views

Various errors in submitting offers

This is my code: var sourceSecretKey = 'REDACTED'; var sourceKeypair = StellarSdk.Keypair.fromSecret(sourceSecretKey); var sourcePublicKey = sourceKeypair.publicKey(); var server = new StellarSdk....
J R's user avatar
  • 157
4 votes
1 answer
349 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 = '...
Suman Raj's user avatar
2 votes
2 answers
169 views

Getting all offers for a particular Asset (pair)

For a while now I'm trying to figure out how to get all offers for a particular Asset (or pair). As an example, StellarExpert lists all offers of MOBI on the following page: https://stellar.expert/...
CodeR70's user avatar
  • 123
-1 votes
1 answer
30 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
Nik's user avatar
  • 3
3 votes
1 answer
129 views

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

I'm trying to post multiple transactions of payment to the network. Let's say 10 at a time. I used javascript in this context. Problems: If I try to post all of 10 transactions at the same time ...
Him Hah's user avatar
  • 131
1 vote
1 answer
115 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 ...
Nik's user avatar
  • 11
0 votes
0 answers
176 views

Select failed: pq: relation "signers" does not exist

I have set up private Stellar Core and Horizon with 2 nodes. I am following this tutorial. I am first creating an account and then I am executing the code below. It is showing select failed: pq: ...
Suman Raj's user avatar
1 vote
2 answers
61 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/...
yulemata's user avatar
  • 312
0 votes
1 answer
244 views

Paying with Custom Tokens

UPDATE: I removed the quotes from BPTOKEN. That was a mistake. I had them removed in the real code but cut and pasted a change before this happened. It has been corrected and the error included. ...
lvto2000's user avatar
2 votes
1 answer
247 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-...
M Gopi's user avatar
  • 21
2 votes
1 answer
191 views

How to listening new XLM transaction for multiple accounts

I'm totally new in stellar network. I have experienced create transaction listener for bitcoin and ethereum by listen to every new transaction, if that transaction contain my address it send callback ...
Billy Adelphia's user avatar
-4 votes
4 answers
120 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); ^^^^^...
Peter's user avatar
  • 1
1 vote
1 answer
191 views

tx_bad_seq error when funding the account

I am trying to create a Stellar Standalone network using my own network passphrase. I m able to set up stellar-core and horizon in my private network and it is working fine, I m able to get the root ...
Vijin's user avatar
  • 143
0 votes
1 answer
52 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. ...
bluesky's user avatar
  • 61
0 votes
1 answer
726 views

Send payment issue

I am trying to send a payment on stellar testnet. I have already created both accounts using https://friendbot.stellar.org. So both account have a balance. When I am sending payment it is showing "...
Eithan pitt's user avatar
0 votes
1 answer
32 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),...
StellarFan's user avatar
0 votes
1 answer
190 views

How to extract transaction hash out of XDR using Java Script?

iam having an XDR i want to know the transaction hash before i submit that to stellar. i did this in GO by unmarshal the XDR and used the builder to retrieve the hash. Is there nay way that i can do ...
Sharmilan's user avatar
  • 421
1 vote
1 answer
100 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:...
Deb's user avatar
  • 233
5 votes
1 answer
90 views

Send Lumens and receive custom tokens in a single transaction?

How do I implement the issuance of a loan with a pledge? I want to send a loan from a multi-signature account and receive a pledge in the form of custom tokens in a single transaction. At the moment ...
Tim Golovchak's user avatar
2 votes
1 answer
491 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 ...
Tzion buchris's user avatar
0 votes
1 answer
102 views

Why do we receive an undefined Event error when streaming payments via the node.js sdk?

We run a continuous payments stream that receives fairly useless errors on the regular and would like to know what these may stem from and if they can be disregarded. I haven't been able to correlate ...
Coffee Please's user avatar
3 votes
1 answer
101 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 ...
esc758's user avatar
  • 31
2 votes
2 answers
200 views

Error while submitting change trust transaction

I created an anchor account which issues USD asset. It worked properly. But now when I modify the program where the anchor issues one more asset called INR and I am creating a trustline for both the ...
Siddharth Gupta's user avatar
2 votes
0 answers
44 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 ...
John Murphy's user avatar
3 votes
1 answer
815 views

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

I want to send non-native assets to new stellar accounts. To do this, I understand that I need to create a new account by funding it with XLM (1 XLM minimum), add a trust line to the asset issuer and ...
NBC's user avatar
  • 51
2 votes
1 answer
529 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 ...
Mahmoud Khraisha's user avatar
1 vote
2 answers
100 views

EventStream api only return new transactions

As mentioned in Following payments using EventStream I am able to receive the payment stream on the server side, now what if I want to return only new trisections from the time I start the stream? Is ...
niksmac's user avatar
  • 243
3 votes
1 answer
349 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....
ZaphodBBx's user avatar
2 votes
2 answers
131 views

How can I actually use the js-stellar-sdk?

I'm trying to figure it all my self but I cannot find any useful information on how actually use the Documentation provided. For example I see there are classes and inside Account, ...
Natoshi's user avatar
  • 31
5 votes
1 answer
175 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
niksmac's user avatar
  • 243
5 votes
1 answer
55 views

Stellar address prefix bitwise operator rationale

Stellar prefixes public keys with G. Why do they use a bitwise operation VersionByteAccountID VersionByte = 6 << 3 to get the base 10 value 48? Javascript "returns the default numerical values", ...
aroooo's user avatar
  • 267
0 votes
1 answer
46 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'...
Natoshi's user avatar
  • 31
4 votes
3 answers
635 views

How should the changeTrust Operation be used?

If I want to create a trustline between my issuing account and new users accounts, how do I do this. I tried with this code: const StellarSdk = require('stellar-sdk'); StellarSdk.Network....
John Murphy's user avatar
4 votes
1 answer
274 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 //...
John Murphy's user avatar
1 vote
0 answers
261 views

Error when trying to install stellar-sdk from npm, "LINK : fatal error LNK1181: cannot open input file 'C:\OpenSSL-Win64\lib\libe ay32.lib'"

Anyone know what this means or how to fix it? I ran the command npm install --save stellar-sdk and got this LINK : fatal error LNK1181: cannot open input file 'C:\OpenSSL-Win64\lib\libe ay32.lib' [...
John Murphy's user avatar
3 votes
2 answers
208 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 ...
KyleMcCann's user avatar
4 votes
1 answer
110 views

How to find cursor of a specific timestamp?

I need to find what's the cursor of a specific timestamp in order to let my users see their transactions by date. Is there any function in an SDK or any endpoint on horizon server?
AndreaBorio's user avatar