def _get_tx_params(w3, address, value=None, gas=None):
    """Get generic transaction parameters."""
    params = {
        "from": address,
        "nonce": w3.eth.getTransactionCount(address),
    }
    if value:
        params["value"] = value
    if gas:
        params["gas"] = gas
    return params