getPublicKey method

Future<BuBytes> getPublicKey({
  1. required CryptoCoins<BaseCoinConfig> coin,
  2. required int device,
  3. String? path,
  4. required BuHwTransport transport,
})

Parse + validate + fetch pubkey in one call. path defaults to defaultHwPath. Needs a connected transport (USB) except the validation part — throws before touching transport on bad input.

Implementation

Future<BuBytes> getPublicKey({
  required CryptoCoins coin,
  required int device,
  String? path,
  required BuHwTransport transport,
}) async {
  final coinId = hwCoinIdFor(coin);
  final pathU32 = parsePath(path ?? defaultHwPath(coin));
  validatePath(device: device, coin: coinId, pathU32: pathU32);
  return executeGetAddress(
    device: device,
    coin: coinId,
    pathU32: pathU32,
    transport: transport,
  );
}