MsgSignature.fromSignHex constructor

MsgSignature.fromSignHex(
  1. String signHex
)

Implementation

factory MsgSignature.fromSignHex(String signHex) {
  signHex = strip0x(signHex);
  final sign = hexToBytes(signHex);
  final r = bytesToUnsignedInt(sign.sublist(0, 32));
  final s = bytesToUnsignedInt(sign.sublist(32, 64));
  final v = bytesToUnsignedInt(sign.sublist(64)).toInt();
  // final r = hexToInt(signHex.substring(0, 64));
  // final s = hexToInt(signHex.substring(64, 128));
  // final v = hexToDartInt(signHex.substring(128));
  return MsgSignature(r, s, v);
}