addressIndex method

  1. @override
Bip84 addressIndex(
  1. int addressIndex
)
override

derive address with index

Implementation

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