litecore-archive / litecore-lib

A pure and powerful JavaScript Litecoin library
https://litecore.io/
Other
72 stars 85 forks source link

sign error #8

Open pefish opened 6 years ago

pefish commented 6 years ago

TypeError: r.gt is not a function at ECDSA.sigError (/Users/joy/Work/backend/withdraw_all/node_modules/litecore-lib/lib/crypto/ecdsa.js:169:11) at ECDSA.verify (/Users/joy/Work/backend/withdraw_all/node_modules/litecore-lib/lib/crypto/ecdsa.js:272:13) at Function.ECDSA.verify (/Users/joy/Work/backend/withdraw_all/node_modules/litecore-lib/lib/crypto/ecdsa.js:294:6) at Object.verify (/Users/joy/Work/backend/withdraw_all/node_modules/litecore-lib/lib/transaction/sighash.js:127:16) at PublicKeyHashInput.Input.isValidSignature (/Users/joy/Work/backend/withdraw_all/node_modules/litecore-lib/lib/transaction/input/input.js:198:18) at PublicKeyHashInput.addSignature (/Users/joy/Work/backend/withdraw_all/node_modules/litecore-lib/lib/transaction/input/publickeyhash.js:63:21) at Transaction.applySignature (/Users/joy/Work/backend/withdraw_all/node_modules/litecore-lib/lib/transaction/transaction.js:1166:37) at /Users/joy/Work/backend/withdraw_all/node_modules/litecore-lib/lib/transaction/transaction.js:1135:10 at arrayEach (/Users/joy/Work/backend/withdraw_all/node_modules/litecore-lib/node_modules/lodash/index.js:1289:13) at Function.<anonymous>

my codes: var privateKey = new litecore.PrivateKey('cUEHLwt7e7rXFoATPKyyWEGJv3BTznPSz79aFBWfyAHMzemCADCL'); var utxo = { "txId" : "ea81cfdaf1f467e8fc729913f5250ed6997841177f0e393789fcdd48c91f3896", "outputIndex" : 0, "address" : "mpcFhXGhao3J7xaP1eCTKZP8t5vzN5jwND", "script" : "76a91463b9bd92a3605869946677cf24f38f572fd6603788ac", "satoshis" : 10000000000 }; var transaction = new litecore.Transaction() .from(utxo) .to('n3chACpRvZHr5zvCLcxVPtguwGWSMHC4fk', 15000) .sign(privateKey)

please help

cyio commented 6 years ago

try not use yarn https://github.com/bitpay/bitcore-lib/issues/109