EIP-1559 (type-2) Ethereum transaction assembly + signing, for Hedera's
EthereumTransaction (Hedera runs the EVM; a signed Ethereum tx is relayed and
executed against its EVM address).
sign_eip1559/2 RLP-encodes the transaction, signs keccak256 of it with a
secp256k1 key (the Hedera ECDSA path is exactly Ethereum's), recovers the
yParity, and returns the complete signed ethereum_data — the bytes that go
into Hedera.Transaction.ethereum/1 / Hedera.Client.send_ethereum_transaction/3.
Chain id defaults to Hedera testnet (296; mainnet is 295).
Summary
Functions
Build + sign an EIP-1559 transaction, returning the ethereum_data bytes
(0x02 ‖ rlp([...])). Params (a map): :chain_id (default 296),
:nonce, :max_priority_fee_per_gas, :max_fee_per_gas, :gas_limit, :to
(a 20-byte address, "0x…" hex, or nil/absent for contract creation),
:value, :data (call data, bytes or "0x…"). Access lists are empty.
Functions
@spec sign_eip1559(map(), Hedera.PrivateKey.t()) :: binary()
Build + sign an EIP-1559 transaction, returning the ethereum_data bytes
(0x02 ‖ rlp([...])). Params (a map): :chain_id (default 296),
:nonce, :max_priority_fee_per_gas, :max_fee_per_gas, :gas_limit, :to
(a 20-byte address, "0x…" hex, or nil/absent for contract creation),
:value, :data (call data, bytes or "0x…"). Access lists are empty.
Raises ArgumentError when a required gas field is missing/negative or a :to
address / :data hex string is malformed.