Closed dmytrotkk closed 1 year ago
That’s a bit annoying. I’d say viem’s implementation is technically correct as without an application/json
header, the response is essentially raw text (even though it might be represented as json). Wonder what it would take to fix this on Skale’s side.
Let's track this issue here: https://github.com/skalenetwork/skaled/issues/1619.
This issue has been locked since it has been closed for more than 14 days.
If you found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Viem version. If you have any questions or comments you can create a new discussion thread.
Is there an existing issue for this?
Package Version
1.3.0
Current Behavior
With the current implementation, all JSON RPC calls don't work in case of using
publicClient
:The root cause of this issue is a combination of 2 factors:
application/json
inContent-Type
header.viem
doesn't handle this case correctly in therpc
module.Without
application/json
it goes to this if clause, and then passed (in string format, without being parsed) here - botherror
andresult
areundefined
because of this.Expected Behavior
Correct behaviour when using SKALE Chains, since they are a part of
wagmi/chains
module.Steps To Reproduce
wagmi/chains
(e.g.skaleCalypso
)http
as a transportLink to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)
https://stackblitz.com/edit/viem-getting-started-po5zk3?file=index.ts
Anything else?
No response