Cannot read property 'fromWIF' of undefined error

1k Views Asked by At

Im trying create and sign a raw transaction with bitcoinjs-lib.

const assert = require('assert');
const ecpair = require('ecpair');
const bitcoin = require('bitcoinjs-lib');
var keys    =new bitcoin.ecpair.fromWIF('cMvPQZiG5mLARSjxbBwMxKwzhTHaxgpTsXB6ymx7SGAeYUqF8HAT', bitcoin.networks.testnet);

this is my code and i get error "Cannot read property 'fromWIF' of undefined error" message. i think i am making a mistake while adding the libraries. bitcoinjs-lib version is 6 and using nodejs. thank you.

0

There are 0 best solutions below