• Welcome to forex.pm forex forum binary options trade. Please login or sign up.
 

In bip32-utils for bitcoinjs, node.getAddress is not a function

Started by Bitcoin, Feb 15, 2022, 06:30 am

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bitcoin

In bip32-utils for bitcoinjs, node.getAddress is not a function

I am trying to run the example code in the bip32-utils taken here (https://github.com/bitcoinjs/bip32-utils) of:


const bip39 = require('bip39')
const bitcoin = require('bitcoinjs-lib')
const bip32utils = require('bip32-utils')

let mnemonic = bip39.generateMnemonic()
let seed = bip39.mnemonicToSeedSync(mnemonic)

let hdNode = bitcoin.bip32.fromSeed(seed)

let childNode = hdNode.deriveHardened(0)
let external = childNode.derive(0)
let internal = childNode.derive(1)
let account = new bip32utils.Account([
  new bip32utils.Chain(external.neutered()),
  new bip32utils.Chain(internal.neutered())
])

console.log(account.getChainAddress(0))

But i keep getting this typeError of node.getAddress is not a function, any suggestions?


Source: In bip32-utils for bitcoinjs, node.getAddress is not a function