generateSignHashRequest method

SignRequest<SuiSignatureResult> generateSignHashRequest(
  1. SuiSignHashRequestProps props
)

Build a sui-sign-hash-request (7103) — signs the given 32-byte digest directly.

Implementation

SignRequest<SuiSignatureResult> generateSignHashRequest(
    SuiSignHashRequestProps props) {
  if (props.messageHash.length != 32) {
    throw EraSdkError('invalid-props', 'messageHash must be 32 bytes');
  }
  // The hash travels as a HEX STRING on this variant (device contract).
  return _build(
    urType: 'sui-sign-hash-request',
    signData: cbText(bytesToHex(props.messageHash)),
    requestId: props.requestId,
    path: props.path,
    xfp: props.xfp,
    address: props.address,
    origin: props.origin,
  );
}