const bch = require('bitcore-lib-cash');
var privateKey = new bitcore.PrivateKey('L1uyy5qTuGrVXrmrsvHWHgVzW9kKdrp27wBC7Vs6nZDTF2BRUVwy');
var utxo = {
"txId" : "115e8f72f39fad874cfab0deed11a80f24f967a84079fb56ddf53ea02e308986",
"outputIndex" : 0,
"address" : "17XBj6iFEsf8kzDMGQk5ghZipxX49VXuaV",
"script" : "76a91447862fe165e6121af80d5dde1ecb478ed170565b88ac",
"satoshis" : 50000
};
var transaction = new bitcore.Transaction()
.from(utxo)
.addData('bitcore rocks') // Add OP_RETURN data
.sign(privateKey);
console.log(transaction.toString())
but i get the error
Address has mismatched network type
this is my code
const bch = require('bitcore-lib-cash'); var privateKey = new bitcore.PrivateKey('L1uyy5qTuGrVXrmrsvHWHgVzW9kKdrp27wBC7Vs6nZDTF2BRUVwy'); var utxo = { "txId" : "115e8f72f39fad874cfab0deed11a80f24f967a84079fb56ddf53ea02e308986", "outputIndex" : 0, "address" : "17XBj6iFEsf8kzDMGQk5ghZipxX49VXuaV", "script" : "76a91447862fe165e6121af80d5dde1ecb478ed170565b88ac", "satoshis" : 50000 };
var transaction = new bitcore.Transaction() .from(utxo) .addData('bitcore rocks') // Add OP_RETURN data .sign(privateKey); console.log(transaction.toString())
but i get the error Address has mismatched network type