buildPreImageHash

fun buildPreImageHash(tx: Transaction, from: String, nonce: BigInteger, fee: Fee): Result<ByteArray>

Build a preImageHash for a transaction.

The preImageHash is an opaque byte array containing the serialized WalletCore PreSigningOutput protobuf. It includes:

  • data_hash: 32-byte hash to be signed

  • data: RLP-encoded unsigned transaction (NOT used for compilation)

Note: For internal signing use buildPreImageHashWithSigningInput which also returns the original SigningInput bytes needed for compileWithSignatures.

Return

Result containing the serialized PreSigningOutput bytes, or an error

Parameters

tx

The transaction to build

from

The sender's address

nonce

The sender's nonce (transaction count)

fee

The fee to use for the transaction