NEM Transaction Discussion

Welcome to the thread about NEM Transactions. Here you can discuss everything about the code and potential problems that you might stumble upon.

1 Like

hello philip .
how do i resolve this

Error: Cannot find module ‘nem-sdk’
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)

Did you install it with the npm install command?

yes i followed your video on how to instal nem sdk using terminal.
but every time i do a run in the terminal it throw an error.
am i missing something?
thank Filip.

Did you do it in the same directory as the project your trying to run? Otherwise you can try to add the -g flag when running the npm install command. Some other guy on the forum also had an issue with his firewall that prevented the installation from succeeding.

This question is about the NEM wallet that we were shown how to use. I have googled unsuccessfully for an answer to this.
The problem is that when I login to my wallet that I created by doing what Filip did in the lecture I get a message that is “Error at fetching account data, reason: address must be valid”.
I then created another wallet on the testnet but it has the same error.
Please help.

I don’t know what that error message is. If you can’t figure it out the only thing I could recommend is to post on the NEM forum.

Hello,

I receive FAILURE_TIMESTAMP_TOO_FAR_IN_FUTURE error when I try to send a transaction on the test net. I did some googling and found a suggestion to use the server time so changes the code to:

let nem = require(“nem-sdk”).default;

let endpoint = nem.model.objects.create(“endpoint”)(nem.model.nodes.defaultTestnet, nem.model.nodes.defaultPort);
let common = nem.model.objects.create(“common”)(“PASSWORD-HERE”,“SECRET-HERE”);

let transferTransaction = nem.model.objects.create(“transferTransaction”)(“TCUPVQ-C77TAM-H7QKPF-P5OT3T-LUV4JY-RPV6CE-GJXW”, 2, “Test ability to transact by returning some NEM.”);

let preparedTransaction = nem.model.transactions.prepare(“transferTransaction”)(common, transferTransaction, nem.model.network.data.testnet.id);

nem.com.requests.chain.time(endpoint).then(function(timeResult){
preparedTransaction.timestamp = timeResult.sendTimeStamp;

nem.model.transactions.send(common, preparedTransaction, endpoint).then(function(result){
console.log(result);
}, function(err){
console.log(err);
});

}, function(err){
console.log(err);
})

This still received the same error.

Any thoughts?

Thanbk you

You should be fine without that as long as your system time is correct on your computer. Have you adjusted that so it’s correct?

Hey @filip, are you saying I need to adjust my local time to match NEM’s server time? If so what is the purpose of the nem.com.requests.chain.time method? BTW are you coming to the meet up in New York on Feb 6th?

I have never used the chain.time function so I’m not sure. But it should work without it as long as your system time is correct. Is you system time correct both in terms of date, year and time? According to your local time, not any server.

Hi, all the faucets that I found are drained or not working and the one that works needs some TOK stake … Has somebody found a working faucet, or anyone just send some NEM for my testnet on TCMKMYUCFNSMFYOYVYVXYO6X73T7WY4WBR4T7ZY6 :confused: thx

The ‘TOK stake’ problem is solved here https://forum.nem.io/t/any-decent-nem-faucets/20923/4 and they give you a proper link (the same that Filip gave us or updated for us).

Hi there,

I have a problem with the send property:

Any idea?

You are missing an ‘s’. It should me nem.model.transactions.send() :slight_smile:

1 Like

Thanks… sorry I didn’t check the typo

1 Like