deriveAddress method

Bip32KeyPair deriveAddress({
  1. int purpose = defaultPurpose,
  2. int coinType = defaultCoinType,
  3. int account = defaultAccountIndex,
  4. int change = defaultChange,
  5. int address = defaultAddressIndex,
})

Implementation

Bip32KeyPair deriveAddress(
    {int purpose = defaultPurpose,
    int coinType = defaultCoinType,
    int account = defaultAccountIndex,
    int change = defaultChange,
    int address = defaultAddressIndex}) {
  final rootKeys =
      Bip32KeyPair(privateKey: _rootSigningKey, publicKey: rootVerifyKey);
  final pair0 = derive(keys: rootKeys, index: purpose);
  final pair1 = derive(keys: pair0, index: coinType);
  final pair2 = derive(keys: pair1, index: account);
  final pair3 = derive(keys: pair2, index: change);
  final pair4 = derive(keys: pair3, index: address);
  return pair4;
}