Replies: 1 comment 1 reply
-
Yes. You will need to properly hook up the generics in the library code. Here you go: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In our library
@zoralabs/protocol-sdk
we publish some client creation methods that take aPublicClient
as an argument.When trying to integrate with this package externally, we get typescript errors when passing a
PublicClient
as an argument. Here is some example code:This gives us typescript error: "The types returned by 'getBlock(...)' are incompatible between these types."
See this error in the typescript playground
However, if we append
as Chain
to the chain argument, the error goes away.Is there a way types can be better defined without requiring us to use this
as Chain
argument?Beta Was this translation helpful? Give feedback.
All reactions