Questions tagged [javascript]
Tag for questions on the javascript library of Iota and related subjects.
34 questions
2
votes
2
answers
215
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....
0
votes
1
answer
98
views
How to handle access to wallet.rs Stronghold database in a serverless web app
Excited by the upcoming release of Chrysalis I wanted to start a little web app project using the wallet.rs library. Without going into too many details, users on the site will be able to generate an ...
1
vote
1
answer
159
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 ...
2
votes
2
answers
30
views
How to calculate the outputId?
How can I calculate the output id with transaction id and output index?
An OutputId is the the concatenation of transactionId+outputIndex where outputIndex needs to be converted to little endian first....
2
votes
1
answer
119
views
Is there a way to sign a transaction?
I would like to create a system whereby a client signs a message to authenticate itself in Shimmer.
What are my options?
1
vote
0
answers
55
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
114
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
...
0
votes
2
answers
116
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 ...
1
vote
1
answer
71
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?
0
votes
2
answers
147
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')
// ...
2
votes
1
answer
55
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
39
views
What's the difference between getNewAddress and generateAddress?
What's the difference between getNewAddress and generateAddress?
Don't see the diferences between them.
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. ...
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
117
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
129
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
0
answers
48
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})
...
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 ...
0
votes
1
answer
152
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, ...
4
votes
1
answer
412
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 ...
4
votes
1
answer
103
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 ...
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 ...
2
votes
1
answer
110
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
280
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
39
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}, ...
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. ...
4
votes
1
answer
128
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, ...
6
votes
1
answer
107
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
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
432
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?
4
votes
1
answer
255
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 ...
2
votes
1
answer
108
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.
9
votes
1
answer
627
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'...
2
votes
0
answers
77
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/...