public static CallParameter fromTransaction(final Transaction tx) {
    final var builder =
        ImmutableCallParameter.builder()
            .chainId(tx.getChainId())
            .sender(tx.getSender())
            .gas(tx.getGasLimit())
            .value(tx.getValue())
            .input(tx.getPayload())
            .nonce(tx.getNonce());

    tx.getTo().ifPresent(builder::to);
    tx.getGasPrice().ifPresent(builder::gasPrice);
    tx.getMaxPriorityFeePerGas().ifPresent(builder::maxPriorityFeePerGas);
    tx.getMaxFeePerGas().ifPresent(builder::maxFeePerGas);

    tx.getAccessList().ifPresent(builder::accessList);

    tx.getMaxFeePerBlobGas().ifPresent(builder::maxFeePerBlobGas);
    tx.getVersionedHashes().ifPresent(builder::blobVersionedHashes);
    return builder.build();
  }
Returns either the 'input' or 'data' field, depending on which is present, or empty if neither
is present.

@return the payload, or empty if none is present.
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/transaction/CallParameter.java