examples/send-bch/send-bch.js
function changeAddrFromMnemonic(mnemonic) {
  // root seed buffer
  const rootSeed = Wormhole.Mnemonic.toSeed(mnemonic)

  // master HDNode
  let masterHDNode
  if (NETWORK === "testnet")
    masterHDNode = Wormhole.HDNode.fromSeed(rootSeed, "testnet")
  else masterHDNode = Wormhole.HDNode.fromSeed(rootSeed)

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

  // derive the first external change address HDNode which is going to spend utxo
  const change = Wormhole.HDNode.derivePath(account, "0/0")

  return change
}
function changeAddrFromMnemonic(mnemonic) {
  // root seed buffer
  const rootSeed = Wormhole.Mnemonic.toSeed(mnemonic)

  // master HDNode
  let masterHDNode
  if (NETWORK === "testnet")
    masterHDNode = Wormhole.HDNode.fromSeed(rootSeed, "testnet")
  else masterHDNode = Wormhole.HDNode.fromSeed(rootSeed)

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

  // derive the first external change address HDNode which is going to spend utxo
  const change = Wormhole.HDNode.derivePath(account, "0/0")

  return change
}
function changeAddrFromMnemonic ( mnemonic ) { // root seed buffer const rootSeed = Wormhole . Mnemonic . toSeed ( mnemonic ) // master HDNode let masterHDNode if ( NETWORK === "testnet" ) masterHDNode = Wormhole . HDNode . fromSeed ( rootSeed , "testnet" ) else masterHDNode = Wormhole . HDNode . fromSeed ( rootSeed ) // HDNode of BIP44 account const account = Wormhole . HDNode . derivePath ( masterHDNode , "m/44'/145'/0'" ) // derive the first external change address HDNode which is going to spend utxo const change = Wormhole . HDNode . derivePath ( account , "0/0" ) return change }
Generate a change address from a Mnemonic of a private key.
Generate a change address from a Mnemonic of a private key .