Closed wbobeirne closed 5 years ago
I agree, the type errors that currently surface are not helpful.
We are planning to stop consuming the generated types directly and use them for diff comparisons between LND versions only. This will allow us to write the actual lnrpc types in a flatter, cleaner, and more developer-friendly format.
I'll make this update in the next week. Thanks!
We've removed the direct usage of generated types in release 0.5.2-beta.3.
Hey all, loving what you're providing to the TypeScript + Lightning ecosystem, hope I can help out going forward. Just started using lnrpc, and I'm finding the type errors to be really hard to grok. Take for instance this line of code that I'm converting over from using
ln-service
which has a slightly different api and nomenclature for arguments:This results in the following error:
It looks like due to the
AsObject
wrapping that the types have, you don't really get useful information out of the errors. It's only by drilling down into the types that I can find the definition forAsObject
. Not sure how the types are generated, and if there's a better way to surface them, but it'd definitely improve the developer experience!