derivePath method

HDNode derivePath(
  1. String path
)

Return a new HDNode which is the child of hdNode found by deriving path.

Implementation

HDNode derivePath(String path) {
  final root = bip32.BIP32.fromPrivateKey(
    Uint8List.fromList(hex.decode(strip0x(privateKey!))),
    Uint8List.fromList(hex.decode(strip0x(chainCode))),
  );

  final child = root.derivePath(path);
  return _nodeFromRoot(
    child,
    path: path,
    mnemonic: (mnemonic != null) ? mnemonic!.phrase : null,
  );
}