Questions tagged [javascript]

Tag for questions on the javascript library of Iota and related subjects.

Filter by
Sorted by
Tagged with
1 vote
0 answers
38 views

Can't connect to custom hornet node using nodejs clientbuilder

Have a hornet node set up on AWS, able to access the dashboard and interact with the REST API just fine. However when trying to build a connection to it using nodejs @iota/client ClientBuilder cannot ...
0 votes
1 answer
57 views

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

I know MAM is deprecated but I am doing some research on MAM. I was able to send and fetch a data payload of size 740 KB. But when I tried to use a data of 1 MB I am getting this issue with node.js ...
  • 25
0 votes
2 answers
78 views

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

Thank you in advance. I would like to have a working example using the node.js client of iota, where i give an index to a function and the function returns to me the messages or the message ids. I ...
0 votes
1 answer
121 views

How to publish messages using MAM to my private tangle?

I have a private tangle with 2 hornet nodes. I tried MAM using one of the devnet nodes by following the example on the official IOTA webpage. Can someone please tell me how do I publish and fetch ...
  • 25
2 votes
1 answer
53 views

Unable to read transaction from the Tangle

While following the IOTA JavaScript guide, I changed the example node to a main net node - https://nodes.thetangle.org:443 and received the following error message below. How do I get messages from ...
1 vote
1 answer
38 views

What's the difference between getNewAddress and generateAddress?

What's the difference between getNewAddress and generateAddress? Don't see the diferences between them.
2 votes
2 answers
185 views

Receiving JSON messages from ZMQ feed using an IRI fullnode

I am trying to use ZMQ feeds to monitor IRI nodes and addresses, but I am having trouble obtaining the "Message" in text and/or JSON. I am using this code: let zmq = require('zeromq') let sock = zmq....
1 vote
1 answer
18 views

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

When I make a simple request like shown in the iota workshop: https://github.com/iota-community/javascript-iota-workshop - 2.2-fetch-hello.js the newest transaction is not fetched but a random one. ...
user avatar
0 votes
0 answers
23 views

What is an “apiEndpoint” in poc-ipfs config file

In the poc-ipfs app blueprint from IOTA’s GitHub, they have a config file on the client side (link below), one of the parts of the script contains “apiEndpoint”, I do not know what would go there for ...
1 vote
0 answers
116 views

How to attach a message multiple times (say 200 times) with the tangle using MAM

What I am trying to do is to attach a payload to the tangle using MAM protocol. If I run this loop for k=5 times it works fine i.e., data is attached to the Tangle. I confirmed that the data is ...
2 votes
1 answer
128 views

Transaction is inconsistent. Reason: tails are not consistent

i'm trying to promote a transaction by using the following code const spamTransfer = [{address: '9'.repeat(81), value: 0, message: '', tag: ''}] iota.promoteTransaction(hash, 10, 9, spamTransfer, {...
0 votes
2 answers
140 views

toTrytes() does not work

I'm always getting this error without understanding why. TypeError: Cannot read property 'toTrytes' of undefined Code: // Require the use of IOTA library const Iota = require('@iota/core') // ...
  • 1
0 votes
0 answers
46 views

getAccountData returns undefined

it is a few days ago that getAccountData has stopped returning value (returns always undefined). Does any of you know why? This is the code: iota.getAccountData(seed, {start: 0,security: 2}) ...
4 votes
1 answer
101 views

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

According to iota.lib.js documents, iota.api.getInputs(seed, [, options], callback) the getInputs() have a options argument. options object have four members, start, end, security and ...
4 votes
1 answer
400 views

IOTA get all transactions for wallet/address programmatically js

I need to listen for a new transactions on testnet submitted by wallet/address programmatically(js). I have tried iota.lib.js, but findTransactionObjects and getAccountData always returns null. Is ...
0 votes
1 answer
145 views

Interacting with IOTA from mobile application?

Is it possible to interact with IOTA Tangle (for example, send a message) using an application installed in a mobile phone? If so, is it possible to install IOTA library in a mobile phone? And if yes, ...
3 votes
0 answers
46 views

Why do I need to create an IOTA instance to use the library functions?

Let the IOTA node instance be iota variable in the following context: var IOTA=require("./node_modules/iota.lib.js/lib/iota") var iota=new IOTA({ 'provider': 'https://iotanode.us:443'}) If I want to ...
  • 798
1 vote
1 answer
125 views

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

In all of the ways to getNewAddress() we have to call an iri node (reference). But using the seed it is a deterministic algorith, why do I have to use and http request to do that? How do I generate ...
  • 798
2 votes
1 answer
107 views

findTransactionObjects() call returning empty array when searching for tag [duplicate]

With this findTransactionObjects call: iota.api.findTransactionObjects({ tags: [ 'ZARCXARCQCVAZA9BUAZASCVAEXP' ]}, callback) I am getting back an empty array. However, when I search for the tag on ...
3 votes
1 answer
276 views

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

When running a sendTransfer() on a testnet node (https://testnet140.tangle.works) I can attach without any problems. When I try to use a mainnet node (http://nodes.iota.fm:80) I get Invalid ...
2 votes
0 answers
38 views

Caching account data

Reading through the documentation for the IOTA Javascript Library I realized the method iota.api.getAccountData can be provided with an starting index: iota.api.getAccountData(seed, {start: 123}, ...
  • 121
1 vote
1 answer
66 views

How to save the bundle trytes to reattach after a snapshot? [closed]

How to save the bundle trytes to reattach it after a snapshot? How to do this using the JavaScript library?
  • 1,468
5 votes
1 answer
71 views

Why are the first 2 characters of my tag altered?

I used the official javascript library to create and attach a transaction to the tangle, but the first 2 characters of the tag are always changed to some random characters. eg. ...
  • 81
4 votes
1 answer
126 views

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

I'm trying to get account data with the following code: const iota = new IOTA({ 'host': 'https://testnet140.tangle.works', 'port': 443 }); const seed = //my seed iota.api.getAccountData(seed, ...
3 votes
0 answers
44 views

I need help recovering my pre-Kerl funds [duplicate]

I think I generated a couple addresses with a pre-Kerl version of the wallet and sent funds from an exchange to them. I did this after the snapshots, so the funds are not frozen by the Foundation, i.e....
5 votes
1 answer
429 views

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

Is there a sample publicly available, showing how to use the official IOTA S Library to promote a transaction?
  • 1,063
4 votes
1 answer
253 views

sendTransfer Error: "inconsistent tips pair selected"

I'm trying to send my first zero-value transaction with the javascript library. I took out "attachToTangle" from my ini, but now getting this error: Uncaught Error: Request Error: inconsistent tips ...
  • 43
6 votes
1 answer
104 views

Javascript Transaction object Message versus Tag

What is the difference between the Message and Tag values when creating a new transaction object via the JS library
2 votes
1 answer
102 views

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

I tried to use fromTrytes() but the function does not accept trytes with an odd length. The nonce appears to always have an odd length, e.g. EPV9MUTXNFDAFNIQLAZWTOLAFJT.
  • 1,063
2 votes
0 answers
75 views

Invalid response from server using iota.lib.js

I try the sendTransfer command on my full node. After long time, I get this error: Error: Invalid Response: at Object.invalidResponse (/home/atena/iota/node_modules/iota.lib.js/lib/errors/...
9 votes
1 answer
620 views

How to know a transaction is "confirmed"?

I'm building a little IOTA test project with TypeScript + Node.js. I want to start an action when IOTAs are received on an certain address. I've tried the findTransactionObjects function, but I don'...
  • 257