user11525941
user11525941

Reputation: 11

About @waves/waves-transactions library

I was testing https://www.npmjs.com/package/@waves/waves-transactions and npm installed and create a simple transaction to sign and tried to display the Tx object in console however this error is displayed.

node tx.js
module.js:529
throw err;
^

Error: Cannot find module '@waves/waves-transactions'
at Function.Module._resolveFilename (module.js:527:15)
at Function.Module._load (module.js:476:23)
at Module.require (module.js:568:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/SatoruBito 1/waves-transactions/tx.js:1:84)
at Module._compile (module.js:624:30)
at Object.Module._extensions..js (module.js:635:10)
at Module.load (module.js:545:32)
at tryModuleLoad (module.js:508:12)
at Function.Module._load (module.js:500:3)

Code is below in tx.js

const { transfer } = require('@waves/waves-transactions');
const nodeUrl = 'https://nodes.wavesplatform.com';

const seed = "a valid seed phrase";

const signedTranserTx = transfer({
amount: 0.01,
recipient: 'a valid Waves mainet address',
timestamp:Date.now()
}, seed)

console.log(signedTranserTx);

wanted to sign Tx and show the Tx object with signature

Upvotes: 1

Views: 110

Answers (1)

Sergei
Sergei

Reputation: 51

The problem is within you node environment, since you have import error. Make sure you have package installed and require it from within the project

Upvotes: 1

Related Questions