The ever-increasing brightness of synchrotron radiation sources demands improved X-ray optics to utilize their capability for imaging and probing biological cells, nano-devices and functional matter on the nanometre scale with chemical sensitivity. Hard X-rays are ideal for high-resolution imaging and spectroscopic applications owing to their short wavelength, high penetrating power and chemical sensitivity. The penetrating power that makes X-rays useful for imaging also makes focusing them technologically challenging. Recent developments in layer deposition techniques have enabled the fabrication of a series of highly focusing X-ray lenses, known as wedged multi-layer Laue lenses. Improvements to the lens design and fabrication technique demand an accurate, robust, in situ and at-wavelength characterization method. To this end, a modified form of the speckle tracking wavefront metrology method has been developed. The ptychographic X-ray speckle tracking method is capable of operating with highly divergent wavefields. A useful by-product of this method is that it also provides high-resolution and aberration-free projection images of extended specimens. Three separate experiments using this method are reported, where the ray path angles have been resolved to within 4 nrad with an imaging resolution of 45 nm (full period). This method does not require a high degree of coherence, making it suitable for laboratory-based X-ray sources. Likewise, it is robust to errors in the registered sample positions, making it suitable for X-ray free-electron laser facilities, where beam-pointing fluctuations can be problematic for wavefront metrology.