decodeBip32Fvk static method

Bip32PublicKey decodeBip32Fvk(
  1. List<int> bytes
)

Implementation

static Bip32PublicKey decodeBip32Fvk(List<int> bytes) {
  if (bytes.length != 65) {
    throw BuError(
      DefaultErrorType.invalidLength,
      "Invalid transparent fvk bytes length.",
    );
  }
  return Bip32PublicKey.fromBytes(
    bytes.sublist(Bip32KeyDataConst.chaincodeByteLen),
    Bip32KeyData(
      depth: Bip32Depth(4),
      fingerPrint: Bip32FingerPrint([0xff, 0xff, 0xff, 0xff]),
      index: Bip32KeyIndex(Bip44Changes.chainExt.value),
      chainCode: Bip32ChainCode(
        bytes.sublist(0, Bip32KeyDataConst.chaincodeByteLen),
      ),
    ),
    Bip32Const.mainNetKeyNetVersions,
    CryptoKeyType.secp256k1,
  );
}