Closed asymptotik closed 2 months ago
Hey @asymptotik thanks for bringing this to our attention -- we're checking it out and will report back :)
Hey @asymptotik I just wanted to drop a quick update on this. On our first major revision in a while, we were focused on not having too much disruption while we brought in tests for existing code, and now we’re reviewing as a bigger group, making sure there’s alignment with the latest API and considering runtime type checks.
We are comparing the TS interfaces to each API response through the functional tests, using Zod to easily catch mismatches (in addition to manual review), and are updating accordingly for the 6.0 release.
We've recently been discussing how we're going to handle releases going forward, and are formalizing a release plan that we'll publicize, to better align with upstream language and framework releases.
Also, I realized that I didn't happen to receive an alert on this, so we're reviewing and updating settings.
Thanks!
Hi! We've done a lot of work implementing Zod and checking types with the API team. It's been out for a bit, so I'll go ahead and close this. Please feel free to reach out if you have any other issues. Thanks!
Maybe I'm missing something, but there seems to be a lot of typescript types that do not match the data. Here are some examples with Invoice. I get an invoice back from a call to create an invoice and I get back something with a fragment like this. (I'm paring things way back for brevity)
Then we have the InvoiceInterface.
Shouldn't this be something more like:
You can do something like this to see the incompatability:
There are quite a few of these (paymentSubtotals, paymentTotals, paymentDisplayTotals, MinerFees, etc) along with quite a few other other typing issues. This makes it very difficult to use this library with typescript. What I ended up doing was making my own copy of the library and updating the types where I need them. Would really great to see some of this get some attention. Or, maybe I'm just missing something. Happens all the time :).