EvmTransactionBuilder

Builds Ethereum transaction protobufs for use with WalletCore's TransactionCompiler.

This class is responsible for:

  • Converting SDK transaction models to WalletCore protobuf format

  • Building SigningInput for native and ERC-20 transfers

  • Computing preImageHash for external signing (MPC)

  • Compiling signed transactions from external signatures

Phase 5.1: preImageHash generation Phase 5.2: signature compilation

Functions

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

Build a preImageHash for a transaction.

Link copied to clipboard

Build a preImageHash for a transaction, returning both the PreSigningOutput and the original SigningInput bytes.

Link copied to clipboard
fun compileSignedTransaction(signingInputData: ByteArray, signature: ByteArray, publicKey: ByteArray, network: Network): Result<String>

Compile a signed transaction from preImageHash data and an external signature.

Link copied to clipboard

Extract the data hash from a preImageHash for signing.

Link copied to clipboard

Extract data from PreSigningOutput.

Link copied to clipboard
fun getUnsignedTxBytes(tx: Transaction, from: String, nonce: BigInteger, fee: Fee): Result<ByteArray>

Returns RLP-encoded unsigned transaction bytes for the given tx/fee. Used by OP Stack L1 fee estimation (GasPriceOracle.getL1Fee(bytes)). Supports both legacy and EIP-1559 (type-2) transactions.