getOriginAsPublicKey method

Uint8List? getOriginAsPublicKey()

Get "origin" of the tx by public key bytes style. @return If can't decode just return null.

Implementation

Uint8List? getOriginAsPublicKey() {
  if (!_isSignatureValid()) {
    return null;
  }

  try {
    Uint8List h = getSigningHash(null);
    ThorSignature sig = ThorSignature.fromBytes(
        Uint8List.fromList(signature!.sublist(0, 65)));
    Uint8List pubKey = recover(h, sig);
    return pubKey;
  } catch (e) {
    return null;
  }
}