src/util.js
function changeAddrFromMnemonic(walletInfo, index, BITBOX) {
  // root seed buffer
  const rootSeed = BITBOX.Mnemonic.toSeed(walletInfo.mnemonic)

  // master HDNode
  if (walletInfo.network === "testnet")
    var masterHDNode = BITBOX.HDNode.fromSeed(rootSeed, "testnet")
  else var masterHDNode = BITBOX.HDNode.fromSeed(rootSeed)

  // HDNode of BIP44 account
  const account = BITBOX.HDNode.derivePath(masterHDNode, "m/44'/145'/0'")

  // derive the first external change address HDNode which is going to spend utxo
  const change = BITBOX.HDNode.derivePath(account, `0/${index}`)

  return change
}
function changeAddrFromMnemonic(walletInfo, index, BITBOX) {
  // root seed buffer
  const rootSeed = BITBOX.Mnemonic.toSeed(walletInfo.mnemonic)

  // master HDNode
  if (walletInfo.network === "testnet")
    var masterHDNode = BITBOX.HDNode.fromSeed(rootSeed, "testnet")
  else var masterHDNode = BITBOX.HDNode.fromSeed(rootSeed)

  // HDNode of BIP44 account
  const account = BITBOX.HDNode.derivePath(masterHDNode, "m/44'/145'/0'")

  // derive the first external change address HDNode which is going to spend utxo
  const change = BITBOX.HDNode.derivePath(account, `0/${index}`)

  return change
}
Generate a change address from a Mnemonic of a private key.