starknet-io / starknet.js

JavaScript library for StarkNet
https://www.starknetjs.com
MIT License
1.21k stars 706 forks source link

Fix: public responseParser #1154

Closed tabaktoni closed 3 weeks ago

tabaktoni commented 4 weeks ago

Motivation and Resolution

YoavG RpcProvider's CTOR expects both channel and responseParser if channel is provided in RPCProviderOptions Since I wanted to create a provider with a custom RpcChannel I had to provide the response parser as well. Since I didn't want to touch the response parser I expected that the default response parser will be available via new RPCResponseParser but it isn't since it is not exported. My workaround was to instantiate the provider as usual and then override provider.channel = customChannel (edited)

set responseParser to be public should add an additional option to instantiate from default and change any/both channels or parsers.

Development related changes

mentioned above

Checklist: