tran.jsNode.jsのUnhandledPromiseRejection:TypeError例外:未定義
var CoinStack = require('coinstack-sdk-js')
var coinstackclient = new CoinStack('c7dbfacbdf1510889b38c01b8440b1',
'10e88e9904f29c98356fd2d12b26de');
var privateKeyWIF = CoinStack.ECKey.createKey(); //개인키 생성
var txBuilder = coinstackclient.createTransactionBuilder();
txBuilder.addOutput("1Q8xE8T3G9mxRoDUde6gDSxnK1uCac2kqh",
CoinStack.Math.toSatoshi("0.01"))
txBuilder.setInput("1Q8xE8T3G9mxRoDUde6gDSxnK1uCac2kqh");
txBuilder.buildTransaction(function(err, tx) {
tx.sign(privateKeyWIF)
var rawTx = tx.serialize()
// send tx
client.sendTransaction(rawTx, function(err) {
if (null != err) {
console.log("failed to send tx");
}
});
});
私が何をするか分からない
(node:12012) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'sign' of undefined (node:12012) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
エラーのプロパティ '記号' を読み取ることができません