8

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 getInclusionStates to determine if the transaction has been confirmed at that milestone. This might be useful if you use a different API (for a different programming ...


4

Solution: seed must be recipient of transaction function getLastTransaction(seed){ iota.api.getAccountData(seed, (error, success) => { if(error){ console.log(error) } else { let long = success.transfers.length let lastT = success.transfers[long-1][0] let tx = { ...


3

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 have square brackets around it, i have made similar mistakes.


3

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 field is longer; but for transactions that spend iota (which is internally represented by a negative Value), the message needs to contain the signature so that the ...


3

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'


2

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 can run on any device that has a ("modern") browser. Therefore: Yes, you can use the iota.lib.js on your smartphone and you can use the same code that you use on ...


2

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 to give the total number you want), which will work without any HTTP requests (but obviously you cannot know whether the addresses have already been spent).


2

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!


2

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-encoded strings. You may want to sort the transactions in the original order (i. e. so that they are chained by trunk transaction hash) to avoid surprises when ...


2

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 have FIFO list that keeps the tips, so I believe that the first one will be the newest transaction... Note that if the node tries to solidify a path, then the ...


2

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 (would be doublespends or reattaches of already confirmed transactions). When you try to promote it, chances are high that the promotion transaction will pick a ...


1

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 that have already been done, or to find your "old" addresses again. getNewAddress will automatically cycle through indexes and will search for an address that has ...


1

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 Converter.value to convert into an integer value. This works well for tags of milestones or for bundle index fields, but I am not sure whether a nonce is too ...


1

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://p103.iotaledger.net:14700 solves my issue. Update It appears that https://testnet140.tangle.works without the port is working while having the port results in ...


1

Taken from the official wallet app: const spamTransfer = [{address: '9'.repeat(81), value: 0, message: '', tag: ''}] iota.api.promoteTransaction(transactionHash, 10, 14, spamTransfer, {interrupt: false, delay: 0}); Documentation is available here.


1

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. Once the MCMC walk is finished, iri validates again that the two transactions do not conflict (one transacton tries to spend the same funds as the other). In ...


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