forex.pm forex forum binary options trade

 Сryptocurrency exchanges => Binance - Сryptocurrency exchanges => Topic started by: Bitcoin on Feb 15, 2022, 06:30 am

Title: In bip32-utils for bitcoinjs, node.getAddress is not a function
Post by: Bitcoin on Feb 15, 2022, 06:30 am
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 (https://bitcoin.stackexchange.com/questions/109963/in-bip32-utils-for-bitcoinjs-node-getaddress-is-not-a-function)