8 votes
Accepted

How to know a transaction is "confirmed"?

You can call the GetLatestInclusion convenience function in iota.lib.js. Under the hood, this will first call getNodeInfo to find out the latest solid subtangle milestone hash, and then call ...
user avatar
  • 7,254
4 votes
Accepted

IOTA get all transactions for wallet/address programmatically js

Solution: seed must be recipient of transaction function getLastTransaction(seed){ iota.api.getAccountData(seed, (error, success) => { if(error){ console.log(error) ...
user avatar
3 votes
Accepted

Can iota.api.getTransfers() get specific transactions?

The options argument is just an object, not an array (that goes for both getInputs and getTansfers). It should work if you remove the square brackets. The confusion is understandable since the docs ...
user avatar
3 votes

Why are the first 2 characters of my tag altered?

Due to a bug in the signing process, the js lib needs to work around by altering the tag Ref: Why is the normalized hash considered insecure when containing the char 'M'
user avatar
  • 81
3 votes
Accepted

Javascript Transaction object Message versus Tag

The Tag field is short and can be used to search transactions (so you can search the tangle for transactions with tag "GUS9GORMAN", but not for transactions with message "GUS9GORMAN"). The Message ...
user avatar
  • 7,254
2 votes

Interacting with IOTA from mobile application?

Interacting with the IOTA Tangle is just using a REST API of any full node and since you can do that on every smartphone: Yes, you can interact with the IOTA Tangle from your smartphone. JavaScript ...
user avatar
  • 4,459
2 votes
Accepted

How do I generate an IOTA address from a given seed in Javascript without making an HTTP(s) requst?

getNewAddress can either search for an unused address (this will do HTTP requests to check if an address was already spent from or has a balance) or you can use it to get a list of addresses (you have ...
user avatar
  • 7,254
2 votes
Accepted

sendTransfer() 'Invalid transaction hash' when running mainnet but fine on testnet

As I was writing this out I realized I might try changing the weight to 14 and that did it! Too bad the error wasn't a little more descriptive!
user avatar
2 votes
Accepted

How to save the bundle trytes to reattach after a snapshot?

Starting from the bundle hash, call the findTransactions API to get the transaction hashes of all transactions in your bundle. Pass the hashes to getTrytes to retrieve the transactions as tryte-...
user avatar
  • 7,254
2 votes
Accepted

Sample code for promoting a transaction using the official IOTA JS Library?

Taken from the official wallet app: const spamTransfer = [{address: '9'.repeat(81), value: 0, message: '', tag: ''}] iota.api.promoteTransaction(transactionHash, 10, 14, spamTransfer, {...
user avatar
  • 7,254
2 votes
Accepted

Transaction is inconsistent. Reason: tails are not consistent

You should check if the transaction is promotable before trying to promote it. For that transaction, isPromotable will return false, since it approves one or more transactions that are inconsistent (...
user avatar
  • 7,254
1 vote

toTrytes() does not work

UPDATE 2021 Please be aware that IOTA has changed at architectural level. Read about it in the official documentation: https://docs.iota.org/
user avatar
1 vote
Accepted

How to send a data payload of a size 1 MB or greater with MAM and node.js?

Splitting the data into fragments will work. Alternatively if you work with the IOTA streams library you should have more luck with big sizes. https://github.com/iotaledger/streams
user avatar
1 vote

How can i get messages using the index in the node.js client

Check out the iota.js lib: https://github.com/iotaledger/iota.js/blob/main/examples/browser/index.html const client = new Iota.SingleNodeClient("https://chrysalis-nodes.iota.org/"); const ...
user avatar
  • 31
1 vote

Unable to read transaction from the Tangle

The '@iota/extract-json' module provides a way to encode arbitrary JSON (of arbitrary length) into a IOTA bundle and decode it from there again. Decoding requires that the transactions have actually ...
user avatar
  • 7,254
1 vote
Accepted

What's the difference between getNewAddress and generateAddress?

generateAddress is used to deterministically generate an address from the index (e.g. you want to have the fifth address from your seed). You will use it if you want to show a list of transactions ...
user avatar
  • 7,254
1 vote

How do I fetch the latest transaction without using Zero MQ stream on a specific address?

I didn't click the link to the workshop. The way I would do it is to use the getTips api call. This will return all tips including old stale one. However, by examining the IRI code we can see that we ...
user avatar
  • 131
1 vote
Accepted

Getting error: "Invalid Response: The deployment could not be found"

While I thought this looked like an issue with the iota.lib.js, it appears that it is actually a problem with the testnet node I was using, https://testnet140.tangle.works:443. Switching to http://...
user avatar
1 vote
Accepted

sendTransfer Error: "inconsistent tips pair selected"

Looks like a bug in iri. When you call getTransactionsToApprove (which is called by sendTransfer), iri will do some random MCMC walk to find the two transactions that your transaction should approve. ...
user avatar
  • 7,254
1 vote

How do I convert the nonce into an integer value with the official JS lib?

fromTrytes is used to revert the toTrytes function (which encodes ASCII text into trytes, but will not support all encoded values). You can use Converter.trits to convert your trytes into trits, then ...
user avatar
  • 7,254

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