change method

  1. @override
Cip1852 change(
  1. Bip44Changes changeType
)
override

derive change with change type Bip44Changes internal or external

Implementation

@override
Cip1852 change(Bip44Changes changeType) {
  if (!isLevel(Bip44Levels.account)) {
    throw Bip44DepthError(
        "Current depth (${bip32.depth.toInt()}) is not suitable for deriving change");
  }
  Bip32KeyIndex changeIndex = Bip32KeyIndex(changeType.value);
  if (!bip32Object.isPublicDerivationSupported) {
    changeIndex = Bip32KeyIndex.hardenIndex(changeType.value);
  }
  return Cip1852._(bip32.childKey(changeIndex), coinConf);
}