Open AzizGayes opened 7 years ago
Getting the same error
/home/ubuntu/transaction/node_modules/bitcore-lib/lib/util/preconditions.js:14
throw new errors.InvalidArgument(argumentName, message, docsPath);
^
Invalid Argument: Must provide an object from where to extract data
Error
at Error.NodeError (/home/ubuntu/transaction/node_modules/bitcore-lib/lib/errors/index.js:20:41)
at Object.module.exports.checkArgument (/home/ubuntu/transaction/node_modules/bitcore-lib/lib/util/preconditions.js:14:13)
at new UnspentOutput (/home/ubuntu/transaction/node_modules/bitcore-lib/lib/transaction/unspentoutput.js:33:5)
at Transaction._fromNonP2SH (/home/ubuntu/transaction/node_modules/bitcore-lib/lib/transaction/transaction.js:561:10)
at Transaction.from (/home/ubuntu/transaction/node_modules/bitcore-lib/lib/transaction/transaction.js:554:10)
at /home/ubuntu/transaction/output.js:11:5
at Request._callback (/home/ubuntu/transaction/node_modules/bitcore-explorers/lib/insight.js:80:12)
at Request.self.callback (/home/ubuntu/transaction/node_modules/bitcore-explorers/node_modules/request/request.js:188:22)
at emitTwo (events.js:87:13)
at Request.emit (events.js:172:7)
I am also having same error, if you guys @AlexanderKozhevin or @AzizGayes found any solution please let me know
You need to send a string to broadcast, see:
https://github.com/bitpay/bitcore-explorers/blob/master/lib/insight.js#L118
Try:
insight.broadcast(tx.toString(), function(err, txId) {
I am getting the same error but even after using
insight.broadcast(tx.toString(), function(err, txId) {
The error is continuing to appear.
Desktop\btc\node_modules\bitcore-lib\lib\transaction\transaction.js:189 throw serializationError; ^ undefined Error at new NodeError (C:\Users\ADMIN\Desktop\btc\node_modules\bitcore-lib\lib\errors\index.js:20:41) at Transaction.getSerializationError (C:\Users\ADMIN\Desktop\btc\node_modules\bitcore-lib\lib\transaction\transaction.js:222:22) at Transaction.checkedSerialize (C:\Users\ADMIN\Desktop\btc\node_modules\bitcore-lib\lib\transaction\transaction.js:185:33) at Transaction.serialize (C:\Users\ADMIN\Desktop\btc\node_modules\bitcore-lib\lib\transaction\transaction.js:169:17) at C:\Users\ADMIN\Desktop\btc\app.js:46:6 at Request._callback (C:\Users\ADMIN\Desktop\btc\node_modules\bitcore-explorers\lib\insight.js:80:12) at Request.self.callback (C:\Users\ADMIN\Desktop\btc\node_modules\request\request.js:185:22) at Request.emit (events.js:189:13) at Request.
(C:\Users\ADMIN\Desktop\btc\node_modules\request\request.js:1161:10) at Request.emit (events.js:189:13)
Hello guys,
When I try to broadcast a transaction, I'm having this error:
this is my code:
Can someone help me? thanks!